/* Lets Create — member area.
   Hybrid brief: app-like structure (Thinkific/Kajabi), funnel's brand skin.
   Tokens lifted from life-in-color-site/public/css/site.css so the two properties feel
   like one business. This is the v1 skeleton — expect to restyle against the design refs. */

@font-face {
  font-family: "Ivy Presto Headline";
  src: url("/fonts/ivy-presto-headline.otf") format("opentype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: rgb(14, 23, 42);
  --body-ink: rgb(18, 18, 18);
  --muted: rgb(88, 88, 88); /* darker than the funnel's grey — legibility for a 35-60 audience */
  --gold: rgb(191, 175, 0);
  --cream: #faf8f0;
  --card-bg: #fffff8;
  --card-border: rgb(240, 241, 227);
  --line: rgb(226, 232, 240);
  --coral: rgb(255, 111, 97);
  --green: #3ec463;
  --navy: #1e293b;
  --shell: #ffffff;
  --radius: 12px;
  --max: 1140px;

  /* one action colour across buttons + progress (brand call, 2026-07-14) */
  --action: #D6994E;
  --action-dark: #c1873f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px; /* base bumped from 16 — every rem below scales with it */
  line-height: 1.65;
  color: var(--body-ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Ivy Presto Headline", Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}
h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

a { color: inherit; }

/* ---- chrome ---- */
.topbar {
  background: var(--shell);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.wordmark {
  display: flex;
  align-items: center;
  margin-right: auto;
  text-decoration: none;
}
.wordmark img { height: 34px; width: auto; display: block; }
.topbar a.nav, .topbar button.nav {
  font: inherit;
  font-size: .9rem;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.topbar a.nav:hover, .topbar button.nav:hover { color: var(--ink); }

main { max-width: var(--max); margin: 0 auto; padding: 36px 24px 80px; }

.page-head { margin-bottom: 28px; }
.page-head p { color: var(--muted); margin-top: 6px; }

.crumb {
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 10px;
}
.crumb:hover { color: var(--ink); }

/* ---- cards ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.card {
  position: relative;            /* anchor for the "Coming soon" badge */
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;              /* keeps the cover image inside the rounded corners */
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
/* Owned-but-not-yet-published course (e.g. a pre-order): flag it on the cover. */
.card .coming-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(14, 23, 42, .82);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}
a.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(14, 23, 42, .08); }

.card .cover {
  aspect-ratio: 16 / 9;
  background: var(--card-border);
  overflow: hidden;
}
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* a course with no artwork yet still gets a card with presence, in its own colour */
.card .cover.empty {
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  display: grid;
  place-items: center;
  font-family: "Ivy Presto Headline", Georgia, serif;
  color: var(--accent);
  font-size: 1.05rem;
}
.card .swatch { height: 5px; background: var(--accent, var(--action)); }
.card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .blurb { color: var(--muted); font-size: .92rem; flex: 1; }
.card.locked { border-style: dashed; }

/* ---- progress ---- */
.bar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > span {
  display: block;
  height: 100%;
  background: var(--action);
  border-radius: 6px;
  transition: width .3s ease;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  color: var(--muted);
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  background: var(--action);
  color: #fff;
  transition: background .12s ease;
}
.btn:hover { background: var(--action-dark); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.soon { background: #b9b3aa; cursor: default; pointer-events: none; }
.btn.soon:hover { background: #b9b3aa; }
.btn.ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn.ghost:hover { border-color: var(--ink); }
.btn.done { background: var(--green); }

/* ---- curriculum ---- */
.module { margin-bottom: 26px; }
.module h2 { font-size: 1.15rem; margin-bottom: 4px; }
.module .count { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.lessons { list-style: none; margin-top: 12px; border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; }
.lessons li + li { border-top: 1px solid var(--card-border); }
.lessons a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card-bg);
  text-decoration: none;
}
.lessons a:hover { background: #fff; }
.lessons a[aria-current="true"] { background: #fff; box-shadow: inset 3px 0 0 var(--coral); }
.tick {
  width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font-size: .7rem;
  color: transparent;
}
.tick.done { background: var(--green); border-color: var(--green); color: #fff; }
.lessons .t { flex: 1; }
.lessons .meta { font-size: .85rem; color: var(--muted); }

/* ---- lesson player ---- */
.player {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}
/* On desktop the rail is always expanded, so its mobile toggle stays hidden — and the
   index stays visible even if the `open` attribute somehow isn't set, since with the
   summary hidden there would be no way to reopen it. Scoped to desktop: below the
   breakpoint the collapse is the point. */
@media (min-width: 901px) {
  .rail-disclosure > summary { display: none; }
  .rail-disclosure:not([open]) > .rail-body { display: block; content-visibility: visible; }
  .rail-disclosure::details-content { content-visibility: visible; }
}
.video {
  position: relative;
  padding-top: 56.25%;
  background: var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 18px 0;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Portrait-shot clips (e.g. the phone time-lapses) — a 9:16 frame, centered and capped
   so they show large instead of being letterboxed tiny inside the default 16:9 box. */
.video.portrait {
  padding-top: 0;
  aspect-ratio: 9 / 16;
  max-width: min(360px, 100%);
  margin-left: auto;
  margin-right: auto;
}
.blocks p { margin: 14px 0; }
.blocks ul, .blocks ol { margin: 14px 0 14px 24px; }
.blocks li { margin: 6px 0; }
.blocks a { color: var(--action-dark); }
.blocks strong { color: var(--ink); }

/* a reference image inside a lesson — served gated from R2, same as a download */
.figure {
  margin: 20px 0;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
}
.figure img { width: 100%; height: auto; display: block; }

/* Life in Color: reference photos and bonus lesson thumbnails read better smaller —
   half the reading column, centered — with the full-size copy a click away in the
   download link. Falls back to full width on phones where 50% would be too small. */
.course-life-in-color .figure {
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 640px) {
  .course-life-in-color .figure { max-width: 100%; }
}

/* the "share your sketch" call to action */
.cta { margin: 26px 0; text-align: center; }
.cta .btn { padding: 14px 28px; }
.dl {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin: 14px 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  text-decoration: none;
}
.dl:hover { border-color: var(--coral); }
.dl .ico { font-size: 1.1rem; }
.dl .label { font-weight: 600; flex: 1; }
.dl .hint { font-size: .85rem; color: var(--muted); }

.rail {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.rail h3 { font-size: .95rem; margin-bottom: 12px; }
.rail .lessons { margin-top: 0; }
.rail .lessons a { padding: 11px 12px; font-size: .95rem; }

/* section groups within the rail (course name / Bonuses / bundle).
   Readable heading, not a tiny uppercase eyebrow — the audience skews 35-60. */
.rail-section + .rail-section { margin-top: 24px; }
.rail-section h3 {
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--card-border);
}

.lesson-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.lesson-foot .spacer { flex: 1; }

/* ---- lesson player: phone/tablet ----
   Must come AFTER the .rail/.player/.lesson-foot base rules above: a media query adds
   no specificity, so an override placed earlier in the file loses to them. */
@media (max-width: 900px) {
  .player { grid-template-columns: 1fr; gap: 20px; }
  .player .rail { order: -1; }

  /* The rail kept `position: sticky` + a viewport-tall max-height on phones, so it
     pinned itself over the lesson and covered the video and text (user-reported
     2026-07-20). Here it collapses to a one-tap index in normal flow instead —
     the lesson itself is what the page is for. */
  .rail {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .rail-disclosure > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 16px;   /* ≥44px tap target */
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }
  .rail-disclosure > summary::-webkit-details-marker { display: none; }
  .rail-disclosure > summary::after {
    content: "⌄";
    font-size: 1.1rem;
    line-height: 1;
    transform: translateY(-3px);
    transition: transform .15s ease;
  }
  .rail-disclosure[open] > summary::after { transform: rotate(180deg) translateY(-1px); }
  .rail-disclosure[open] > summary { border-bottom: 1px solid var(--card-border); }
  .rail-summary-label { flex: 1; }
  .rail-summary-meta { color: var(--muted); font-weight: 400; font-size: .9rem; }
  .rail-body { padding: 16px; }

  /* three buttons in one row squash badly on a phone */
  .lesson-foot { flex-wrap: wrap; }
  .lesson-foot .spacer { display: none; }
  .lesson-foot .btn { flex: 1 1 140px; text-align: center; }
}

/* ---- auth pages ---- */
.auth {
  max-width: 460px;
  margin: 10vh auto;
  padding: 0 24px;
  text-align: center;
}
.auth .box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: left;
  margin-top: 24px;
}
.auth p.lede { color: var(--muted); margin-top: 8px; }
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
input[type="email"] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 14px;
}
input[type="email"]:focus { outline: 2px solid var(--coral); outline-offset: 1px; }
.auth .btn { width: 100%; }

.note {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: .9rem;
  margin-bottom: 16px;
}
.note.ok { background: #eaf8ee; color: #1c6b34; }
.note.err { background: #fdecea; color: #8b2c22; }
.note.info { background: #f3f6fd; color: #35507e; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.muted { color: var(--muted); }
.skeleton { color: var(--muted); padding: 40px 0; }
