/* Episode pages (episode-1.html … episode-8.html, written by tools/episodes.py): each episode of the
   course on its own page, opening on its stage of the one bean plant that grows through the course. */

/* Opening: the entry, and the plant at this stage ---------------------------------------------- */
.ep-open { padding-block: calc(5.4rem + 3vh) clamp(3rem, 6vw, 5rem); }
.ep-open__grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: clamp(1.5rem, 5vw, 5rem); align-items: center; }
.ep-open__id { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.ep-open__stage { font-family: var(--f-hand); font-weight: 700; font-size: 2rem; line-height: 1; color: var(--earth); rotate: -2deg; }
.ep-open h1 { margin-top: 1.1rem; font-size: clamp(2.7rem, 1.5rem + 4vw, 5.3rem); max-width: 13ch; }
.ep-quote { margin: 1.5rem 0 0; max-width: 33rem; padding-left: 1.2rem; border-left: 4px solid var(--c); }
.ep-quote p { font-family: var(--f-display); font-style: italic; font-size: var(--step-2); line-height: 1.24; font-variation-settings: "SOFT" 100, "WONK" 1; color: var(--canopy-2); }
.ep-quote footer { margin-top: 0.5rem; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-3); }
.ep-open .lede { margin-top: 1.3rem; max-width: 34rem; }
.ep-meta { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ep-meta li { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.32rem 0.85rem 0.34rem; border: 1.5px solid rgba(30, 43, 34, 0.22); border-radius: 999px; background: rgba(251, 247, 238, 0.7); font-size: 0.85rem; font-weight: 700; color: var(--ink-2); }
.ep-meta svg { width: 1rem; height: 1rem; color: var(--earth); }
.ep-open__cta { margin-top: 1.9rem; }

.ep-specimen { margin: 0; justify-self: center; width: min(100%, 31rem); }
.ep-specimen figcaption { display: grid; justify-items: center; gap: 0.2rem; margin-top: 0.4rem; text-align: center; }
.ep-specimen figcaption .hand { font-size: 1.55rem; rotate: -1.5deg; }
.ep-specimen__credit { max-width: 24rem; font-size: 0.78rem; color: var(--ink-3); }
@media (max-width: 860px) {
  .ep-open__grid { grid-template-columns: minmax(0, 1fr); }
  .ep-specimen { width: min(100%, 24rem); margin-top: 0.5rem; }
  .ep-specimen .specimen__notes .art__hand { font-size: 66px; stroke-width: 14px; }
}

/* The big idea (its idea blocks, drawings and take-home are shared with the hub's lessons, in components.css) */
.ep-idea .head { margin-bottom: clamp(2.2rem, 5vw, 3.5rem); }

/* What's inside: what you'll come away with, then the four parts on a strip of film ------------ */
.ep-reel { background-color: #1b2a20; background-image: var(--grain); color: #efe4cc; padding-bottom: calc(var(--section) * 0.8); }
.ep-reel .eyebrow { color: #cdbb95; }
.ep-reel h2 { color: #fbf3e1; }
.ep-reel h2 em { color: var(--wattle-2); }
.ep-reel .lede { color: #d9d0b8; }
.ep-reel__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 25rem); gap: clamp(1.8rem, 4vw, 3.5rem); align-items: end; }
/* what you'll come away with: a note taped up beside the outline */
.ep-after {
  position: relative; padding: 1.4rem 1.4rem 1.35rem; rotate: 1.2deg; color: var(--ink);
  background-color: #fbf7ee; background-image: var(--grain); background-size: 260px 260px; border-radius: 3px;
  box-shadow: 0 28px 38px -26px rgba(0, 0, 0, 0.75), 0 2px 5px -2px rgba(0, 0, 0, 0.35);
}
.ep-after::before { content: ""; position: absolute; left: 50%; top: -0.8rem; width: 6.5rem; height: 1.55rem; translate: -50% 0; rotate: -4deg; background: rgba(236, 222, 184, 0.88); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.ep-after__kick { font-family: var(--f-hand); font-weight: 700; font-size: 1.75rem; line-height: 1; color: var(--earth); }
.ep-after__list { list-style: none; margin: 0.85rem 0 0; padding: 0; display: grid; gap: 0.65rem; }
.ep-after__list li { position: relative; padding-left: 1.9rem; font-size: 1rem; line-height: 1.4; }
.ep-after__list li::before {
  content: ""; position: absolute; left: 0; top: 0.05rem; width: 1.3rem; height: 1.3rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M3 12.5 C 5 14, 7 16.5, 8.6 18.5 C 11.5 12, 14.5 7.5, 19.5 3' fill='none' stroke='%233f7d3a' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (max-width: 860px) {
  .ep-reel__head { grid-template-columns: 1fr; }
  .ep-after { max-width: 30rem; }
}
.reel {
  --holes: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='14'%3E%3Crect x='7' y='2' width='16' height='10' rx='3' fill='%23efe4cc'/%3E%3C/svg%3E");
  position: relative; margin-top: clamp(2rem, 4vw, 3rem); padding-block: 2.6rem;
}
.reel::before, .reel::after { content: ""; position: absolute; left: 0; right: 0; height: 14px; background: var(--holes) repeat-x; opacity: 0.8; }
.reel::before { top: 0.4rem; }
.reel::after { bottom: 0.4rem; }
.reel__clock { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 auto 0.9rem; padding: 0 var(--gutter); max-width: calc(var(--wide) + 2 * var(--gutter)); font: 700 0.72rem var(--f-body); letter-spacing: 0.12em; color: #a99b7d; }
.reel__clock span { border-left: 1px solid rgba(239, 228, 204, 0.3); padding-left: 0.5rem; }
.reel__clock span:last-child { position: relative; }
.reel__clock span:last-child::after { content: "60"; position: absolute; right: 0; }
.reel__frames {
  list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: calc(var(--wide) + 2 * var(--gutter));
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(0.8rem, 2vw, 1.4rem); counter-reset: seg;
}
.reel__frame { counter-increment: seg; position: relative; display: grid; align-content: start; gap: 0.45rem; padding: 1.1rem 1.1rem 1.4rem; border-radius: 6px; background: #fbf7ee; color: var(--ink); }
.reel__frame:nth-child(odd) { rotate: -0.5deg; }
.reel__frame:nth-child(even) { rotate: 0.5deg; }
.reel__frame::before { content: counter(seg); font-family: var(--f-display); font-weight: 600; font-size: 2.6rem; line-height: 0.9; color: var(--c); -webkit-text-stroke: 1px rgba(30, 43, 34, 0.6); }
.reel__time { position: absolute; right: 1rem; top: 1.1rem; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; color: var(--ink-3); }
.reel__frame h3 { font-size: var(--step-1); font-weight: 620; line-height: 1.2; }
.reel__frame p { font-size: 0.95rem; color: var(--ink-2); }
@media (max-width: 960px) {
  .reel__frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reel__clock { display: none; }
}
@media (max-width: 560px) { .reel__frames { grid-template-columns: 1fr; } }

/* Take it further: the other pages this episode leads to ------------------------------------- */
.ep-more { background-color: var(--paper-2); background-image: var(--grain); }
.more { list-style: none; margin: clamp(2rem, 4vw, 3rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 1.8rem); }
.more li { display: flex; }
.more a {
  flex: 1; display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; row-gap: 0.3rem; align-content: start; padding: 1.3rem 1.3rem 1.4rem;
  border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-paper); color: inherit; text-decoration: none;
  transition: translate 0.3s var(--ease-grow), box-shadow 0.3s ease;
}
.more li:nth-child(odd) a { rotate: -0.4deg; }
.more li:nth-child(even) a { rotate: 0.5deg; }
.more a:hover { translate: 0 -3px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 24px 44px -26px rgba(74, 46, 16, 0.55), 0 2px 6px -2px rgba(74, 46, 16, 0.18); }
.more__ico { grid-row: span 3; width: 3rem; height: 3rem; display: grid; place-items: center; }
.more__ico svg { width: 1.9rem; height: 1.9rem; }
.more__kick { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--earth); }
.more__title { font-family: var(--f-display); font-size: var(--step-1); font-weight: 600; line-height: 1.2; }
.more__desc { font-size: 0.93rem; color: var(--ink-2); }
.more a:hover .more__title { text-decoration: underline; text-decoration-color: var(--wattle); text-decoration-thickness: 2px; }
@media (max-width: 900px) { .more { grid-template-columns: 1fr; max-width: 34rem; } }
/* where sign-in is off, or a first visit waits to hear, the members' wiki card goes (base.css), so the other two share
   the row (qag-12eni, qag-1nk1j) */
@media (min-width: 901px) { .sign-in-off .more:has(> li > a[href*="?tour"]:only-child), .sign-in-wait .more:has(> li > a[href*="?tour"]:only-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The whole course: the eight stages as the way round, then the waitlist ----------------------- */
.series { list-style: none; margin: clamp(2rem, 4vw, 3rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0.4rem; }
.series a { display: grid; justify-items: center; text-align: center; padding: 0.4rem 0.2rem 0.6rem; border-radius: 12px; color: inherit; text-decoration: none; transition: background-color 0.3s ease; }
.series .specimen { width: 100%; }
.series .specimen__top, .series .specimen__roots { opacity: 0.62; transition: opacity 0.3s ease; }
.series a:hover .specimen__top, .series a:hover .specimen__roots, .series a:focus-visible .specimen__top, .series a:focus-visible .specimen__roots,
.series [aria-current] .specimen__top, .series [aria-current] .specimen__roots { opacity: 1; }
.series a:hover .specimen__top, .series a:focus-visible .specimen__top { animation: sway 2.4s ease-in-out infinite; --lean: 2.5deg; }
.series__pad {
  margin-top: 0.3rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 6px; background: var(--card);
  box-shadow: inset 0 0 0 1.5px rgba(30, 43, 34, 0.7); font-family: var(--f-display); font-weight: 650; font-size: 0.95rem; color: var(--ink-2); rotate: -3deg;
}
.series li:nth-child(even) .series__pad { rotate: 3deg; }
.series [aria-current] .series__pad { background: var(--pc); color: var(--on, #fff8ea); box-shadow: inset 0 0 0 2px rgba(30, 43, 34, 0.9), 2px 2px 0 rgba(30, 43, 34, 0.9); }
/* each plant keeps to its column: a stage's one word too long for it (Framework, on a narrow phone or with a
   reader's own spacing) breaks at a soft hyphen (tools/episodes.py) rather than widening it */
.series a { grid-template-columns: minmax(0, 1fr); }
.series__stage { margin-top: 0.35rem; font-family: var(--f-hand); font-weight: 600; font-size: 1.2rem; line-height: 1; color: var(--earth); }
.series__title { margin-top: 0.25rem; font-size: 0.8rem; font-weight: 650; line-height: 1.25; color: var(--ink-2); }
.series [aria-current] .series__title { color: var(--ink); font-weight: 800; }
.series a:hover .series__title { text-decoration: underline; text-decoration-color: var(--wattle); text-decoration-thickness: 2px; }
@media (max-width: 900px) {
  .series { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 1rem; }
}
@media (max-width: 480px) { .series__title { display: none; } }

.ep-step { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: clamp(2rem, 4vw, 3rem); }
.ep-step a {
  display: grid; gap: 0.2rem; padding: 1.1rem 1.3rem 1.2rem; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--card);
  box-shadow: 0 3px 0 var(--ink); color: inherit; text-decoration: none; transition: translate 0.2s ease, box-shadow 0.2s ease;
}
.ep-step a:hover { translate: 0 -2px; box-shadow: 0 5px 0 var(--ink); }
.ep-step__next { text-align: right; grid-column: 2; }
.ep-step__dir { font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--earth); }
.ep-step__title { font-family: var(--f-display); font-size: var(--step-1); font-weight: 600; line-height: 1.2; }
@media (max-width: 600px) { .ep-step { grid-template-columns: 1fr; } .ep-step__next { grid-column: 1; } }

.ep-cta {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.5rem 3rem; margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(1.5rem, 4vw, 2.6rem) clamp(1.3rem, 4vw, 3rem); border-radius: 16px 12px 18px 14px; background: var(--canopy); color: #f3ecd9;
  background-image: var(--grain); box-shadow: 0 40px 60px -40px rgba(15, 42, 24, 0.8), 0 2px 6px -2px rgba(15, 42, 24, 0.3); rotate: -0.4deg;
}
.ep-cta h2 { font-size: var(--step-3); color: #fbf3e1; }
.ep-cta h2 em { color: var(--wattle-2); }
.ep-cta p { margin-top: 0.5rem; color: #d7dcc4; max-width: 34rem; }
.ep-cta .hand { color: var(--wattle-2); font-size: 1.45rem; }
@media (max-width: 700px) { .ep-cta { grid-template-columns: 1fr; } }

/* the opener trims the empty paper above the early stages (--lift, a fraction of the plant's height) */
.ep-specimen .specimen { margin-block: calc(var(--lift, 0) * -134.4%) calc(var(--drop, 0) * -134.4%); pointer-events: none; }
/* and never grows taller than the screen */
@media (min-width: 861px) {
  .ep-specimen { width: min(100%, 31rem, calc((100svh - 9rem) / (1.344 * (1 - var(--lift, 0) - var(--drop, 0))))); }
}
