/* Metsuke public site — shared styles.
   Light by default, dark when the visitor prefers it or toggles it.
   One typeface (Inter) throughout; navy type on a white page. */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: var(--font-sans); /* no monospace on the site */

  /* White page, navy type. One scheme on every machine. */
  --bg: #ffffff;
  --bg-2: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --navy: #0f1c3f;
  --ink: #0f1c3f;
  --ink-2: #2c3a5e;
  --muted: #5f6c8a;
  --line: #dfe4ee;
  --line-2: #c9d1e0;

  --accent: #1d3f9c;
  --accent-h: #16327d;
  --accent-soft: rgba(29, 63, 156, 0.08);
  --accent-line: rgba(29, 63, 156, 0.35);

  --red: #b93434;
  --amber: #b26f0a;
  --green: #187a53;
  --red-soft: rgba(185, 52, 52, 0.10);
  --amber-soft: rgba(178, 111, 10, 0.12);
  --green-soft: rgba(24, 122, 83, 0.11);

  --radius: 10px;
  --radius-s: 6px;
  --shadow: none;
  --max: 1120px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.15; letter-spacing: -0.015em; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.125rem); letter-spacing: -0.025em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; color: var(--ink-2); max-width: 46rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.85em; }
.small { font-size: 0.9rem; }
.eyebrow {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.75rem; display: block;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(3rem, 7vw, 6rem) 0; }
section.tight { padding: clamp(2rem, 4vw, 3rem) 0; }
.alt { background: var(--bg-2); }
.on-navy { background: var(--bg-2); color: var(--ink); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .mark { width: 34px; height: 34px; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink-2); padding: 8px 12px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  width: 38px; height: 38px; border-radius: 8px; display: inline-grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-toggle { display: inline-grid; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid transparent; cursor: pointer; line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #1a2b5c; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--navy); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { padding: 8px 12px; font-size: 0.875rem; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; }

/* Hero */
.hero { padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(2.5rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { max-width: 26ch; text-wrap: balance; font-size: clamp(1.9rem, 4.4vw, 3rem); }
.hero .lede { max-width: 42rem; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.75rem; }
.hero-note { margin-top: 1.5rem; font-size: 0.9rem; color: var(--muted); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* Finding card (hero visual) */
.finding {
  background: var(--surface); border: 1px solid var(--navy); border-radius: var(--radius-s);
  padding: 20px; font-size: 0.925rem;
}
.finding-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.finding-head .ref { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.finding-lead { font-weight: 600; font-size: 1rem; margin-bottom: 10px; }
.finding dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.finding dt { color: var(--muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding-top: 3px; }
.finding dd { margin: 0; color: var(--ink-2); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-grey { background: var(--surface-2); color: var(--muted); }
.badge-plain::before { display: none; }

/* Evidence quote */
.quote {
  border-left: 3px solid var(--accent-line); background: var(--surface-2); padding: 10px 14px;
  border-radius: 0 var(--radius-s) var(--radius-s) 0; margin: 10px 0; font-size: 0.92rem; color: var(--ink-2);
}
.quote .loc { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); display: block; margin-top: 6px; }

/* Cards and grids */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card {
  background: transparent; border: 0; border-top: 2px solid var(--navy); border-radius: 0; padding: 18px 0 0;
  display: flex; flex-direction: column; gap: 10px;
}
.card h3 { margin-bottom: 2px; }
.card p { margin: 0; color: var(--ink-2); }
.card .more { margin-top: auto; padding-top: 8px; font-weight: 600; }
.card-link { color: inherit; transition: border-color 0.15s ease; }
.card-link:hover { text-decoration: none; color: inherit; border-top-color: var(--accent); }
.card-link:hover .more { text-decoration: underline; text-underline-offset: 3px; }
.card .more { color: var(--accent); }
.card .kicker { font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; color: var(--muted); }

/* Section header */
.sec-head { max-width: 46rem; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.sec-head p { color: var(--ink-2); font-size: 1.05rem; }

/* Numbers strip */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fact { padding: 16px 0 0; border-top: 2px solid var(--navy); }
.fact b { display: block; font-size: 1.75rem; letter-spacing: -0.03em; font-weight: 600; }
.fact span { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr 1fr; } }

/* Document-like boxes used inside walkthroughs */
.doc {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px;
  font-size: 0.92rem; color: var(--ink-2); margin: 10px 0;
}
.doc .doc-title { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.doc p:last-child { margin-bottom: 0; }
.doc.letter { font-family: Georgia, 'Times New Roman', serif; font-size: 0.95rem; line-height: 1.55; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 10px 0; font-size: 0.92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }

/* Steps list (vertical) */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li { position: relative; padding-left: 52px; }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 600; font-family: var(--font-mono);
}
.steps h4 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--ink-2); }

/* Checks / bullets */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { padding-left: 30px; position: relative; color: var(--ink-2); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green-soft); border: 1px solid var(--green);
  -webkit-mask: none;
}
.checks li::after {
  content: ""; position: absolute; left: 5px; top: 10px; width: 6px; height: 10px; border: solid var(--green); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checks b { color: var(--ink); }

/* Prose pages */
.prose { max-width: 46rem; color: var(--ink-2); }
.prose h2 { color: var(--ink); margin-top: 2.2rem; }
.prose h3 { color: var(--ink); margin-top: 1.6rem; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: 6px; }
.prose code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; }
.prose pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.85rem; }

/* Definition strip */
.defs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.def { padding: 16px 0 0; border-top: 2px solid var(--navy); }
.def h4 { margin-bottom: 6px; }
.def p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 760px) { .defs { grid-template-columns: 1fr; } }

/* CTA strip */
.cta { text-align: center; }
.cta h2 { margin-bottom: 0.5rem; }
.cta p { color: var(--ink-2); max-width: 40rem; margin: 0 auto 1.5rem; }
.cta .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 40px 0 32px; color: var(--muted); font-size: 0.9rem; }
.foot { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px; }
.foot h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li + li { margin-top: 6px; }
.foot a { color: var(--ink-2); }
.foot-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 0.85rem; }
@media (max-width: 760px) { .foot { grid-template-columns: 1fr 1fr; } }

/* Page header */
.page-head { padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(1.5rem, 4vw, 3rem); }
.page-head h1 { max-width: 20ch; }
.page-head .lede { margin-top: 0.5rem; }

/* Two-column feature */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.feature + .feature { margin-top: clamp(3rem, 6vw, 5rem); }
.feature.flip > :first-child { order: 2; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature.flip > :first-child { order: 0; } }

/* Notice */
.notice { border: 1px dashed var(--line-2); border-radius: var(--radius-s); padding: 12px 14px; font-size: 0.875rem; color: var(--muted); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
