/* =========================================================================
   Ivan Teh Big Data Expert
   Design system: "Chart and Contour"
   Surfaces are drawn from a nautical survey chart. Structure is carried by
   hairline rules and a two column register, not by cards or shadows.
   ========================================================================= */

@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Plex";
  src: url("/assets/fonts/plex-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --abyss: #0b2430;
  --hull: #143a4a;
  --shoal: #47707f;
  --verdigris: #17685b;
  --seafoam: #6fc9b6;
  --sand: #c9bb98;
  --paper: #f1f2ef;
  --shelf: #e3e7e4;
  --ink: #12242c;
  --muted: #56686e;
  --line: #c8d0cd;
  --line-soft: #dbe1de;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Plex", "Segoe UI", system-ui, -apple-system, sans-serif;

  --s-1: 0.845rem;
  --s0: 1.0625rem;
  --s1: 1.33rem;
  --s2: 1.6rem;
  --s3: 2.1rem;
  --s4: 2.75rem;

  --gut: clamp(1.15rem, 4vw, 3rem);
  --wide: 1240px;
  --measure: 35em;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--s0);
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--verdigris); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--abyss); }

:focus-visible {
  outline: 2px solid var(--verdigris);
  outline-offset: 3px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.012em;
  margin: 0 0 0.55em;
  color: var(--abyss);
  font-variation-settings: "opsz" 36;
}
h1 { font-size: var(--s4); }
h2 { font-size: var(--s3); }
h3 { font-size: var(--s1); line-height: 1.28; font-variation-settings: "opsz" 20; }
p { margin: 0 0 1.15em; }

.wrap { max-width: var(--wide); margin: 0 auto; padding-inline: var(--gut); }
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--abyss); color: var(--paper); padding: 0.7rem 1.1rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ------------------------------------------------------------- masthead --- */

.masthead {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 74px;
}

.brand { display: flex; align-items: center; gap: 0.72rem; text-decoration: none; color: inherit; }
.brand svg { width: 40px; height: 40px; flex: none; border-radius: 6px; }
.brand-name {
  font-family: var(--serif); font-size: 1.22rem; font-weight: 600;
  color: var(--abyss); line-height: 1.05; letter-spacing: -0.015em;
  font-variation-settings: "opsz" 18;
}
.brand-sub {
  display: block; font-family: var(--sans); font-size: 0.68rem;
  letter-spacing: 0.055em; color: var(--muted); font-weight: 500; margin-top: 3px;
}

.nav ul { list-style: none; display: flex; gap: 0.15rem; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 0.5rem 0.62rem; font-size: 0.925rem; font-weight: 500;
  color: var(--ink); text-decoration: none; border-radius: 3px;
}
.nav a:hover { background: var(--shelf); color: var(--abyss); }
.nav a[aria-current="page"] { color: var(--verdigris); box-shadow: inset 0 -2px 0 var(--verdigris); }

.burger {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line);
  background: transparent; border-radius: 4px; cursor: pointer; padding: 0;
  align-items: center; justify-content: center;
}
.burger span { display: block; width: 19px; height: 1.5px; background: var(--abyss); position: relative; }
.burger span::before, .burger span::after {
  content: ""; position: absolute; left: 0; width: 19px; height: 1.5px; background: var(--abyss);
}
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }

@media (max-width: 1180px) {
  .burger { display: flex; }
  html.js .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.6rem var(--gut) 1.1rem; display: none;
  }
  html.js .nav[data-open="true"] { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .nav a[aria-current="page"] { box-shadow: none; }
}

/* ----------------------------------------------------------------- hero --- */

.hero { background: var(--abyss); color: #dfe8e6; position: relative; overflow: hidden; }
.hero-field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-field path { fill: none; vector-effect: non-scaling-stroke; }
.hero-in {
  position: relative; display: grid; gap: clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: end; padding-block: clamp(3rem, 7vw, 5.5rem) 0;
}
.hero-copy { padding-bottom: clamp(3rem, 7vw, 5.5rem); }
.hero .nb { display: block; }
.hero h1 {
  color: #f4f7f5; font-size: clamp(2.5rem, 6.4vw, 4.5rem);
  font-variation-settings: "opsz" 60; font-weight: 500;
  letter-spacing: -0.028em; margin-bottom: 0.4em; text-wrap: balance;
}
.hero-lede { font-size: clamp(1.06rem, 1.6vw, 1.28rem); color: #c3d3d1; max-width: 30em; }
.hero-lede strong { color: #eaf2f0; font-weight: 500; }
.hero-acts { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.8rem; }
.hero-portrait { align-self: end; position: relative; }
.hero-portrait img { width: 100%; max-width: 470px; margin-inline: auto; }

.hero-facts {
  position: relative; border-top: 1px solid rgba(111, 201, 182, 0.28);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.hero-facts div { padding: 1.15rem 1.2rem 1.3rem 0; border-left: 1px solid rgba(111, 201, 182, 0.18); padding-left: 1.2rem; }
.hero-facts div:first-child { border-left: 0; padding-left: 0; }
.hero-facts dt { font-size: 0.78rem; color: var(--seafoam); font-weight: 500; letter-spacing: 0.04em; }
.hero-facts dd { margin: 0.3rem 0 0; font-family: var(--serif); font-size: 1.18rem; color: #eef4f2; line-height: 1.25; }

@media (max-width: 900px) {
  .hero-in { grid-template-columns: 1fr; padding-bottom: 0; }
  .hero-copy { padding-bottom: 0.5rem; }
  .hero-portrait img { max-width: 330px; }
  .hero-facts { grid-template-columns: 1fr 1fr; }
  .hero-facts div:nth-child(3) { border-left: 0; padding-left: 0; }
  .hero-facts div { border-top: 1px solid rgba(111, 201, 182, 0.14); }
  .hero-facts div:first-child, .hero-facts div:nth-child(2) { border-top: 0; }
}

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-block; font-family: var(--sans); font-size: 0.95rem; font-weight: 500;
  padding: 0.78rem 1.4rem; border-radius: 3px; text-decoration: none;
  border: 1px solid transparent; transition: background-color 0.16s ease, color 0.16s ease;
}
.btn-solid { background: var(--seafoam); color: var(--abyss); }
.btn-solid:hover { background: #8fd8c8; color: var(--abyss); }
.btn-line { border-color: rgba(196, 216, 212, 0.45); color: #e2edea; }
.btn-line:hover { border-color: var(--seafoam); color: #fff; }
.btn-ink { background: var(--abyss); color: var(--paper); }
.btn-ink:hover { background: var(--hull); color: #fff; }

/* -------------------------------------------------------------- register -- */

.reg { display: grid; gap: clamp(1.2rem, 3vw, 3.2rem); padding-block: clamp(3rem, 6vw, 5rem); }
.reg + .reg { border-top: 1px solid var(--line-soft); }
@media (min-width: 900px) {
  .reg { grid-template-columns: minmax(190px, 23%) minmax(0, 1fr); }
}
.reg-head h2 { margin-bottom: 0.5rem; }
.reg-kicker { font-size: 0.86rem; color: var(--muted); margin: 0; max-width: 22em; }
.reg-body > *:last-child { margin-bottom: 0; }
.prose { max-width: var(--measure); }
.prose p, .prose li { color: #22343a; }
.band { background: var(--shelf); }

/* ------------------------------------------------------------- registers -- */

.record { list-style: none; margin: 0; padding: 0; }
.record li { padding: 1.15rem 0; border-top: 1px solid var(--line-soft); display: grid; gap: 0.15rem 1.6rem; }
.record li:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 720px) { .record li { grid-template-columns: 14rem minmax(0, 1fr); } }
.record dt, .record .rec-t {
  font-family: var(--serif); font-size: 1.16rem; color: var(--abyss); font-weight: 600;
  font-variation-settings: "opsz" 18;
}
.record .rec-d { color: var(--muted); font-size: 0.97rem; margin: 0; }

.grid2 { display: grid; gap: 0; }
@media (min-width: 720px) { .grid2 { grid-template-columns: 1fr 1fr; column-gap: 2.6rem; } }
.grid2 > div { padding: 1.15rem 0; border-top: 1px solid var(--line-soft); }
.grid2 h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.grid2 p { font-size: 0.96rem; color: var(--muted); margin: 0; }

.media-row { display: flex; flex-wrap: wrap; gap: 0 2.4rem; align-items: baseline; margin: 0; padding: 0; list-style: none; }
.media-row li {
  font-family: var(--serif); font-size: clamp(1.35rem, 3vw, 2rem); color: var(--hull);
  font-weight: 500; font-variation-settings: "opsz" 24;
}

.quotes { display: grid; gap: 2rem; }
@media (min-width: 820px) { .quotes { grid-template-columns: 1fr 1fr; gap: 2.8rem; } }
.quotes figure { margin: 0; border-left: 2px solid var(--verdigris); padding-left: 1.4rem; }
.quotes blockquote {
  margin: 0 0 0.9rem; font-family: var(--serif); font-size: 1.2rem; line-height: 1.45;
  color: var(--abyss); font-variation-settings: "opsz" 22;
}
.quotes figcaption { font-size: 0.9rem; color: var(--muted); }
.quotes figcaption b { color: var(--ink); font-weight: 600; display: block; }

/* ----------------------------------------------------------------- feed --- */

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { border-top: 1px solid var(--line-soft); }
.feed li:first-child { border-top: 0; }
.feed a.feed-link {
  display: grid; gap: 0.35rem 1.6rem; padding: 1.5rem 0; text-decoration: none; color: inherit;
}
@media (min-width: 760px) { .feed a.feed-link { grid-template-columns: 168px minmax(0, 1fr); align-items: start; } }
.feed .thumb { background: var(--shelf); border-radius: 3px; overflow: hidden; }
.feed .thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top center; }
.feed h3 { margin-bottom: 0.3rem; font-size: 1.28rem; }
.feed a.feed-link:hover h3 { color: var(--verdigris); }
.feed p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.feed .tag { font-size: 0.78rem; color: var(--verdigris); font-weight: 500; letter-spacing: 0.04em; }

/* ------------------------------------------------------------------ faq --- */

.faq { margin: 0; }
.faq > div { padding: 1.25rem 0; border-top: 1px solid var(--line-soft); }
.faq > div:first-child { border-top: 0; padding-top: 0; }
.faq h3 { font-size: 1.13rem; margin-bottom: 0.35rem; }
.faq p { margin: 0; color: var(--muted); max-width: var(--measure); }
.readcol .faq p { max-width: 100%; }

/* -------------------------------------------------------------- article --- */

/* ------------------------------------------------------------ page hero --- */

.phero { background: var(--abyss); color: #dfe8e6; position: relative; overflow: hidden; }
.phero-in {
  position: relative; display: grid; gap: clamp(1.1rem, 3vw, 2.8rem);
  align-items: end; padding-block: clamp(2.2rem, 4.6vw, 3.4rem) 0;
}
@media (min-width: 900px) {
  .phero-in { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
}
.phero-copy { padding-bottom: clamp(2.4rem, 5vw, 3.6rem); }
.phero-flat .phero-in { padding-bottom: clamp(2.4rem, 5vw, 3.6rem); }
.phero h1 {
  color: #f4f7f5; font-size: clamp(2rem, 4.4vw, 3.15rem);
  font-variation-settings: "opsz" 44; letter-spacing: -0.022em;
  max-width: 15em; text-wrap: balance; margin-bottom: 0.45em;
}
.phero .dek { color: #bacecb; max-width: 33em; }
.phero-portrait { align-self: end; }
.phero-portrait img { width: auto; max-width: 100%; max-height: 22rem; margin-inline: auto; }
@media (max-width: 899px) {
  .phero-copy { padding-bottom: 0.4rem; }
  .phero-portrait img { max-height: 15rem; }
}

.crumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 1.2rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--verdigris); text-decoration: underline; }
.crumbs span { padding: 0 0.45rem; color: var(--line); }
.phero .crumbs { color: #8ea8a5; }
.phero .crumbs a { color: #a8c0bd; }
.phero .crumbs a:hover { color: var(--seafoam); }
.phero .crumbs span { color: #46626a; }

.dek { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--muted); max-width: 34em; margin: 0; }

.readcol { max-width: 41rem; margin-inline: auto; padding-block: clamp(2.6rem, 5vw, 4rem); }

.figure-frame { margin: 2.4rem auto; max-width: 26rem; }
.faq-block { margin-top: 3rem; }
.readcol .sources + .faq-block { margin-top: 2.8rem; }
.figure-frame img { width: 100%; border-radius: 4px; }
.figure-frame figcaption { font-size: 0.86rem; color: var(--muted); padding-top: 0.7rem; }

.article { max-width: 100%; }
.article h2 { font-size: var(--s2); margin-top: 1.9em; }
.article h2:first-child { margin-top: 0; }
.article ul { padding-left: 1.15rem; }
.article li { margin-bottom: 0.5em; }
.article strong { font-weight: 600; color: var(--abyss); }

.sources { margin-top: 2.8rem; padding-top: 1.3rem; border-top: 2px solid var(--abyss); }
.sources h2 { font-size: 1.15rem; margin: 0 0 0.7rem; }
.source-note { font-size: 0.87rem; color: var(--muted); margin: 0.9rem 0 0; }
.sources ol { margin: 0; padding-left: 1.15rem; font-size: 0.94rem; color: var(--muted); }
.sources li { margin-bottom: 0.45rem; }
.sources cite { font-style: normal; font-weight: 600; color: var(--ink); }

.next { margin-top: 3.2rem; padding-top: 1.4rem; border-top: 1px solid var(--line-soft); }
.next h2 { font-size: 1.25rem; }

/* ----------------------------------------------------------------- form --- */

.form { max-width: 34rem; }
.field { margin-bottom: 1.15rem; }
.field label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 0.35rem; color: var(--abyss); }
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 0.72rem 0.85rem;
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--verdigris); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; }
button.btn { cursor: pointer; font: inherit; font-weight: 500; }
.form-note { font-size: 0.87rem; color: var(--muted); margin-top: 0.9rem; }
.form-status { margin-top: 1rem; font-size: 0.94rem; padding: 0.8rem 1rem; border-radius: 3px; display: none; }
.form-status[data-state="ok"] { display: block; background: #e2efe9; color: #14553f; }
.form-status[data-state="err"] { display: block; background: #f6e6e2; color: #7d3320; }

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { padding: 1rem 0; border-top: 1px solid var(--line-soft); }
.contact-list li:first-child { border-top: 0; padding-top: 0; }
.contact-list b { display: block; font-size: 0.86rem; color: var(--muted); font-weight: 500; }
.contact-list a, .contact-list span { font-family: var(--serif); font-size: 1.14rem; color: var(--abyss); font-variation-settings: "opsz" 18; }

/* --------------------------------------------------------------- closing -- */

.closer { background: var(--abyss); color: #d6e3e0; position: relative; overflow: hidden; }
.closer-in { position: relative; padding-block: clamp(3rem, 6vw, 4.6rem); display: grid; gap: 1.6rem; align-items: center; }
@media (min-width: 860px) { .closer-in { grid-template-columns: minmax(0, 1fr) auto; } }
.closer h2 { color: #f2f7f5; margin: 0 0 0.5rem; font-size: var(--s3); max-width: 15em; }
.closer p { margin: 0; color: #b9cbc8; max-width: 34em; }

.foot { background: var(--hull); color: #c1d2cf; }
.foot-in { padding-block: clamp(2.4rem, 5vw, 3.4rem); display: grid; gap: 2rem; }
@media (min-width: 860px) { .foot-in { grid-template-columns: 1.3fr 1fr 1fr; } }
.foot h2 { font-size: 0.86rem; color: var(--seafoam); font-family: var(--sans); font-weight: 600; letter-spacing: 0.05em; margin-bottom: 0.8rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: 0.45rem; }
.foot a { color: #cfdedb; text-decoration: none; font-size: 0.95rem; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot .foot-brand { font-family: var(--serif); font-size: 1.3rem; color: #eef5f3; margin-bottom: 0.5rem; font-variation-settings: "opsz" 20; }
.foot p { font-size: 0.92rem; color: #a8bebb; max-width: 30em; }
.foot-base { border-top: 1px solid rgba(111, 201, 182, 0.2); padding-block: 1.1rem; font-size: 0.86rem; color: #9db4b1; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; justify-content: space-between; }

/* ------------------------------------------------------- notfound + misc -- */

.center-note { max-width: 34rem; margin-inline: auto; text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }

/* one orchestrated moment: the contour field draws itself in once */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero-field path { stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: draw 2.4s cubic-bezier(.22,.61,.36,1) forwards; }
  html.js .hero-field path:nth-child(2n) { animation-delay: .12s; }
  html.js .hero-field path:nth-child(3n) { animation-delay: .26s; }
  html.js .hero-field path:nth-child(5n) { animation-delay: .4s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
