/* ============================================================================
   THE AESTHETIC METHOD — stylesheet
   Type system: Oswald (CAPS, structural) + PT Serif (lowercase, human)
   Color: olive #636B49 · black · white (breathing room) · chrome #C0C0C0 (rare)
   ========================================================================== */

@font-face {
  font-family: "Oswald";
  src: url("../assets/fonts/Oswald-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "PT Serif";
  src: url("../assets/fonts/PTSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --olive: #636b49;
  --olive-deep: #5b6736;
  --olive-hover: #4f5538;
  --olive-soft: #eef0e9;
  --olive-tint: #f7f8f4;
  --black: #1a1a1a;
  --ink: #2a2a28;
  --muted: #74786c;
  --white: #ffffff;
  --chrome: #c0c0c0;
  --line: #e4e5df;
  --paper: #ffffff;

  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "Oswald", "Arial Narrow", system-ui, sans-serif;

  --maxw: 1180px;
  --radius: 0px;
  --shadow: 0 18px 50px -28px rgba(40, 44, 30, 0.45);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* sticky footer: footer sits at the bottom of the viewport on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

::selection { background: var(--olive); color: #fff; }

/* ---- structural type (Oswald, caps) ---- */
.display,
.eyebrow,
.btn,
.topbar__brand,
.phase-card h3,
.substep-card h3,
.outline__title,
.outline__home,
.modal__title,
.phase-card__num,
.substep-card__num,
.phase-card__kind,
.phase-card__deliverable {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.display {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: 0.02em;
  color: var(--black);
  margin: 0.1em 0 0.4em;
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  color: var(--olive);
  margin: 0 0 0.5rem;
}

.lede {
  font-size: 1.12rem;
  color: var(--ink);
  max-width: 60ch;
  margin: 0 0 1.1rem;
}

.prose p { max-width: 64ch; margin: 0 0 1.15rem; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--olive); color: #fff; padding: 0.6rem 1rem;
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.1em; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem clamp(1rem, 4vw, 2.4rem);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__left { display: flex; align-items: center; gap: 0.7rem; }
.topbar__brand { display: inline-flex; cursor: pointer; }
.topbar__brand img { height: 74px; width: auto; }
.topbar__right { display: flex; align-items: center; gap: 0.6rem; }

/* hamburger — hidden on desktop, shown on mobile (see responsive block) */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 9px 8px;
  background: transparent; border: 1px solid var(--line); border-radius: 0;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--olive); }
.nav-toggle:hover { border-color: var(--olive); }

.account { display: flex; align-items: center; gap: 0.6rem; }
.account__email {
  font-family: var(--serif); text-transform: lowercase;
  font-size: 0.82rem; color: var(--muted); letter-spacing: 0.02em;
  text-decoration: none; cursor: default;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-size: 0.86rem; letter-spacing: 0.12em;
  padding: 0.42rem 1.7rem;
  border: 1px solid var(--olive);
  background: var(--olive); color: #fff;
  border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  transition: background-color 0.2s ease;
}
.btn:hover { background: var(--olive-hover); border-color: var(--olive-hover); }
.btn--primary { background: var(--olive); color: #fff; }
.btn--ghost { background: transparent; color: var(--olive); }
/* hover always darkens: ghost buttons fill olive on hover (never lighten) */
.btn--ghost:hover { background: var(--olive-hover); color: #fff; border-color: var(--olive-hover); }
/* SAVE button (top-right): hover background = #636B49 only */
#account-slot .btn:hover { background: #636b49; border-color: #636b49; }
/* Review Scope button (outro): hover background = #636B49 only */
.complete .btn--ghost:hover { background: #636b49; border-color: #636b49; }
.btn--lg { padding: 0.42rem 2.4rem; font-size: 0.95rem; }
.btn--sm { padding: 0.42rem 0.9rem; font-size: 0.72rem; }
.btn--block { width: 100%; margin-top: 0.6rem; }
.btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn__label { display: inline-flex; align-items: center; line-height: 1; }
/* THE arrow — inline line+chevron SVG (thick, sharp corners, no fill). stroke=currentColor:
   black on light backgrounds, white on the green (olive) primary button */
.ui-arrow { flex: 0 0 auto; display: inline-block; width: 1.35em; line-height: 0; color: var(--black); }
.ui-arrow svg { display: block; width: 100%; height: auto; }
.ui-arrow--left { transform: scaleX(-1); }
.btn--primary .ui-arrow { color: #fff; }
/* back/previous buttons: arrow matches the button's olive text/border (white on hover) */
.btn--back .ui-arrow { color: inherit; }

.linkbtn {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--serif); color: var(--olive); text-decoration: underline;
  font-size: inherit;
}

.row-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }

/* ============================================================
   VIEW SHELL
   ============================================================ */
.view {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(0.7rem, 2vw, 1.2rem) clamp(1rem, 4vw, 2.4rem) 1rem;
  outline: none;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
/* navigating to any new section/submodule fades the content in (no slide/scroll) */
@keyframes tamFadeIn { from { opacity: 0; } to { opacity: 1; } }
.view > * { animation: tamFadeIn 0.3s ease; }

/* ============================================================
   INTRO / LANDING
   ============================================================ */
/* intro fills the viewport and centers; footer pins to the bottom */
.intro { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }
.hero { text-align: center; padding: 0; }
.hero__welcome {
  font-size: clamp(2.7rem, 5.4vw, 3.9rem); line-height: 1.03;
  max-width: 18ch; margin: 0 auto; color: var(--black);
  letter-spacing: normal;
}
.hero__accent { color: var(--olive); }

.intro__body {
  margin: 1.5rem auto 0;
  max-width: 680px; text-align: center;
}
.intro__body p {
  max-width: 100%; margin: 0 auto 0.34rem; color: var(--black);
  font-size: 0.83rem; line-height: 1.33;
}
/* visible breathing room between the two intro paragraphs */
.intro__body p:not(:last-child) { margin-bottom: 1rem; }

.phases {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem; margin: 0.55rem 0 0;
}
.phase-card {
  display: flex; flex-direction: column; gap: 0.18rem;
  padding: 0.5rem 0.9rem; text-decoration: none;
  border: 1px solid var(--line); border-radius: 0;
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}
.phase-card:hover { border-color: var(--olive); box-shadow: var(--shadow); }
.phase-card__num { color: var(--chrome); font-size: 0.95rem; letter-spacing: normal; }
.phase-card h3 { margin: 0.05rem 0 0; font-size: 1.1rem; color: var(--olive); letter-spacing: normal; }
.phase-card__kind { font-size: 0.66rem; letter-spacing: 0.2em; color: var(--muted); }
.phase-card p { margin: 0.15rem 0 0.35rem; font-size: 0.8rem; color: var(--ink); }
.phase-card__deliverable { margin-top: auto; font-size: 0.68rem; letter-spacing: normal; color: var(--olive); }
.phase-card--locked { opacity: 0.55; cursor: default; }
.phase-card--locked:hover { transform: none; border-color: var(--line); box-shadow: none; }

.intro__cta { text-align: center; margin: 0.55rem 0 0; }

/* ============================================================
   COURSE LAYOUT (outline + main)
   ============================================================ */
.course {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.course__main { min-width: 0; }

/* ---- outline / method map ---- */
/* sticky method map; scrolls internally when taller than the viewport (so the
   expanded discover list never forces the page itself to scroll) */
.outline {
  position: sticky; top: 84px; font-family: var(--sans);
  max-height: calc(100vh - 195px); overflow-y: auto; overscroll-behavior: contain;
}
.outline__home {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; letter-spacing: 0.16em;
  color: var(--muted); text-decoration: none; margin-bottom: 1.4rem;
}
.outline__home:hover { color: var(--olive); }
.outline__group { padding: 0.55rem 0; border-top: 1px solid var(--line); }
.outline__group:last-child { border-bottom: 1px solid var(--line); }
.outline__module {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; color: var(--black);
}
.outline__module.is-locked { color: var(--chrome); cursor: default; }
.outline__num { font-size: 0.72rem; color: var(--chrome); letter-spacing: 0.15em; }
.outline__title { font-size: 0.95rem; letter-spacing: 0.08em; }
.outline__group.is-active .outline__title { color: var(--olive); }
.outline__soon { margin-left: auto; font-size: 0.6rem; letter-spacing: 0.16em; color: var(--chrome); }
.tick { margin-left: auto; color: var(--olive); font-size: 0.8rem; }

.outline__steps { list-style: none; margin: 0.4rem 0 0.2rem; padding: 0; }
/* submodule sub-headers inside an expanded module (e.g. discover's 9 topics) */
.outline__subgroup {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.64rem; color: var(--chrome); margin: 0.7rem 0 0.2rem 0.55rem;
}
.outline__subgroup:first-child { margin-top: 0.1rem; }
/* submodule header that is also the intro-page link */
.outline__subgroup--link { margin-left: 0; padding: 0; }
.outline__subgroup--link a {
  display: block; padding: 0.2rem 0.55rem; text-decoration: none; color: var(--chrome);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.outline__subgroup--link a:hover { color: var(--olive); }
.outline__subgroup--link.is-current { background: var(--olive-soft); box-shadow: inset 2px 0 0 var(--olive); }
.outline__subgroup--link.is-current a { color: var(--olive-deep); }
.outline__step a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.36rem 0.55rem; text-decoration: none; color: var(--muted);
  font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.outline__step a:hover { color: var(--olive); }
.outline__step.is-current { background: var(--olive-soft); box-shadow: inset 2px 0 0 var(--olive); }
.outline__step.is-current a { color: var(--olive-deep); }

/* summary tag at the foot of each module's section → its outro page */
.outline__summary { margin: 0.45rem 0 0.1rem; }
.outline__summary a {
  display: inline-flex; align-items: center;
  margin: 0 0.55rem; padding: 0.2rem 0.55rem;
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.62rem; color: var(--olive); text-decoration: none;
  border: 1px solid var(--line);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.outline__summary a:hover { color: var(--olive-deep); border-color: var(--olive); }
.outline__summary.is-current a { background: var(--olive); border-color: var(--olive); color: #fff; }

/* "your plan" sidebar entry — styled like a module title (no number) */
.outline__plan { margin: 0.7rem 0 0.1rem; }
.outline__plan a {
  display: inline-flex; align-items: center; gap: 0.4rem; padding: 0; text-decoration: none;
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.95rem; color: var(--black);
}
.outline__plan a:hover { color: var(--olive); }
.outline__plan.is-current a { color: var(--olive); }

/* outro headline accent word */
.display__olive { color: var(--olive); }

/* completion = circle turns green only; text is left unchanged */
.outline__dot {
  width: 13px; height: 13px; border-radius: 0;
  border: 1px solid var(--chrome); flex: 0 0 auto;
}
.outline__dot.is-partial { background: var(--chrome); border-color: var(--chrome); }
.outline__dot.is-done { background: var(--olive); border-color: var(--olive); }

/* ============================================================
   MODULE OVERVIEW
   ============================================================ */
.callout {
  background: var(--olive-tint); border: 1px solid var(--line);
  padding: 0.85rem 1.2rem; margin: 1rem 0; border-radius: 0;
  font-size: 0.96rem; color: var(--ink);
}

/* compact the scope-intro so it fits one viewport with headroom */
.module-intro .eyebrow { margin-bottom: 0.25rem; }
.module-intro .display { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0 0 0.25rem; }
.module-intro .lede { margin-bottom: 0.45rem; }
.module-intro .callout { margin: 0.45rem 0; padding: 0.5rem 1.2rem; }
.module-intro .row-cta { margin-top: 0.65rem; }
/* subtopic intro pages: match the module intro page's title size exactly */
.step--intro .display { font-size: clamp(1.8rem, 4vw, 2.5rem); }

.substep-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem; margin: 0.65rem 0 0;
}
.substep-card {
  display: flex; flex-direction: column; gap: 0.22rem;
  padding: 0.62rem 1.1rem; text-decoration: none;
  border: 1px solid var(--line); border-radius: 0; background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}
.substep-card:hover { border-color: var(--olive); box-shadow: var(--shadow); }
.substep-card__num { font-size: 0.68rem; letter-spacing: 0.2em; color: var(--chrome); }
.substep-card h3 { margin: 0.25rem 0; font-size: 1.35rem; color: var(--olive); }
.substep-card p { margin: 0; font-size: 0.95rem; color: var(--ink); flex: 1; }
.substep-card__meta { display: flex; align-items: center; gap: 0.6rem; margin-top: 1rem; }
.substep-card__count { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); }

.minibar { flex: 1; height: 3px; background: var(--line); border-radius: 0; overflow: hidden; }
.minibar > span { display: block; height: 100%; background: var(--olive); transition: width 0.4s var(--ease); }
.minibar.is-complete > span { background: var(--olive); }

/* progress bar */
.progress { display: flex; align-items: center; gap: 0.9rem; margin: 0.4rem 0 0.5rem; max-width: 480px; }
.progress__bar { flex: 1; height: 4px; background: var(--line); border-radius: 0; overflow: hidden; }
.progress__bar > span { display: block; height: 100%; background: var(--olive); transition: width 0.5s var(--ease); }
.progress__label { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em; color: var(--muted); white-space: nowrap; }

/* ============================================================
   STEP / WORKSHEET
   ============================================================ */
.step__head { margin-bottom: 2.2rem; }
/* submodule description spans the full width of the separators on the page */
.step__head .lede { max-width: none; }

/* TEACH section (discover) — concept panel above the reflection prompts */
.teach {
  background: var(--olive-tint); border: 1px solid var(--line); border-radius: 0;
  padding: 1.15rem 1.35rem; margin: 0 0 2rem;
}
.teach__eyebrow { margin: 0 0 0.7rem; }
.teach__summary { font-style: italic; color: var(--ink); font-size: 1rem; margin: 0 0 0.9rem; }
.teach__point { margin: 0 0 0.8rem; }
.teach__point:last-child { margin-bottom: 0; }
.teach__term {
  display: block; font-family: var(--sans); text-transform: uppercase;
  letter-spacing: 0; font-size: 1rem; color: var(--black); margin-bottom: 0.25rem;
}
.teach__body { margin: 0; font-size: 0.92rem; color: var(--ink); line-height: 1.55; max-width: 70ch; }
/* separator sits ABOVE the reflect title only — never a line below it */
.reflect-rule { border-top: 2px solid var(--black); margin: 0 0 1.1rem; }
.reflect-eyebrow { margin: 0 0 1.4rem; letter-spacing: 0.1em; }
/* the question right after the reflect title gets no line above it */
.reflect-eyebrow + .prompt { border-top: none; padding-top: 0; }

.prompt {
  --num-col: 2.2rem;
  --num-gap: 0.9rem;
  padding: 2.2rem 0;
  border-top: 1px solid var(--line);
}
.prompt:first-of-type { border-top: 2px solid var(--black); }
/* number sits in a fixed column; align-items:flex-start keeps it on the
   question's FIRST line when the question wraps (question text never shrinks) */
.prompt__labelrow { display: flex; align-items: flex-start; gap: var(--num-gap); margin-bottom: 1.1rem; }
.prompt__n {
  font-family: var(--sans); color: var(--chrome);
  font-size: 1.6rem; letter-spacing: 0.1em; line-height: 1.25;
  flex: 0 0 var(--num-col);
}
.prompt__label {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem); line-height: 1.25;
  color: var(--black); margin: 0;
}
/* description aligns its left edge to where the question text starts, and
   extends to the full content width (the line separators) on the right */
.prompt__help {
  font-style: italic; font-size: 0.9rem; color: var(--muted);
  margin: 0 0 1.3rem;
  margin-left: calc(var(--num-col) + var(--num-gap));
  max-width: none;
}
/* all question content (images, choices, inputs) aligns to where the
   question text starts — not to where the number is */
.prompt .gallery,
.prompt .choicegroup,
.prompt .field {
  margin-left: calc(var(--num-col) + var(--num-gap));
}

/* image galleries */
.gallery { margin: 0 0 1.6rem; gap: 0.8rem; }
.gallery--row { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
.gallery--grid { display: grid; grid-template-columns: repeat(3, 1fr); align-items: start; }
.gallery--quad { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
.gallery--single { max-width: 320px; }
.gallery__item { margin: 0; align-self: start; }
/* height:auto + aspect-ratio means the caption always flows below the image
   and is never overlapped, even when cells differ in caption length */
.gallery__item img {
  width: 100%; height: auto; object-fit: cover; aspect-ratio: 4 / 3;
  border: none; outline: none; display: block;
}
.gallery--row .gallery__item img { aspect-ratio: 4 / 5; }
.gallery--single .gallery__item img { aspect-ratio: auto; width: auto; max-height: 360px; }
/* color concept images: taller cells so the (square) color wheel isn't cropped */
.step--color .teach + .gallery .gallery__item img { aspect-ratio: 1 / 1; }
/* vision plan mood board: tall portrait shots shown in full, not cropped */
.step--plan .gallery__item img { aspect-ratio: 9 / 16; }
.gallery__item figcaption {
  font-size: 0.82rem; color: var(--muted); margin: 0.55rem 0 0.2rem;
  font-style: italic; line-height: 1.4;
}
/* vision edit/design single photos: caption wraps to the photo's exact width */
.step--edit .gallery__item, .step--design .gallery__item { width: -moz-fit-content; width: fit-content; max-width: 100%; }
.step--edit .gallery__item img, .step--design .gallery__item img { max-width: 100%; }
.step--edit .gallery__item figcaption, .step--design .gallery__item figcaption { width: 0; min-width: 100%; }
/* annotated figure (cohesion): photo left, labelled callouts right, thin
   connector lines/arrows. fixed aspect so the 174x100 svg maps 1:1 onto it */
.annot { position: relative; width: 100%; aspect-ratio: 174 / 100; margin: 0 0 1.6rem; }
.annot__photo { position: absolute; left: 0; top: 0; width: 46%; height: 100%; }
.annot__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.annot__overlay { position: absolute; inset: 0; pointer-events: none; }
.annot__lines { width: 100%; height: 100%; display: block; overflow: visible; }
.annot__lines line, .annot__lines polyline {
  fill: none; stroke: var(--olive); stroke-width: 1.6;
  vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
}
.annot__notes { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.annot__note { position: absolute; left: 54%; right: 1%; transform: translateY(-50%); }
.annot__text {
  display: block; font-family: var(--serif); font-style: italic;
  font-size: 0.82rem; line-height: 1.4; color: var(--muted); text-transform: lowercase;
}
/* stack on narrow screens: photo over a plain list, no connector lines */
@media (max-width: 767px) {
  .annot { aspect-ratio: auto; }
  .annot__photo { position: static; width: 100%; height: auto; }
  .annot__overlay { display: none; }
  .annot__notes { position: static; margin-top: 1rem; }
  .annot__note {
    position: static; transform: none; left: auto; right: auto;
    margin-bottom: 0.7rem; padding-left: 0.85rem; border-left: 2px solid var(--olive);
  }
}

/* field */
.field { position: relative; }
.field__input {
  width: 100%; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6;
  color: var(--ink); background: var(--olive-tint);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; resize: vertical; min-height: 96px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field__input::placeholder { color: #a7a99c; font-style: italic; }
.field__input:focus {
  outline: none; background: #fff;
  border-color: var(--olive); box-shadow: 0 0 0 3px rgba(99, 107, 73, 0.12);
}
.field__status {
  display: block; text-align: right;
  font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); min-height: 1.1em; margin-top: 0.4rem;
}
.field__status.is-saving { color: var(--chrome); }
.field__status.is-saved { color: var(--olive); }

/* multiple-choice pills */
.choicegroup { margin: 0 0 1.3rem; }
.choicegroup__label {
  display: block; font-family: var(--sans); text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.6rem;
}
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice {
  font-family: var(--serif); font-size: 0.98rem; line-height: 1;
  padding: 0.55rem 1.05rem; cursor: pointer;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 0;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.choice:hover { border-color: var(--olive); color: var(--olive-deep); }
.choice.is-selected { background: var(--olive); border-color: var(--olive); color: #fff; }

.field__hint {
  display: block; font-family: var(--sans); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 0.72rem; color: var(--muted); margin-bottom: 0.5rem;
}

.step__nav { display: flex; justify-content: space-between; gap: 0.8rem; margin-top: 2.6rem; flex-wrap: wrap; }
/* bottom nav buttons sit snug to their label + arrow (less side padding than other buttons) */
.step__nav .btn { padding-left: 0.9rem; padding-right: 0.9rem; }
/* align the back/previous button's left edge with the indented question/input column */
.step__nav .btn:first-child { margin-left: calc(2.2rem + 0.9rem); }
/* submodule intro pages have no questions — align the back button to the text */
.step--intro .step__nav .btn:first-child { margin-left: 0; }

/* ============================================================
   COMPLETION
   ============================================================ */
.complete {
  min-height: calc(100vh - 210px);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; max-width: 640px; margin: 0 auto;
}
.complete > * { margin-left: auto; margin-right: auto; }
.complete__mark img { width: 132px; margin: 0 auto 0.4rem; }
.complete .eyebrow { margin-bottom: 0.2rem; }
.complete .display { margin: 0 0 0.2rem; }
.complete .lede { max-width: 100%; margin-bottom: 0.3rem; }
.complete .progress { margin: 0.45rem auto; }
.complete .callout { margin: 0.4rem 0; padding: 0.5rem 1.2rem; }
.complete .row-cta { justify-content: center; margin-top: 0.5rem; }

/* ============================================================
   YOUR PLAN — the final deliverable / personal design plan
   ============================================================ */
.plan { max-width: 760px; margin: 0 auto; }
.plan__head { text-align: center; margin-bottom: 2.6rem; }
.plan__brand img { height: 54px; width: auto; margin: 0 auto 1.2rem; display: block; }
.plan__title { font-size: clamp(2.4rem, 5vw, 3.4rem); margin: 0 0 0.7rem; }
.plan__lede { max-width: 52ch; margin: 0 auto; color: var(--ink); }
.plan__section { margin: 0 0 2.2rem; }
.plan__phase {
  font-family: var(--sans); font-weight: 400; text-transform: uppercase; letter-spacing: 0;
  font-size: 1.5rem; color: var(--olive); margin: 0 0 0.9rem;
  padding-bottom: 0.5rem; border-bottom: 2px solid var(--black);
}
.plan__items { display: flex; flex-direction: column; }
.plan__item {
  display: grid; grid-template-columns: 12.5rem 1fr; gap: 1rem;
  padding: 0.95rem 0; border-bottom: 1px solid var(--line); align-items: start;
}
.plan__item:last-child { border-bottom: none; }
.plan__itemlabel {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.82rem; color: var(--black); padding-top: 0.15rem;
}
.plan__itembody { min-width: 0; }
.plan__chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.45rem; }
.plan__chips:last-child { margin-bottom: 0; }
.plan__chip {
  font-family: var(--serif); font-size: 0.92rem; line-height: 1; color: #fff;
  background: var(--olive); padding: 0.32rem 0.7rem; border-radius: 0;
}
.plan__text { margin: 0; font-size: 1rem; line-height: 1.55; color: var(--ink); }
.plan__empty { margin: 0; font-style: italic; color: var(--muted); }
.plan__cta { justify-content: center; margin-top: 2.4rem; }
@media (max-width: 620px) {
  .plan__item { grid-template-columns: 1fr; gap: 0.35rem; }
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(26, 26, 26, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
  animation: fade 0.18s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: 100%; max-width: 420px;
  background: #fff; border-radius: var(--radius);
  padding: 2.4rem 2rem; box-shadow: var(--shadow);
  border-top: 3px solid var(--olive);
}
.modal__close {
  position: absolute; top: 0.6rem; right: 0.8rem;
  background: none; border: none; font-size: 1.6rem; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.modal__close:hover { color: var(--black); }
.modal__title { font-size: 1.6rem; margin: 0 0 0.5rem; color: var(--black); }
.modal__sub { font-size: 0.95rem; color: var(--muted); margin: 0 0 1.4rem; }

.auth-form { display: flex; flex-direction: column; gap: 0.7rem; }
.auth-form .field__input { background: #fff; min-height: 0; }
.auth-form__err { color: #a23b2d; font-size: 0.85rem; min-height: 1em; margin: 0; }
.auth-form__toggle { font-size: 0.9rem; color: var(--muted); text-align: center; margin: 1rem 0 0; }

/* login gate — centered narrow column under the hero */
.gate { max-width: 30rem; margin: 1.4rem auto 0; text-align: center; }
.gate .modal__sub { margin-bottom: 1.4rem; }
.gate .auth-form { text-align: left; }

/* ============================================================
   MOBILE NAV DRAWER (built in JS; only visible on small screens)
   ============================================================ */
.nav-drawer {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(26, 26, 26, 0.5);
  display: flex;
  animation: fade 0.18s var(--ease);
}
.nav-drawer__panel {
  position: relative;
  width: min(86vw, 360px); height: 100%;
  background: #fff; border-right: 3px solid var(--olive);
  padding: 3.4rem 1.3rem 1.4rem; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-drawer__close {
  position: absolute; top: 0.5rem; right: 0.7rem;
  background: none; border: none; font-size: 1.8rem; line-height: 1;
  color: var(--muted); cursor: pointer;
}
.nav-drawer__close:hover { color: var(--black); }
/* the outline inside the drawer flows normally (not sticky / not clipped / not boxed) */
.nav-drawer .outline {
  position: static; top: auto; max-height: none; overflow: visible;
  border: none; padding: 0; margin: 0;
}
/* lock background scroll while the drawer is open */
body.nav-open { overflow: hidden; }

/* ============================================================
   FOOTER
   ============================================================ */
/* full-width footer: same horizontal padding as the topbar, so the separator's
   ends line up with the top-left logo and the top-right save button */
.sitefoot {
  position: relative;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem;
  padding: 0.8rem clamp(1rem, 4vw, 2.4rem);
}
.sitefoot::before {
  content: ""; position: absolute; top: 0;
  left: clamp(1rem, 4vw, 2.4rem); right: clamp(1rem, 4vw, 2.4rem);
  border-top: 1px solid var(--line);
}
.sitefoot__short { font-style: italic; color: var(--black); text-align: left; }
.sitefoot__copy {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0;
  font-size: 0.82rem; color: var(--black); text-align: right;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  body { font-size: 17px; }
  .phases { grid-template-columns: 1fr; }
  .course { grid-template-columns: 1fr; }
  .outline {
    position: static; top: auto;
    margin-bottom: 1.6rem; padding: 0.6rem 0;
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1rem 1.1rem;
  }
  .outline__group:last-child { border-bottom: none; }
  .gallery--grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .gallery--grid { grid-template-columns: 1fr 1fr; }
  .row-cta .btn, .step__nav .btn { flex: 1; }
  .modal { padding: 2rem 1.4rem; }
}

/* ============================================================
   MOBILE (320–767px) — desktop layout above 767px is untouched
   ============================================================ */
@media (max-width: 767px) {
  body { font-size: 16px; }

  /* topbar: show hamburger, shrink logo to make room */
  .nav-toggle { display: inline-flex; }
  .topbar { padding: 0.4rem 1rem; }
  .topbar__brand img { height: 52px; }

  .view { padding: 0.8rem 1rem 1rem; }

  /* course is a single column; the inline sidebar lives in the drawer instead */
  .course { grid-template-columns: 1fr; gap: 0; }
  .course .outline { display: none; }

  /* everything stacks to one column */
  .phases { grid-template-columns: 1fr; gap: 0.5rem; }
  .substep-grid { grid-template-columns: 1fr; gap: 0.6rem; }
  .gallery--row, .gallery--grid, .gallery--quad { grid-template-columns: 1fr; }
  .gallery--single { max-width: 100%; }
  .plan { max-width: 100%; }
  .plan__item { grid-template-columns: 1fr; gap: 0.35rem; }

  /* question content goes full width (no number-column indent) */
  .prompt { padding: 1.5rem 0; }
  .prompt__labelrow { gap: 0.6rem; margin-bottom: 0.9rem; }
  .prompt__n { font-size: 1.2rem; flex-basis: auto; }
  .prompt__help,
  .prompt .gallery,
  .prompt .choicegroup,
  .prompt .field { margin-left: 0; }

  /* inputs full width is inherited; make sure nothing forces overflow */
  .field__input { font-size: 1rem; }

  /* bottom navigation: stacked and full width, clearly spaced */
  .step__nav { flex-direction: column; gap: 0.7rem; margin-top: 2rem; }
  .step__nav .btn,
  .step__nav .btn:first-child { width: 100%; margin-left: 0; flex: none; }

  /* tighten the standalone pages so they fit the screen */
  .hero__welcome { font-size: clamp(1.9rem, 9vw, 2.4rem); }
  .intro__body { margin-top: 0.9rem; }
  .intro__body p { font-size: 0.82rem; }
  .module-intro .display,
  .step--intro .display { font-size: clamp(1.6rem, 7vw, 2rem); }
  .lede { font-size: 1rem; }
  .complete { min-height: 0; padding: 1rem 0; }
  .complete__mark img { width: 92px; }

  /* modal/gate comfortable on small screens */
  .modal { padding: 2rem 1.3rem; }
}

/* TABLET (768–1024px) — fix excess white space under the footer.
   iPad Safari treats 100vh as the full screen (toolbars included), so the
   sticky-footer body overshoots the visible viewport and leaves a blank gap
   beneath the footer. Dynamic viewport height (100dvh) resolves to the actual
   visible height. Scoped to tablet only; desktop (>=1025px) keeps 100vh exactly.
   Browsers without dvh support simply fall back to the base 100vh rule. */
@media (min-width: 768px) and (max-width: 1024px) {
  body { min-height: 100dvh; }
}

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