/* yoniso.app — the one stylesheet (WB-1). Frames and rules: docs/design/website-nov15/ (S2 is the component sheet).
   Colours are the app's own values, named after Yoniso/Design/YonisoPalette.swift. Dark only. */

@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url("/fonts/archivo-800.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 900; font-display: swap; src: url("/fonts/archivo-900.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("/fonts/jetbrains-mono-400.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --canvas: #0C0B0A;      /* YonisoPalette.canvas */
  --surface-1: #1C1A18;   /* YonisoPalette.surface1 */
  --surface-2: #24211E;   /* YonisoPalette.surface2 */
  --surface-3: #2E2A26;   /* YonisoPalette.surface3 */
  --bone: #F0EBE0;        /* YonisoPalette.textPrimary (bone) */
  --ink-2: #C9C3B6;       /* YonisoPalette.ink2 */
  --stone: #A39D91;       /* YonisoPalette.textSecondary — the board's "stone" swatch, 7.3:1 on canvas */
  --hairline: rgb(240 235 224 / .07);   /* YonisoPalette.hairline */
  --outline: rgb(240 235 224 / .22);    /* YonisoPalette.outline */
  --pressed: #D6D0C4;     /* S2: the button pressed (board value; not an app token) */
  --phone-edge: rgb(240 235 224 / .62); /* S2: phone frame edge, bone at 62 % */
  --tile-edge: rgb(240 235 224 / .40);  /* S2: crop tile edge, bone at 40 % */

  --head: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* S2 type scale, 375 first */
  --h1: 40px; --h2: 30px; --close: 32px; --panel: 24px; --body: 17px; --body-lh: 1.5;
  --fact: 17px; --caption: 13.5px; --over: 11.5px; --step-h: 21px; --tip: 17px;
  /* S2 spacing */
  --side: 20px; --section: 40px; --close-pad: 48px; --row: 12px; --q-row: 52px;
  --bar: 56px; --phone: 280px; --hero-phone: 296px;
}

@media (min-width: 960px) {
  :root {
    --h1: 76px; --h2: 48px; --close: 60px; --panel: 30px; --body: 19px; --body-lh: 1.55;
    --fact: 20px; --caption: 15px; --over: 12.5px; --step-h: 22px; --tip: 18px;
    --side: max(100px, calc((100vw - 1080px) / 2)); --section: 128px; --close-pad: 160px; --row: 18px; --q-row: 64px;
    --bar: 64px; --phone: 300px; --hero-phone: 326px;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 16px); }
body { margin: 0; background: var(--canvas); color: var(--ink-2); font: 400 var(--body)/var(--body-lh) var(--text); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--bone); }
:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--side); top: -100px; z-index: 20; background: var(--bone); color: var(--canvas); padding: 12px 16px; border-radius: 8px; }
.skip:focus { top: 8px; }

h1, h2, h3 { color: var(--bone); margin: 0; font-family: var(--head); letter-spacing: -.02em; }
h1 { font-size: var(--h1); line-height: .98; font-weight: 900; }
h2 { font-size: var(--h2); line-height: 1.04; font-weight: 800; }
h3 { font-size: var(--panel); line-height: 1.08; font-weight: 800; }
p { margin: 0; }
.lede { margin-top: 16px; max-width: 36em; }
.overline { font: 400 var(--over)/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--stone); margin: 0; }
.caption { font: 400 var(--over)/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--stone); margin-top: 16px; }
.more { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }

/* The button — the only primary (S2): bone, radius half the height, no hover colour, no shadow. */
.button { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 24px; border-radius: 24px;
  background: var(--bone); color: var(--canvas); font: 700 16.5px/1 var(--text); text-decoration: none; white-space: nowrap; }
.button:active { background: var(--pressed); transform: scale(.98); }
.button:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; border-radius: 24px; }
.cta { margin-top: 24px; }

/* Top bar (S2): 56 / 64 tall, canvas at 85 %, hairline under. */
.bar { position: sticky; top: 0; z-index: 10; height: var(--bar); display: flex; align-items: center; gap: 8px;
  padding: 0 var(--side); background: rgb(12 11 10 / .85); border-bottom: 1px solid var(--hairline); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; color: var(--bone);
  font: 700 20px/1 var(--text); text-decoration: none; }
.brand img { width: 28px; height: 26px; }
.bar nav { display: none; }
.bar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink-2); text-decoration: none; font-size: 16px; }
.bar nav a:hover, .bar nav a[aria-current] { color: var(--bone); }
.bar .button { height: 44px; padding: 0 18px; font-size: 15px; }
@media (min-width: 960px) { .bar nav { display: flex; gap: 8px; margin-right: 16px; } }

/* Sections */
main { display: block; }
.section { padding: var(--section) var(--side); border-top: 1px solid var(--hairline); }
.section:first-child { border-top: 0; }
.inner { max-width: 1080px; margin: 0 auto; }

/* Phone frame (S2): a 393 × 852 screen, radius 48, edge 1.5 bone at 62 %, the island the only hardware. */
.phone { width: var(--phone); margin: 32px auto 0; }
.screen { position: relative; aspect-ratio: 393 / 852; border: 1.5px solid var(--phone-edge); border-radius: 12.21% / 5.63%;
  overflow: hidden; background: var(--canvas); }
.screen::before { content: ""; position: absolute; z-index: 1; top: 1.3%; left: 34.5%; width: 31%; height: 4.2%; border-radius: 99px; background: #000; }
.screen img { width: 100%; height: 100%; object-fit: cover; }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center;
  font: 400 11px/1.4 var(--mono); color: var(--stone); background: var(--surface-1); }
/* At 375 a phone on Home ends flat at the section edge (S2 "crops"). */
.crop { overflow: hidden; height: var(--crop, 220px); margin: 24px calc(var(--side) * -1) calc(var(--section) * -1); display: flex; justify-content: center; }
.crop .phone { margin: 0; flex: none; }
.crop.top { align-items: flex-start; } .crop.top .phone { margin-top: 0; }
.crop.bottom { align-items: flex-end; }
.crop.middle { align-items: center; }
.hero .crop { --crop: 320px; }
.hero .phone { width: var(--hero-phone); }
/* A tile (S2): a crop in a 14-radius tile with a 1 pt bone edge at 40 %. */
.tile { border: 1px solid var(--tile-edge); border-radius: 14px; overflow: hidden; background: var(--canvas); }
.tile { position: relative; }
.tile.row { aspect-ratio: 393 / 150; }   /* fits-block: a crop of Today's row */
.tile.note { aspect-ratio: 393 / 170; }  /* fits-note: a crop of the note */
.tile.grid { aspect-ratio: 393 / 230; }  /* fits-thread: a crop of the commitment card */

/* Home features: one heading, two sentences, one phone, a link. */
.feature h2 { max-width: 14em; }
@media (min-width: 960px) {
  .hero .inner, .feature .inner { display: grid; grid-template-columns: 1fr auto; gap: 96px; align-items: center; }
  /* H.4, H.5 and H.6a put the phone on the left (the 1280 frames). */
  .feature:nth-of-type(even) .inner { grid-template-columns: auto 1fr; }
  .feature:nth-of-type(even) .crop { order: -1; }
  .crop { height: auto; margin: 0; overflow: visible; }
  .hero { padding-top: 96px; }
}

/* H.2 — how it fits together */
.fits { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 16px; }
.fits li { background: var(--surface-1); border-radius: 20px; padding: 16px; }
.fits .overline { margin-bottom: 16px; }
.fits h3 { margin-top: 16px; }
.fits p { margin-top: 8px; }
@media (min-width: 960px) { .fits { grid-template-columns: repeat(3, 1fr); gap: 24px; } .fits li { padding: 32px; } }

/* Fact rows (S2): line glyph in stone, text bone, hairline between. */
.split { display: grid; gap: 24px; }
@media (min-width: 960px) { .split { grid-template-columns: 5fr 7fr; gap: 64px; } .wont div { grid-template-columns: 1fr 1fr; } }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; gap: 14px; padding: var(--row) 0; border-bottom: 1px solid var(--hairline); color: var(--bone); font-size: var(--fact); line-height: 1.4; }
.facts svg { flex: none; width: 20px; height: 20px; margin-top: .1em; color: var(--stone); }
.wont { margin: 0; }
.wont div { display: grid; gap: 4px 16px; padding: var(--row) 0; border-bottom: 1px solid var(--hairline); font-size: var(--fact); line-height: 1.4; }
.wont dt { color: var(--stone); text-decoration: line-through; }
.wont dd { margin: 0; color: var(--bone); }

/* Question rows (S2): the whole row is the target, + becomes –, opens in place, no motion. */
.questions { border-top: 1px solid var(--hairline); }
.questions details { border-bottom: 1px solid var(--hairline); }
.questions summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--q-row);
  cursor: pointer; list-style: none; color: var(--bone); font: 600 var(--fact)/1.4 var(--text); }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: "+"; color: var(--stone); font: 400 20px/1 var(--mono); }
.questions details[open] summary::after { content: "–"; }
.questions details p { padding: 0 0 20px; max-width: 36em; }

/* The close */
.close { padding: var(--close-pad) var(--side); text-align: center; border-top: 1px solid var(--hairline); }
.close h2 { font-size: var(--close); max-width: 12em; margin: 0 auto; }

/* Footer */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 32px var(--side); border-top: 1px solid var(--hairline); font-size: 15px; }
.foot img { width: 22px; height: 21px; }
.foot nav { display: flex; flex-wrap: wrap; column-gap: 20px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--bone); }
.foot small { font-size: 15px; color: var(--stone); }
.foot .year { font-family: var(--mono); font-size: 13px; }
@media (min-width: 960px) { .foot .made { margin-left: auto; } }

/* The Guide (G0–G3, G.5) */
.crumb { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
.page-head { padding: 32px var(--side) 8px; }
.page-head .inner > p { margin-top: 20px; max-width: 34em; }
@media (min-width: 960px) { .page-head { padding-top: 96px; } }
.index-group { margin-top: 40px; }
.index-group ul { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--hairline); }
.index-group a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; min-height: 64px;
  border-bottom: 1px solid var(--hairline); text-decoration: none; }
.index-group strong { display: block; color: var(--bone); font: 600 var(--fact)/1.3 var(--text); }
.index-group span { display: block; color: var(--ink-2); font-size: 16px; margin-top: 4px; }
.index-group a::after { content: "›"; color: var(--stone); font-size: 22px; }

.guide { padding: 24px var(--side) var(--section); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; display: grid; grid-template-columns: 40px 1fr; padding: 28px 0; border-top: 1px solid var(--hairline); }
.step .num { font: 400 13px/1.9 var(--mono); color: var(--stone); }
.step h2 { font: 700 var(--step-h)/1.25 var(--text); letter-spacing: 0; }
.step p { margin-top: 8px; font-size: 17px; line-height: 1.5; }
.step .phone { grid-column: 1 / -1; margin-top: 24px; }
.aside { margin-top: 48px; }
.aside p { margin-top: 12px; max-width: 36em; }
.tips { margin-top: 48px; }
.tips ul { list-style: none; margin: 12px 0 0; padding: 0; }
.tips li { position: relative; padding: 13px 0 13px 22px; border-bottom: 1px solid var(--hairline); color: var(--bone); font-size: var(--tip); line-height: 1.4; }
.tips li::before { content: ""; position: absolute; left: 0; top: calc(13px + .7em - 3.5px); width: 7px; height: 7px; border: 1.4px solid var(--stone); border-radius: 50%; }
.next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; }
.next a.more { margin: 0; font-size: 20px; }
.stage { display: none; }
@media (min-width: 960px) {
  .guide .inner { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 120px; }
  .step { grid-template-columns: 72px 1fr; padding: 40px 0 40px 24px; }
  .step .phone { width: 300px; margin-left: 0; }
  /* With scripts on, one phone stays in view and shows the step in view (site.js); steps are the tap targets. */
  .js .step { cursor: pointer; }
  .js .step h2 { color: var(--stone); }
  .js .step[aria-current] h2 { color: var(--bone); }
  .js .step[aria-current]::before { content: ""; position: absolute; left: 0; top: 40px; bottom: 40px; width: 2px; background: var(--bone); }
  .js .step .phone { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
  .js .stage { display: block; position: sticky; top: calc(var(--bar) + 32px); align-self: start; grid-row: 1 / span 4; grid-column: 2; }
  .js .stage .phone { width: 340px; margin: 0; }
  .js .stage .slot { display: grid; }
  .js .stage .slot > * { grid-area: 1 / 1; opacity: 0; transition: opacity .3s; }
  .js .stage .slot > .on { opacity: 1; }
  .guide .steps, .guide .aside, .guide .tips, .guide .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .js .stage .slot > * { transition: none; } .button:active { transform: none; } }

/* Small pages: Support, Not found, Invite, Privacy, Terms */
.page { padding: 32px var(--side) var(--section); }
@media (min-width: 960px) { .page { padding-top: 96px; } }
.page .inner { max-width: 760px; }
.page h1 + .questions, .page h1 + p { margin-top: 32px; }
.write { margin-top: 48px; }
.write p { margin-top: 8px; }
.notfound { min-height: 50vh; }
/* Invite (P.3): no top bar; the mark, one line, the button. Never a name (owner, 15 Nov). */
.invite { text-align: center; min-height: 100vh; display: grid; place-items: center; }
.invite .inner { max-width: 520px; }
.invite-mark { width: 84px; height: auto; margin: 0 auto 32px; }
.invite h1 { font-size: var(--h2); line-height: 1.04; }
.invite p { margin-top: 20px; }
.invite .button { margin-top: 32px; }
.invite-ask { color: var(--stone); }
.invite-ask a { display: inline-flex; align-items: center; min-height: 44px; }
.invite .small { font-size: var(--caption); color: var(--stone); margin-top: 40px; }

/* Legal text (P.1): the existing words, set in the site's type. */
.legal h1 { font-size: var(--h2); }
.legal h2 { font: 700 21px/1.3 var(--text); letter-spacing: 0; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--ink-2); margin: 12px 0 0; }
.legal ul { padding-left: 1.2em; }
.legal .meta { font: 400 var(--over)/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--stone); margin-top: 16px; }
.legal strong { color: var(--bone); }
/* The table scrolls by itself: a wrapper would sit inside the span retention-table.mjs rewrites. */
.legal table { display: block; overflow-x: auto; margin: 16px 0; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hairline); color: var(--ink-2); }
.legal th { color: var(--bone); font-weight: 600; }
