/* Phyto Optics marketing site — shared styles.
   Brand carried over from the Shiny app: black ground, teal #00bc8c,
   amber #f39c12 for the reserve action, Inter throughout. */

:root {
  --bg: #000;
  --bg-1: #0d1114;
  --bg-2: #161b1f;
  --line: #2a3136;
  --ink: #ffffff;
  --ink-2: #cfd6d3;
  --ink-3: #8c9894;
  --teal: #00bc8c;
  --teal-glow: rgba(0, 188, 140, 0.45);
  --amber: #f39c12;
  --amber-glow: rgba(243, 156, 18, 0.45);
  --radius: 12px;
  --max: 1160px;
  --gutter: 20px;
}

*, *::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: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); }
a:hover { color: #3ee0b4; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--ink-2); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 780px; }
.center { text-align: center; }
.center .narrow, .narrow.center { margin-left: auto; margin-right: auto; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--teal);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 44px; height: 44px; }
.brand-name { font-weight: 900; letter-spacing: 1px; color: var(--teal); font-size: 18px; line-height: 1; }
.brand-sub { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: .5px; margin-top: 4px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a {
  color: #b0b0b0; text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 8px 12px; border-radius: 6px; transition: color .2s, background .2s;
}
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: #fff; }
.nav .btn { margin-left: 6px; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  color: #fff; border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit;
}

@media (max-width: 920px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #000; border-bottom: 2px solid var(--teal); padding: 8px var(--gutter) 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid #151a1d; }
  .nav .btn { margin: 10px 0 0; justify-content: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: inherit; font-weight: 700; font-size: 16px; line-height: 1;
  padding: 14px 26px; border-radius: 8px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-amber { background: var(--amber); color: #000 !important; box-shadow: 0 0 18px var(--amber-glow); }
.btn-teal { background: var(--teal); color: #000 !important; box-shadow: 0 0 18px var(--teal-glow); }
.btn-ghost { background: transparent; color: #fff !important; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { border-color: var(--teal); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.center .btn-row, .btn-row.center { justify-content: center; }
.fine { font-size: 13px; color: var(--ink-3); margin-top: 10px; }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
section.tight { padding: 56px 0; }
.alt { background: var(--bg-1); border-top: 1px solid #12171a; border-bottom: 1px solid #12171a; }
.eyebrow {
  display: inline-block; color: var(--teal); font-size: 13px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 14px;
}
.h-xl { font-size: clamp(36px, 6vw, 64px); }
.h-lg { font-size: clamp(28px, 4vw, 42px); }
.h-md { font-size: clamp(22px, 2.6vw, 28px); }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: min(86vh, 760px);
  display: flex; align-items: center; padding: 110px 0 90px;
  background:
    linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,.92) 100%),
    url("assets/hero-coral.jpg") center / cover no-repeat;
}
.hero .wrap { width: 100%; }
.hero h1 { text-shadow: 0 2px 18px rgba(0,0,0,.6); max-width: 900px; }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero .lead { color: #e7eeeb; max-width: 720px; text-shadow: 0 1px 10px rgba(0,0,0,.7); margin-bottom: 32px; }
.hero-logo { width: 72px; margin-bottom: 22px; }

.page-hero { padding: 80px 0 56px; background: radial-gradient(ellipse at top, #0f2a24 0%, #000 65%); border-bottom: 1px solid #12171a; }
.page-hero p { max-width: 760px; }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 22px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .g2, .g4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: 0 10px 30px -18px rgba(0,0,0,.8);
}
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p { font-size: 15.5px; margin-bottom: 0; }
.card .icon {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0,188,140,.12); color: var(--teal); margin-bottom: 16px;
}
.card .icon svg { width: 24px; height: 24px; }
a.card { display: block; text-decoration: none; transition: transform .2s, border-color .2s; }
a.card:hover { transform: translateY(-4px); border-color: var(--teal); }
a.card h3 { color: #fff; }
.card .more { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 14px; color: var(--teal); }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.split.flip { grid-template-columns: .9fr 1.1fr; }
@media (max-width: 860px) { .split, .split.flip { grid-template-columns: 1fr; gap: 32px; } }

.photo { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 20px 40px -20px rgba(0,0,0,.9); overflow: hidden; }
.photo img { width: 100%; }
.photo.light { background: #fff; padding: 18px; }
.caption { font-size: 13px; color: var(--ink-3); font-style: italic; margin-top: 10px; }

/* Problem → solution strip */
.problem-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.problem-list li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.problem-list .n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: var(--amber); border: 1px solid var(--amber);
}
.problem-list strong { color: #fff; display: block; }
.problem-list span { color: var(--ink-2); font-size: 15.5px; }

/* Steps (how it works) */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 22px; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; top: -6px; left: 26px; font-weight: 900; font-size: 13px; letter-spacing: 2px;
  color: #000; background: var(--teal); padding: 3px 9px; border-radius: 4px;
}
.step .meta { font-size: 13px; font-weight: 700; color: var(--teal); letter-spacing: .5px; margin: 6px 0 0; }

/* Explainer animation (reef-signal.html) */
.explainer {
  position: relative; width: 100%; aspect-ratio: 1600 / 700;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); background: #060a0d;
}
.explainer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Audience cards */
.audience { padding: 32px; }
.audience h3 { font-size: 22px; }
.audience ul { margin: 14px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 15.5px; }
.audience li { margin-bottom: 8px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 9px; border-radius: 4px; margin-bottom: 14px;
}
.tag-teal { background: rgba(0,188,140,.15); color: var(--teal); }
.tag-amber { background: rgba(243,156,18,.15); color: var(--amber); }

/* App access band */
.app-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(90deg, #0b201b, #0d1114); border: 1px solid #1d3a32; border-radius: var(--radius);
  padding: 26px 30px;
}
.app-band h3 { margin: 0 0 4px; font-size: 20px; }
.app-band p { margin: 0; font-size: 15px; }

/* CTA band */
.cta {
  text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 56px 24px;
}

/* Pipeline (model) */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1000px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .pipeline { grid-template-columns: 1fr; } }
.pipeline .card { padding: 22px; }
.pipeline .dot { width: 12px; height: 12px; border-radius: 50%; margin-bottom: 12px; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
th { text-align: left; color: var(--teal); background: #0d1114; border-bottom: 2px solid var(--teal); padding: 10px 14px; }
td { border-bottom: 1px solid #1f2529; padding: 10px 14px; color: var(--ink-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; color: #f3b14a; }

/* Publications */
.pub h3 { font-size: 16.5px; line-height: 1.35; }
.pub .authors { font-size: 13.5px; color: var(--ink-3); margin: 0; }
.pub .venue { font-size: 13.5px; font-style: italic; color: var(--ink-2); }

/* Funders / people */
.funders { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.funder {
  background: #fff; border-radius: 10px; width: 200px; padding: 18px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px;
}
.funder img { max-height: 70px; width: auto; }
.funder span { color: #333; font-size: 12px; font-weight: 600; line-height: 1.3; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { color: var(--ink-2); font-size: 14.5px; padding: 5px 0; border-bottom: 1px solid #1f2529; }
.people li:last-child { border-bottom: 0; }
.people b { color: #fff; font-weight: 600; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: #000; border: 2px solid var(--teal);
}
.timeline li.now::before { background: var(--amber); border-color: var(--amber); }
.timeline .when { font-weight: 800; color: #fff; font-size: 14px; letter-spacing: .5px; }
.timeline p { margin: 2px 0 0; font-size: 15px; }

/* Form */
.form { display: grid; gap: 14px; }
.form label { display: block; font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.form input, .form select {
  width: 100%; font: inherit; font-size: 16px; color: #fff; background: #0b0e10;
  border: 1px solid #39424a; border-radius: 8px; padding: 12px 14px;
}
.form input:focus, .form select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: transparent; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .form .row2 { grid-template-columns: 1fr; } }
.form-status { border-radius: 8px; padding: 14px 16px; font-size: 15px; }
.form-status.err { border: 1px solid #ff6b6b; color: #ff9b9b; }
.form-status.ok { border: 1px solid var(--teal); background: #0b1a16; }
.form-status.ok strong { color: var(--teal); }
.form-status p { margin: 6px 0 0; }
.hp { position: absolute; left: -9999px; }
.checklist { padding-left: 20px; color: var(--ink-2); }
.checklist li { margin-bottom: 6px; }

/* Footer */
.site-footer { border-top: 1px solid var(--teal); padding: 44px 0 36px; margin-top: 40px; color: var(--ink-3); font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--teal); }
.site-footer .legal { margin-top: 30px; padding-top: 18px; border-top: 1px solid #151a1d; font-size: 12.5px; }

/* Reveal-on-scroll (skipped for reduced motion) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
