/* ————————————————————————————————————————————————————————————————
   TERRACE — a small studio of practical courses
   Identity: limewash & sangiovese · Hepta Slab / Alegreya Sans / Spline Sans Mono
   Signature: the terrace step — progress drawn as an ascending staircase.
   ———————————————————————————————————————————————————————————————— */

:root {
  /* daylight studio */
  --limewash: #e7e9df;      /* ground — green-grey plaster */
  --plaster:  #f3f4ec;      /* raised cards */
  --plaster-2:#eceee3;      /* recessed panels */
  --ink:      #232128;      /* plum-black text */
  --ink-soft: #45424c;
  --muted:    #5d5c55;
  --stone:    #c3c6b4;      /* rules and borders */
  --stone-soft:#d5d8c8;
  --wine:     #7d2c3e;      /* primary action — sangiovese */
  --wine-deep:#652232;
  --wine-wash:#ecdfe0;
  --moss:     #55642b;      /* completion, free preview */
  --moss-wash:#e0e5cd;
  --shadow:   0 10px 26px -18px rgba(35, 33, 40, 0.55);

  --font-display: "Hepta Slab", "Georgia", serif;
  --font-body: "Alegreya Sans", "Helvetica Neue", sans-serif;
  --font-mono: "Spline Sans Mono", "Menlo", monospace;

  --measure: 1120px;
  --gutter: clamp(18px, 4vw, 44px);
  --r-sm: 3px;
  --r-md: 6px;
}

/* the lights dim: learning view flips the whole chrome */
body.mode-screening {
  --limewash: #17151d;
  --plaster:  #211e29;
  --plaster-2:#1c1a24;
  --ink:      #ebe8dd;
  --ink-soft: #cfccc2;
  --muted:    #a49fae;
  --stone:    #3a3745;
  --stone-soft:#2e2b38;
  --wine:     #8e3348;
  --wine-deep:#a34158;
  --wine-wash:#332028;
  --moss:     #9db35b;
  --moss-wash:#252a18;
  --shadow: 0 12px 30px -18px rgba(0, 0, 0, 0.8);
}

/* ————— base ————— */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--limewash);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg, video { display: block; max-width: 100%; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }

p { margin: 0; }

a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--plaster);
  border: 1px solid var(--stone);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.75; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 1px;
}

:focus-visible { outline: 2px solid var(--wine); outline-offset: 2px; }

.mono { font-family: var(--font-mono); font-size: 0.82em; letter-spacing: 0.01em; }

.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 60;
  background: var(--ink); color: var(--limewash);
  padding: 8px 14px; border-radius: var(--r-sm);
  font-family: var(--font-mono); font-size: 13px;
}
.skip-link:focus { left: 8px; }

/* ————— masthead: strip · wordmark deck · step rail ————— */

.masthead {
  border-bottom: 1px solid var(--stone);
  background: var(--limewash);
  transition: background-color 0.35s ease, border-color 0.35s ease;
}

.mast-strip { border-bottom: 1px solid var(--stone-soft); }
.strip-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 7px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.strip-motto { text-transform: uppercase; }
.strip-session { display: flex; gap: 12px; align-items: baseline; white-space: nowrap; }
.strip-session a, .strip-session button {
  color: var(--wine);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.strip-session button:hover, .strip-session a:hover { text-decoration: underline; text-underline-offset: 3px; }

.mast-deck {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 22px var(--gutter) 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
}

.wordmark {
  display: flex;
  align-items: flex-end;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { text-decoration: none; }
.wordmark-mark { width: 40px; height: 28px; fill: var(--wine); flex: none; margin-bottom: 7px; }
.wordmark-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.wordmark:hover .wordmark-mark { fill: var(--wine-deep); }

.mast-desc {
  max-width: 300px;
  text-align: right;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--muted);
  padding-bottom: 6px;
}

/* navigation as stepped plinths standing on the baseline */
.steprail {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 18px var(--gutter) 0;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.steprail::-webkit-scrollbar { display: none; }

.step {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--stone);
  border-bottom: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--plaster-2);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: height 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}
.step:hover { text-decoration: none; height: 40px; color: var(--ink); }
.step[aria-current="page"] {
  height: 46px;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--limewash);
}

/* ————— view shell ————— */

.view {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(26px, 4.5vw, 52px) var(--gutter) 72px;
}
.view:focus { outline: none; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow b { color: var(--wine); font-weight: 500; }

.backlink {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 22px;
}
.backlink:hover { color: var(--wine); }

/* ————— buttons & chips ————— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--wine);
  color: #f6f1ea;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.03em;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--wine);
  transition: background-color 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}
.btn:hover { background: var(--wine-deep); border-color: var(--wine-deep); text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn.block { width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--stone);
}
.btn-ghost:hover { background: var(--plaster-2); border-color: var(--ink-soft); color: var(--ink); }

.btn-quiet {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--wine);
  padding: 6px 2px;
}
.btn-quiet:hover { text-decoration: underline; text-underline-offset: 3px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--stone);
  color: var(--muted);
  white-space: nowrap;
}
.chip-moss { background: var(--moss-wash); border-color: transparent; color: var(--moss); }
.chip-wine { background: var(--wine-wash); border-color: transparent; color: var(--wine); }

/* ————— the terrace staircase (progress as climbed steps) ————— */

.staircase { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.staircase .tread {
  flex: 1 1 0;
  min-width: 4px;
  max-width: 26px;
  background: var(--stone-soft);
  border-radius: 1.5px;
  transition: background-color 0.2s ease;
}
.staircase .tread.done { background: var(--moss); }
.staircase.stair-lg { height: 34px; gap: 4px; }

.stairline { display: flex; align-items: center; gap: 12px; }
.stairline .staircase { flex: 1; }
.stairline .stairlabel { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ratings as five ascending steps */
.rating { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 15px; }
.rating i {
  width: 7px;
  background: var(--stone);
  border-radius: 1px;
}
.rating i.on { background: var(--wine); }
.rating.rating-moss i.on { background: var(--moss); }

/* rating input: clickable steps */
.rate-picker { display: flex; align-items: flex-end; gap: 5px; }
.rate-picker button {
  width: 34px;
  border: 1px solid var(--stone);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--plaster);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  transition: background-color 0.12s ease;
}
.rate-picker button.on { background: var(--wine); border-color: var(--wine); color: #f6f1ea; }
.rate-picker button:hover { border-color: var(--wine); }

/* ————— hero: cross-section of five terraces ————— */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: end;
  padding-bottom: clamp(30px, 5vw, 56px);
  border-bottom: 1px solid var(--stone);
  margin-bottom: clamp(30px, 5vw, 52px);
}

.hero-copy .eyebrow { margin-bottom: 16px; }
.hero-title {
  font-size: clamp(38px, 5.6vw, 62px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.hero-title em { font-style: normal; color: var(--wine); }
.hero-lede { font-size: 19px; color: var(--ink-soft); max-width: 46ch; }
.hero-lede + .hero-lede { margin-top: 10px; }

.terraces { display: block; }
.terraces-caption {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.terraces-caption .clear-filter { color: var(--wine); text-transform: none; letter-spacing: 0.03em; }
.terrace-row { display: flex; align-items: flex-end; gap: 5px; border-bottom: 2px solid var(--ink); padding-bottom: 0; }
.terrace {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  border: 1px solid var(--stone);
  border-bottom: 0;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--plaster);
  padding: 10px 8px 12px;
  text-align: left;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.terrace:hover { background: var(--plaster-2); transform: translateY(-3px); }
.terrace.active { background: var(--ink); border-color: var(--ink); }
.terrace.active .terrace-name, .terrace.active .terrace-count { color: var(--limewash); }
.terrace-count { font-family: var(--font-mono); font-size: 11px; color: var(--wine); white-space: nowrap; }
.terrace.active .terrace-count { color: var(--moss); }
.terrace-name {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}
/* ascending heights: the hillside */
.terrace:nth-child(1) { padding-top: 12px; }
.terrace:nth-child(2) { padding-top: 26px; }
.terrace:nth-child(3) { padding-top: 40px; }
.terrace:nth-child(4) { padding-top: 54px; }
.terrace:nth-child(5) { padding-top: 68px; }

/* ————— catalog grid ————— */

.shelf-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
}
.shelf-head h2 { font-size: clamp(22px, 3vw, 28px); }
.shelf-count { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.course-card {
  display: flex;
  flex-direction: column;
  background: var(--plaster);
  border: 1px solid var(--stone);
  border-radius: var(--r-md);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); text-decoration: none; }
.card-media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--stone-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.course-card:hover .card-media img { transform: scale(1.035); }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { font-size: 19.5px; font-weight: 700; line-height: 1.22; }
.course-card:hover .card-title { color: var(--wine); }
.card-desc {
  font-size: 15px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--stone-soft);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.price { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--ink); }
.card-cta { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--wine); }

/* ————— course page ————— */

.course-head { max-width: 780px; margin-bottom: clamp(26px, 4vw, 42px); }
.course-head .eyebrow { margin-bottom: 14px; }
.course-title { font-size: clamp(30px, 4.6vw, 46px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 16px; }
.course-lede { font-size: 19.5px; color: var(--ink-soft); max-width: 62ch; }

.byline { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.byline img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--plaster); box-shadow: 0 0 0 1px var(--stone); }
.byline-name { font-weight: 700; font-size: 15.5px; }
.byline-role { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(26px, 4vw, 52px);
  align-items: start;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-label::after { content: ""; height: 1px; background: var(--stone); flex: 1; }
section + section { margin-top: clamp(34px, 5vw, 54px); }

/* curriculum: modules as terrace levels */
.module { border: 1px solid var(--stone); border-radius: var(--r-md); background: var(--plaster); overflow: hidden; }
.module + .module { margin-top: 14px; }
.module-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--stone-soft);
  flex-wrap: wrap;
}
.module-level {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--limewash);
  background: var(--ink);
  border-radius: var(--r-sm);
  padding: 3px 7px;
  flex: none;
}
.module-title { font-size: 17.5px; font-weight: 700; flex: 1 1 200px; min-width: 0; }
.module-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.module-desc { padding: 12px 18px 4px; font-style: italic; color: var(--muted); font-size: 15px; }

.lesson-list { list-style: none; margin: 0; padding: 8px 6px 10px; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  width: 100%;
  text-align: left;
  color: var(--ink);
  font-size: 15.5px;
}
button.lesson-row:hover, a.lesson-row:hover { background: var(--plaster-2); text-decoration: none; }
.lesson-glyph {
  flex: none;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--stone);
  border-radius: 50%;
  color: var(--ink-soft);
}
.lesson-glyph svg { width: 10px; height: 10px; fill: currentColor; }
.lesson-name { flex: 1; min-width: 0; overflow-wrap: break-word; }
.lesson-mins { font-family: var(--font-mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.lesson-tick { flex: none; width: 18px; height: 18px; color: var(--moss); }
.lesson-tick svg { width: 18px; height: 18px; fill: currentColor; }

.module-empty { padding: 14px 18px 16px; color: var(--muted); font-style: italic; font-size: 15px; }

/* inline preview screening strip on the course page */
/* — free preview: guests sit in on module 1 in the screening room — */
.buy-card .preview-cta { margin-top: 10px; }

.rail-lesson.locked { cursor: default; color: var(--muted); }
.rail-lesson.locked:hover { background: transparent; }
.rail-lesson .tickbox.lock { border-style: dashed; color: var(--muted); }
.rail-lesson .tickbox.lock svg { width: 10px; height: 10px; fill: currentColor; }

.rail-lock-note {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}

.preview-note-rail { font-size: 13.5px; color: var(--muted); margin-top: 8px; }

/* buy card with the stepped-notch corner */
.buy-card {
  position: sticky;
  top: 20px;
  background: var(--plaster);
  box-shadow: 0 0 0 1px var(--stone);
  border-radius: var(--r-md);
  padding: 22px 22px 24px;
  clip-path: polygon(0 0, calc(100% - 26px) 0, calc(100% - 26px) 14px, 100% 14px, 100% 100%, 0 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.buy-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.buy-price { font-family: var(--font-mono); font-size: 34px; font-weight: 600; letter-spacing: -0.02em; }
.buy-note { font-size: 14px; color: var(--muted); }
.buy-note b { color: var(--moss); font-weight: 700; }
.buy-facts { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--stone-soft); display: grid; gap: 7px; }
.buy-facts li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.buy-facts .mono { color: var(--muted); }

.instructor-card { display: flex; gap: 13px; padding-top: 14px; border-top: 1px solid var(--stone-soft); }
.instructor-card img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.instructor-card .who b { display: block; font-size: 15px; }
.instructor-card .who span { font-size: 13.5px; color: var(--muted); line-height: 1.4; display: block; margin-top: 2px; }

/* reviews */
.review-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.review-card { background: var(--plaster); border: 1px solid var(--stone); border-radius: var(--r-md); padding: 16px 18px; }
.review-card + .review-card { margin-top: 12px; }
.review-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.review-title { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; flex: 1 1 180px; }
.review-body { font-size: 15.5px; color: var(--ink-soft); }

.composer { background: var(--plaster-2); border: 1px solid var(--stone); border-radius: var(--r-md); padding: 18px; margin-top: 18px; display: grid; gap: 12px; }
.composer h3 { font-size: 17px; }
.composer .field label { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.composer .form-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ————— screening room (learning view) ————— */

.room {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: clamp(22px, 3.5vw, 44px);
  align-items: start;
}

.room-rail {
  background: var(--plaster);
  border: 1px solid var(--stone);
  border-radius: var(--r-md);
  overflow: hidden;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}
.rail-head { padding: 16px 18px 14px; border-bottom: 1px solid var(--stone-soft); }
.rail-course { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; line-height: 1.25; margin-bottom: 12px; }
.rail-modules { overflow-y: auto; padding: 6px 8px 10px; }
.rail-module-label {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted);
  padding: 12px 10px 6px;
}
.rail-lesson {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-size: 14.5px;
}
.rail-lesson:hover { background: var(--plaster-2); }
.rail-lesson.now { background: var(--wine-wash); color: var(--ink); }
.rail-lesson .tickbox {
  flex: none; width: 16px; height: 16px;
  border: 1.5px solid var(--stone);
  border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
}
.rail-lesson .tickbox.done { background: var(--moss); border-color: var(--moss); color: var(--limewash); }
body.mode-screening .rail-lesson .tickbox.done { color: #17151d; }
.rail-lesson .tickbox svg { width: 10px; height: 10px; fill: currentColor; }
.rail-lesson .l-name { flex: 1; min-width: 0; overflow-wrap: break-word; }
.rail-lesson .l-min { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.rail-foot { border-top: 1px solid var(--stone-soft); padding: 12px 18px; }

.stage { min-width: 0; }
.stage-eyebrow { margin-bottom: 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.stage-title { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -0.015em; margin-bottom: 20px; }
.stage-media video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-md); }

.notes-plate {
  background: var(--plaster);
  border: 1px solid var(--stone);
  border-left: 4px solid var(--moss);
  border-radius: var(--r-md);
  padding: clamp(20px, 3.5vw, 34px);
}
.notes-plate .notes-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--moss); margin-bottom: 12px; }
.notes-plate h3 { font-size: 21px; margin-bottom: 12px; }
.notes-plate p { color: var(--ink-soft); max-width: 62ch; }

.stage-actions {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.stage-nav { display: flex; gap: 16px; }
.stage-nav a { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.stage-nav a:hover { color: var(--wine); }
.done-flag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13.5px; color: var(--moss); }
.done-flag svg { width: 16px; height: 16px; fill: currentColor; }

.room-empty {
  border: 1px dashed var(--stone);
  border-radius: var(--r-md);
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
}
.room-empty h3 { font-size: 21px; margin-bottom: 10px; }
.room-empty p { color: var(--muted); max-width: 48ch; margin: 0 auto; }

/* ————— my learning ————— */

.enroll-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  background: var(--plaster);
  border: 1px solid var(--stone);
  border-radius: var(--r-md);
  padding: 16px;
}
.enroll-row + .enroll-row { margin-top: 14px; }
.enroll-thumb { aspect-ratio: 3 / 2; border-radius: var(--r-sm); overflow: hidden; background: var(--stone-soft); }
.enroll-thumb img { width: 100%; height: 100%; object-fit: cover; }
.enroll-main { min-width: 0; display: grid; gap: 9px; }
.enroll-title { font-size: 19px; font-weight: 700; line-height: 1.2; }
.enroll-title a { color: var(--ink); }
.enroll-title a:hover { color: var(--wine); text-decoration: none; }
.enroll-side { display: grid; gap: 8px; justify-items: end; }

/* ————— auth ————— */

.auth-wrap { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.auth-panel { background: var(--plaster); border: 1px solid var(--stone); border-radius: var(--r-md); padding: clamp(20px, 3vw, 30px); }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.auth-tab {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--stone);
  border-radius: var(--r-sm);
  color: var(--muted);
}
.auth-tab.on { background: var(--ink); border-color: var(--ink); color: var(--limewash); }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.auth-note { font-size: 14px; color: var(--muted); }

.demo-cards { display: grid; gap: 14px; }
.demo-card {
  text-align: left;
  background: var(--plaster);
  box-shadow: 0 0 0 1px var(--stone);
  border-radius: var(--r-md);
  padding: 18px 20px;
  clip-path: polygon(0 0, calc(100% - 22px) 0, calc(100% - 22px) 12px, 100% 12px, 100% 100%, 0 100%);
  display: grid;
  gap: 8px;
  transition: transform 0.15s ease;
}
.demo-card:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--wine); }
.demo-card b { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; }
.demo-card p { font-size: 14.5px; color: var(--muted); }
.demo-card .mono { color: var(--wine); font-size: 12.5px; }
.demo-lede { margin-bottom: 14px; }

/* ————— studio ————— */

.studio-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.studio-head h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 800; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(20px, 3vw, 36px); align-items: start; }

.desk-list { display: grid; gap: 10px; }
.desk-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--plaster);
  border: 1px solid var(--stone);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.desk-row:hover { border-color: var(--ink-soft); }
.desk-row.on { border-color: var(--wine); box-shadow: 0 0 0 1px var(--wine); }
.desk-row .d-title { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.desk-row .d-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.desk-panel { background: var(--plaster); border: 1px solid var(--stone); border-radius: var(--r-md); padding: 20px; display: grid; gap: 16px; }
.desk-panel h2 { font-size: 19px; }
.desk-panel .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.desk-panel label { display: grid; gap: 6px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.desk-panel textarea { min-height: 88px; resize: vertical; }
.desk-panel .check { display: flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 12.5px; text-transform: none; letter-spacing: 0.02em; color: var(--ink-soft); }
.desk-panel .check input { width: auto; }
.desk-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.desk-sub { border-top: 1px solid var(--stone-soft); padding-top: 16px; display: grid; gap: 12px; }
.desk-sub h3 { font-size: 16px; }

/* ————— states: loading, empty, error ————— */

.state-plate { padding: clamp(40px, 8vw, 90px) 20px; text-align: center; }
.state-plate h2 { font-size: 23px; margin-bottom: 10px; }
.state-plate p { color: var(--muted); max-width: 52ch; margin: 0 auto 18px; }

.loader { display: inline-flex; align-items: flex-end; gap: 5px; height: 34px; margin-bottom: 16px; }
.loader i { width: 12px; background: var(--stone); border-radius: 2px; animation: climb 1.05s ease-in-out infinite; }
.loader i:nth-child(1) { height: 12px; animation-delay: 0s; }
.loader i:nth-child(2) { height: 22px; animation-delay: 0.15s; }
.loader i:nth-child(3) { height: 32px; animation-delay: 0.3s; }
@keyframes climb { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; background: var(--wine); } }
.state-plate .mono { color: var(--muted); }

.form-error {
  font-size: 14px;
  color: var(--wine);
  background: var(--wine-wash);
  border-radius: var(--r-sm);
  padding: 9px 12px;
}
body.mode-screening .form-error { color: #f0aab6; }

/* ————— toast ————— */

.toast-holder { position: fixed; left: 18px; bottom: 18px; z-index: 70; display: grid; gap: 10px; max-width: min(360px, calc(100vw - 36px)); }
.toast {
  background: var(--ink);
  color: var(--limewash);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  clip-path: polygon(0 0, calc(100% - 18px) 0, calc(100% - 18px) 9px, 100% 9px, 100% 100%, 0 100%);
  animation: toast-in 0.25s ease;
}
.toast.toast-wine { background: var(--wine-deep); color: #f6f1ea; }
body.mode-screening .toast { background: #ebe8dd; color: #17151d; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ————— colophon ————— */

.colophon { border-top: 1px solid var(--stone); background: var(--limewash); transition: background-color 0.35s ease; }
.colophon-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 26px var(--gutter) 34px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.colophon-brand { display: flex; gap: 12px; align-items: center; }
.colophon-mark { width: 26px; height: 18px; fill: var(--wine); flex: none; }
.colophon-brand p { font-size: 14.5px; color: var(--ink-soft); }
.colophon-note { font-size: 12.5px; color: var(--muted); max-width: 420px; line-height: 1.6; }
.colophon-note .mono { color: var(--wine); }

/* ————— responsive ————— */

@media (max-width: 980px) {
  .course-layout { grid-template-columns: minmax(0, 1fr); }
  .buy-card { position: static; order: -1; max-width: 460px; }
  .room { grid-template-columns: minmax(0, 1fr); }
  .room-rail { position: static; max-height: none; }
  .rail-modules { max-height: 300px; }
  .studio-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .mast-deck { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 18px; }
  .mast-desc { text-align: left; max-width: 52ch; padding-bottom: 0; }
  .enroll-row { grid-template-columns: 104px minmax(0, 1fr); }
  .enroll-side { grid-column: 1 / -1; justify-items: stretch; }
  .enroll-side .btn { width: 100%; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .strip-inner { flex-direction: column; gap: 3px; }
  .strip-session { white-space: normal; }
  .terrace:nth-child(1) { padding-top: 10px; }
  .terrace:nth-child(2) { padding-top: 18px; }
  .terrace:nth-child(3) { padding-top: 26px; }
  .terrace:nth-child(4) { padding-top: 34px; }
  .terrace:nth-child(5) { padding-top: 42px; }
  .terrace { padding-left: 5px; padding-right: 5px; }
  .terrace-name { font-size: 9.5px; letter-spacing: 0; overflow-wrap: normal; }
  .terrace-count { font-size: 9.5px; }
  .desk-panel .grid-2 { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
