/* ═══════════════════════════════════════════════════════════════
   Sidetake — the story, first half: hero, the promise list, the
   section title, the pinned process scene, the line, the bands.
   Second half in story-end.css; shell and tokens in site.css.
   Every scroll-driven value is written by story.js as a CSS
   variable or a class — the CSS describes each state, the JS only
   chooses between them.
   ═══════════════════════════════════════════════════════════════ */


/* ══════════ 1 · hero — the framed emerald block ══════════ */

.hero {
  display: flex;
  flex-direction: column;
  height: 100svh;
  min-height: 620px;
  padding: var(--frame);
}
/* flex: 1 rather than height: 100%, so the frame still fills the screen
   when the hero's height is auto (phones) and only min-height is set */
.hero__frame {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(4.6rem, 3.2rem + 4vw, 6.6rem) clamp(1rem, 4vw, 4.5rem) clamp(1rem, 2vw, 1.8rem);
  border-radius: var(--r);
  overflow: hidden;
}
.hero__title {
  font-size: clamp(2.5rem, 0.6rem + 7.2vw, 8.6rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-align: center;
  text-transform: uppercase;
}
.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.05em;
}
.hero__title .line > span {
  display: block;
  animation: line-up 1s var(--ease-out) both;
}
.hero__title .line:nth-child(2) > span {
  animation-delay: 0.12s;
}
@keyframes line-up {
  from {
    transform: translateY(105%);
  }
}

.hero__mid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(1rem, 2.6vw, 3rem);
  padding-block: clamp(0.75rem, 2vh, 1.75rem);
}
.hero__side {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-block: 1.05rem;
  border-block: 1px solid rgba(255, 255, 255, 0.3);
  animation: fade-in 0.9s var(--ease-out) 0.45s both;
}
.hero__side--r {
  justify-content: flex-end;
}
.hero__label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.hero__icons {
  display: flex;
  gap: 0.3rem;
}
.hero__icons i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  transition: transform var(--dur-slow) var(--ease), background var(--dur) var(--ease);
}
.hero__icons i:hover {
  transform: rotate(-18deg) scale(1.08);
  background: rgba(255, 255, 255, 0.12);
}
.hero__icons svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero__square {
  display: grid;
  place-items: center;
  width: clamp(170px, 20vw, 300px);
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--ink);
  box-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.75);
  animation: square-in 1s var(--ease-out) 0.2s both;
}
@keyframes square-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.94);
  }
}
.creature {
  width: 70%;
  fill: none;
  stroke: var(--text);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: bob 5.5s ease-in-out 2.4s infinite;
}
/* the mascot draws itself in — only once JS has measured each line */
.js .creature.is-drawing path {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  animation: draw 1.9s var(--ease-out) forwards;
}
.js .creature.is-drawing path:nth-child(2) { animation-delay: 0.9s; }
.js .creature.is-drawing path:nth-child(3) { animation-delay: 1.1s; }
.js .creature.is-drawing path:nth-child(4) { animation-delay: 1.2s; }
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-5px) rotate(-2deg);
  }
}

.hero__foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 1rem;
  animation: fade-in 0.9s var(--ease-out) 0.6s both;
}
.hero__badge {
  justify-self: start;
  padding: 0.5rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.hero__cta {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  text-align: center;
}
.hero__cta p {
  max-width: 42ch;
  font-size: 0.95rem;
  color: rgba(244, 250, 247, 0.86);
}
.hero__down {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  background: rgba(6, 9, 10, 0.25);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.hero__down:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--ink);
}
.hero__down svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: nudge 2.4s var(--ease) infinite;
}
@keyframes nudge {
  0%,
  100% {
    transform: translateY(-2px);
  }
  50% {
    transform: translateY(3px);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ══════════ 2 · the promise — a list that fills as it passes ══════════ */

.promise {
  display: grid;
  grid-template-columns: minmax(240px, 23%) 1fr;
  gap: var(--frame);
  padding: 0 var(--frame) var(--frame);
}
.promise__aside {
  display: flex;
  flex-direction: column;
  gap: var(--frame);
}
.promise__intro p {
  padding: var(--pad);
  font-size: 0.95rem;
  color: var(--text-2);
}
/* the only sticky thing here: the picture that changes with the list */
.promise__visual {
  position: sticky;
  top: 88px;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1.08;
}
.pv {
  grid-area: 1 / 1;
  width: 56%;
  fill: none;
  stroke: var(--text);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.9) rotate(-4deg);
  transition: opacity 0.4s var(--ease), transform 0.7s var(--ease-out);
}
.pv.is-on {
  opacity: 1;
  transform: none;
}
.js .pv * {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.js .pv.is-on * {
  animation: draw 1.1s var(--ease-out) forwards;
}
.pv__hot {
  fill: rgba(69, 214, 159, 0.25);
  stroke: var(--sage);
}

.promise__list {
  padding: clamp(1.5rem, 4vw, 4rem) clamp(1.25rem, 5vw, 5.5rem) clamp(2.5rem, 7vw, 7rem);
}
.promise__list ol {
  display: grid;
  gap: clamp(2.2rem, 5vw, 4.8rem);
  padding-top: clamp(3rem, 7vw, 6rem);
}
.promise__list li {
  display: grid;
  grid-template-columns: 2.3rem 1fr;
  gap: clamp(1rem, 2.6vw, 2.6rem);
}
.num {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  margin-top: 0.55em;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-3);
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease),
    background var(--dur) var(--ease);
}
li.is-on .num {
  border-color: var(--sage);
  background: rgba(69, 214, 159, 0.12);
  color: var(--sage);
}
.fill {
  position: relative;
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 0.9rem + 4.4vw, 5.4rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--dim);
}
/* the same words, laid exactly over the dim ones and uncovered left to
   right as the line crosses the middle of the screen */
.fill::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--text);
  clip-path: inset(0 calc(100% - var(--f, 0%)) 0 0);
}
html:not(.js) .fill {
  color: var(--text);
}

/* ══════════ 3 · section title ══════════ */

.way {
  display: grid;
  grid-template-columns: minmax(240px, 23%) 1fr minmax(260px, 29%);
  grid-template-rows: auto auto;
  gap: var(--frame);
  padding: clamp(4rem, 9vw, 8rem) var(--frame) var(--seam);
}
.way__intro {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
}
.way__intro p {
  padding: var(--pad);
  color: var(--text-2);
}
.way__title {
  grid-column: 1 / 3;
  grid-row: 2;
  padding: clamp(1.25rem, 3vw, 2.6rem) clamp(1.25rem, 3vw, 2.6rem) clamp(1.5rem, 3.5vw, 3rem);
}
.way__title .mega {
  font-size: clamp(2.8rem, 0.8rem + 7.4vw, 8.6rem);
  padding-right: clamp(3rem, 6vw, 5rem);
}
.way__r {
  text-align: right;
}
.way__photo {
  grid-column: 3;
  grid-row: 1 / 3;
  min-height: 22rem;
  overflow: hidden;
  background: #07100d;
}
.way__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: scale 1.2s var(--ease-out);
}
.way__photo:hover img {
  scale: 1.04;
}

/* ══════════ pixel dissolve between blocks ══════════
   A canvas hanging just above a block, in the previous block's
   space. story.js fills it cell by cell as you approach. */
.pixels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--seam);
  transform: translateY(-100%);
  z-index: 5;
  pointer-events: none;
}

/* ══════════ 4 · the process — pinned card + a scene ══════════ */

.steps {
  position: relative;
  height: calc(300vh + var(--seam));
  padding-bottom: var(--seam);
}
.steps__sticky {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: minmax(300px, 33%) 1fr;
  align-items: start;
  gap: var(--frame);
  height: 100vh;
  padding: calc(var(--frame) + 66px) var(--frame) var(--frame);
}
.steps__stage {
  display: grid;
}
.step {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s var(--ease), transform 0.6s var(--ease-out);
  pointer-events: none;
}
.step.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.step__big {
  display: grid;
  grid-template-columns: auto 1fr;
  border-bottom: 1px solid var(--line);
}
.step__num {
  padding: 0.9rem 1.1rem 0.7rem;
  border-right: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 2rem + 4vw, 6.2rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--sage);
}
.step__title {
  align-self: center;
  padding: 1rem 1.2rem;
  font-size: clamp(1.8rem, 1rem + 2.4vw, 3.2rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.step__body {
  padding: 1.05rem 1.2rem 1.4rem;
}
.step__body p {
  margin-top: 0.5rem;
  font-size: 0.97rem;
  color: var(--text-2);
}
.scene {
  align-self: center;
  width: 100%;
  height: calc(100vh - 120px);
  overflow: visible;
}
.scene__mentors circle {
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
}
.scene__mentors .dot {
  fill: #fff;
  stroke: none;
}
.scene__mentors text {
  fill: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scene__student circle {
  fill: var(--sage);
}
.scene__halo {
  fill: rgba(69, 214, 159, 0.22) !important;
  animation: halo 2.6s var(--ease) infinite;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes halo {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.35;
  }
}
.scene__link {
  fill: none;
  stroke: var(--sage);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 6 8;
}
.scene__waves circle {
  fill: none;
  stroke: var(--sage);
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.scene.is-talking .scene__waves circle {
  animation: wave 2.4s var(--ease-out) infinite;
}
.scene.is-talking .scene__waves circle:nth-child(2) { animation-delay: 0.8s; }
.scene.is-talking .scene__waves circle:nth-child(3) { animation-delay: 1.6s; }
@keyframes wave {
  from {
    opacity: 0.8;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(4.5);
  }
}
.scene__bubble path {
  fill: var(--ink);
  stroke: #fff;
  stroke-width: 1.6;
}
.scene__bubble circle {
  fill: var(--sage);
}

/* ══════════ 5 · the line ══════════ */

.love {
  position: relative;
  padding: clamp(4rem, 9vw, 8rem) clamp(1.25rem, 5vw, 5rem) clamp(3rem, 6vw, 5rem);
}
.love__title {
  font-size: clamp(3rem, 0.8rem + 9vw, 10.5rem);
}
.love__title mark {
  padding: 0 0.1em;
  border-radius: 6px;
  background: linear-gradient(var(--sage), var(--sage)) no-repeat left / 0% 100%;
  color: var(--text);
  transition: background-size 0.9s var(--ease-out) 0.35s, color 0.5s var(--ease) 0.6s;
}
.love__title.is-in mark,
html:not(.js) .love__title mark {
  background-size: 100% 100%;
  color: var(--ink);
}
.love__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: clamp(2rem, 5vw, 4rem);
}
.love__lede {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 0.9rem + 1.4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--sage);
}
.love__card {
  width: min(100%, 22rem);
}
.love__card > p {
  padding: var(--pad) var(--pad) 0.4rem;
  font-size: 0.9rem;
  color: var(--text-2);
}
.love__card ul {
  display: grid;
  gap: 0.35rem;
  padding: 0 var(--pad) var(--pad);
}
.love__card li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.9rem;
}
.love__card li::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--sage);
}

/* ══════════ 6 · the bands ══════════ */

.bands {
  display: grid;
  padding: clamp(1rem, 3vw, 2rem) 0 var(--seam);
  overflow: hidden;
}
.band {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--ink-3);
}
.band + .band {
  margin-top: -1px;
}
.band--em {
  background: var(--em);
  border-color: rgba(255, 255, 255, 0.14);
}
.band__track {
  display: flex;
  width: max-content;
  animation: marquee 46s linear infinite;
}
.band--rev .band__track {
  animation-direction: reverse;
}
.band__track span {
  display: flex;
  align-items: center;
  padding-block: 0.7em;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 0.9rem + 1.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.band__track span::after {
  content: '';
  width: 0.28em;
  height: 0.28em;
  margin-inline: 1.1em;
  border-radius: 50%;
  background: var(--sage);
}
.band--em .band__track span::after {
  background: var(--ink);
}
.band__track em {
  margin-inline: 0.35em;
  font-style: normal;
  color: var(--sage);
}
.band--em .band__track em {
  color: var(--ink);
}
@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* Short screens — a small phone, or any phone turned sideways. The hero is
   sized by its content below 900px, and that content wanted ~630px, so the
   store buttons fell past the fold. Shrink each beat until the whole hero
   fits the screen; the top padding still clears the floating nav. */
@media (max-height: 640px) {
  .hero__frame {
    padding-top: clamp(3.4rem, 9vh, 4.6rem);
  }
  .hero__title {
    font-size: clamp(2.1rem, 0.6rem + 6vw, 8.6rem);
  }
  .hero__mid {
    padding-block: 0.35rem;
  }
  .hero__square {
    width: clamp(80px, 22vh, 200px);
  }
  .hero__foot {
    gap: 0.6rem;
  }
  .hero__frame {
    padding-bottom: 0.7rem;
  }
}

/* A phone held sideways: shrink the mascot again so the framed block still
   ends on screen rather than a few pixels past it. */
@media (max-height: 460px) {
  .hero__square {
    width: clamp(72px, 18vh, 140px);
  }
}

/* ══════════ narrow screens ══════════ */

@media (max-width: 900px) {
  .hero {
    height: auto;
    min-height: 100svh;
  }
  .hero__mid {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .hero__side {
    display: none;
  }
  .hero__foot {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .hero__badge,
  .hero__down {
    display: none;
  }
  .promise {
    grid-template-columns: 1fr;
  }
  .promise__visual {
    display: none;
  }
  .promise__list li {
    grid-template-columns: 1.9rem 1fr;
  }
  .num {
    width: 1.9rem;
    height: 1.9rem;
    margin-top: 0.3em;
  }
  .way {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }
  .way__intro,
  .way__title,
  .way__photo {
    grid-column: auto;
    grid-row: auto;
  }
  .way__photo {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .steps__sticky {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    padding-top: calc(var(--frame) + 58px);
  }
  .scene {
    height: 100%;
    min-height: 0;
  }
}

/* The pinned scenes need a tall enough window; on short phones, and for
   anyone who prefers less motion, they settle into plain stacked lists. */
@media (max-width: 900px) and (max-height: 640px), (prefers-reduced-motion: reduce) {
  .steps {
    height: auto;
    padding-bottom: var(--seam);
  }
  .steps__sticky {
    position: relative;
    height: auto;
    padding-top: 3rem;
  }
  .step {
    position: static;
    opacity: 1;
    transform: none;
    grid-area: auto;
  }
  .steps__stage {
    gap: 0;
  }
  .step + .step {
    border-top: 1px solid var(--line);
  }
  .scene {
    display: none;
  }
}
