.anki-page {
  background: #f2f4ef;
}

.anki-hero {
  position: relative;
  min-height: 82svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.75fr);
  align-items: center;
  gap: 56px;
  overflow: hidden;
  padding: 122px clamp(22px, 7vw, 96px) 66px;
  background: #101412;
  color: var(--paper-2);
  isolation: isolate;
}

.anki-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.7;
  background:
    linear-gradient(90deg, rgba(16, 20, 18, 0.98) 0%, rgba(16, 20, 18, 0.87) 47%, rgba(16, 20, 18, 0.44) 100%),
    linear-gradient(rgba(201, 255, 74, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 255, 74, 0.07) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
}

.anki-hero::after {
  position: absolute;
  right: -12vw;
  bottom: -46%;
  z-index: -1;
  width: 58vw;
  aspect-ratio: 1;
  border: 1px solid rgba(201, 255, 74, 0.2);
  border-radius: 50%;
  content: "";
}

.anki-hero__content {
  max-width: 750px;
  animation: hero-rise 700ms ease-out both;
}

.anki-hero h1 {
  max-width: 9ch;
  margin-bottom: 24px;
  font-size: clamp(4rem, 7vw, 7.3rem);
}

.anki-hero__copy {
  max-width: 42rem;
  margin-bottom: 30px;
  color: rgba(255, 250, 240, 0.86);
  font-size: 1.26rem;
  line-height: 1.56;
}

.purchase-boundary {
  max-width: 42rem;
  margin: 14px 0 0;
  color: rgba(255, 250, 240, 0.72);
  font-size: 0.78rem;
  line-height: 1.48;
}

.purchase-boundary a {
  color: var(--acid);
  text-underline-offset: 3px;
}

.deck-scene {
  position: relative;
  width: min(520px, 100%);
  min-height: 420px;
  justify-self: end;
  perspective: 1100px;
  animation: board-enter 850ms 120ms ease-out both;
}

.deck-card {
  position: absolute;
  right: 4%;
  width: min(410px, 86vw);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 250, 240, 0.22);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.35);
  transform-origin: 70% 100%;
}

.deck-card--back {
  top: 12px;
  background: #ff6b4a;
  color: #101412;
  transform: rotate(7deg) translateX(18px);
  animation: deck-breathe 5.8s ease-in-out infinite;
}

.deck-card--middle {
  top: 62px;
  background: #2364aa;
  color: var(--paper-2);
  transform: rotate(2deg);
  animation: deck-breathe 5.8s 180ms ease-in-out infinite;
}

.deck-card--front {
  top: 120px;
  background: var(--paper-2);
  color: var(--ink);
  transform: rotate(-2deg) translateX(-16px);
  animation: deck-breathe 5.8s 360ms ease-in-out infinite;
}

.deck-card > span,
.deck-card__top span,
.deck-card small {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.deck-card > strong {
  margin: auto 0 12px;
  font-size: 2rem;
}

.deck-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 52px;
  color: #59615a;
}

.deck-card__top svg {
  width: 20px;
}

.deck-card code {
  overflow-wrap: anywhere;
  border-left: 4px solid var(--coral);
  padding: 12px;
  background: #ebe7db;
  font-size: 0.88rem;
}

.deck-progress {
  height: 8px;
  margin: 22px 0 16px;
  overflow: hidden;
  border-radius: 8px;
  background: #d8ccb8;
}

.deck-progress span {
  display: block;
  width: 68%;
  height: 100%;
  background: var(--acid);
  animation: proof-progress 3.4s ease-in-out infinite alternate;
}

.anki-answer,
.anki-output,
.anki-boundary,
.anki-process {
  padding: 84px clamp(22px, 7vw, 96px);
}

.anki-answer {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(320px, 1fr);
  gap: 64px;
  background: #f2f4ef;
}

.anki-answer__body > p,
.anki-boundary p,
.anki-output p,
.anki-process p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.anki-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 32px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.anki-metrics span {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.anki-metrics span:last-child {
  border-right: 0;
}

.anki-metrics strong {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 1.42rem;
}

.anki-output {
  background: #e8eddf;
  border-top: 1px solid #cad1c2;
  border-bottom: 1px solid #cad1c2;
}

.anki-output__rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}

.anki-output__rail article {
  min-height: 260px;
  padding: 26px 22px;
  border-right: 1px solid #bfc7b7;
}

.anki-output__rail article:last-child {
  border-right: 0;
}

.anki-output__rail span {
  color: var(--coral);
  font-weight: 850;
}

.anki-output__rail h3 {
  margin-top: 72px;
  font-size: 1.46rem;
}

.anki-boundary {
  display: grid;
  grid-template-columns: minmax(280px, 0.76fr) minmax(0, 1.25fr);
  gap: 68px;
  background: var(--paper-2);
}

.anki-boundary__lead {
  position: sticky;
  top: 110px;
  align-self: start;
}

.anki-boundary__lists {
  border-top: 1px solid var(--ink);
}

.anki-boundary__lists > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.38fr) minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.anki-boundary__lists h3 {
  font-size: 1.26rem;
}

.anki-boundary__lists ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.anki-process {
  background: #101412;
  color: var(--paper-2);
}

.anki-process .section-label {
  color: var(--acid);
}

.anki-process ol {
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255, 250, 240, 0.28);
  list-style: none;
}

.anki-process li {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(255, 250, 240, 0.18);
}

.anki-process li > span {
  color: var(--acid);
  font-size: 1.4rem;
  font-weight: 850;
}

.anki-process li strong {
  font-size: 1.28rem;
}

.anki-process li p {
  max-width: 760px;
  margin: 8px 0 0;
  color: rgba(255, 250, 240, 0.7);
}

.anki-conversion {
  background: #ff6b4a;
  color: var(--ink);
}

.anki-conversion .section-label,
.anki-conversion p {
  color: var(--ink);
}

.anki-conversion .button--primary {
  background: var(--ink);
  color: var(--paper-2);
}

.anki-conversion .button--ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.conversion__terms {
  margin-top: 16px;
  font-size: 0.86rem;
}

.conversion__terms a {
  color: var(--ink);
  text-underline-offset: 3px;
}

@keyframes deck-breathe {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}

@keyframes proof-progress {
  from { width: 54%; }
  to { width: 92%; }
}

@media (max-width: 900px) {
  .anki-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 38px;
    padding-top: 116px;
  }

  .anki-hero h1 {
    font-size: 4.5rem;
  }

  .deck-scene {
    width: min(520px, 100%);
    min-height: 350px;
    justify-self: center;
  }

  .deck-card {
    right: 7%;
    min-height: 220px;
  }

  .deck-card--front {
    top: 92px;
  }

  .anki-answer,
  .anki-boundary {
    grid-template-columns: 1fr;
  }

  .anki-output__rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .anki-output__rail article:nth-child(2) {
    border-right: 0;
  }

  .anki-output__rail article:nth-child(-n + 2) {
    border-bottom: 1px solid #bfc7b7;
  }

  .anki-boundary__lead {
    position: static;
  }
}

@media (max-width: 640px) {
  .anki-hero {
    min-height: 790px;
    align-content: start;
    gap: 16px;
    padding-top: 92px;
    padding-bottom: 18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .anki-hero h1 {
    max-width: 100%;
    margin-bottom: 18px;
    font-size: 3.3rem;
    line-height: 0.92;
  }

  .anki-hero__copy {
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.48;
  }

  .anki-hero .button {
    min-height: 46px;
  }

  .anki-hero .hero__note {
    margin-top: 14px;
    font-size: 0.84rem;
    line-height: 1.42;
  }

  .purchase-boundary {
    margin-top: 8px;
    font-size: 0.7rem;
    line-height: 1.34;
  }

  .deck-scene {
    width: min(360px, 100%);
    min-height: 150px;
  }

  .deck-card {
    right: 8%;
    width: 84%;
    min-height: 108px;
    padding: 11px 14px;
  }

  .deck-card--back {
    top: 0;
  }

  .deck-card--middle {
    top: 18px;
  }

  .deck-card--front {
    top: 36px;
    transform: rotate(-1deg);
  }

  .deck-card__top {
    margin-bottom: 5px;
  }

  .deck-card > strong {
    margin-bottom: 4px;
    font-size: 1.08rem;
  }

  .deck-card code {
    padding: 5px;
    font-size: 0.64rem;
  }

  .deck-progress {
    height: 5px;
    margin: 6px 0;
  }

  .deck-card > span,
  .deck-card__top span,
  .deck-card small {
    font-size: 0.62rem;
  }

  .anki-metrics,
  .anki-output__rail {
    grid-template-columns: 1fr;
  }

  .anki-metrics span,
  .anki-output__rail article,
  .anki-output__rail article:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .anki-boundary__lists > div {
    grid-template-columns: 1fr;
  }

  .anki-process li {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deck-card,
  .deck-progress span {
    animation: none;
  }
}
