:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5c667a;
  --line: #dfe4ec;
  --paper: #ffffff;
  --page: #f3f5f8;
  --navy: #17365f;
  --blue: #2c62b7;
  --blue-soft: #edf4ff;
  --green: #176b50;
  --green-soft: #eaf7f1;
  --amber: #895a07;
  --amber-soft: #fff6de;
  --shadow: 0 16px 45px rgba(27, 42, 70, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 16px/1.68 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-underline-offset: 0.17em;
}

a:focus-visible,
video:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #f0b44d;
  outline-offset: 4px;
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  max-width: 880px;
  margin: 14px 0 18px;
  font-size: clamp(2.4rem, 6vw, 4.7rem);
  letter-spacing: -0.045em;
}

h2 {
  margin: 0 0 24px;
  font-size: clamp(1.65rem, 3.2vw, 2.2rem);
  letter-spacing: -0.025em;
}

h3 {
  margin: 38px 0 12px;
  font-size: 1.32rem;
  letter-spacing: -0.012em;
}

p {
  margin: 15px 0;
}

ul {
  margin: 16px 0;
  padding-left: 1.4rem;
}

li {
  margin: 8px 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 9px 13px;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-weight: 750;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.hero {
  padding: 76px 24px 68px;
  color: #fff;
  background:
    radial-gradient(circle at 83% 10%, rgba(82, 147, 244, 0.34), transparent 30%),
    linear-gradient(135deg, #102542 0%, #183e70 56%, #245a96 100%);
}

.hero-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 26px;
  color: #dbe8f8;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}

.portfolio-link:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.eyebrow {
  margin: 0;
  color: #bcd2f3;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1,
.hero .lede {
  color: #fff;
}

.lede {
  max-width: 860px;
  margin: 0;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.62;
}

.hero-summary {
  max-width: 780px;
  margin: 18px 0 0;
  color: #dbe8f8;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #edf5ff;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.hero-meta > div {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  color: #edf5ff;
  backdrop-filter: blur(8px);
}

.hero-meta strong {
  display: block;
  margin-bottom: 4px;
  color: #bcd2f3;
  font-size: 0.76rem;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 850px);
  gap: 34px;
  align-items: start;
  width: min(1140px, calc(100% - 40px));
  margin: 38px auto 36px;
}

.toc {
  position: sticky;
  top: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 8px 24px rgba(27, 42, 70, 0.05);
  backdrop-filter: blur(8px);
}

.toc-title {
  display: block;
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc a {
  display: block;
  padding: 5px 0;
  color: #47556c;
  font-size: 0.91rem;
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue);
}

main {
  min-width: 0;
}

.case-section {
  margin-bottom: 24px;
  padding: clamp(25px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  scroll-margin-top: 24px;
}

.case-section > :first-child {
  margin-top: 0;
}

.case-section > :last-child {
  margin-bottom: 0;
}

figure,
.overview-visual {
  margin: 30px 0 34px;
}

figure img,
.overview-visual img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  background: #f8fafd;
  box-shadow: 0 9px 25px rgba(27, 42, 70, 0.08);
}

figcaption {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.video-figure {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafd;
}

video {
  display: block;
  width: 100%;
  max-width: 378px;
  height: auto;
  margin: 0 auto;
  border-radius: 10px;
  background: #0d1727;
  box-shadow: 0 10px 28px rgba(23, 54, 95, 0.16);
}

.video-figure figcaption {
  max-width: 620px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.table-wrap {
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.inspection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.inspection-table th,
.inspection-table td {
  padding: 13px 15px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.inspection-table th:last-child,
.inspection-table td:last-child {
  border-right: 0;
}

.inspection-table tr:last-child td {
  border-bottom: 0;
}

.inspection-table th {
  background: #eff3f8;
  color: var(--navy);
  font-size: 0.82rem;
  letter-spacing: 0.025em;
}

.inspection-table .area {
  width: 20%;
  background: #f8fafd;
  color: var(--navy);
  font-weight: 700;
}

.inspection-table .task {
  width: 25%;
  color: #31435f;
  font-weight: 700;
}

.inspection-table tbody tr:hover td {
  background: #f8fbff;
}

.inspection-table tbody tr:hover .area {
  background: var(--blue-soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 25px 0;
}

.metric-grid > div {
  padding: 18px;
  border: 1px solid #c7d8f0;
  border-radius: 12px;
  background: var(--blue-soft);
  color: #31435f;
}

.metric-grid strong {
  display: block;
  margin-bottom: 3px;
  color: var(--navy);
  font-size: 0.8rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.pipeline {
  margin: 28px 0 0;
  padding: 18px 20px;
  border: 1px solid #c7d8f0;
  border-left: 5px solid var(--blue);
  border-radius: 11px;
  background: var(--blue-soft);
  color: #31435f;
  font-weight: 700;
  line-height: 1.65;
}

#role li::marker {
  color: var(--blue);
}

.project-note {
  border-color: #ead8ad;
  background: linear-gradient(145deg, #fffdf7, #fff9e9);
}

.project-note h2 {
  color: #674707;
}

.project-note::before {
  display: block;
  width: 42px;
  height: 5px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: #c48718;
  content: "";
}

.page-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 50px;
  border-top: 1px solid var(--line);
}

.page-footer a {
  color: #47556c;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}

.page-footer a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 900px) {
  .hero-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout {
    display: block;
  }

  .toc {
    position: static;
    margin-bottom: 24px;
  }

  .toc nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 15px;
  }
}

@media (max-width: 620px) {
  .hero {
    padding: 50px 20px 46px;
  }

  .hero-meta,
  .metric-grid,
  .toc nav {
    grid-template-columns: 1fr;
  }

  .layout,
  .page-footer {
    width: min(100% - 24px, 850px);
  }

  .layout {
    margin-top: 20px;
  }

  .case-section {
    border-radius: 14px;
  }

  .inspection-table {
    min-width: 700px;
  }

  .video-figure {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .skip-link {
    transition: none;
  }
}

@media print {
  body {
    background: #fff;
    font-size: 11pt;
  }

  .skip-link,
  .portfolio-link,
  .toc,
  .page-footer {
    display: none;
  }

  .hero {
    padding: 35px 0;
    background: #17365f;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .hero-inner,
  .layout {
    width: 100%;
  }

  .layout {
    display: block;
    margin: 20px 0;
  }

  .case-section {
    padding: 28px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }

  figure,
  .overview-visual,
  .metric-grid,
  .pipeline,
  .table-wrap {
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible;
  }

  .inspection-table {
    font-size: 8.5pt;
  }

  video {
    box-shadow: none;
  }
}
