/* Second Shore Lab — site styles */

:root {
  --bg: #f6f3ec;
  --bg-alt: #efeadf;
  --surface: #fffdf8;
  --ink: #13221d;
  --muted: #56665f;
  --line: #e2dccd;
  --primary: #1f5e4a;
  --primary-ink: #ffffff;
  --primary-soft: #dcebe3;
  --accent: #2f7fa6;
  --warm: #c9772b;
  --shadow: 0 1px 2px rgba(19, 34, 29, .06), 0 8px 24px rgba(19, 34, 29, .06);

  --c-reuse: #2e7d4f;
  --c-repair: #2f6fa6;
  --c-donate: #b7791f;
  --c-parts: #7a4fa0;
  --c-recycle: #1f8a8a;
  --c-hazard: #c0392b;

  --radius: 14px;
  --radius-lg: 22px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1714;
    --bg-alt: #131d19;
    --surface: #18241f;
    --ink: #e7eee9;
    --muted: #9fb1a9;
    --line: #26352f;
    --primary: #6fc2a0;
    --primary-ink: #0d1a15;
    --primary-soft: #1d3a2f;
    --accent: #6cb6dc;
    --warm: #e2a35f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .25);

    --c-reuse: #5fc28a;
    --c-repair: #6aa8e0;
    --c-donate: #e0ac55;
    --c-parts: #b48ee0;
    --c-recycle: #4fc4c4;
    --c-hazard: #f0776a;
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.1rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 34px; height: 34px; color: var(--primary); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand-lab { font-weight: 400; color: var(--primary); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500; padding: 8px 12px; border-radius: 999px; }
.site-nav a:hover { background: var(--primary-soft); }
.site-nav .nav-cta { background: var(--primary); color: var(--primary-ink); margin-left: 6px; }
.site-nav .nav-cta:hover { background: var(--primary); filter: brightness(1.08); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 16px 18px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 14px; }
  .site-nav .nav-cta { margin: 6px 0 0; text-align: center; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 600; font-size: 1rem; text-decoration: none; border: 1.5px solid transparent; transition: transform .15s, filter .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--primary); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 64px 0 120px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: 20px; right: -180px; width: 620px; height: 620px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 56px; } .hero { padding-top: 88px; } }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 22px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.hero h1 em { font-style: italic; color: var(--primary); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-wave { position: absolute; bottom: -1px; left: 0; width: 100%; height: 70px; }
.hero-wave path { fill: var(--bg-alt); }

/* Journey visual */
.journey { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px 24px; box-shadow: var(--shadow); }
.journey-step { display: flex; align-items: center; gap: 14px; font-weight: 600; }
.j-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-alt); color: var(--muted); }
.j-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.journey-step.decision .j-icon { background: color-mix(in srgb, var(--warm) 18%, transparent); color: var(--warm); }
.journey-line { width: 2px; height: 18px; margin-left: 21px; background: repeating-linear-gradient(to bottom, var(--line) 0 4px, transparent 4px 8px); }
.journey-fork { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); align-items: start; }
.fork-bad span { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--bg-alt); text-decoration: line-through; text-decoration-color: var(--c-hazard); text-decoration-thickness: 2px; }
.fork-good { display: flex; flex-wrap: wrap; gap: 6px; }

.pill { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: #fff; }
.pill-secondary { opacity: .75; }
.p-reuse { background: var(--c-reuse); }
.p-repair { background: var(--c-repair); }
.p-donate { background: var(--c-donate); }
.p-parts { background: var(--c-parts); }
.p-recycle { background: var(--c-recycle); }
.p-hazard { background: var(--c-hazard); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pill,
  :root:not([data-theme="light"]) .pw-badge { color: #0d1a15; }
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: 44px; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.section-lead { font-size: 1.1rem; color: var(--muted); }

/* Stats */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.stat-num { font-family: var(--font-display); font-size: 2.8rem; font-weight: 700; line-height: 1; margin-bottom: 12px; color: var(--primary); }
.stat-num span { font-size: 1.3rem; font-weight: 600; }
.stat-label { color: var(--muted); font-size: .97rem; margin: 0; }
.stat sup a { text-decoration: none; font-weight: 700; padding-left: 2px; }

.gap { display: grid; gap: 32px; margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; }
@media (min-width: 900px) { .gap { grid-template-columns: 1.4fr 1fr; padding: 40px; gap: 48px; } }
.gap-copy p { color: var(--muted); }
.gap-copy strong { color: var(--ink); }
.gap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; align-content: start; }
.gap-list li { display: flex; gap: 14px; align-items: baseline; padding: 14px 16px; border-radius: 12px; background: var(--bg-alt); font-weight: 500; }
.gap-list span { font-family: var(--font-display); font-weight: 700; color: var(--warm); }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0 0 48px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding: 26px 24px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.step-num { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-weight: 700; margin-bottom: 14px; }
.step p { color: var(--muted); margin: 0; }

/* ---------- Demo ---------- */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .demo { padding: 32px; } }
.demo-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.demo-head h3 { margin-bottom: 4px; }
.demo-head p { color: var(--muted); margin: 0; }
.tag-illustrative { font-size: .8rem; font-weight: 600; color: var(--warm); background: color-mix(in srgb, var(--warm) 14%, transparent); padding: 6px 12px; border-radius: 999px; }

.demo-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .93rem; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s; }
.chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chip:hover { border-color: var(--primary); }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

.demo-stage { display: grid; gap: 24px; align-items: start; }
@media (min-width: 860px) { .demo-stage { grid-template-columns: 250px 1fr; gap: 32px; } }

.phone { width: 230px; max-width: 100%; margin: 0 auto; padding: 10px; border-radius: 34px; background: #121a17; box-shadow: var(--shadow); }
.phone-screen { border-radius: 26px; overflow: hidden; background: #1c2723; aspect-ratio: 9 / 16; display: flex; flex-direction: column; }
.viewfinder { position: relative; flex: 1; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2c3b35, #18221e); }
.corner { position: absolute; width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.85); }
.corner.tl { top: 22%; left: 16%; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.corner.tr { top: 22%; right: 16%; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.corner.bl { bottom: 22%; left: 16%; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.corner.br { bottom: 22%; right: 16%; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.vf-object { width: 96px; height: 96px; color: #e9f1ec; }
.vf-object svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.scanline { position: absolute; left: 16%; right: 16%; height: 2px; top: 22%; background: #6fc2a0; box-shadow: 0 0 12px #6fc2a0; opacity: 0; }
.phone.is-scanning .scanline { opacity: 1; animation: scan 1s ease-in-out infinite alternate; }
@keyframes scan { from { top: 22%; } to { top: 78%; } }
.phone-status { padding: 14px; text-align: center; color: #e9f1ec; font-size: .85rem; font-weight: 600; background: #121a17; }

.result { min-height: 300px; transition: opacity .25s; }
.result.is-loading { opacity: .35; }
.result-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.result h4 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 4px; }
.result .r-sub { color: var(--muted); margin-bottom: 18px; }
.r-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.r-cell { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.r-cell dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.r-cell dd { margin: 0; font-weight: 600; }
.r-value dd { font-family: var(--font-display); font-size: 1.35rem; color: var(--primary); }
.r-why { margin-bottom: 14px; }
.r-why strong { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.r-next { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.r-next li { display: flex; gap: 10px; align-items: baseline; }
.r-next li::before { content: "→"; color: var(--primary); font-weight: 700; }
.r-warn { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--c-hazard) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c-hazard) 35%, transparent); font-weight: 500; }
.demo-note { margin: 22px 0 0; font-size: .85rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 16px; }

/* ---------- Pathways ---------- */
.pathways { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .pathways { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .pathways { grid-template-columns: repeat(3, 1fr); } }
.pathway { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.pathway p { color: var(--muted); margin: 0; }
.pw-badge { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; font-weight: 700; margin-bottom: 14px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-left: 44px; margin-bottom: 20px; }
.tl-marker { position: absolute; left: 3px; top: 26px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 3px solid var(--line); }
.tl-item.is-current .tl-marker { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 20%, transparent); }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.tl-item.is-current .tl-card { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; font-size: .85rem; }
.tl-phase { font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; }
.tl-when { color: var(--muted); }
.tl-status { font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 2px 10px; border-radius: 999px; }
.tl-card ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.tl-card li { margin-bottom: 4px; }

/* ---------- Research ---------- */
.research-grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .research-grid { grid-template-columns: 1.3fr 1fr; gap: 56px; } }
.questions { counter-reset: q; list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.questions li { counter-increment: q; position: relative; padding: 16px 18px 16px 62px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.questions li::before { content: "RQ" counter(q); position: absolute; left: 16px; top: 17px; font-weight: 700; font-size: .8rem; color: var(--accent); }
.principles { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; align-self: start; }
.principles dl { margin: 0; }
.principles dt { font-weight: 700; margin-top: 16px; }
.principles dt:first-child { margin-top: 0; }
.principles dd { margin: 2px 0 0; color: var(--muted); }

/* ---------- Team ---------- */
.team { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.person { display: flex; gap: 18px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.person h3 { margin-bottom: 2px; }
.person .role { color: var(--primary); font-weight: 600; margin-bottom: 8px; }
.person p:last-child { color: var(--muted); margin: 0; font-size: .95rem; }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.avatar svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.person-open { border-style: dashed; background: transparent; }
.person-open .avatar { background: transparent; border: 2px dashed var(--line); color: var(--muted); }

/* ---------- Contact ---------- */
.section-contact { background: var(--bg-alt); }
.contact-grid { display: grid; gap: 40px; align-items: start; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1.3fr 1fr; gap: 56px; } }
.involve { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.involve li { padding: 14px 16px; border-left: 3px solid var(--primary); background: var(--surface); border-radius: 0 12px 12px 0; color: var(--muted); }
.involve strong { color: var(--ink); }
.contact-card { background: var(--primary); color: var(--primary-ink); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.contact-card h3 { font-size: 1.6rem; }
.contact-card p { opacity: .9; }
.contact-card .email { display: block; color: inherit; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; word-break: break-all; margin-bottom: 20px; }
.contact-card .btn-primary { background: var(--primary-ink); color: var(--primary); width: 100%; }
.contact-card .small { font-size: .9rem; margin: 20px 0 0; opacity: .8; }

/* ---------- References ---------- */
.section-refs { padding: 48px 0; }
.refs-title { font-family: var(--font-body); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.refs { margin: 0; padding-left: 1.2em; font-size: .88rem; color: var(--muted); display: grid; gap: 6px; }
.refs li:target { color: var(--ink); background: var(--primary-soft); border-radius: 6px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 28px; font-size: .92rem; color: var(--muted); }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1fr 1.2fr; gap: 56px; } }
.brand-footer { margin-bottom: 10px; }
.footer-tag { max-width: 28em; }
.footer-ack p { margin: 0; font-style: italic; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .85rem; }
.footer-bottom p { margin: 0; max-width: 46em; }
.footer-bottom a { color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .phone.is-scanning .scanline { animation: none; top: 50%; }
  .btn:hover { transform: none; }
}
