/* SAIL: Sustainable AI Lab
   Look: open ocean (rendered by water.js on a fixed canvas behind every page), with
   reading content on square white panels floating on it. Clean lines, right angles, hairline rules.
   On the home page the mark and name rise up from the depths as you scroll. Accents are ocean blues.
   Type: Lexend for display, Atkinson Hyperlegible Next for reading and interface, Montserrat for the wordmark only. */

@property --rise { syntax: "<number>"; inherits: true; initial-value: 1; }

:root {
  /* Ocean (keep in sync with COLORS in water.js) */
  --ocean-deep: #04192b;
  --ocean: #0a3350;
  --ocean-mid: #165273;
  --haze: #f1f6f9;
  --surface: #eef5f9;       /* the lockup once it has surfaced */

  /* Brand */
  --logo: #005949;           /* logo green: logo files only (favicon, logo.svg, social image) */
  --accent: #0b3a57;         /* deep ocean blue: text accents and buttons on white */
  --accent-deep: #04192b;
  --accent-soft: #e3eef4;    /* off-white blue: soft fills, button text */
  --accent-line: #86dcef;    /* light blue: accent rules, the same blue as on dark water */
  --aqua: #86dcef;           /* accent on dark water */

  /* Reading */
  --white: #ffffff;
  --paper: #f5faf8;
  --ink: #0b1f1d;
  --ink-2: #2d4743;
  --muted: #566e69;
  --rule: #d3e1dc;
  --on-dark: #e6f0f5;
  --on-dark-muted: #a3bccb;
  --line-dark: rgba(230, 240, 245, 0.2);
  --focus: #0b3a57;

  --display: "Lexend", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;
  --wordmark: "Montserrat", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --max: 1200px;
  --read: 40rem;
  --gutter: clamp(16px, 4vw, 40px);
  --header: 68px;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }
body {
  margin: 0;
  /* Shown until the ocean canvas starts, and wherever WebGL is unavailable */
  background: var(--ocean) linear-gradient(180deg, var(--ocean-mid) 0%, var(--ocean) 45%, var(--ocean-deep) 100%) fixed;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--white); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 16px; top: 16px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Ocean ---------- */
.water { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 0.8s ease; }
.water.is-live { opacity: 1; }

/* ---------- Logo ---------- */
.mark { fill: currentColor; color: var(--accent); height: auto; }
.wordmark { font-family: var(--wordmark); font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em; line-height: 1.1; color: var(--accent); white-space: nowrap; }

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.5em; color: var(--ink); }
h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); font-weight: 300; letter-spacing: -0.03em; line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); font-weight: 300; letter-spacing: -0.025em; }
h3 { font-size: 1.45rem; }
h4 { font-size: 1.1rem; font-weight: 500; letter-spacing: 0; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.2rem, 1.7vw, 1.35rem); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.label { font-family: var(--display); font-size: 0.9rem; font-weight: 500; color: var(--accent); margin: 0 0 0.9rem; }
.muted { color: var(--muted); }
.small { font-size: 0.95rem; }
.prose { max-width: var(--read); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--display); font-size: 1rem; font-weight: 500; line-height: 1; letter-spacing: 0;
  padding: 1em 1.5em; text-decoration: none; border: 1.5px solid transparent;
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: var(--accent-soft); }
.btn-primary:hover { background: var(--accent-deep); color: var(--white); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--accent-deep); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent-deep); text-decoration: none; }
.on-dark .btn-primary { background: var(--aqua); color: var(--ocean-deep); }
.on-dark .btn-primary:hover { background: var(--white); color: var(--ocean-deep); }
.on-dark .btn-secondary { color: var(--on-dark); border-color: rgba(230, 243, 239, 0.55); }
.on-dark .btn-secondary:hover { background: rgba(230, 243, 239, 0.1); color: var(--white); border-color: var(--on-dark); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--haze); border-bottom: 1px solid rgba(10, 51, 80, 0.16); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .mark { width: 34px; }
.brand-name { font-family: var(--wordmark); font-weight: 600; font-size: 1.2rem; letter-spacing: 0.14em; line-height: 1; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 30px; font-family: var(--display); font-size: 0.95rem; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 0; }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.nav .btn { color: var(--accent-soft); padding: 0.8em 1.2em; font-size: 0.92rem; box-shadow: none; }
.menu { display: none; }
@media (max-width: 1020px) {
  .nav { display: none; }
  .menu { display: block; position: relative; font-family: var(--display); }
  .menu summary { list-style: none; cursor: pointer; padding: 10px 16px; border: 1.5px solid var(--accent); font-weight: 500; font-size: 0.95rem; color: var(--accent-deep); }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] summary { background: var(--accent); color: var(--accent-soft); }
  .menu nav { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1px solid var(--rule); min-width: 240px; display: grid; box-shadow: 0 16px 40px rgba(4, 24, 40, 0.3); }
  .menu nav a { padding: 14px 18px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
  .menu nav a:hover, .menu nav a[aria-current="page"] { background: var(--accent-soft); }
  .menu nav .btn { margin: 10px; color: var(--accent-soft); border-bottom: 0; }
}
@media (max-width: 420px) {
  .brand { gap: 9px; }
  .brand .mark { width: 28px; }
  .brand-name { font-size: 1.05rem; }
}

/* ---------- Sections: square white panels on the water ---------- */
.section { padding: 6px var(--gutter); }
.section > .wrap { padding: clamp(28px, 5vw, 72px); background: var(--white); }
main > :last-child { margin-bottom: clamp(48px, 8vw, 120px); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 2.5rem; }
.section-head h2 { margin: 0; max-width: 18em; }
.section-head h2.one-line { max-width: none; }
.section-head p { margin: 0; }

/* Deep-water bands */
.on-dark, .on-ocean { color: var(--on-dark); --focus: var(--aqua); }
.section.on-ocean > .wrap { background: var(--ocean-deep); border-top: 2px solid var(--aqua); }
.on-ocean h1, .on-ocean h2, .on-ocean h3, .on-ocean h4 { color: var(--white); }
.on-ocean a:not(.btn) { color: var(--aqua); }
.on-ocean .label { color: var(--aqua); }
.on-ocean .lede, .on-ocean .muted { color: var(--on-dark-muted); }
.on-ocean .mark, .on-ocean .wordmark { color: var(--on-dark); }

/* ---------- Home: the mark and name rise up from the depths ---------- */
.intro-stage {
  position: relative;
  height: calc(100vh - var(--header));
  height: calc(100svh - var(--header));
  min-height: 560px; max-height: 1000px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(36px, 7vh, 76px);
  padding: clamp(24px, 5vh, 56px) var(--gutter);
  text-align: center;
}
.intro-lockup {
  display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2.2vh, 22px);
  /* Deep: small, low, blurred and tinted by the sea. Surfaced: full size, crisp, white. */
  color: var(--surface);
  color: color-mix(in srgb, var(--surface) calc(var(--rise) * 100%), #2a6a8f);
  opacity: calc(var(--rise) * 1.6 - 0.04); /* nothing but water at the start */
  transform: translateY(calc((1 - var(--rise)) * 9vh)) scale(calc(0.8 + 0.2 * var(--rise)));
}
.intro.is-rising .intro-lockup { filter: url(#depth) blur(calc((1 - var(--rise)) * 9px)); }
.intro.is-risen .intro-lockup { filter: drop-shadow(0 2px 22px rgba(3, 20, 34, 0.45)); }
.intro-boat { width: clamp(92px, 11vw, 150px); }
.intro-boat .mark { width: 100%; overflow: visible; color: inherit; }
.intro-title {
  margin: 0 -0.16em 0 0; font-family: var(--wordmark); font-weight: 600; text-transform: uppercase;
  font-size: clamp(1.7rem, 5.4vw, 4.6rem); letter-spacing: 0.16em; line-height: 1.08; text-align: center;
  color: inherit;
}
.intro-title span { display: inline-block; white-space: nowrap; }

.intro-call { position: relative; color: var(--on-dark); max-width: 46rem; transition: opacity 0.9s ease 0.15s, transform 0.9s ease 0.15s; --focus: var(--aqua); }
.intro-call .call-status { background: rgba(4, 24, 40, 0.55); color: var(--on-dark); border: 1px solid var(--line-dark); }
.intro-pitch { font-family: var(--display); font-weight: 300; font-size: clamp(1.4rem, 2.8vw, 2.2rem); line-height: 1.2; letter-spacing: -0.02em; color: var(--white); margin: 0; text-shadow: 0 1px 24px rgba(4, 24, 40, 0.6); }
.intro-call .actions { justify-content: center; margin-top: 1.6rem; }
.intro-call .btn-primary { background: var(--aqua); color: var(--ocean-deep); }
.intro-call .btn-primary:hover { background: var(--white); }
.intro-call .btn-secondary { color: var(--white); border-color: rgba(238, 245, 249, 0.7); background: rgba(4, 24, 40, 0.35); }
.intro-call .btn-secondary:hover { background: rgba(238, 245, 249, 0.14); color: var(--white); }

/* Scroll-driven rise. water.js adds .is-scrolled, pins the stage, and sets --rise, --call and --cue as you scroll.
   Before water.js takes over (and if it never loads), start deep, then surface after 2.5s. */
@keyframes failsafe { to { --rise: 1; } }
@keyframes failsafe-call { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .js .intro:not(.is-risen) { --rise: 0; }
  .js .intro:not(.is-scrolled):not(.is-risen) { animation: failsafe 0.01s 2.5s forwards; }
  .js .intro:not(.is-scrolled):not(.is-risen) .intro-call { opacity: 0; transform: translateY(14px); animation: failsafe-call 0.9s ease 2.6s forwards; }
  .intro.is-risen .intro-boat .mark { animation: bob 6s ease-in-out infinite; }
}
.intro.is-scrolled .intro-track { height: 170vh; height: 170svh; }
.intro.is-scrolled .intro-stage { position: sticky; top: var(--header); }
.intro.is-scrolled .intro-call { opacity: var(--call, 0); transform: translateY(calc((1 - var(--call, 0)) * 18px)); transition: none; }
.intro.is-scrolled .intro-call:focus-within { opacity: 1; transform: none; }
.intro-cue { display: none; }
.intro.is-scrolled .intro-cue {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: absolute; left: 50%; bottom: clamp(20px, 4vh, 40px); transform: translateX(-50%);
  margin: 0; font-family: var(--display); font-size: 0.9rem; color: var(--on-dark);
  opacity: var(--cue, 1); pointer-events: none;
}
.intro.is-scrolled .intro-cue::after { content: ""; width: 1px; height: 40px; background: linear-gradient(var(--aqua), transparent); animation: cue 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 70% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(5px) rotate(1.2deg); } }

@media (max-width: 640px) {
  .intro-pitch { font-size: 1.35rem; }
  .intro-call .actions { flex-direction: column; align-items: stretch; }
}
@media (max-height: 700px) and (min-width: 641px) {
  .intro-boat { width: 84px; }
  .intro-title { font-size: clamp(1.6rem, 4.2vw, 3rem); }
}

/* ---------- Focus areas ---------- */
.focus-grid { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.focus { background: var(--white); padding: clamp(28px, 4vw, 56px); border-top: 3px solid var(--accent-line); }
.focus h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.12; margin-bottom: 0.6em; }
.focus p:last-child { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .focus-grid { grid-template-columns: 1fr; } }

/* ---------- Call for proposals ---------- */
.call-status { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 0.88rem; font-weight: 500; color: var(--accent-deep); margin: 0 0 1.25rem; padding: 8px 14px 8px 12px; background: var(--accent-soft); }
.call-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-line); box-shadow: 0 0 0 4px rgba(134, 220, 239, 0.25); }
.call { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.call h2 { max-width: 16em; }
.call-facts { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.call-facts li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.call-facts strong { font-family: var(--display); font-size: 0.92rem; font-weight: 500; color: var(--accent); padding-top: 0.15em; }
@media (max-width: 860px) { .call { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .call-facts li { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Inner page header: on the open water ---------- */
.page-head { padding: clamp(64px, 10vw, 136px) 0 clamp(40px, 6vw, 72px); color: var(--on-dark); --focus: var(--aqua); }
.page-head h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); max-width: 15em; color: var(--white); }
.page-head h1, .page-head .lede, .page-head .label { text-shadow: 0 1px 2px rgba(4, 24, 40, 0.5), 0 0 28px rgba(4, 24, 40, 0.55); }
.page-head .lede { margin-bottom: 0; color: var(--on-dark); }
.page-head .label { color: var(--aqua); }
.page-head a:not(.btn) { color: var(--aqua); }
.page-head .btn-primary { background: var(--aqua); color: var(--ocean-deep); }
.page-head .btn-primary:hover { background: var(--white); color: var(--ocean-deep); }
.page-head .btn-secondary { color: var(--white); border-color: rgba(238, 245, 249, 0.7); background: rgba(4, 24, 40, 0.35); }
.page-head .btn-secondary:hover { background: rgba(238, 245, 249, 0.14); color: var(--white); }

/* ---------- Two pillars (generic) ---------- */
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); }
.pillar h3 { font-size: 1.6rem; }
.pillar p { color: var(--ink-2); }
@media (max-width: 760px) { .pillars { grid-template-columns: 1fr; } }

/* ---------- Problem and answer band ---------- */
.why { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.why h2 { margin: 0; max-width: 14em; }
.why .lede { margin: 0; }
.answers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-dark); }
.answers li { padding: 28px clamp(16px, 2.5vw, 32px) 4px 0; }
.answers li + li { padding-left: clamp(16px, 2.5vw, 32px); border-left: 1px solid var(--line-dark); }
.answers h3 { font-size: 1.6rem; font-weight: 300; color: var(--aqua); margin-bottom: 0.4em; }
.answers p { color: var(--on-dark); font-size: 1.02rem; }
.answers-note { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--line-dark); color: var(--on-dark-muted); font-size: 1rem; }
@media (max-width: 860px) {
  .why { grid-template-columns: 1fr; }
  .answers { grid-template-columns: 1fr; }
  .answers li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-dark); }
}

/* ---------- Projects ---------- */
.projects { border-top: 1px solid var(--ink); }
.project { display: grid; grid-template-columns: 11rem minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); padding: 36px 0; border-bottom: 1px solid var(--rule); }
.project:last-child { border-bottom: 0; padding-bottom: 0; }
.project h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 300; letter-spacing: -0.02em; margin-bottom: 0.35em; }
.project h3 a { color: var(--ink); text-decoration: none; }
.project h3 a:hover { color: var(--accent); text-decoration: underline; }
.project p { color: var(--ink-2); margin-bottom: 0.6em; }
.status { font-family: var(--display); font-size: 0.85rem; color: var(--muted); padding-top: 0.6em; }
.status b { display: block; color: var(--accent); font-weight: 500; }
@media (max-width: 860px) { .project { grid-template-columns: 1fr; gap: 8px; } .status { padding-top: 0; } }

/* Project detail */
.detail { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding: clamp(36px, 5vw, 72px) 0; border-bottom: 1px solid var(--rule); }
.detail:first-child { padding-top: 0; }
.detail:last-child { border-bottom: 0; padding-bottom: 0; }
.detail aside { font-size: 0.95rem; color: var(--muted); border-top: 3px solid var(--accent-line); padding-top: 16px; align-self: start; }
.detail aside .label { margin-bottom: 0.4rem; }
.detail aside dl { margin: 0.5rem 0 0; }
.detail aside dt { font-family: var(--display); font-weight: 500; color: var(--ink); margin-top: 14px; font-size: 0.9rem; }
.detail aside dd { margin: 2px 0 0; }
.detail h2 { margin-bottom: 0.4em; }
.detail h3 { font-size: 1.25rem; margin-top: 1.8em; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }

/* ---------- CNDC feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.feed-item { padding: 20px 0; border-bottom: 1px solid var(--rule); }
.feed-meta { display: flex; gap: 14px; margin: 0 0 6px; font-family: var(--display); font-size: 0.82rem; color: var(--muted); }
.feed-kind { font-weight: 500; color: var(--accent); }
.feed-title { font-family: var(--display); font-weight: 400; font-size: 1.15rem; line-height: 1.35; color: var(--ink); text-decoration: none; }
.feed-title:hover { color: var(--accent); text-decoration: underline; }
.feed-summary { margin: 8px 0 0; color: var(--ink-2); font-size: 1rem; max-width: var(--read); }
.feed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); }
.feed-grid .feed { border-top: 0; }
.feed-grid .feed-item:first-child { border-top: 1px solid var(--ink); }
@media (max-width: 760px) { .feed-grid { grid-template-columns: 1fr; } .feed-grid .feed + .feed .feed-item:first-child { border-top: 0; } }
.feed-empty { padding: 20px 0; border-top: 1px solid var(--ink); }
.cndc-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 1.5rem 0 0; font-size: 0.95rem; }

/* ---------- Partner ways ---------- */
.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 64px); border-top: 1px solid var(--ink); }
.way { padding: 32px 0; border-bottom: 1px solid var(--rule); }
.way h3 { font-size: 1.45rem; }
.way p { color: var(--ink-2); }
.way a { font-family: var(--display); font-weight: 500; font-size: 0.95rem; }
@media (max-width: 760px) { .ways { grid-template-columns: 1fr; } }

/* ---------- Review process (a real sequence) ---------- */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.steps li { counter-increment: step; border-top: 3px solid var(--accent-line); padding-top: 16px; }
.steps li::before { content: "Step " counter(step); display: block; font-family: var(--display); font-size: 0.85rem; font-weight: 500; color: var(--accent); margin-bottom: 8px; }
.steps h4 { margin-bottom: 0.3em; }
.steps p { font-size: 1rem; color: var(--ink-2); margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

.topics { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); }
.topics ul { margin: 0; padding-left: 1.1em; }
.topics li { margin-bottom: 0.45em; color: var(--ink-2); }
@media (max-width: 760px) { .topics { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--ink); max-width: 48rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 20px 36px 20px 0; font-family: var(--display); font-size: 1.1rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 15px; font-size: 1.4rem; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 20px; color: var(--ink-2); max-width: var(--read); }

/* ---------- Form ---------- */
.form-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(32px, 6vw, 80px); }
.form-shell aside p { color: var(--ink-2); }
@media (max-width: 900px) { .form-shell { grid-template-columns: 1fr; } }
form.proposal { background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--accent-line); padding: clamp(20px, 4vw, 40px); }
fieldset { border: 0; padding: 0; margin: 0 0 28px; }
legend { font-family: var(--display); font-size: 1.3rem; font-weight: 400; margin-bottom: 14px; padding: 0; color: var(--ink); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; } }
.field { margin-bottom: 18px; }
.field label, .field .q { display: block; font-size: 0.98rem; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field .hint { display: block; font-size: 0.88rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
input[type="text"], input[type="email"], input[type="url"], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: var(--white);
  border: 1.5px solid #b9cdc7; padding: 12px; border-radius: 0;
}
textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(134, 220, 239, 0.45); }
input[type="file"] { font: inherit; font-size: 0.95rem; width: 100%; padding: 14px; border: 1.5px dashed #a6bfb8; background: var(--white); }
input[type="file"]::file-selector-button { font: inherit; border: 1.5px solid var(--accent); background: var(--white); color: var(--accent-deep); padding: 8px 12px; margin-right: 12px; cursor: pointer; border-radius: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: 0.98rem; border: 1.5px solid #b9cdc7; padding: 9px 14px; cursor: pointer; background: var(--white); margin: 0; }
.choices input { accent-color: var(--accent); margin: 0; }
.choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.field label.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 0.98rem; font-weight: 400; line-height: 1.5; background: var(--accent-soft); padding: 16px; }
.field label.consent input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 1px; }
.counter { font-size: 0.88rem; color: var(--muted); margin-top: 4px; }
.counter.over { color: #a4262c; font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { display: none; border-left: 4px solid #a4262c; background: #fbecec; color: #6b1a1d; padding: 12px 16px; margin-bottom: 20px; font-size: 0.98rem; }
.form-error.show { display: block; }
.form-done { background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--accent-line); padding: clamp(24px, 4vw, 40px); }

/* ---------- About ---------- */
.levers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.levers div { border-top: 3px solid var(--accent-line); padding-top: 16px; }
.levers p { color: var(--ink-2); font-size: 1rem; }
@media (max-width: 760px) { .levers { grid-template-columns: 1fr; } }
.contrast { max-width: 48rem; border-top: 1px solid var(--ink); }
.contrast div { display: grid; grid-template-columns: 14rem 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.contrast strong { font-family: var(--display); font-weight: 500; font-size: 0.98rem; }
.contrast p { margin: 0; color: var(--ink-2); }
@media (max-width: 600px) { .contrast div { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Methodology document ---------- */
.doc { max-width: 46rem; }
.doc h2 { font-size: 1.7rem; margin-top: 2em; }
.doc h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 1.2em 0 1.6em; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc th { font-family: var(--display); font-weight: 500; border-bottom-color: var(--ink); }
.doc pre { background: var(--ocean-deep); color: var(--on-dark); padding: 18px 20px; overflow-x: auto; font-size: 0.9rem; line-height: 1.5; }
.doc code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
.doc :not(pre) > code { background: var(--accent-soft); padding: 0.1em 0.35em; }

/* ---------- Footer: deep water, straight edge ---------- */
.site-footer { background: var(--ocean-deep); border-top: 2px solid var(--aqua); padding: 72px 0 40px; margin-top: 6px; font-size: 0.98rem; color: var(--on-dark); --focus: var(--aqua); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.footer-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.footer-lockup .mark { width: 38px; color: var(--on-dark); }
.footer-lockup .wordmark { font-size: 0.8rem; color: var(--on-dark); }
.footer-brand p { color: var(--on-dark-muted); max-width: 26em; margin: 0; }
.site-footer h4 { font-family: var(--display); font-size: 0.85rem; font-weight: 500; color: var(--aqua); margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a:not(.btn) { color: var(--on-dark); text-decoration: none; }
.site-footer a:not(.btn):hover { color: var(--aqua); text-decoration: underline; }
.footer-base { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line-dark); color: var(--on-dark-muted); font-size: 0.875rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
