/* Courses page of m1ndst0rm.space. Same skin as the personal page and the AVPN cabinet: OLED
   black, warm white, one orange accent, Unbounded + Onest, the "Mindstorm" streamlines in the
   hero. Here the page has a job: a visitor (or a payment-service moderator) has to see what is
   sold, for how much, how it is delivered, how to get a refund and who the seller is. So the
   storm stays in the hero and never goes under text. Fonts and the storm engine: /shared/. */

@font-face { font-family: "Unbounded"; src: url("/shared/fonts/Unbounded-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Onest"; src: url("/shared/fonts/Onest-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Onest"; src: url("/shared/fonts/Onest-600.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #000000;
  --card: #0e0e10;
  --card-2: #16161a;
  --text: #f2f0ed;
  --hint: #8a8680;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .12);
  --accent: #ff7a1a;
  --accent-rgb: 255, 122, 26;
  --accent-ink: #1a0900;
  --warn: 245, 165, 36;

  --storm-a: #ff7a1a;
  --storm-b: #ff5a4f;
  --storm-c: #8b7cf6;

  --font-display: "Unbounded", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-body: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;

  --gutter: clamp(18px, 5vw, 56px);
  --wrap: 1160px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
::selection { background: rgba(var(--accent-rgb), .32); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

#storm-page { position: fixed; inset: 0; z-index: 0; width: 100vw; height: 100vh; pointer-events: none; }
main, .foot, .bar { position: relative; z-index: 1; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* Placeholder for a field the seller has not filled in yet. Only ever visible in a draft. */
mark.todo { background: rgba(var(--warn), .18); color: rgb(var(--warn)); padding: 0 .3em; border-radius: 4px; font-weight: 600; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink);
  font: 700 1rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(var(--accent-rgb), .38); }
.btn:active { transform: translateY(0); }
.btn-ghost { background: var(--card-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { background: #1d1d22; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .55); }
.btn-small { min-height: 38px; padding: 0 18px; font-size: .9375rem; }

/* ---------------------------------------------------------------- top bar */

.bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gutter) 0; }
.bar-brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font: 600 .9375rem/1 var(--font-display); letter-spacing: -.02em; text-decoration: none; }
.bar-brand svg { width: 30px; height: 30px; flex: none; }
.bar-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); font-weight: 600; font-size: .9375rem; }
.bar-nav a:not(.btn) { color: var(--hint); text-decoration: none; transition: color .2s; }
.bar-nav a:not(.btn):hover { color: var(--text); }

/* ---------------------------------------------------------------- hero */

.hero { position: relative; display: flex; align-items: flex-end; min-height: min(86vh, 760px); min-height: min(86svh, 760px); padding: 110px var(--gutter) clamp(34px, 7vh, 72px); isolation: isolate; }
.storm-hero { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.hero-inner { width: min(var(--wrap), 100%); margin-inline: auto; }
.hero h1 { max-width: 15ch; font: 600 clamp(2.3rem, 7.4vw, 5.6rem)/1.02 var(--font-display); letter-spacing: -.045em; text-wrap: balance; }
.hero-lede { max-width: 40ch; margin-top: clamp(18px, 3vw, 30px); font-size: clamp(1.1rem, 2vw, 1.4rem); line-height: 1.45; }
.hero-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: clamp(24px, 4vw, 38px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-price { color: var(--hint); font-size: .9375rem; }
.hero-price strong { color: var(--text); font-weight: 700; }

/* ---------------------------------------------------------------- sections */

.block { padding-block: clamp(56px, 9vw, 120px) 0; }
.block:last-of-type { padding-bottom: clamp(56px, 9vw, 120px); }
h2 { font: 600 clamp(1.6rem, 3.8vw, 2.7rem)/1.12 var(--font-display); letter-spacing: -.035em; text-wrap: balance; }
.lead { max-width: 52ch; margin-top: 16px; color: var(--hint); font-size: 1.125rem; line-height: 1.55; }

/* ---------------------------------------------------------------- courses */

.courses { display: grid; gap: clamp(18px, 3vw, 30px); margin-top: clamp(28px, 5vw, 52px); }
.course {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(26px, 5vw, 64px);
  padding: clamp(22px, 4vw, 46px);
  border-radius: 28px;
  background: radial-gradient(90% 60% at 0% 0%, rgba(var(--accent-rgb), .07), rgba(var(--accent-rgb), 0) 70%), var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
}
.course h3 { font: 600 clamp(1.35rem, 2.6vw, 1.9rem)/1.15 var(--font-display); letter-spacing: -.035em; }
.course-summary { margin-top: 14px; font-size: 1.0625rem; line-height: 1.55; }
.course-meta { margin-top: 22px; border-top: 1px solid var(--line-strong); }
.course-meta div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .96875rem; }
.course-meta dt { flex: none; color: var(--hint); white-space: nowrap; }
.course-meta dd { text-align: right; font-weight: 600; }
.course-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 26px; }
.course-price { font: 600 clamp(1.5rem, 3vw, 2.1rem)/1 var(--font-display); letter-spacing: -.04em; }
.course-modules-title { color: var(--hint); font-size: .9375rem; font-weight: 600; }
.modules { margin-top: 12px; counter-reset: module; border-top: 1px solid var(--line-strong); }
.modules li { counter-increment: module; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 10px; padding: 13px 0 14px; border-bottom: 1px solid var(--line); }
.modules li::before { content: counter(module); color: rgb(var(--accent-rgb)); font: 600 .9375rem/1.6 var(--font-display); }
.course-result { margin-top: 20px; padding: 14px 16px; border-radius: 14px; background: rgba(var(--accent-rgb), .08); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .22); font-size: .96875rem; }

/* ---------------------------------------------------------------- plans */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: clamp(14px, 2.4vw, 24px); margin-top: clamp(26px, 4vw, 44px); }
.plan { display: flex; flex-direction: column; gap: 6px; padding: clamp(20px, 3vw, 30px); border-radius: 24px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.plan[data-best] { background: radial-gradient(90% 60% at 0% 0%, rgba(var(--accent-rgb), .1), rgba(var(--accent-rgb), 0) 70%), var(--card); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .4); }
.plan h3 { font: 600 1.1rem/1.2 var(--font-display); letter-spacing: -.03em; }
.plan-price { margin-top: 10px; font: 600 clamp(1.7rem, 3.2vw, 2.3rem)/1 var(--font-display); letter-spacing: -.04em; }
.plan-per { color: var(--hint); font-size: .9375rem; }
.plan .btn { margin-top: 18px; }
.agree { display: flex; align-items: flex-start; gap: 12px; max-width: 62ch; margin-top: 24px; padding: 14px 16px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: .96875rem; line-height: 1.5; cursor: pointer; }
.agree input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.agree a { text-decoration-color: rgba(var(--accent-rgb), .55); text-underline-offset: 3px; }
.agree a:hover { color: var(--accent); }
.agree.nudge { box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb)); }
.btn[aria-disabled="true"] { background: var(--card-2); color: var(--hint); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: not-allowed; }
.btn[aria-disabled="true"]:hover { transform: none; box-shadow: inset 0 0 0 1px var(--line-strong); }
.plans-note { max-width: 62ch; margin-top: 22px; color: var(--hint); font-size: .96875rem; line-height: 1.55; }

/* ---------------------------------------------------------------- how, pay, author */

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 40px); margin-top: clamp(26px, 4vw, 46px); counter-reset: step; }
.steps li { counter-increment: step; padding-top: 18px; border-top: 1px solid var(--line-strong); }
.steps li::before { content: counter(step); display: block; margin-bottom: 12px; color: rgb(var(--accent-rgb)); font: 600 1.6rem/1 var(--font-display); }
.steps strong { display: block; margin-bottom: 6px; font-size: 1.0625rem; }
.steps p { color: var(--hint); font-size: .96875rem; line-height: 1.5; }

.two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 88px); align-items: start; }
.prose p + p { margin-top: 14px; }
.prose p { max-width: 58ch; }
.prose a, .doc a, .foot a { text-decoration-color: rgba(var(--accent-rgb), .55); text-underline-offset: 3px; }
.prose a:hover, .doc a:hover { color: var(--accent); }

.req { border-top: 1px solid var(--line-strong); }
.req div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .96875rem; }
.req dt { color: var(--hint); }
.req dd { font-weight: 600; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- footer */

.foot { padding: 30px 0 calc(38px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: rgba(0, 0, 0, .7); }
.foot-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; color: var(--hint); font-size: .9375rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.foot nav a { color: var(--text); font-weight: 600; text-decoration: none; transition: color .2s; }
.foot nav a:hover { color: var(--accent); }

/* ---------------------------------------------------------------- legal pages */

.doc-page .bar { position: static; padding-bottom: 0; }
.doc { width: min(760px, 100% - 2 * var(--gutter)); margin: clamp(30px, 6vw, 70px) auto clamp(56px, 9vw, 110px); }
.doc h1 { font: 600 clamp(1.7rem, 4.4vw, 2.7rem)/1.12 var(--font-display); letter-spacing: -.04em; text-wrap: balance; }
.doc .updated { margin-top: 12px; color: var(--hint); font-size: .9375rem; }
.doc h2 { margin: clamp(30px, 5vw, 48px) 0 12px; font: 600 clamp(1.1rem, 2.2vw, 1.4rem)/1.25 var(--font-display); letter-spacing: -.03em; }
.doc p, .doc li { line-height: 1.65; }
.doc p { margin-top: 12px; }
.doc ol.clauses { margin-top: 8px; list-style: none; }
.doc ol.clauses > li { margin-top: 12px; }
.doc ul.plain { margin-top: 10px; padding-left: 1.2em; list-style: disc; }
.doc ul.plain li { margin-top: 6px; }
.doc .req { margin-top: 16px; }

/* ---------------------------------------------------------------- narrow screens */

@media (max-width: 900px) {
  .course, .two { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .bar-nav a:not(.btn) { display: none; }
  .hero-actions .btn { flex: 1 1 auto; }
  .req div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------------------------------------------------------------- motion: one hero entrance */

@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero-lede, .hero-foot { opacity: 0; transform: translateY(14px); animation: enter .9s var(--ease) forwards; }
  .hero-lede { animation-delay: .15s; }
  .hero-foot { animation-delay: .3s; }
  @keyframes enter { to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
