/* Snifff Academy — independent music-magazine minimalism.
   Colors come from brand.js (CSS variables). Fallbacks below keep the page readable before JS runs. */

:root {
  --paper: #FAF8F3;
  --ink: #111111;
  --muted: #5C5C57;
  --rule: #DEDAD0;
  --accent: #2EDB6F;
  --accentInk: #0A7A3A;
  --ts: 1;                        /* in-app text size: 1 / 1.15 / 1.3 */
  --navh: 5.25rem;
  --maxw: 40rem;
  --font: -apple-system, BlinkMacSystemFont, "SF Hebrew", "Segoe UI", "Arial Hebrew", Arial, "Noto Sans Hebrew", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: calc(100% * var(--ts));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accentInk); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem calc(var(--navh) + env(safe-area-inset-bottom) + 2.5rem);
}
.wrap.no-nav { padding-bottom: calc(env(safe-area-inset-bottom) + 3rem); }
.center-screen {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 2rem 1.25rem calc(2rem + env(safe-area-inset-bottom));
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--paper);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1.25rem;
  min-height: 3.75rem;
}
.logo { height: 1.9rem; width: auto; }
.logo-slot { display: flex; align-items: center; }
.topbar-label { font-size: .875rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.logo-slot { flex: none; }
.progress { height: 4px; background: var(--rule); }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; }

.icon-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 2.75rem; min-width: 2.75rem; padding: 0 .75rem;
  background: none; border: 1.5px solid var(--ink); border-radius: 999px;
  font-size: .9375rem; font-weight: 600;
  flex: none; white-space: nowrap;
}
.icon { width: 1.35rem; height: 1.35rem; flex: none; }

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 10;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: .75rem 1.25rem calc(.75rem + env(safe-area-inset-bottom));
}
.bottomnav-inner { max-width: var(--maxw); margin: 0 auto; display: flex; gap: .75rem; }
.bottomnav .btn { flex: 1; white-space: nowrap; padding-inline: 1rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3.5rem; padding: .75rem 1.5rem;
  border-radius: 999px; border: 1.5px solid var(--ink);
  background: transparent; color: var(--ink);
  font-size: 1.0625rem; font-weight: 700; text-decoration: none; text-align: center;
}
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-ghost { border-color: transparent; text-decoration: underline; text-underline-offset: .25em; }
.link-btn { background: none; border: 0; padding: .5rem 0; font-weight: 600; text-decoration: underline; text-underline-offset: .25em; min-height: 2.75rem; }

/* ---------- typography ---------- */
.kicker {
  display: inline-block;
  font-size: .8125rem; font-weight: 700; letter-spacing: .08em;
  color: var(--accentInk);
  margin: 0 0 .75rem;
}
h1 {
  font-size: clamp(2.4rem, 11vw, 4.25rem);
  line-height: 1.02; letter-spacing: -.02em; font-weight: 800;
  margin: 0 0 1rem;
}
h1:focus { outline: none; }
.lead { font-size: 1.3rem; line-height: 1.45; margin: 0 0 2rem; font-weight: 500; }
h2 { font-size: 1.35rem; line-height: 1.25; margin: 0 0 1rem; font-weight: 800; }
.section { border-top: 1px solid var(--ink); padding-top: 1rem; margin-top: 2rem; }
.section h2 { font-size: .9375rem; letter-spacing: .04em; font-weight: 700; margin-bottom: .5rem; }

.step-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.numeral {
  font-size: clamp(4.5rem, 22vw, 7rem); line-height: .85; font-weight: 200;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  direction: ltr;
}
.step-icon { width: 2.5rem; height: 2.5rem; color: var(--ink); }
.step-icon .icon { width: 100%; height: 100%; }

ul.points { list-style: none; margin: 0; padding: 0; }
ul.points li { position: relative; padding: .55rem 1.5rem .55rem 0; border-bottom: 1px solid var(--rule); }
ul.points li:last-child { border-bottom: 0; }
ul.points li::before {
  content: ""; position: absolute; right: 0; top: 1.25em;
  width: .75rem; height: 2px; background: var(--accentInk);
}
bdi, .ltr { unicode-bidi: isolate; }

/* ---------- figures ---------- */
.figure { margin: 2.5rem 0 0; padding: 1.25rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.figure svg { width: 100%; height: auto; max-height: 22rem; margin: 0 auto; }
.figure svg text { font-family: var(--font); }
.fig-note { font-size: .875rem; color: var(--muted); margin: .75rem 0 0; text-align: center; }
.i-line { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.i-soft { stroke: var(--rule); stroke-width: 1.4; fill: none; }
.i-thick { stroke-width: 3; }
.i-acc { fill: var(--accent); }
.i-acc-line { stroke: var(--accentInk); stroke-width: 1.6; stroke-linecap: round; }
.i-ink { fill: var(--ink); }
.i-lbl { fill: var(--ink); font-size: 17px; font-weight: 600; }
.i-small { font-size: 14px; font-weight: 500; }
.i-muted { fill: var(--muted); }

.video { margin: 2rem 0 0; }
.video video { width: 100%; height: auto; background: #000; border-radius: 6px; }
.video figcaption { font-size: .875rem; color: var(--muted); margin-top: .5rem; }

/* ---------- task / checklist ---------- */
.task {
  margin-top: 2.5rem; padding: 1.25rem 1.25rem 1rem;
  border: 1.5px solid var(--ink); border-radius: 4px; background: #fff;
}
.task-label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.task-label .kicker { margin: 0; }
.task-count { font-size: .875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.task h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: .75rem; }
.checks { list-style: none; margin: 0; padding: 0; }
.check {
  display: flex; align-items: center; gap: .9rem;
  min-height: 3.25rem; padding: .5rem 0;
  border-top: 1px solid var(--rule); cursor: pointer;
}
.checks li:first-child .check { border-top: 0; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box {
  flex: none; width: 1.6rem; height: 1.6rem;
  border: 1.5px solid var(--ink); border-radius: 3px;
  display: grid; place-items: center; background: var(--paper);
}
.box .icon { width: 1.2rem; height: 1.2rem; stroke-width: 2.4; opacity: 0; }
.check input:checked + .box { background: var(--accent); border-color: var(--ink); }
.check input:checked + .box .icon { opacity: 1; }
.check input:focus-visible + .box { outline: 3px solid var(--accentInk); outline-offset: 3px; }
.check-text { flex: 1; }
.check input:checked ~ .check-text { color: var(--muted); }

/* ---------- welcome ---------- */
.hero { padding-top: 1rem; }
.hero h1 { font-size: clamp(3rem, 15vw, 5.5rem); }
fieldset.tracks { border: 0; margin: 2.5rem 0 0; padding: 0; }
fieldset.tracks legend { font-weight: 800; font-size: 1.2rem; margin-bottom: .75rem; padding: 0; }
.track { display: block; position: relative; margin-bottom: .6rem; cursor: pointer; }
.track input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track-card {
  display: flex; align-items: center; gap: 1rem;
  min-height: 4rem; padding: .75rem 1rem;
  border: 1.5px solid var(--rule); border-radius: 4px; background: #fff;
}
.track-card .dot { flex: none; width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--ink); border-radius: 50%; display: grid; place-items: center; }
.track input:checked + .track-card { border-color: var(--ink); }
.track input:checked + .track-card .dot::after { content: ""; width: .65rem; height: .65rem; border-radius: 50%; background: var(--ink); }
.track input:focus-visible + .track-card { outline: 3px solid var(--accentInk); outline-offset: 3px; }
.track-title { font-weight: 700; display: block; }
.track-desc { font-size: .9rem; color: var(--muted); display: block; }

.outline-h { margin: 3rem 0 0; font-size: 1rem; }
ol.outline { list-style: none; margin: .5rem 0 0; padding: 0; counter-reset: s; }
ol.outline li { display: flex; gap: 1rem; align-items: baseline; padding: .6rem 0; border-bottom: 1px solid var(--rule); counter-increment: s; }
ol.outline li::before { content: counter(s, decimal-leading-zero); font-weight: 300; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 1.75rem; direction: ltr; }

/* ---------- finish ---------- */
blockquote.quote {
  margin: 1.5rem 0 2.5rem; padding: 0;
  font-size: clamp(1.55rem, 6.5vw, 2.2rem); line-height: 1.3; font-weight: 700;
}
blockquote.quote::before { content: ""; display: block; width: 3rem; height: 6px; background: var(--accent); margin-bottom: 1.25rem; }
.summary-step { margin-top: 1.75rem; }
.summary-step h3 { font-size: 1rem; margin: 0 0 .25rem; display: flex; justify-content: space-between; gap: 1rem; }
.stats { font-size: 1rem; color: var(--muted); margin: 0 0 1rem; }
.actions { display: flex; flex-direction: column; gap: .75rem; margin-top: 2.5rem; }

/* ---------- login ---------- */
.login { width: 100%; max-width: 26rem; }
.login .logo { height: 2.6rem; margin-bottom: 3rem; }
.login h1 { font-size: clamp(2.4rem, 12vw, 3.5rem); }
.field { margin: 2rem 0 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .5rem; }
.field input {
  width: 100%; min-height: 3.5rem; padding: .75rem 1rem;
  border: 1.5px solid var(--ink); border-radius: 4px; background: #fff;
  font-size: 1.25rem; letter-spacing: .12em; text-align: center; font-variant-numeric: tabular-nums;
  direction: ltr;
}
.field input::placeholder { color: #9b9b94; letter-spacing: .08em; }
.error { color: #A11D1D; font-weight: 600; min-height: 1.6em; margin: .5rem 0 0; }
.note { font-size: .9rem; color: var(--muted); margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.demo-banner { background: var(--ink); color: var(--paper); text-align: center; font-weight: 700; padding: .5rem 1rem; font-size: .9rem; }

/* ---------- dialogs ---------- */
dialog {
  border: 0; padding: 0; margin: 0 auto auto; max-width: none; max-height: none;
  width: 100%; height: 100%; background: var(--paper); color: var(--ink);
}
dialog::backdrop { background: rgba(17,17,17,.35); }
.dlg { max-width: var(--maxw); margin: 0 auto; padding: calc(1rem + env(safe-area-inset-top)) 1.25rem calc(2rem + env(safe-area-inset-bottom)); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.dlg-head h2 { margin: 0; }
.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 1rem; text-align: start;
  min-height: 3.5rem; padding: .6rem 0;
  background: none; border: 0; border-bottom: 1px solid var(--rule);
}
.menu-item .num { font-weight: 300; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 1.75rem; direction: ltr; }
.menu-item .t { flex: 1; font-weight: 600; }
.menu-item .c { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.menu-item[aria-current="step"] .t { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 4px; text-underline-offset: .3em; }
.menu-item .done { color: var(--accentInk); }
.seg { display: flex; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; margin-top: .5rem; }
.seg button { flex: 1; min-height: 3rem; background: none; border: 0; font-weight: 700; }
.seg button + button { border-inline-start: 1.5px solid var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.menu-group { margin-top: 2rem; }
.menu-group h3 { font-size: .8125rem; letter-spacing: .08em; color: var(--muted); margin: 0 0 .25rem; }

dialog.confirm { width: min(92vw, 26rem); height: fit-content; max-height: 90vh; margin: auto; border-radius: 6px; }
.confirm .dlg { padding: 1.5rem; }
.confirm p { margin: 0 0 1.5rem; }
.confirm .row { display: flex; flex-wrap: wrap; gap: .75rem; }
.confirm .row .btn { flex: 1 1 8rem; white-space: nowrap; }

@media (min-width: 48rem) {
  .wrap { padding-top: 3.5rem; }
  .topbar-inner, .bottomnav { padding-inline: 2rem; }
  .logo { height: 2.2rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .progress > span { transition: width .25s ease; }
}
/* enlarged text on a narrow phone: drop the header label (the step number is repeated on the page) */
@media (max-width: 26rem) {
  html[data-ts="1"] .topbar-label, html[data-ts="2"] .topbar-label { display: none; }
}
