/* lcf-strain-life site. Shared design system.
   Lab-instrument aesthetic: cool steel neutrals, a single deep-teal
   measurement accent, sans for reading and mono for readouts. */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --bg:          #F5F7F9;
  --surface:     #FFFFFF;
  --surface-2:   #EDF1F4;
  --text:        #14181D;
  --text-muted:  #52616D;
  --border:      #D7DEE4;
  --border-strong: #C2CCD4;
  --accent:      #0C8A8C;   /* teal, for filled controls */
  --accent-ink:  #096F71;   /* darker teal, AA for text links on light */
  --accent-soft: #E1F0F0;   /* teal wash for surfaces */
  --on-accent:   #FFFFFF;
  --caution:     #8A5510;   /* amber, honesty/caution notes only */
  --caution-soft:#F6ECDC;
  --hero-grid: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%3E%3Cpath%20d='M28%200H0V28'%20fill='none'%20stroke='%23d3dae0'%20stroke-width='1'/%3E%3C/svg%3E");

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: 0.836rem;
  --step-0:  1rem;
  --step-1:  1.2rem;
  --step-2:  1.44rem;
  --step-3:  1.85rem;
  --step-4:  clamp(2rem, 1.4rem + 2.6vw, 2.9rem);
  --step-5:  clamp(2.5rem, 1.6rem + 4vw, 3.7rem);

  --measure: 68ch;
  --container: 1080px;
  --radius: 5px;
  --radius-sm: 3px;
  --gap: clamp(1rem, 0.6rem + 1.5vw, 1.6rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #0E1317;
    --surface:     #151C22;
    --surface-2:   #1C242B;
    --text:        #E7ECEF;
    --text-muted:  #9CA9B3;
    --border:      #273139;
    --border-strong: #354049;
    --accent:      #2BC4B8;
    --accent-ink:  #4FD6CB;
    --accent-soft: #123033;
    --on-accent:   #06201E;
    --caution:     #E0A45B;
    --caution-soft:#241C10;
    --hero-grid: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%3E%3Cpath%20d='M28%200H0V28'%20fill='none'%20stroke='%231e262d'%20stroke-width='1'/%3E%3C/svg%3E");
  }
}
/* Explicit toggle wins over the media query in both directions. */
:root[data-theme="light"] {
  --bg:#F5F7F9; --surface:#FFFFFF; --surface-2:#EDF1F4; --text:#14181D;
  --text-muted:#52616D; --border:#D7DEE4; --border-strong:#C2CCD4;
  --accent:#0C8A8C; --accent-ink:#096F71; --accent-soft:#E1F0F0; --on-accent:#FFFFFF;
  --caution:#8A5510; --caution-soft:#F6ECDC;
  --hero-grid: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%3E%3Cpath%20d='M28%200H0V28'%20fill='none'%20stroke='%23d3dae0'%20stroke-width='1'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] {
  --bg:#0E1317; --surface:#151C22; --surface-2:#1C242B; --text:#E7ECEF;
  --text-muted:#9CA9B3; --border:#273139; --border-strong:#354049;
  --accent:#2BC4B8; --accent-ink:#4FD6CB; --accent-soft:#123033; --on-accent:#06201E;
  --caution:#E0A45B; --caution-soft:#241C10;
  --hero-grid: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='28'%20height='28'%3E%3Cpath%20d='M28%200H0V28'%20fill='none'%20stroke='%231e262d'%20stroke-width='1'/%3E%3C/svg%3E");
}

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; height: auto; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; text-wrap: balance; letter-spacing: -0.015em; font-weight: 750; }
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); letter-spacing: -0.01em; }
p { max-width: var(--measure); }

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

/* ---- Layout ------------------------------------------------------------ */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 0.6rem + 2vw, 2rem); }
.section { padding-block: clamp(3rem, 2rem + 5vw, 5.5rem); }
.section--tight { padding-block: clamp(2rem, 1.4rem + 3vw, 3.25rem); }
.section + .section { border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.eyebrow {
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink);
}
.lead { font-size: var(--step-1); color: var(--text-muted); max-width: 62ch; }
.section-intro { max-width: 64ch; margin-bottom: 2rem; }

/* ---- Nav --------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; gap: 1.25rem; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-mono); font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-decoration: none; font-size: 1.02rem; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent-ink); }
.brand__mark { width: 19px; height: 19px; flex: none; display: block; }
.nav__links { display: flex; align-items: center; gap: 1.1rem; margin-left: auto; }
.nav__links a { color: var(--text-muted); text-decoration: none; font-size: var(--step--1); }
.nav__links a:hover { color: var(--text); text-decoration: none; }
.nav__cta { color: var(--text) !important; font-weight: 600; }
@media (max-width: 720px) { .nav__links .hide-sm { display: none; } }

.theme-toggle {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 600; font-size: var(--step-0); line-height: 1;
  padding: 0.75rem 1.15rem; border-radius: var(--radius);
  border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* ---- Chips ------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-family: var(--font-mono); font-size: var(--step--1);
  padding: 0.3rem 0.6rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text-muted);
  text-decoration: none;
}
a.chip:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.chip b { color: var(--text); font-weight: 700; }

/* ---- Hero -------------------------------------------------------------- */
/* Graph-paper texture drawn with a tiled SVG line, no gradients. Uniform and
   faint so it reads as a plotting grid, not a centered decorative motif. */
.hero { position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--hero-grid);
  background-size: 28px 28px;
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: center; }
.hero__copy { display: flex; flex-direction: column; gap: 1.25rem; }
.hero h1 { max-width: 15ch; }
.hero .lead { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.28rem); }
.hero__note { font-family: var(--font-mono); font-size: var(--step--1); color: var(--text-muted); }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
}

/* Interaction readout card (illustration, real numbers) */
.readout { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.readout__bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.readout__bar .lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.readout__bar .lamp.on { background: var(--accent); }
.readout__bar .title { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-left: 0.25rem; }
.readout__body { padding: 0.95rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.msg { display: flex; flex-direction: column; gap: 0.3rem; }
.msg .who { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.msg .bubble { font-size: 0.96rem; padding: 0.6rem 0.75rem; border-radius: 8px; }
.msg.user .bubble { background: var(--surface-2); border: 1px solid var(--border); }
.msg.bot .bubble { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); }
.readout dl { display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.9rem; font-family: var(--font-mono); font-size: 0.83rem; margin: 0.1rem 0; }
.readout dt { color: var(--text-muted); }
.readout dd { color: var(--text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.readout__plot { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.caption { font-size: var(--step--1); color: var(--text-muted); margin-top: 0.6rem; }
.caption--center { text-align: center; }

/* ---- Feature grid ------------------------------------------------------ */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: var(--gap); }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem 1.35rem; background: var(--surface); display: flex; flex-direction: column; gap: 0.5rem; }
.card h3 { font-size: var(--step-1); }
.card p { color: var(--text-muted); font-size: 0.96rem; }
.card__tag { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); }
.note-line { margin-top: 1.6rem; font-size: 0.96rem; color: var(--text-muted); }

/* ---- Example ----------------------------------------------------------- */
.example { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 1rem + 3vw, 3rem); align-items: center; }
@media (max-width: 820px) { .example { grid-template-columns: 1fr; } }

/* ---- Callouts ---------------------------------------------------------- */
/* Full tinted border plus a small square indicator, deliberately not the
   colored left-border card that reads as AI-generated. */
.callout { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; background: var(--surface); display: flex; flex-direction: column; gap: 0.35rem; }
.callout .callout__label { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
.callout .callout__label::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--text-muted); flex: none; }
.callout p { font-size: 0.94rem; color: var(--text-muted); max-width: none; }
.callout--ok { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.callout--ok .callout__label { color: var(--accent-ink); }
.callout--ok .callout__label::before { background: var(--accent); }
.callout--warn { border-color: color-mix(in srgb, var(--caution) 45%, var(--border)); background: var(--caution-soft); }
.callout--warn .callout__label { color: var(--caution); }
.callout--warn .callout__label::before { background: var(--caution); }

/* ---- Code + copy ------------------------------------------------------- */
.code { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); overflow: hidden; }
.code pre { margin: 0; padding: 0.95rem 1rem; overflow-x: auto; }
.code code { font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.55; color: var(--text); }
.copy-btn {
  position: absolute; top: 0.55rem; right: 0.55rem;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600;
  padding: 0.3rem 0.55rem; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text-muted); cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent-ink); border-color: var(--accent); }

/* ---- Tabs -------------------------------------------------------------- */
.tabs { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tablist { display: flex; flex-wrap: wrap; gap: 0; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tab {
  font-family: var(--font-mono); font-size: var(--step--1); font-weight: 600;
  padding: 0.6rem 1rem; border: none; background: transparent; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent-ink); background: var(--surface); border-bottom-color: var(--accent); }
.tabpanel { padding: 1.15rem; }
.tabpanel[hidden] { display: none; }
.tabpanel > *:first-child { margin-top: 0; }
.tabpanel ul { margin: 0.2rem 0 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 0.55rem; }
.tabpanel li { color: var(--text-muted); }
.tabpanel li strong { color: var(--text); }

/* ---- Steps ------------------------------------------------------------- */
.steps { display: flex; flex-direction: column; gap: 2rem; counter-reset: step; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 1.1rem; align-items: start; }
.step__num {
  counter-increment: step; font-family: var(--font-mono); font-weight: 700;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent-ink); border-radius: 50%;
  background: var(--accent-soft); font-size: 0.95rem;
}
.step__num::before { content: counter(step); }
.step__body { display: flex; flex-direction: column; gap: 0.7rem; min-width: 0; }
.step__body h3 { font-size: var(--step-1); }

/* ---- Details (advanced) ------------------------------------------------ */
.disclose { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.disclose > summary { cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 0.6rem; }
.disclose > summary::-webkit-details-marker { display: none; }
.disclose > summary::before { content: "+"; font-family: var(--font-mono); color: var(--accent-ink); font-weight: 700; }
.disclose[open] > summary::before { content: "\2212"; }
.disclose__body { padding: 0 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.85rem; }

/* ---- FAQ --------------------------------------------------------------- */
.faq { display: flex; flex-direction: column; gap: 0.65rem; max-width: 760px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.faq summary { cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent-ink); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 1.1rem 1rem; color: var(--text-muted); max-width: none; }

/* ---- CTA band + footer ------------------------------------------------- */
.cta-band { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2rem; }
.cta-band h2 { max-width: 20ch; }
.cta-band .btn-row { justify-content: flex-start; }

.footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: var(--step--1); }
.footer__grid { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; padding-block: 2.5rem; }
.footer h4 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); margin-bottom: 0.6rem; }
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--accent-ink); }
.footer__links { display: flex; flex-direction: column; gap: 0.35rem; }
.footer__meta { max-width: 34ch; line-height: 1.7; }
.footer__bottom { border-top: 1px solid var(--border); padding-block: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; border-radius: 0 0 var(--radius) 0; z-index: 50; }
.skip-link:focus { left: 0; }
