/* ==========================================================================
   OffDuty Labs design system
   Labs pages are monochrome. Each app sets --accent on <body data-app="...">
   so a new app is a one-variable change, never a redesign.
   ========================================================================== */

:root {
  --bg:        #FCFCFA;
  --surface:   #FFFFFF;
  --surface-2: #F4F5F2;
  --ink:       #14171A;
  --muted:     #5B6570;
  --line:      #E4E6E3;

  --accent:     #14171A;   /* Labs default: monochrome */
  --accent-ink: #FFFFFF;
  --accent-soft:#F0F1EE;
  --alert:      #C2410C;   /* the problem, never the brand */

  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1060px;
  --pad: clamp(1.15rem, 4vw, 2rem);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* Per-app accents. Add one block per app; nothing else changes. */
body[data-app="offduty"] {
  --accent:      #2E9E4F;
  --accent-ink:  #FFFFFF;
  --accent-soft: #EAF6EE;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0E1114;
    --surface:   #151A1F;
    --surface-2: #1B2127;
    --ink:       #E8EBED;
    --muted:     #98A2AC;
    --line:      #232A31;

    --accent:     #E8EBED;
    --accent-ink: #14171A;
    --accent-soft:#1B2127;
    --alert:      #FB923C;
  }
  body[data-app="offduty"] {
    --accent:      #46C46B;
    --accent-ink:  #0E1114;
    --accent-soft: #14231A;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(2rem, 5.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.2vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1.1em; }

a { color: inherit; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.75rem 0; }

code {
  font-family: var(--mono); font-size: .875em;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: .12em .4em; border-radius: 5px;
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.narrow { max-width: 720px; }

/* --- Skip link ----------------------------------------------------------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

/* --- Global header (company-level links ONLY) ---------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 62px;
}
.brand {
  font-weight: 680; letter-spacing: -.025em; text-decoration: none;
  display: inline-flex; align-items: center; gap: .5rem; font-size: 1.02rem;
  white-space: nowrap;
}
.brand .dot {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent); flex: none;
}
.site-nav { margin-left: auto; display: flex; gap: 1.4rem; font-size: .94rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--ink); }

/* --- App sub-nav (app-scoped links live here, never in .site-nav) -------- */
.app-bar { border-bottom: 1px solid var(--line); background: var(--surface); }
.app-bar .wrap { display: flex; align-items: center; gap: 1.15rem; flex-wrap: wrap; min-height: 54px; }
.app-bar .app-name {
  font-weight: 640; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem;
}
.app-bar .app-name .mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent); flex: none;
}
.app-nav { display: flex; gap: 1.15rem; font-size: .92rem; flex-wrap: wrap; }
.app-nav a { text-decoration: none; color: var(--muted); padding: .15rem 0; }
.app-nav a:hover { color: var(--ink); }
.app-nav a[aria-current="page"] {
  color: var(--ink); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

/* --- Hero ---------------------------------------------------------------- */
.hero { padding: clamp(3rem, 9vw, 5.5rem) 0 clamp(2rem, 6vw, 3.5rem); }
.hero p.lede { font-size: clamp(1.05rem, 2.4vw, 1.28rem); color: var(--muted); max-width: 42ch; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .09em; font-size: .76rem;
  font-weight: 650; color: var(--muted); margin-bottom: .9rem;
}

/* --- Buttons ------------------------------------------------------------- */
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--accent); color: var(--accent-ink);
  padding: .68rem 1.15rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 1px solid var(--accent);
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }

/* --- Cards / grids ------------------------------------------------------- */
.grid { display: grid; gap: 1rem; }
.grid.two   { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.4rem;
}
.card h3 { margin-bottom: .35rem; }
.card h3 .badge { margin-left: .45rem; vertical-align: 2px; }
.card p:last-child { margin-bottom: 0; }
.card .muted { color: var(--muted); font-size: .95rem; }

/* App card: the unit that repeats as the studio grows */
.app-card {
  display: block; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem;
  transition: border-color .15s ease, transform .15s ease;
}
.app-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); transform: translateY(-2px); }
.app-card .mark {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--accent); margin-bottom: 1rem;
}
.app-card h3 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; }
.app-card .tagline { color: var(--muted); margin: 0 0 .9rem; }
.app-card .more { font-size: .9rem; font-weight: 600; color: var(--accent); }
.app-card.soon { border-style: dashed; background: transparent; }
.app-card.soon .mark { background: var(--line); }

.badge {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  font-weight: 700; padding: .2rem .5rem; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  white-space: nowrap;
}
body:not([data-app]) .badge { color: var(--muted); border-color: var(--line); background: var(--surface-2); }


/* --- Alert-storm figure -------------------------------------------------- */
.figure {
  margin: 0 0 2rem; padding: 0;
}
.figure svg { width: 100%; height: auto; display: block; }
.figure figcaption {
  color: var(--muted); font-size: .88rem; margin-top: .85rem; text-align: center;
}

.storm .ink    { fill: none; stroke: var(--ink);   stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.storm .soft   { fill: none; stroke: var(--muted); stroke-width: 2;   stroke-linecap: round; stroke-linejoin: round; }
.storm .flow   { fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-dasharray: 4 7; stroke-linecap: round; opacity: .65; }
.storm .body   { fill: var(--surface-2); stroke: var(--ink); stroke-width: 2.2; }
.storm .screen { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.storm .pill   { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.storm .bar    { stroke: var(--line); stroke-width: 4.5; stroke-linecap: round; }
.storm .dot    { fill: var(--alert); }
.storm .spark  { stroke: var(--alert); stroke-width: 2.2; stroke-linecap: round; fill: none; }
.storm .lbl    { fill: var(--muted); font-size: 15px; font-weight: 500; }
.storm .count  { fill: var(--alert); font-size: 15px; font-weight: 700; }

@media (max-width: 620px) {
  .storm .lbl, .storm .count { font-size: 18px; }
}

/* --- Sections ------------------------------------------------------------ */
section.band { padding: clamp(2.5rem, 7vw, 4rem) 0; }
section.band + section.band { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 1.75rem; max-width: 60ch; }
.section-head p { color: var(--muted); margin-bottom: 0; }

/* --- Steps --------------------------------------------------------------- */
ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
ol.steps > li {
  counter-increment: s; position: relative;
  padding: 0 0 1.6rem 3.1rem; margin: 0;
  border-left: 2px solid var(--line); margin-left: 1rem;
}
ol.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps > li::before {
  content: counter(s);
  position: absolute; left: -1rem; top: -.1rem;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: .85rem; font-weight: 700;
}
ol.steps h3 { margin-bottom: .3rem; }
ol.steps > li > :last-child { margin-bottom: 0; }

/* --- Callouts ------------------------------------------------------------ */
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--muted);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 1.05rem 1.2rem; margin: 1.5rem 0;
}
.callout :last-child { margin-bottom: 0; }
.callout strong:first-child { display: block; margin-bottom: .25rem; }
.callout.warn   { border-left-color: #D98324; }
.callout.accent { border-left-color: var(--accent); background: var(--accent-soft); }

/* --- Prose (privacy, support, setup) ------------------------------------- */
.prose h2 { margin-top: 2.4rem; padding-top: .3rem; }
.prose h3 { margin-top: 1.8rem; }
.prose > h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.15rem; }
.prose li { margin-bottom: .45rem; }
.prose .updated { color: var(--muted); font-size: .92rem; }

table {
  width: 100%; border-collapse: collapse; margin: 0 0 1.4rem;
  font-size: .93rem; display: block; overflow-x: auto;
}
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 640; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* --- FAQ ----------------------------------------------------------------- */
details.faq {
  border-bottom: 1px solid var(--line); padding: .35rem 0;
}
details.faq summary {
  cursor: pointer; padding: .85rem 0; font-weight: 600;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.3rem; line-height: 1; }
details.faq[open] summary::after { content: "\2013"; }
details.faq .body { padding: 0 0 .9rem; }
details.faq .body > :last-child { margin-bottom: 0; }

/* --- Footer -------------------------------------------------------------- */
.site-foot {
  border-top: 1px solid var(--line); margin-top: clamp(3rem, 8vw, 5rem);
  padding: 2.5rem 0 3rem; font-size: .9rem; color: var(--muted);
  background: var(--surface);
}
.foot-cols { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 2rem; }
.foot-cols h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: .7rem; }
.foot-cols ul { list-style: none; padding: 0; margin: 0; }
.foot-cols li { margin-bottom: .4rem; }
.foot-cols a { text-decoration: none; }
.foot-cols a:hover { color: var(--ink); }
.legal { border-top: 1px solid var(--line); padding-top: 1.5rem; font-size: .84rem; }
.legal p { margin-bottom: .6rem; }
.legal p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
  .site-head .wrap { gap: .9rem; }
  .site-nav { gap: 1rem; font-size: .9rem; }
}
