:root {
  --navy: #071a2b;
  --ink: #102b3d;
  --ivory: #f4efe4;
  --paper: #fffdf8;
  --cyan: #1f8e96;
  --cyan-soft: #cdeff0;
  --amber: #d88716;
  --amber-soft: #f9e3bd;
  --coral: #c54e47;
  --green: #247b61;
  --line: #c9d1d2;
  --muted: #526773;
  --shadow: 0 18px 50px rgba(7, 26, 43, 0.12);
  --radius: 22px;
  --content: 78rem;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--navy);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 2%, rgba(75, 209, 217, 0.18), transparent 23rem),
    var(--ivory);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; }
a { color: #09666f; text-underline-offset: 0.18em; }
a:hover { color: #074a52; }
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--navy);
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.preview-strip {
  padding: 0.36rem 1rem;
  color: var(--navy);
  background: var(--amber-soft);
  border-bottom: 1px solid rgba(7, 26, 43, 0.18);
  font-size: 0.79rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  color: white;
  background: rgba(7, 26, 43, 0.96);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(14px);
}

.header-inner,
.page-wrap,
.footer-inner {
  width: min(calc(100% - 2rem), var(--content));
  margin-inline: auto;
}

.header-inner {
  min-height: 4.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: white;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  color: var(--navy);
  background: var(--cyan-soft);
  border-radius: 50% 50% 44% 56%;
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.desktop-nav { display: flex; align-items: center; gap: 1.35rem; }
.desktop-nav a {
  color: #e7f2f4;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}
.desktop-nav a[aria-current="page"] { color: #75e1e6; }
.licence-link {
  padding: 0.58rem 0.82rem;
  border: 1px solid rgba(255,255,255,0.36);
  border-radius: 999px;
}

.mobile-nav { display: none; position: relative; }
.mobile-nav summary {
  padding: 0.58rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav-panel {
  position: absolute;
  top: calc(100% + 0.8rem);
  right: 0;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.75rem;
  background: var(--navy);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}
.mobile-nav-panel a {
  display: block;
  padding: 0.78rem 0.9rem;
  color: white;
  border-radius: 0.65rem;
  text-decoration: none;
}
.mobile-nav-panel a:hover { background: rgba(75,209,217,0.14); }

.breadcrumbs {
  margin: 0;
  padding: 1.25rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.86rem;
  list-style: none;
}
.breadcrumbs li:not(:last-child)::after { content: " /"; margin-left: 0.5rem; color: #87969d; }

.hero {
  padding: clamp(2.8rem, 7vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(18rem, 5fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.hero-copy { min-width: 0; }
.kicker {
  margin: 0 0 0.7rem;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--navy);
  line-height: 1.1;
  text-wrap: balance;
}
h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2.55rem, 7vw, 5.75rem);
  letter-spacing: -0.055em;
}
.article-page h1 { font-size: clamp(2.45rem, 6vw, 4.8rem); }
.lead {
  max-width: 49rem;
  margin: 1.4rem 0 0;
  color: #244354;
  font-size: clamp(1.16rem, 2vw, 1.42rem);
  line-height: 1.55;
}
.editorial-notice {
  margin: 1.25rem 0 0;
  padding-left: 1rem;
  color: #405865;
  border-left: 4px solid var(--amber);
  font-size: 0.92rem;
}

.hero-media { min-width: 0; }
.image-stack {
  position: relative;
  min-height: 19rem;
}
.image-stack figure { margin: 0; }
.image-card {
  overflow: hidden;
  background: #dce9e7;
  border: 1px solid rgba(7,26,43,0.15);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.image-card img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.image-card figcaption {
  padding: 0.7rem 0.9rem;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.78rem;
}
.article-visual {
  margin: 1.25rem 0 2rem;
  box-shadow: 0 12px 34px rgba(7, 26, 43, 0.1);
}
.article-visual img { aspect-ratio: 16/9; }
.image-stack .image-card:nth-child(2) {
  width: 62%;
  margin: -2.5rem 0 0 -1.5rem;
  transform: rotate(-2.2deg);
}
.image-stack .image-card:nth-child(3) {
  width: 54%;
  margin: -4rem -1rem 0 auto;
  transform: rotate(2deg);
}
.hero-fallback {
  min-height: 18rem;
  padding: 2rem;
  display: grid;
  align-content: space-between;
  color: white;
  background: var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-fallback strong { font-family: Georgia, serif; font-size: 2rem; }

.trace-rail {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  padding: 1.1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: rgba(255,255,255,0.54);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
}
.trace-step { padding: 0.95rem; display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; align-items: center; }
.trace-step + .trace-step { border-left: 1px dashed #91a0a5; }
.trace-number { width: 2.2rem; height: 2.2rem; display: grid; place-items: center; background: var(--cyan-soft); border-radius: 50%; font-weight: 850; }
.trace-step strong { display: block; color: var(--navy); }
.trace-step span:last-child { color: var(--muted); font-size: 0.85rem; }

.route-map {
  margin: 0 0 4rem;
  padding: 1.3rem;
  background: var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.route-map h2 { margin: 0 0 1rem; color: white; font-size: 1.55rem; }
.route-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
.route-card {
  padding: 1.15rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.9rem;
  align-items: start;
  color: white;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 0.95rem;
  text-decoration: none;
}
.route-card:hover { color: white; background: rgba(75,209,217,0.13); }
.route-icon { width: 2.3rem; height: 2.3rem; display: grid; place-items: center; color: var(--navy); background: var(--amber-soft); border-radius: 0.72rem; font-weight: 900; }
.route-card strong { display: block; }
.route-card small { display: block; margin-top: 0.25rem; color: #bfd0d7; line-height: 1.4; }
.route-arrow { color: #75e1e6; font-size: 1.35rem; }

.article-layout {
  padding: 0 0 5rem;
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 50rem);
  gap: clamp(2rem, 5vw, 5rem);
  justify-content: center;
  align-items: start;
}
.toc {
  position: sticky;
  top: 6.5rem;
  padding: 1rem;
  background: rgba(255,255,255,0.62);
  border: 1px solid var(--line);
  border-radius: 1rem;
}
.toc strong { display: block; margin-bottom: 0.55rem; color: var(--navy); }
.toc ol { margin: 0; padding-left: 1.15rem; }
.toc li { margin: 0.35rem 0; color: var(--muted); font-size: 0.84rem; line-height: 1.35; }
.toc a { color: inherit; text-decoration: none; }
.toc a:hover { color: var(--cyan); text-decoration: underline; }

.article-body { min-width: 0; }
.article-body > section,
.article-body > .table-wrap,
.article-body > blockquote { scroll-margin-top: 7rem; }
.article-body h2 {
  margin: 3.4rem 0 1rem;
  padding-top: 0.8rem;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
}
.article-body h2:first-child { margin-top: 0; }
.article-body h3 { margin: 2rem 0 0.55rem; font-size: 1.38rem; }
.article-body p { margin: 0.8rem 0 1.15rem; }
.article-body ul { padding-left: 1.3rem; }
.article-body li { margin: 0.45rem 0; }
.article-body blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  background: #e4f3f2;
  border-left: 5px solid var(--cyan);
  border-radius: 0 0.8rem 0.8rem 0;
}

.table-wrap {
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
}
table { width: 100%; min-width: 42rem; border-collapse: collapse; font-size: 0.94rem; }
th, td { padding: 0.9rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid #d9e0e1; }
th { color: white; background: var(--navy); font-size: 0.82rem; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f2f6f4; }

.source-list a { word-break: break-word; }
.content-note {
  margin-top: 2.5rem;
  padding: 1rem 1.2rem;
  color: #455a66;
  background: #fff8e8;
  border: 1px solid #e6c982;
  border-radius: 0.8rem;
  font-size: 0.9rem;
}

.demo-facade {
  margin: 1.35rem 0 2rem;
  overflow: hidden;
  color: white;
  background: var(--navy);
  border: 1px solid rgba(31, 142, 150, 0.55);
  border-radius: 1rem;
  box-shadow: 0 14px 36px rgba(7, 26, 43, 0.16);
}
.demo-facade summary {
  min-height: 7rem;
  padding: 1.25rem;
  display: grid;
  align-content: center;
  gap: 0.2rem;
  cursor: pointer;
  background: radial-gradient(circle at 85% 20%, rgba(75,209,217,0.22), transparent 45%), var(--navy);
}
.demo-facade summary span { font-family: Georgia, serif; font-size: 1.45rem; }
.demo-facade summary small { color: #bfd0d7; }
.demo-facade-body { padding: 0.2rem 1.25rem 1.25rem; }
.demo-facade-body p { color: #e1ecee; }
.demo-facade-body ol { margin: 1rem 0; padding-left: 1.3rem; }
.demo-facade-body li { margin: 0.65rem 0; }
.demo-status { padding-top: 0.8rem; border-top: 1px solid rgba(255,255,255,0.16); font-size: 0.82rem; }

.site-footer {
  color: #dce8ea;
  background: var(--navy);
  border-top: 5px solid var(--cyan);
}
.footer-inner { padding: 3rem 0 1.6rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid h2 { margin: 0 0 0.65rem; color: white; font-size: 1.2rem; }
.footer-grid p { color: #b7c8ce; max-width: 34rem; }
.footer-grid a { color: #c9eff1; }
.footer-links { margin: 0; padding: 0; list-style: none; }
.footer-links li { margin: 0.45rem 0; }
.footer-bottom { margin-top: 2rem; padding-top: 1.2rem; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid rgba(255,255,255,0.16); color: #aebfc5; font-size: 0.82rem; }

.not-found { min-height: 62vh; padding: 5rem 0; text-align: center; }
.not-found h1 { max-width: none; }
.not-found p { max-width: 40rem; margin: 1.2rem auto; }
.text-link { display: inline-block; padding: 0.72rem 1rem; color: white; background: var(--navy); border-radius: 999px; text-decoration: none; font-weight: 750; }

@media (max-width: 980px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .hero { grid-template-columns: 1fr; gap: 2.3rem; }
  .hero-media { max-width: 45rem; }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; columns: 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 1rem; }
  .header-inner, .page-wrap, .footer-inner { width: min(calc(100% - 1.25rem), var(--content)); }
  .header-inner { min-height: 4.2rem; }
  .brand { font-size: 0.95rem; }
  .hero { padding-top: 2.6rem; }
  h1 { font-size: clamp(2.35rem, 13vw, 4rem); }
  .route-grid { grid-template-columns: 1fr; }
  .trace-rail { grid-template-columns: 1fr; }
  .trace-step + .trace-step { border-left: 0; border-top: 1px dashed #91a0a5; }
  .image-stack { min-height: auto; }
  .image-stack .image-card:nth-child(n) { width: 100%; margin: 0.8rem 0 0; transform: none; }
  .article-visual { margin: 1rem 0 1.6rem; }
  .toc { columns: 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > :first-child { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
}

@media (max-width: 390px) {
  .preview-strip { font-size: 0.68rem; }
  .brand-mark { width: 1.9rem; height: 1.9rem; }
  .brand span:last-child { max-width: 9.8rem; white-space: normal; line-height: 1.05; }
  .hero { padding-top: 2rem; }
  .route-map { padding: 0.8rem; }
  .route-card { grid-template-columns: auto 1fr; }
  .route-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
