/* swarmtower.dev: the one stylesheet of the public pages (Milestone 19 Task 19.8). Colours are the apps' design
   tokens (contract/app-api/tokens.json, Milestone 36: one look on every platform): light = the tokens' light values,
   dark = their dark values (navy ground #0B1020). Session looks follow the tokens' "web" shapes: needs a triangle,
   stuck an octagon, working a ring, done a disc, idle a hollow ring; each beside its state word. No scripts, no
   web fonts: the system font stack. */

:root {
  color-scheme: light dark;
  --paper: #F1F3F2; --surface: #FFFFFF; --raised: #FFFFFF; --sunk: #EAEDEC;
  --ink: #1D2427; --ink-2: #4C575B; --ink-3: #636F74;
  --rule: #D5DBDB; --rule-2: #E7EBEB; --rule-card: #E1E6E6;
  --accent: #0D6A7D; --accent-ink: #FFFFFF; --accent-soft: #DCEDF0;
  --st-needs: #C96A00; --st-needs-ink: #8F4A00; --st-needs-soft: #F8ECD6;
  --st-stuck: #B3261E; --st-stuck-ink: #B3261E;
  --st-working: #0D6A7D; --st-working-ink: #0B6070;
  --st-done: #1D63C9; --st-done-ink: #1A56B0;
  --st-idle: #636F74;
  --ok: #2B7149; --quiet-soft: #E6EAEA;
  --bar: #1D2427; --bar-ink: #EEF2F2;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --r-xs: 6px; --r-sm: 8px; --r-field: 12px; --r-card: 16px; --r-lg: 20px; --r-pill: 999px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --page: 68rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0B1020; --surface: #151D30; --raised: #1A2338; --sunk: #080C18;
    --ink: #E4E9F2; --ink-2: #9AA6BD; --ink-3: #8490AA;
    --rule: #222C42; --rule-2: #1A2236; --rule-card: #1E2740;
    --accent: #5FC3D6; --accent-ink: #06262D; --accent-soft: #163238;
    --st-needs: #FF9F0A; --st-needs-ink: #FFB84D; --st-needs-soft: #35270F;
    --st-stuck: #FF8A80; --st-stuck-ink: #FF8A80;
    --st-working: #5FC3D6; --st-working-ink: #5FC3D6;
    --st-done: #3B8CFF; --st-done-ink: #62AEFF;
    --st-idle: #8E9BA0;
    --ok: #7FCB9C; --quiet-soft: #243034;
    --bar: #080C18; --bar-ink: #E4E9F2;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.012em; margin: 0; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -.022em; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.06rem; }
p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.3em; }
li { margin: 0 0 var(--s-2); }
li > ul, li > ol { margin-top: var(--s-2); }
b, strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-6) 0; }

code, kbd, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--sunk); padding: .1em .38em; border-radius: var(--r-xs); overflow-wrap: anywhere; }
pre {
  background: var(--sunk); color: var(--ink); border: 1px solid var(--rule-2); border-radius: var(--r-field);
  padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-4); overflow-x: auto; line-height: 1.5;
}
pre code { background: none; padding: 0; font-size: 1em; overflow-wrap: normal; }
.menu { font-weight: 600; white-space: nowrap; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--s-4); }
@media (min-width: 720px) { .wrap { padding: 0 var(--s-5); } }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: var(--s-4); top: var(--s-2); background: var(--surface); padding: var(--s-2) var(--s-3); z-index: 2; }

/* top bar */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top .wrap { display: flex; align-items: center; gap: var(--s-4); min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: 1.05rem; letter-spacing: -.01em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.top nav { margin-left: auto; display: flex; gap: var(--s-1); flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: var(--r-sm); font-size: .94rem; }
.top nav a:hover { color: var(--ink); background: var(--accent-soft); }
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: var(--r-field);
  font-weight: 600; font-size: .97rem; text-decoration: none; border: 1px solid transparent; line-height: 1.2;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.secondary { background: var(--raised); color: var(--ink); border-color: var(--rule-card); }
.btn.soon { background: var(--quiet-soft); color: var(--ink-2); cursor: default; }
.btn small { font-weight: 500; color: inherit; opacity: .85; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-5) 0 0; }

/* session looks: a mark plus its state word */
.mark { display: inline-block; width: 12px; height: 12px; flex: none; }
.mark.needs { background: var(--st-needs); clip-path: polygon(50% 4%, 98% 92%, 2% 92%); }
.mark.stuck { background: var(--st-stuck); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.mark.working { border-radius: 50%; border: 2.5px solid var(--st-working); border-right-color: transparent; transform: rotate(45deg); }
.mark.done { border-radius: 50%; background: var(--st-done); }
.mark.idle { border-radius: 50%; border: 1.5px solid var(--st-idle); }
.word { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.word.needs { color: var(--st-needs-ink); }
.word.stuck { color: var(--st-stuck-ink); }
.word.working { color: var(--st-working-ink); }
.word.done { color: var(--st-done-ink); }
.word.idle { color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  .mark.working { animation: spin 1.2s linear infinite; }
  @keyframes spin { to { transform: rotate(405deg); } }
}

/* homepage */
.hero { padding: var(--s-6) 0 var(--s-6); }
@media (min-width: 900px) {
  .hero { padding: 72px 0 64px; }
  .hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
}
.eyebrow { color: var(--accent); font-weight: 600; font-size: .9rem; letter-spacing: .01em; margin: 0 0 var(--s-3); }
.lede { font-size: 1.16rem; color: var(--ink-2); max-width: 36rem; margin: var(--s-4) 0 0; }
.hero-note { color: var(--ink-3); font-size: .88rem; margin: var(--s-3) 0 0; }

.board { background: var(--raised); border: 1px solid var(--rule-card); border-radius: var(--r-lg); padding: var(--s-2); margin-top: var(--s-6); box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -18px rgb(0 0 0 / .25); }
@media (min-width: 900px) { .board { margin-top: 0; } }
.board-head { display: flex; justify-content: space-between; align-items: baseline; padding: var(--s-2) var(--s-3) var(--s-3); color: var(--ink-3); font-size: .8rem; }
.board-head b { color: var(--ink); font-size: .95rem; }
.sessions { list-style: none; margin: 0; padding: 0; }
.sessions li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: center; padding: var(--s-3); margin: 0; border-radius: var(--r-field); }
.sessions li + li { border-top: 1px solid var(--rule-2); }
.sessions li.needs { background: color-mix(in srgb, var(--st-needs) 10%, transparent); border-top-color: transparent; }
.sessions .name { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.sessions .meta { display: block; color: var(--ink-3); font-size: .8rem; line-height: 1.35; margin-top: 2px; overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: .72rem; font-weight: 600; color: var(--ink-2); background: var(--sunk); border-radius: var(--r-pill); padding: 1px 8px; margin-left: 6px; vertical-align: 1px; }

.band { padding: 56px 0; border-top: 1px solid var(--rule); }
.band.alt { background: var(--surface); }
.band h2 { margin-bottom: var(--s-3); }
.band .intro { color: var(--ink-2); max-width: 40rem; margin-bottom: var(--s-5); }

.grid { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
.grid > *, .price > *, .steps > li { min-width: 0; }
@media (min-width: 640px) { .grid.two, .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.four { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--raised); border: 1px solid var(--rule-card); border-radius: var(--r-card); padding: var(--s-5); }
.card h3 { margin-bottom: var(--s-2); display: flex; align-items: center; gap: 10px; }
.card p { color: var(--ink-2); font-size: .95rem; margin: 0; }
.card p + p { margin-top: var(--s-2); }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }
a.card h3 { color: var(--ink); }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: var(--s-4); }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; margin: 0; position: relative; padding: var(--s-5); padding-top: 60px; background: var(--raised); border: 1px solid var(--rule-card); border-radius: var(--r-card); color: var(--ink-2); font-size: .95rem; }
.steps li::before { content: counter(step); position: absolute; top: var(--s-5); left: var(--s-5); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem; }
.steps li b { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: var(--s-1); }

.price { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 800px) { .price { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: start; } }
.price .card h3 { font-size: 1.3rem; }
.ticks { list-style: none; padding: 0; margin: var(--s-3) 0 0; }
.ticks li { position: relative; padding-left: 26px; color: var(--ink-2); font-size: .95rem; }
.ticks li::before { content: ""; position: absolute; left: 3px; top: .5em; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }

/* docs */
.page { padding: var(--s-6) 0 56px; }
.doc { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .doc { grid-template-columns: 13rem minmax(0, 1fr); gap: 48px; } }
.side { font-size: .93rem; }
.side p { color: var(--ink-3); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 var(--s-2); }
.side ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); }
@media (min-width: 900px) { .side ul { display: block; position: sticky; top: var(--s-5); } }
.side li { margin: 0; }
.side a { display: block; padding: 6px 10px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; }
.side a:hover { background: var(--accent-soft); color: var(--ink); }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
@media (max-width: 899px) { .side a { background: var(--raised); border: 1px solid var(--rule-card); } }

.prose { max-width: 44rem; min-width: 0; }
.prose h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.5rem); margin-bottom: var(--s-3); }
.prose .sub { color: var(--ink-2); font-size: 1.1rem; margin-bottom: var(--s-5); }
.prose h2 { margin: 48px 0 var(--s-3); padding-top: var(--s-2); scroll-margin-top: var(--s-4); }
.prose h3 { margin: var(--s-5) 0 var(--s-2); scroll-margin-top: var(--s-4); }
.prose li { color: var(--ink); }
.toc { background: var(--raised); border: 1px solid var(--rule-card); border-radius: var(--r-card); padding: var(--s-4) var(--s-5); margin: 0 0 var(--s-5); }
.toc p { margin: 0 0 var(--s-2); color: var(--ink-3); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.toc ol { margin: 0; columns: 2 14rem; column-gap: var(--s-5); }
.toc li { margin: 0 0 var(--s-1); break-inside: avoid; }
.note { border-radius: var(--r-field); padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-4); background: var(--accent-soft); color: var(--ink); font-size: .95rem; }
.note.warn { background: var(--st-needs-soft); }
.note p:last-child { margin-bottom: 0; }
.placeholder { font-family: var(--mono); font-size: .9em; background: var(--st-needs-soft); color: var(--st-needs-ink); padding: .1em .4em; border-radius: var(--r-xs); }

.problem { background: var(--raised); border: 1px solid var(--rule-card); border-radius: var(--r-card); padding: var(--s-4) var(--s-5); margin: 0 0 var(--s-4); }
.problem h3 { margin: 0 0 var(--s-2); }
.problem p, .problem li { font-size: .96rem; }
.problem > :last-child { margin-bottom: 0; }

details.qa { border-bottom: 1px solid var(--rule); padding: var(--s-3) 0; }
details.qa:first-of-type { border-top: 1px solid var(--rule); }
details.qa summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: var(--s-3); }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 1.2rem; line-height: 1; }
details.qa[open] summary::after { content: "\2212"; }
details.qa > div { padding-top: var(--s-3); color: var(--ink-2); }
details.qa > div > :last-child { margin-bottom: 0; }

table { border-collapse: collapse; width: 100%; font-size: .94rem; margin: 0 0 var(--s-4); }
th, td { text-align: left; vertical-align: top; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--rule); }
th { color: var(--ink-3); font-weight: 600; font-size: .85rem; }
.table { overflow-x: auto; }

/* footer */
.foot { border-top: 1px solid var(--rule); padding: var(--s-6) 0; color: var(--ink-3); font-size: .9rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: center; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot p { margin: 0; }
.more { margin: var(--s-5) 0 0; }
td .mark + .word, td .mark { vertical-align: -1px; }
.states td:first-child { white-space: nowrap; }
