/* =========================================================================
   NETHOUND — Public surface stylesheet
   The calm clinical wellness lie. Cold/terminal look lives in void.css only.
   ========================================================================= */

:root {
  /* Palette — see build spec §1 */
  --paper: #F2F5F7;        /* cool clinical near-white */
  --paper-2: #E9EEF1;      /* slightly deeper panel */
  --ink: #1B2A33;          /* deep desaturated slate */
  --ink-soft: #4A5A63;     /* muted body text */
  --continuity: #3E9C99;   /* reassuring spa/biotech teal */
  --continuity-dk: #2F7C79;
  --vital: #E8C4B0;        /* too-perfect peach/skin tone */
  --hairline: #D5DEE2;     /* dividers, rules */
  --void: #0A0E0F;
  --amber: #D8A24A;

  --maxw: 1120px;
  --gap: clamp(1.5rem, 4vw, 4rem);
  --radius: 14px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --shadow: 0 1px 2px rgba(27, 42, 51, .04), 0 12px 40px rgba(27, 42, 51, .06);
}

/* Language-aware fonts: CJK gets proper system fallbacks so glyphs render
   cleanly while the brand still feels consistent. */
html[lang="ja"] {
  --font-display: "Fraunces", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --font-body: "Hanken Grotesk", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
}
html[lang="zh"] {
  --font-display: "Fraunces", "Songti SC", "Noto Serif SC", "SimSun", serif;
  --font-body: "Hanken Grotesk", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* CJK lines breathe a little more */
html[lang="ja"] body, html[lang="zh"] body { line-height: 1.8; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0 0 .4em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin: 0 0 .5em; }
h3 { font-size: 1.25rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: var(--continuity-dk); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(var(--maxw), 92vw); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--continuity-dk);
  margin: 0 0 1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .8em 1.5em; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: .2s ease;
}
.btn-primary { background: var(--continuity); color: #fff; }
.btn-primary:hover { background: var(--continuity-dk); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--hairline); color: var(--ink); }
.btn-ghost:hover { border-color: var(--continuity); color: var(--continuity-dk); text-decoration: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(242, 245, 247, .82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; }
.nav { display: flex; gap: 1.4rem; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); font-size: .92rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--continuity-dk); text-decoration: none; }

/* Language switcher */
.lang {
  position: relative;
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: .8rem;
}
.lang select {
  appearance: none; -webkit-appearance: none;
  font-family: var(--font-mono); font-size: .8rem; color: var(--ink);
  background: transparent; border: 1px solid var(--hairline);
  border-radius: 999px; padding: .35em 2em .35em .9em; cursor: pointer;
}
.lang::after {
  content: "▾"; position: absolute; right: .8em; pointer-events: none; color: var(--ink-soft);
}
.lang select:focus-visible { outline: 2px solid var(--continuity); outline-offset: 2px; }

.nav-toggle { display: none; }

/* ---------- Pulse line (signature element) ---------- */
.pulse {
  width: 100%; height: 38px; display: block;
  color: var(--continuity);
  overflow: hidden;
}
.pulse svg { width: 100%; height: 100%; display: block; }
.pulse path { fill: none; stroke: currentColor; stroke-width: 2; vector-effect: non-scaling-stroke; }
.pulse .trace {
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
  animation: pulse-run 6s linear infinite;
}
@keyframes pulse-run { to { stroke-dashoffset: 0; } }
.header-pulse { opacity: .6; }
.header-pulse path { stroke-width: 1.5; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem); }
.hero .lead { margin: 1.4rem 0 2.2rem; }
.hero-cta { display: flex; gap: .9rem; flex-wrap: wrap; }
.hero-band {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 1.2rem 0;
}

/* ---------- Promise section ---------- */
.section-promise { position: relative; overflow: hidden; }
.section-promise::before {
  content: "";
  position: absolute; pointer-events: none;
  width: 680px; height: 680px; border-radius: 50%;
  background: radial-gradient(circle, var(--continuity) 0%, transparent 68%);
  opacity: .055; top: -260px; right: -140px;
}
.section-promise::after {
  content: "";
  position: absolute; pointer-events: none;
  width: 320px; height: 320px; border-radius: 50%;
  border: 1px solid var(--continuity);
  opacity: .09; bottom: -80px; left: 8%;
}
.promise-rule {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.4rem 0 2.4rem;
}
.promise-rule .pr-line {
  flex: 1; height: 1px; background: linear-gradient(90deg, var(--continuity) 0%, transparent 100%);
  opacity: .35;
}
.promise-rule .pr-diamond {
  width: 8px; height: 8px; border: 1.5px solid var(--continuity);
  transform: rotate(45deg); opacity: .7; flex-shrink: 0;
}

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border: 1px solid var(--hairline);
  border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow);
}
.card .num { font-family: var(--font-mono); color: var(--vital); font-size: .8rem; letter-spacing: .15em; }
.card h3 { margin-top: .5rem; }
.card-promise { border-top: 2px solid var(--continuity); }
.card-icon { width: 52px; height: 52px; margin-bottom: 1.1rem; color: var(--continuity); }

/* ---------- Testimonials ---------- */
.quotes { display: grid; gap: 1.4rem; grid-template-columns: repeat(3, 1fr); }
.quote { background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.quote p { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.quote .who { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-soft); letter-spacing: .04em; }
.quote.broken p::after { content: ""; }
.quote.broken .who { color: var(--vital); }

/* ---------- Team (about) ---------- */
.team { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.face {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--hairline); background: #fff;
  display: flex; flex-direction: column;
}
.face-img-wrap {
  position: relative; aspect-ratio: 3/4; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(160deg, var(--paper-2), #fff);
}
.face .portrait { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 2.4rem; color: var(--continuity); opacity: .35; z-index: 0; }
.face .face-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; z-index: 1; }
.face .label { padding: .65rem .75rem; background: #fff; border-top: 1px solid var(--hairline); }
.face .name { font-weight: 600; font-size: .9rem; }
.face .role { font-size: .76rem; color: var(--ink-soft); }
.face .eid {
  font-family: var(--font-mono); font-size: .72rem; color: var(--vital);
  opacity: 0; transition: opacity .25s ease;
}
.face:hover .eid, .face:focus-within .eid { opacity: 1; }
.face.redacted .portrait { color: transparent; }
.face.redacted .face-img-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: repeating-linear-gradient(45deg, #11181c 0 8px, #1d262b 8px 16px);
  animation: glitch 2.4s steps(2) infinite;
}
.face.redacted .label { background: rgba(10,14,15,.92); border-top-color: #1d262b; }
.face.redacted .name, .face.redacted .role { color: #cfd8dc; }
.face.redacted .eid { color: var(--amber); }
@keyframes glitch {
  0%, 100% { transform: translateX(0); clip-path: inset(0); }
  50% { transform: translateX(-2px); clip-path: inset(12% 0 28% 0); }
}

/* ---------- Careers page ---------- */
.section-careers-hero { position: relative; overflow: hidden; }
.section-careers-hero::before {
  content: ""; position: absolute; pointer-events: none;
  width: 560px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, var(--vital) 0%, transparent 68%);
  opacity: .07; top: -160px; right: -80px;
}

.stat-strip {
  display: flex; margin-top: 2.6rem;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: #fff; overflow: hidden; box-shadow: var(--shadow);
}
.stat-strip .stat {
  flex: 1; padding: 1.2rem .8rem; text-align: center;
  border-right: 1px solid var(--hairline);
}
.stat-strip .stat:last-child { border-right: 0; }
.stat-strip .stat .val {
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 600;
  color: var(--ink); display: block; line-height: 1;
}
.stat-strip .stat .lbl {
  font-family: var(--font-mono); font-size: .65rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft); display: block; margin-top: .45rem;
}

.day-track {
  display: flex; margin: 2rem 0 1.6rem; position: relative;
}
.day-step {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative; padding: 0 .5rem;
}
.day-step:not(:last-child)::after {
  content: ""; position: absolute;
  top: 27px; left: 50%; width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--continuity) 0%, var(--hairline) 100%);
  opacity: .45; pointer-events: none;
}
.day-step .ds-icon {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1.5px solid var(--hairline); background: #fff;
  display: flex; align-items: center; justify-content: center;
  color: var(--continuity); margin-bottom: .75rem; position: relative; z-index: 1;
}
.day-step .ds-label {
  font-weight: 600; font-size: .88rem; color: var(--ink);
}
.day-step .ds-note {
  font-family: var(--font-mono); font-size: .68rem;
  letter-spacing: .08em; color: var(--vital); margin-top: .2rem; display: block;
}

/* ---------- Tech diagram ---------- */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: stretch; }
.flow .step { background: #fff; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 1.4rem; }
.flow .step .stage-img {
  display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius: 10px; margin-bottom: 1.1rem;
  background: var(--paper-2); border: 1px solid var(--hairline);
}
.flow .step .stage { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .15em; color: var(--continuity-dk); }
.euphemism { border-left: 3px solid var(--vital); padding-left: 1.2rem; font-style: italic; color: var(--ink); }

/* ---------- News ---------- */
.release { border-bottom: 1px solid var(--hairline); padding: 1.6rem 0; }
.release .date { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-soft); letter-spacing: .1em; }
.release.decay .date { color: var(--vital); }

/* ---------- Legal ---------- */
.legal-body { max-width: 72ch; }
.legal-body h3 { margin-top: 2.2rem; }
.legal-body ol { padding-left: 1.4rem; }
.legal-body li { margin: .5rem 0; color: var(--ink-soft); }
.clause-buried { color: var(--ink-soft); }

/* ---------- Forms ---------- */
.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea, .field select {
  font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  padding: .7em .9em; border: 1px solid var(--hairline); border-radius: 10px; background: #fff;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--continuity); outline-offset: 1px; }
.form-note { font-size: .82rem; color: var(--ink-soft); }
.form-status { font-family: var(--font-mono); font-size: .85rem; margin-top: 1rem; min-height: 1.4em; color: var(--continuity-dk); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); background: var(--paper-2); margin-top: 3rem; }
.footer-pulse { opacity: .5; }
.footer-grid { display: flex; gap: 2.5rem; flex-wrap: wrap; padding: 2.5rem 0 1rem; }
.footer-grid .col { display: grid; gap: .5rem; align-content: start; }
.footer-grid h4 { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); margin: 0 0 .3rem; font-family: var(--font-body); }
.footer-grid a { color: var(--ink-soft); font-size: .9rem; }
.footer-legal { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.2rem 0 2.2rem; border-top: 1px solid var(--hairline); font-size: .8rem; color: var(--ink-soft); font-family: var(--font-mono); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Utilities ---------- */
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; }
.maxw-60 { max-width: 60ch; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 2px solid var(--continuity); outline-offset: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .grid-3, .quotes, .flow { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .team { grid-template-columns: repeat(2, 1fr); }
  .nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--hairline);
    padding: .5rem 6vw 1rem; margin: 0; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .7rem 0; border-bottom: 1px solid var(--hairline); }
  .nav-toggle {
    display: inline-grid; place-items: center; margin-left: auto;
    width: 42px; height: 42px; border: 1px solid var(--hairline);
    border-radius: 10px; background: transparent; cursor: pointer; color: var(--ink);
  }
  .site-header .wrap { gap: .8rem; }
}

/* ---------- Reduced motion: freeze the pulse, kill glitch ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .pulse .trace { stroke-dashoffset: 0; }
  .reveal { opacity: 1; transform: none; }
}

/* white-on-white inspect breadcrumb (ARG §5) */
.whisper { color: var(--paper); user-select: text; font-family: var(--font-mono); font-size: .7rem; }
