/* Layout: app shell — sticky top bar, stacked on phones; tip view splits media | text from 900px */
:root {
  --turf: #1b241d;        /* app ground (from original #263027, deepened) */
  --turf-2: #243026;      /* raised surface */
  --turf-3: #2f3d31;      /* hairlines, pressed */
  --chalk: #eef3ec;       /* primary text */
  --chalk-dim: #a9b8aa;   /* secondary text */
  --flag: #50ec6d;        /* original highlight green */
  --flag-ink: #0d2412;    /* text on --flag */
  --ok: #50ec6d;
  --bad: #ff5a4f;
  --font-display: "Cabin", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --bar-h: 56px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--turf);
  color: var(--chalk);
  font: 16px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 30; background: var(--turf);
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--flag); outline-offset: 2px; }
img { max-width: 100%; display: block; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 8px;
  min-height: var(--bar-h);
  padding-inline: var(--gutter-l) var(--gutter-r);
  background: color-mix(in srgb, var(--turf) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--turf-3);
}
.bar h1 {
  flex: 1; min-width: 0; margin: 0;
  font: italic 600 1.15rem/1.2 var(--font-display);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
}
.icon-btn:hover { background: var(--turf-3); }
.icon-btn svg { width: 22px; height: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px;
  font: 600 0.75rem/1 var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  background: var(--sec, var(--turf-3)); color: #fff;
}

main { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.wrap { padding-inline: var(--gutter-l) var(--gutter-r); max-width: 1180px; margin-inline: auto; }

/* ---------- home ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 220px; max-height: 360px; aspect-ratio: 16 / 7; width: 100%;
  background: #22301f center 30% / cover no-repeat;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, var(--turf) 98%);
}
.hero .wrap { position: absolute; inset: auto 0 18px; z-index: 1; }
.brand {
  margin: 0; font: italic 700 clamp(2rem, 7vw, 3.4rem)/1 var(--font-display);
  color: var(--flag); letter-spacing: -.01em; text-wrap: balance;
  text-shadow: 0 2px 18px rgba(0,0,0,.45);
}
.tagline { margin: 6px 0 0; color: var(--chalk); font-size: .98rem; text-shadow: 0 1px 8px rgba(0,0,0,.6); }

.install {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--turf-2); border: 1px solid var(--turf-3); font-size: .92rem;
}
.install p { margin: 0; flex: 1; min-width: 180px; color: var(--chalk-dim); }
.btn {
  border: 0; cursor: pointer; border-radius: 99px; padding: 9px 16px;
  font-weight: 700; background: var(--flag); color: var(--flag-ink);
}
.btn.ghost { background: transparent; color: var(--chalk); border: 1px solid var(--turf-3); }

.tiles {
  display: grid; gap: 14px; margin-top: 18px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr));
}
.tile {
  display: flex; flex-direction: column; text-align: left;
  border: 0; padding: 0; cursor: pointer; overflow: hidden;
  border-radius: 14px; background: #fff; color: var(--sec);
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
  transition: transform .15s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile .art {
  position: relative; height: 140px; padding: 14px 14px 12px;
  background: var(--sec); color: #fff;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.tile .art img { position: absolute; top: 0; right: 0; height: 100%; width: auto; pointer-events: none; }
.tile { justify-content: space-between; }
.tile .art ul {
  position: relative; list-style: none; margin: 0; padding: 0; max-width: 62%;
  font: italic 500 .9rem/1.35 var(--font-display);
}
.tile .name {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px;
  padding: 10px 14px 12px; flex: 1; align-content: center;
  font: italic 600 1.3rem/1.1 var(--font-display); text-transform: uppercase;
}
.tile .name small { font: 600 .75rem/1 var(--font-body); color: #6d7a6f; text-transform: none; font-style: normal; white-space: nowrap; }
.tile.glossary { background: var(--turf-2); color: var(--chalk); border: 1px solid var(--turf-3); }
.tile.glossary .art { background: transparent; color: var(--chalk-dim); }
.tile.glossary .art .az { position: absolute; right: 14px; top: 6px; font: italic 700 3.4rem/1 var(--font-display); color: var(--flag); opacity: .9; }
.tile.glossary .name small { color: var(--chalk-dim); }

.foot { margin-top: 28px; color: var(--chalk-dim); font-size: .8rem; }

/* ---------- section list ---------- */
.sec-head {
  background: var(--sec); color: #fff;
  padding-block: 18px 16px;
}
.sec-head h2 { margin: 0; font: italic 700 clamp(1.7rem, 5vw, 2.4rem)/1.05 var(--font-display); text-transform: uppercase; }
.sec-head p { margin: 4px 0 0; opacity: .9; }
.tip-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.tip-row {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 10px; border-radius: 12px; cursor: pointer;
  background: var(--turf-2); border: 1px solid var(--turf-3);
}
.tip-row:hover { border-color: var(--sec); }
.thumb { width: 64px; height: 64px; flex: none; border-radius: 8px; object-fit: cover; background: var(--turf-3); }
.thumb.blank { display: grid; place-items: center; color: var(--sec); font: italic 700 1.4rem var(--font-display); }
.tip-row .t { min-width: 0; flex: 1; }
.tip-row strong { display: block; font: italic 600 1.08rem/1.2 var(--font-display); }
.meta { display: flex; gap: 10px; margin-top: 3px; color: var(--chalk-dim); font-size: .8rem; }
.meta span { display: inline-flex; align-items: center; gap: 4px; }
.meta svg { width: 14px; height: 14px; }
.num { color: var(--chalk-dim); font: 600 .8rem var(--font-body); font-variant-numeric: tabular-nums; }

/* ---------- tip view ---------- */
.tip { display: grid; gap: 18px; padding-top: 14px; }
@media (min-width: 900px) {
  .tip.has-media { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
  .tip.has-media .media { position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px) + 14px); }
}
.media { display: grid; gap: 10px; min-width: 0; }
.carousel {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: 14px; background: #0f1611;
  aspect-ratio: var(--ar, 4 / 3); max-height: 62vh; width: 100%; max-width: 100%;
}
.carousel::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always;
}
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.slide .cap {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  font: italic 700 clamp(1rem, 3.6vw, 1.35rem)/1.15 var(--font-display); text-transform: uppercase;
  color: #fff; text-shadow: 0 1px 2px #000, 0 0 14px rgba(0,0,0,.7); white-space: pre-line;
}
.slide .cap.center { text-align: center; bottom: auto; top: 50%; transform: translateY(-50%); }
.slide .cap.right { text-align: right; }
.mark {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.4);
}
.mark.correct { background: var(--ok); color: var(--flag-ink); }
.mark.incorrect { background: var(--bad); }
.mark svg { width: 24px; height: 24px; }
.media-controls { display: flex; align-items: center; gap: 10px; }
.dots { flex: 1; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--turf-3); cursor: pointer; }
.dot[aria-current="true"] { background: var(--flag); width: 20px; border-radius: 4px; }
.count { font-size: .8rem; color: var(--chalk-dim); font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: right; }

.video-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--turf-3); background: var(--turf-2);
}
.video-btn .play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--flag); color: var(--flag-ink); flex: none; }
.video-btn .play svg { width: 18px; height: 18px; }
.video-btn small { display: block; color: var(--chalk-dim); font-size: .8rem; }
.player { border-radius: 14px; overflow: hidden; background: #000; }
.player video { display: block; width: 100%; max-height: 62vh; background: #000; }
.player .err { padding: 22px 18px; color: var(--chalk-dim); font-size: .92rem; background: var(--turf-2); }
.player .err strong { color: var(--chalk); display: block; margin-bottom: 4px; }

.prose { min-width: 0; max-width: 68ch; }
.prose h1, .prose h2, .prose h3 {
  margin: 1.4em 0 .4em; font: italic 700 1.2rem/1.2 var(--font-display); color: var(--flag);
  text-transform: uppercase; letter-spacing: .01em; text-wrap: balance;
}
.prose > :first-child { margin-top: 0; }
.prose h2.band, .prose h1.band {
  background: var(--chalk); color: var(--turf); padding: 6px 10px; border-radius: 6px; font-size: 1rem;
}
.prose p { margin: .55em 0; }
.prose .hl { color: var(--flag); font-weight: 700; }
.prose b, .prose strong { font-weight: 700; }
.term {
  display: inline; padding: 0 2px; margin: 0; border: 0; background: none; cursor: pointer;
  color: var(--flag); font-weight: 700;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.def-card {
  margin-top: 4px; padding: 16px; border-radius: 14px; background: var(--turf-2); border: 1px solid var(--turf-3);
}
.def-card .lbl { font: 700 .72rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--chalk-dim); }
.def-card p { margin: 8px 0 0; font-size: 1.05rem; }

/* prev / next */
.pager {
  position: sticky; bottom: 0; z-index: 15;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  margin-top: 24px;
  padding: 10px var(--gutter-r) calc(10px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  background: color-mix(in srgb, var(--turf) 94%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--turf-3);
}
.pager button {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  border: 0; background: none; cursor: pointer; padding: 6px 4px; color: var(--chalk);
}
.pager button:disabled { opacity: .3; cursor: default; }
.pager .next { justify-content: flex-end; text-align: right; }
.pager span.l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: italic 600 .95rem var(--font-display); }
.pager svg { width: 20px; height: 20px; flex: none; }
.pager .pos { font-size: .8rem; color: var(--chalk-dim); font-variant-numeric: tabular-nums; }
main.has-pager { padding-bottom: 0; }

/* glossary */
.gl-search {
  width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--turf-3); background: var(--turf-2); color: var(--chalk); font: inherit;
}
.gl-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.gl-list li { padding: 12px 14px; border-radius: 12px; background: var(--turf-2); border: 1px solid var(--turf-3); }
.gl-list dt { font: italic 700 1rem var(--font-display); color: var(--flag); text-transform: uppercase; }
.gl-list dd { margin: 4px 0 0; color: var(--chalk); font-size: .95rem; }
.gl-list mark { background: var(--flag); color: var(--flag-ink); border-radius: 2px; }

/* bottom sheet */
.sheet-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: min(560px, 100%); margin: 0; padding: 18px var(--gutter-r) calc(22px + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  background: var(--turf-2); border-radius: 18px 18px 0 0; border-top: 3px solid var(--flag);
  animation: up .2s ease-out;
}
.sheet h3 { margin: 0 0 6px; font: italic 700 1.25rem var(--font-display); color: var(--flag); text-transform: uppercase; }
.sheet p { margin: 0 0 14px; font-size: 1.05rem; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50;
  padding: 10px 16px; border-radius: 18px; background: var(--chalk); color: var(--turf); font-weight: 600; font-size: .9rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.4); width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
.offline-pill { font-size: .72rem; padding: 3px 8px; border-radius: 99px; background: #6b5a1d; color: #fff3c4; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- members (dormant until paywall is switched on) ---------- */
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.muted { color: var(--chalk-dim); }
.small { font-size: .85rem; }
.narrow { max-width: 520px; }
.member-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--turf-2); border: 1px solid var(--turf-3);
}
.member-strip p { margin: 0; flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; }
.member-strip p strong { color: var(--flag); }
.member-strip.ok { border-color: color-mix(in srgb, var(--flag) 45%, var(--turf-3)); }
.member-strip svg, .status svg, .benefits svg { width: 18px; height: 18px; flex: none; color: var(--flag); }
.free-tag { padding: 1px 7px; border-radius: 99px; background: var(--flag); color: var(--flag-ink); font-weight: 700; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; }
.tip-row.locked strong { color: var(--chalk-dim); }
.tip-row.locked .thumb { filter: grayscale(.7) brightness(.7); }
.lock-ic { color: var(--chalk-dim); }
.lock-ic svg { width: 20px; height: 20px; }
.locked-media img { filter: brightness(.55) blur(1px); }
.teaser { color: var(--chalk-dim); -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent); mask-image: linear-gradient(180deg, #000 40%, transparent); }
.lock-card { padding: 20px; border-radius: 14px; background: var(--turf-2); border: 1px solid var(--turf-3); display: grid; gap: 8px; justify-items: start; }
.lock-card h2 { margin: 0 !important; color: var(--chalk) !important; }
.lock-card p { margin: 0 0 6px; }
.lock-big { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--flag); color: var(--flag-ink); }
.lock-big svg { width: 22px; height: 22px; }
.icon-btn.acct.in { color: var(--flag); }

.form { display: grid; gap: 8px; margin-top: 18px; padding: 20px; border-radius: 14px; background: var(--turf-2); border: 1px solid var(--turf-3); }
.form h2 { margin: 0; font: italic 700 1.5rem var(--font-display); }
.form p { margin: 0 0 6px; }
.form label, .lbl { font: 700 .75rem/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--chalk-dim); margin-top: 6px; }
.form input {
  width: 100%; padding: 12px 14px; border-radius: 10px; font: inherit;
  border: 1px solid var(--turf-3); background: var(--turf); color: var(--chalk);
}
.form .btn { justify-self: start; margin-top: 8px; }
.form-err { color: #ffb4ae; font-size: .92rem; }
.form-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.linkish { border: 0; background: none; padding: 4px 0; cursor: pointer; color: var(--flag); text-decoration: underline; text-underline-offset: 3px; font-size: .92rem; }
.big { font-size: 1.15rem; font-weight: 600; }
.status { display: flex; align-items: center; gap: 8px; }
.status.ok { color: var(--flag); }

.sub-hero { margin-top: 20px; }
.sub-hero h2 { margin: 0 0 12px; font: italic 700 clamp(1.6rem, 5vw, 2.2rem)/1.1 var(--font-display); color: var(--flag); text-transform: uppercase; text-wrap: balance; }
.benefits { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.benefits li { display: flex; gap: 10px; align-items: flex-start; }
.plans { display: grid; gap: 10px; margin-top: 18px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.plan {
  position: relative; display: grid; gap: 4px; text-align: left; cursor: pointer;
  padding: 18px; border-radius: 14px; border: 2px solid var(--turf-3); background: var(--turf-2);
}
.plan:hover { border-color: var(--flag); }
.plan strong { font: italic 700 1.2rem var(--font-display); }
.plan span { color: var(--chalk-dim); }
.plan-note { position: absolute; top: -10px; right: 12px; padding: 2px 8px; border-radius: 99px; background: var(--flag); color: var(--flag-ink) !important; font-size: .72rem; font-weight: 700; }
.preview-toggle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; cursor: pointer; color: var(--chalk); font-size: .85rem; }
.preview-toggle input { width: 18px; height: 18px; accent-color: var(--flag); }
.preview-toggle span { color: var(--chalk-dim); }
.loading { color: var(--chalk-dim); }
.foot p { margin: 0; }

.carousel.locked-media { max-height: 34vh; }
@media (min-width: 900px) { .carousel.locked-media { max-height: 62vh; } }
.install-steps { margin: 4px 0 16px; padding-left: 1.4em; display: grid; gap: 10px; font-size: 1rem; }
.install-steps li::marker { color: var(--flag); font-weight: 700; }
.install-steps b { color: var(--flag); }
