:root {
  --midnight: #1c2161;
  --midnight-dark: #080840;
  --primary: #3566c9;
  --primary-light: #618ad6;
  --highlight: #fab95b;
  --neutral: #e8e2db;
  --shadowdark: #08083f;
  --artboard: 1280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;

  @media (prefers-reduced-motion: reduce) {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--midnight);
  color: var(--neutral);
  font-family: "Edu SA Beginner", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;

  &:hover {
    color: var(--highlight);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.artboard {
  position: relative;
  width: min(var(--artboard), 100%);
  margin: 0 auto;
  overflow: visible;

  @media (max-width: 1279px) {
    width: 100%;
    padding: 0 clamp(16px, 5vw, 32px) 48px;
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 51px;
  padding: 4px 22px;
  border-radius: 8px;
  background: var(--neutral);
  color: var(--primary);
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 22px;
  line-height: 22px;
  opacity: 0;
  transform: scale(0.45);
  transform-origin: center center;

  &.is-visible {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.14s ease-out, transform 0.4s cubic-bezier(0.34, 1.55, 0.64, 1);
  }

  &.is-swapping {
    transition: transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
  }

  @media (max-width: 1279px) {
    font-size: 22px;
    min-height: 40px;
    padding: 1rem;
    flex: 0 0 auto;
  }

  @media (prefers-reduced-motion: reduce) {
    opacity: var(--word-opacity, 1) !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

.chip--paren {
  background: var(--primary);
  color: var(--neutral);
}

.chip--period {
  background: transparent;
  box-shadow: none;
  color: #fff;
  min-height: auto;
  padding: 0;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  background: var(--highlight);
  color: var(--shadowdark);
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 18px;
  line-height: 16px;
  box-shadow: 0 5px 0 #c48a3a;
  transform: translateY(0);
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;

  &:hover {
    color: var(--shadowdark);
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #c48a3a;
  }

  &:active {
    color: var(--shadowdark);
    filter: brightness(0.96);
    transform: translateY(4px);
    box-shadow: 0 1px 0 #c48a3a;
  }

  &:focus-visible {
    outline: 2px solid var(--neutral);
    outline-offset: 3px;
  }

  @media (prefers-reduced-motion: reduce) {
    &,
    &:hover,
    &:active {
      transform: none;
      transition: none;
      filter: none;
    }
  }
}

.sticky-cta {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) clamp(16px, 5vw, 32px) 12px;
  background: color-mix(in srgb, var(--midnight) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s ease, opacity 0.25s ease;

  &.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  @media (prefers-reduced-motion: reduce) {
    transition: none;
  }
}

header {
  @media (max-width: 1279px) {
    padding-top: clamp(20px, 5vw, 32px);
  }
}

.logo-lockup {
  position: absolute;
  left: 157px;
  top: 59px;
  display: flex;
  align-items: center;
  z-index: 3;

  @media (max-width: 1279px) {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    margin-bottom: 56px;
  }
}

.logo-full {
  width: 12rem;
  height: 4rem;
  object-fit: contain;
}

.hero {
  position: relative;
  height: 780px;
  overflow: visible;

  @media (max-width: 1279px) {
    height: auto;
    padding: 24px 0 56px;
  }
}

.hero-chips {
  position: absolute;
  left: 162px;
  top: 283px;
  width: 656px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 15px;
  z-index: 2;

  @media (max-width: 1279px) {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    height: auto;
    gap: 12px 8px;
    margin-bottom: 22px;
  }
}

.hero-cta {
  position: absolute;
  left: 162px;
  top: 461px;
  margin: 0;
  z-index: 2;

  @media (max-width: 1279px) {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    margin: 0;
  }
}

.hero-art__sleeper,
.hero-art__dream {
  position: absolute;

  img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;

    &.is-active {
      opacity: 1;
    }
  }

  @media (max-width: 1279px) {
    display: none;
  }
}

.hero-art__sleeper {
  left: 644px;
  top: 490px;
  width: 422px;
  height: 314px;
  z-index: 1;
}

.hero-art__dream {
  left: 801px;
  top: -122px;
  width: 302px;
  height: 595px;
  z-index: 0;
  pointer-events: none;
}

.stage-label {
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 16px;
  line-height: 16px;
  text-transform: uppercase;
  margin: 0 0 13px;
  font-weight: 400;
}

.stage-title {
  margin: 0;
  color: var(--primary);
  font-size: 52px;
  line-height: 48px;
  letter-spacing: -0.02em;
  font-weight: 700;

  @media (max-width: 1279px) {
    font-size: clamp(36px, 10vw, 44px);
    line-height: 1.05;
  }
}

.stage-subtitle {
  margin: 9px 0 0;
  color: var(--highlight);
  font-size: 22px;
  line-height: 48px;
  letter-spacing: -0.02em;
  font-weight: 700;

  @media (max-width: 1279px) {
    margin-top: 12px;
    line-height: 1.3;
  }
}

.band {
  position: relative;
  overflow: visible;

  @media (max-width: 1279px) {
    display: flex;
    flex-direction: column;
    gap: 28px;
    height: auto;
    padding: 56px 0;
  }
}

.band-one {
  height: 720px;

  .stage-copy {
    position: absolute;
    left: 161px;
    top: 198px;
    width: 428px;
    z-index: 2;

    @media (max-width: 1279px) {
      position: relative;
      inset: auto;
      width: auto;
      height: auto;
      order: 1;
      margin-top: 0;
    }
  }

  @media (max-width: 1279px) {
    height: auto;
  }
}

.stage-one-visual {
  position: absolute;
  left: 658px;
  top: 82px;
  width: 372px;
  height: 472px;
  z-index: 2;

  @media (max-width: 1279px) {
    position: relative;
    inset: auto;
    align-self: center;
    order: 2;
    width: min(372px, 100%);
    max-width: 372px;
    height: auto;
    margin: 0;
  }

  @media (max-width: 480px) {
    width: 100%;
  }
}

.clouds-left,
.clouds-right {
  position: absolute;
  pointer-events: none;

  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  @media (max-width: 1279px) {
    display: none;
  }
}

.clouds-left {
  left: -13px;
  top: 37px;
  width: 119px;
  height: 177px;
}

.clouds-right {
  left: 1124px;
  top: -10px;
  width: 179px;
  height: 200px;
}

.connector-1,
.connector-2 {
  position: absolute;
  pointer-events: none;
  z-index: 0;

  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  @media (max-width: 1279px) {
    display: none;
  }
}

.connector-1 {
  left: 189px;
  top: 364px;
  width: 471px;
  height: 453px;
}

.connector-2 {
  left: 167px;
  top: 250px;
  width: 504px;
  height: 593px;
}

.word-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 22px;
  line-height: 40px;
  letter-spacing: 0.02em;
  color: var(--primary);

  li {
    --word-opacity: 1;
    opacity: 0;
    transform-origin: left bottom;

    &:nth-child(1) { --word-opacity: 1; }
    &:nth-child(2) { --word-opacity: 0.82; }
    &:nth-child(3) { --word-opacity: 0.68; }
    &:nth-child(4) { --word-opacity: 0.54; }
    &:nth-child(5) { --word-opacity: 0.4; }
    &:nth-child(6) { --word-opacity: 0.28; }
    &:nth-child(7) { --word-opacity: 0.16; }

    &.is-visible {
      opacity: var(--word-opacity);
    }

    &.is-entering {
      animation: word-insert 0.3s ease-out both;
    }

    @media (prefers-reduced-motion: reduce) {
      opacity: var(--word-opacity, 1) !important;
      transform: none !important;
      transition: none !important;
      animation: none !important;
    }
  }

  @media (max-width: 480px) {
    font-size: 19px;
    line-height: 34px;
  }
}

@keyframes word-insert {
  from {
    opacity: 0;
    transform: translateY(48px) scale(0.9);
  }

  to {
    opacity: var(--word-opacity);
    transform: translateY(0) scale(1);
  }
}

.spell-slots {
  display: flex;
  gap: 2px;
  height: 42px;
  margin: 0 0 10px;
  pointer-events: none;

  @media (prefers-reduced-motion: reduce) {
    display: none;
  }
}

.spell-slot {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 22px;
  line-height: 1;
  text-transform: lowercase;
  box-shadow: 0 2px 0 var(--shadowdark);
  animation: slot-land 0.12s ease-out;

  @media (max-width: 480px) {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

@keyframes slot-land {
  from {
    transform: scale(0.86);
    opacity: 0.6;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(7, 42px);
  gap: 11px;

  @media (max-width: 1279px) {
    grid-template-columns: repeat(7, minmax(0, 42px));
    gap: clamp(3px, 2vw, 11px);
  }
}

.tile-grid--second {
  margin-top: 8px;
  grid-template-columns: repeat(6, 42px);
  padding-left: 43px;

  @media (max-width: 1279px) {
    grid-template-columns: repeat(6, minmax(0, 42px));
    padding-left: 11.5%;
  }
}

.tile {
  position: relative;
  width: 42px;
  height: 59px;

  @media (max-width: 1279px) {
    width: 100%;
    height: auto;
    aspect-ratio: 42 / 59;
  }
}

.tile-face {
  position: absolute;
  inset: 0 0 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 18px;
  text-transform: lowercase;
  box-shadow: 0 10px 0 var(--shadowdark);
  transition: transform 0.1s ease, box-shadow 0.1s ease;

  @media (max-width: 1279px) {
    bottom: 28.8%;
    border-radius: clamp(8px, 3vw, 12px);
  }

  @media (max-width: 480px) {
    font-size: 16px;
  }

  @media (prefers-reduced-motion: reduce) {
    transition: none;
  }
}

.tile.is-pressed .tile-face {
  transform: translateY(8px);
  box-shadow: 0 2px 0 var(--shadowdark);
}

.tile--ghost.is-pressed .tile-face,
.tile--backspace.is-pressed .tile-face {
  transform: translateY(3px);
  box-shadow: none;
}

.tile--ghost .tile-face {
  background: transparent;
  box-shadow: none;
  border: 1px solid rgba(53, 102, 201, 0.2);
  color: rgba(53, 102, 201, 0.5);
}

.tile--backspace .tile-face {
  background: rgba(53, 102, 201, 0.1);
  box-shadow: none;

  img {
    width: 22px;
    height: auto;
  }
}

.tile-dots {
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: 0;
  height: 6px;
  display: flex;
  justify-content: center;
  gap: 3px;

  span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-light);
  }
}

.band-two {
  height: 620px;

  .stage-copy {
    position: absolute;
    left: 650px;
    top: 86px;
    width: 428px;
    z-index: 2;

    @media (max-width: 1279px) {
      position: relative;
      inset: auto;
      width: auto;
      height: auto;
      order: 1;
      margin-top: 0;
    }
  }

  @media (max-width: 1279px) {
    height: auto;
  }
}

.award {
  position: absolute;
  left: -131px;
  top: 0;
  width: 630px;
  height: 245px;
  z-index: 2;

  img {
    position: absolute;
    display: block;
    max-width: none;
  }

  &.is-in {
    .award__place {
      animation: place-stamp 0.62s cubic-bezier(0.18, 1.4, 0.32, 1) both;
    }

    .award__hoof {
      animation:
        hoof-slide 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.72s both,
        award-breathe 2s ease-in-out 1.52s infinite alternate;
    }

    .award__book {
      animation:
        book-slide 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.72s both,
        award-breathe 2s ease-in-out 1.52s infinite alternate;
    }
  }

  @media (max-width: 1279px) {
    position: relative;
    inset: auto;
    align-self: flex-start;
    order: 2;
    width: min(630px, calc(100% + clamp(16px, 5vw, 32px) + clamp(16px, 5vw, 32px)));
    height: auto;
    aspect-ratio: 630 / 245;
    margin-inline: calc(0px - clamp(16px, 10vw, 64px));
    transform: translateX(calc(0px - clamp(32px, 10vw, 48px)));

    .award__hoof {
      left: 4px;
      top: 40%;
      width: 60%;
      height: 63.27%;
    }

    .award__book {
      left: 52.7%;
      top: 25.31%;
      width: 17.3%;
      height: 59.59%;
    }

    .award__place {
      left: 61.43%;
      top: auto;
      bottom: 0;
      width: 38.57%;
      height: 100%;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    &.is-in .award__place,
    &.is-in .award__hoof,
    &.is-in .award__book {
      animation: none;
      opacity: 1;
    }
  }
}

.award__hoof {
  left: 12px;
  top: 128px;
  width: 378px;
  height: 155px;
  z-index: 4;
  opacity: 0;
}

.award__book {
  left: 332px;
  top: 62px;
  width: 109px;
  height: 146px;
  transform: rotate(-6.07deg);
  z-index: 3;
  opacity: 0;
}

.award__place {
  left: 387px;
  top: auto;
  bottom: 0;
  width: 243px;
  height: 245px;
  z-index: 1;
  opacity: 0;
  transform-origin: 50% 58%;
}

@keyframes place-stamp {
  0% {
    opacity: 0;
    transform: scale(1.85) rotate(-16deg);
  }

  58% {
    opacity: 1;
    transform: scale(0.9) rotate(5deg);
  }

  78% {
    transform: scale(1.07) rotate(-2deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes hoof-slide {
  from {
    transform: translateX(-80px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes book-slide {
  from {
    transform: translateX(-80px) rotate(-6.07deg);
    opacity: 0;
  }

  to {
    transform: translateX(0) rotate(-6.07deg);
    opacity: 1;
  }
}

@keyframes award-breathe {
  from {
    translate: 0 0;
  }

  to {
    translate: 0 8px;
  }
}

.band-three {
  display: flex;
  align-items: flex-start;
  height: 620px;
  padding-left: 162px;
  gap: 238px;

  .stage-copy {
    flex: 0 0 224px;
    width: 224px;
    margin-top: 178px;

    @media (max-width: 1279px) {
      flex: none;
      width: auto;
      margin-top: 0;
      order: 1;
    }
  }

  @media (max-width: 1279px) {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 56px 0;
    gap: 28px;
  }
}

.dream-stage {
  flex: 0 0 auto;
  width: min(360px, 100%);
  z-index: 2;

  @media (min-width: 1280px) {
    width: min(640px, 100%);
  }

  @media (max-width: 1279px) {
    align-self: stretch;
    order: 2;
    width: 100%;
  }
}

.dream-card {
  --doodle-fill: #173d8c;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  
  @media (min-width: 1280px) {
    max-width: 100%;
  }
}

.dream-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;

  @media (min-width: 1280px) {
    padding: 1.5rem;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
  }
}

.dream-card__quote {
  min-width: 0;
  min-height: 4rem;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--neutral);
  width: 50%;

  @media (max-width: 1280px) {
    font-size: 1.25rem;
    width: 100%;
  }
}

.stage-footnote {
  margin: 12px 0 0;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.4;
  color: var(--primary-light);
}

.dream-carousel {
  --carousel-dwell: 3.2s;
  --carousel-slide: 0.72s;
  --carousel-spring: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 1rem;

  @media (min-width: 1280px) {
    width: 50%;
    height: 50%;
  }

  img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: translateX(32%) rotate(6deg);
    transform-origin: 42% 38%;
    z-index: 0;
    pointer-events: none;

    &.is-active {
      opacity: 1;
      transform: none;
      z-index: 1;
    }

    &.is-entering {
      z-index: 2;
      animation: dream-slide-in var(--carousel-slide) var(--carousel-spring) both;
    }

    &.is-leaving {
      z-index: 3;
      opacity: 1;
      animation: dream-slide-out var(--carousel-slide) var(--carousel-spring) both;
    }

    @media (prefers-reduced-motion: reduce) {
      animation: none !important;
      transform: none !important;
      transition: none !important;
    }
  }

  &.is-playing img.is-settled {
    animation: dream-ken var(--carousel-dwell) ease-out forwards;
  }

  &.is-paused img.is-settled {
    animation-play-state: paused;
  }
}

@keyframes dream-slide-in {
  from {
    opacity: 0.4;
    transform: translateX(38%) rotate(7deg) scale(1.05);
  }

  to {
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
  }
}

@keyframes dream-slide-out {
  from {
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(-44%) rotate(-8deg) scale(0.94);
  }
}

@keyframes dream-ken {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.07) translate(-1.2%, -0.8%);
  }
}

.features {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  padding: 0 162px 80px;

  @media (max-width: 1279px) {
    height: auto;
    gap: 28px;
    padding: 24px 0 64px;
  }
}

.features__intro {
  max-width: 720px;

  .stage-subtitle {
    line-height: 1.35;
  }
}

.features__cards {
  display: flex;
  align-items: stretch;
  gap: 24px;

  @media (max-width: 1279px) {
    flex-direction: column;
    gap: 20px;
  }
}

.doodle-card {
  position: relative;
  isolation: isolate;
  flex: 1 1 0;
  min-width: 0;
}

.doodle-card__frame {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;

  path {
    fill: var(--doodle-fill, var(--midnight-dark));
    stroke: none;
  }
}

.doodle-card__body {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 28px;

  @media (max-width: 1279px) {
    padding: 20px 22px;
  }
}

.doodle-card__icon {
  flex: 0 0 auto;
  width: 40px;
  height: auto;

  @media (max-width: 480px) {
    width: 32px;
  }
}

.doodle-card__copy {
  min-width: 0;
}

.doodle-card .stage-label {
  font-size: 12px;
  line-height: 1.2;
  margin: 0 0 6px;
}

.feature-card__title {
  margin: 0;
  color: var(--primary);
  font-size: 1.5rem;
  line-height: 1.45;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.site-footer {
  overflow: visible;

  @media (max-width: 1279px) {
    height: auto;
    padding-top: 0;
  }
}

.site-footer__hills {
  width: 100%;
  pointer-events: none;

  img {
    width: 100%;
    height: auto;
    display: block;
  }

  @media (max-width: 1279px) {
    position: relative;
    inset: auto;
    width: calc(100% + clamp(16px, 5vw, 32px) + clamp(16px, 5vw, 32px));
    height: auto;
    margin-inline: calc(0px - clamp(16px, 5vw, 32px));
    margin-bottom: 24px;
  }
}

.site-footer__links {
  margin-block: 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: "Martian Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 16px;
  z-index: 1;

  @media (max-width: 1279px) {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    flex-wrap: wrap;
    row-gap: 16px;
  }

  @media (max-width: 480px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }
}

.site-footer__copy {
  font-size: 11px;
  line-height: 14px;
  color: var(--primary);
}
