/* Tokens */
:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: hsl(0 0% 7%);
  --fg-muted: hsl(0 0% 40%);
  --surface-6: rgb(0 0 0 / 0.06);
  --surface-8: rgb(0 0 0 / 0.08);
  --surface-10: rgb(0 0 0 / 0.1);
  --border-8: rgb(0 0 0 / 0.08);
  --border-16: rgb(0 0 0 / 0.16);
  --accent: hsl(216 100% 50%);
  --accent-hover: hsl(212 100% 50%);
  --accent-soft: hsl(216 100% 50% / 0.1);
  --on-accent: #fff;
  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 32px -12px rgb(0 0 0 / 0.14);
  --font-sans: "Inter Tight", system-ui, -apple-system, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --text-hero: clamp(2.75rem, 1.6rem + 5vw, 6rem);
  --text-h2: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
  --text-body: 1rem;
  --text-small: 0.875rem;
  --text-tiny: 0.6875rem;
  --track-hero: -0.032em;
  --track-h2: -0.6px;
  --track-small: 0.2px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --gutter: 1rem;
  --container: 72rem;
  --space-section: clamp(4rem, 8vw, 8rem);
  --nav-height: 4rem;
  --touch: 2.75rem;
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(0 0% 4%);
    --fg: hsl(0 0% 96%);
    --fg-muted: hsl(0 0% 65%);
    --surface-6: rgb(255 255 255 / 0.06);
    --surface-8: rgb(255 255 255 / 0.08);
    --surface-10: rgb(255 255 255 / 0.1);
    --border-8: rgb(255 255 255 / 0.08);
    --border-16: rgb(255 255 255 / 0.16);
    --accent-soft: hsl(216 100% 50% / 0.18);
    --shadow-card: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

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

html {
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font: 400 var(--text-body) / 1.5 var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked {
  overflow: hidden;
}

h1,
h2,
h3,
p,
ul,
ol,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2 {
  font-weight: 600;
  line-height: 1.05;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-hero);
  letter-spacing: var(--track-hero);
}

h2 {
  font-size: var(--text-h2);
  letter-spacing: var(--track-h2);
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Utilities */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.06em;
  letter-spacing: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding-inline: 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.pill:active {
  transform: scale(0.98);
}

.pill--primary {
  background: var(--fg);
  color: var(--bg);
}

.pill--primary:hover {
  background: color-mix(in srgb, var(--fg) 84%, var(--bg));
}

.pill--primary:focus-visible {
  box-shadow: 0 0 0 4px var(--bg);
  outline-offset: 4px;
}

.pill--secondary {
  background: var(--surface-6);
  color: var(--fg);
}

.pill--secondary:hover {
  background: var(--surface-10);
}

.section-title {
  max-width: 44rem;
  margin: 0 auto 3rem;
  text-align: center;
}

@media (min-width: 48rem) {
  :root {
    --gutter: 1.5rem;
  }
}

@media (min-width: 64rem) {
  :root {
    --gutter: 2rem;
  }
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-8);
}

.nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav__brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.nav__toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: var(--touch);
  height: var(--touch);
  margin-right: -0.625rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
}

.nav__toggle-line {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 2px;
  background: var(--fg);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.nav[data-open="true"] .nav__toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav[data-open="true"] .nav__toggle-line:nth-child(2) {
  opacity: 0;
}

.nav[data-open="true"] .nav__toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__menu {
  display: none;
}

.nav[data-open="true"] .nav__menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: block;
  max-height: calc(100dvh - var(--nav-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border-8);
}

.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  font-weight: 500;
  text-decoration: none;
}

.nav__links .nav__link {
  display: flex;
}

.nav__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (min-width: 64rem) {
  .nav__toggle {
    display: none;
  }

  .nav__menu,
  .nav[data-open="true"] .nav__menu {
    position: static;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    margin-left: 2.5rem;
    padding: 0;
    background: none;
    border: 0;
  }

  .nav__links {
    display: flex;
    gap: 0.25rem;
  }

  .nav__links .nav__link {
    display: inline-flex;
  }

  .nav__link {
    padding-inline: 0.75rem;
    font-size: var(--text-small);
    color: var(--fg-muted);
    transition: color 0.15s ease;
  }

  .nav__link:hover {
    color: var(--fg);
  }

  .nav__actions {
    flex-direction: row;
    align-items: center;
    margin-top: 0;
  }

  .nav__actions .pill {
    min-height: 2.5rem;
    font-size: var(--text-small);
  }
}

/* Hero */
.hero {
  padding-block: var(--space-section) calc(var(--space-section) * 0.75);
  text-align: center;
}

.hero__title {
  max-width: 56rem;
  margin-inline: auto;
}

.hero__sub {
  max-width: 36rem;
  margin: 1.5rem auto 0;
  font-size: 1.125rem;
  color: var(--fg-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero__note {
  margin-top: 1rem;
  font-size: var(--text-small);
  letter-spacing: var(--track-small);
  color: var(--fg-muted);
}

@media (min-width: 48rem) {
  .hero__sub {
    font-size: 1.25rem;
  }
}

/* Marquee */
.marquee {
  display: grid;
  gap: 1rem;
  padding-block: 1rem 2rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 50s linear infinite;
}

.marquee__row--reverse .marquee__track {
  animation-direction: reverse;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

/* Each group ends with the same space as the gap, so -50% lands on an exact copy. */
.marquee__group {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-right: 1rem;
}

@media (max-width: 47.999rem) {
  .marquee__track {
    zoom: 0.8;
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* App screen cards */
.card {
  flex: none;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card--phone {
  width: 14rem;
  aspect-ratio: 9 / 18;
}

.card--wide {
  width: 22rem;
  aspect-ratio: 16 / 10;
}

.card--panel {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  padding: 1rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

.card--panel .screen {
  gap: 1rem;
  padding: 1.25rem;
  font-size: 0.875rem;
}

.screen__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 0.25rem;
  font-size: var(--text-tiny);
  font-weight: 600;
}

.screen__battery {
  position: relative;
  width: 1.25rem;
  height: 0.625rem;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.screen__battery::after {
  content: "";
  position: absolute;
  inset: 1px 4px 1px 1px;
  border-radius: 1px;
  background: currentColor;
}

.screen__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.screen__title {
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card--panel .screen__title {
  font-size: 1.125rem;
}

.screen__actions {
  display: flex;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--surface-6);
  color: var(--fg-muted);
  font-size: var(--text-tiny);
  font-weight: 500;
  white-space: nowrap;
}

.chip--accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip--large {
  padding: 0.5rem 1rem;
  font-size: var(--text-small);
  color: var(--fg);
}

.fake-btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--surface-6);
  font-weight: 600;
}

.fake-btn--dark {
  background: var(--fg);
  color: var(--bg);
}

.fake-btn--wide {
  flex: none;
  margin-top: auto;
}

.meter {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-8);
}

.meter__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.meter__fill--20 {
  width: 20%;
}

.meter__fill--40 {
  width: 40%;
}

.meter__fill--60 {
  width: 60%;
}

.meter__fill--80 {
  width: 80%;
}

.flashcard {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 1rem;
  border: 1px solid var(--border-8);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--surface-6), transparent);
  text-align: center;
}

.flashcard--back {
  background: var(--accent-soft);
  border-color: transparent;
}

.flashcard__label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.flashcard__term {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.75rem;
  line-height: 1.1;
}

.flashcard__hint {
  color: var(--fg-muted);
}

.stack {
  position: relative;
  display: flex;
  padding-bottom: 0.75rem;
}

.stack::before,
.stack::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 2rem;
  border: 1px solid var(--border-8);
  border-radius: var(--radius-md);
  background: var(--bg);
  transform: translateX(-50%);
}

.stack::before {
  width: 88%;
}

.stack::after {
  bottom: 0.375rem;
  width: 94%;
}

.flashcard--large {
  position: relative;
  z-index: 1;
  min-height: 11rem;
  background: var(--bg);
}

.flashcard--large .flashcard__term {
  font-size: 2.5rem;
}

.quiz__question {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.card--panel .quiz__question {
  font-size: 1.0625rem;
}

.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.quiz__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--border-8);
  border-radius: 10px;
}

.quiz__option.is-correct {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.quiz__key {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--surface-6);
  font-size: 0.625rem;
  font-weight: 600;
}

.is-correct .quiz__key {
  background: var(--accent);
  color: var(--on-accent);
}

.quiz__feedback {
  margin-top: auto;
  padding: 0.5rem 0.625rem;
  border-radius: 10px;
  background: var(--surface-6);
  color: var(--fg-muted);
}

.chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.5rem;
}

.bubble {
  max-width: 88%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) 4px;
  background: var(--surface-6);
}

.bubble--me {
  align-self: flex-end;
  border-radius: var(--radius-md) var(--radius-md) 4px var(--radius-md);
  background: var(--fg);
  color: var(--bg);
}

.bubble--check {
  background: var(--accent-soft);
}

.composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding: 0.375rem 0.375rem 0.375rem 0.75rem;
  border: 1px solid var(--border-16);
  border-radius: var(--radius-pill);
  color: var(--fg-muted);
}

.composer::after {
  content: "";
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 12V4M4.5 7.5L8 4l3.5 3.5'/%3E%3C/svg%3E")
    center / 0.875rem no-repeat;
}

.diagram {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--border-16);
  border-radius: var(--radius-md);
}

.diagram__node {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  white-space: nowrap;
}

.diagram__node--muted {
  background: var(--surface-8);
  color: var(--fg);
}

.diagram__arrow {
  flex: 1;
  padding-bottom: 0.25rem;
  border-bottom: 1.5px solid var(--border-16);
  color: var(--fg-muted);
  font-size: var(--text-tiny);
  text-align: center;
}

.days {
  display: flex;
  gap: 0.375rem;
}

.day {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--surface-6);
  font-size: var(--text-tiny);
  font-weight: 600;
}

.day--done {
  background: var(--fg);
  color: var(--bg);
}

.day--today {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--accent);
  color: var(--accent);
}

.checklist,
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.checklist__item,
.steps-list__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checklist__item::before,
.steps-list__item::before {
  content: "";
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  border: 1.5px solid var(--border-16);
  border-radius: 4px;
}

.checklist__item.is-checked,
.steps-list__item.is-checked {
  color: var(--fg-muted);
  text-decoration: line-through;
}

.checklist__item.is-checked::before,
.steps-list__item.is-checked::before {
  border-color: var(--accent);
  background: var(--accent) var(--icon-check) center / 0.625rem no-repeat;
}

.steps-list__item.is-active {
  padding: 0.5rem 0.625rem;
  border-radius: 10px;
  background: var(--accent-soft);
  font-weight: 600;
}

.steps-list__item.is-active::before {
  border-color: var(--accent);
}

.hint {
  padding: 0.625rem 0.75rem;
  border-radius: 10px;
  background: var(--surface-6);
}

.hint b {
  margin-right: 0.375rem;
  color: var(--accent);
}

.bars {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 0.5rem;
  min-height: 3.5rem;
}

.bar {
  flex: 1;
  border-radius: 4px;
  background: var(--accent);
}

.bar:nth-child(1) {
  height: 40%;
}

.bar:nth-child(2) {
  height: 65%;
}

.bar:nth-child(3) {
  height: 50%;
}

.bar:nth-child(4) {
  height: 80%;
}

.bar:nth-child(5) {
  height: 100%;
}

.bar:nth-child(6) {
  height: 70%;
}

.bar--muted:nth-child(7) {
  height: 18%;
  background: var(--surface-10);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  color: var(--fg-muted);
  font-size: var(--text-tiny);
}

.stat__value {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.notes__heading {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1.1;
}

.notes__points {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-left: 1rem;
  list-style: disc;
  color: var(--fg-muted);
}

.notes__points li::marker {
  color: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: auto;
}

.mastery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mastery__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0.75rem;
}

/* Subjects */
.subjects {
  padding-block: calc(var(--space-section) / 2);
}

.subjects__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
  max-width: 48rem;
  margin-inline: auto;
  color: var(--fg-muted);
}

.subjects__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Story */
.story {
  padding-block: calc(var(--space-section) / 2);
  text-align: center;
}

.story__title {
  max-width: 50rem;
  margin-inline: auto;
}

.story__text {
  max-width: 36rem;
  margin: 1.5rem auto 0;
  font-size: 1.125rem;
  color: var(--fg-muted);
}

/* Modes and tabs */
.modes {
  padding-block: calc(var(--space-section) / 2);
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-inline: calc(var(--gutter) * -1);
  padding: 0.25rem var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  min-height: var(--touch);
  padding-inline: 1.125rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-6);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.tab:hover {
  background: var(--surface-10);
}

.tab[aria-selected="true"] {
  background: var(--fg);
  color: var(--bg);
}

.panel {
  margin-top: 2rem;
}

.panel__caption {
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--fg-muted);
}

@media (min-width: 48rem) {
  .tabs {
    justify-content: center;
  }
}

/* Demo */
.demo {
  padding-block: calc(var(--space-section) / 2);
}

.demo__box {
  max-width: 44rem;
  margin-inline: auto;
  padding: 1.5rem;
  border: 1px solid var(--border-16);
  border-radius: var(--radius-lg);
  background: var(--bg);
  box-shadow: var(--shadow-card);
}

.demo__prompt {
  min-height: 3.5em;
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.demo__caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.demo__caret.is-hidden {
  display: none;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.demo__steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-8);
}

.demo__step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.demo__step::before {
  content: "";
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border: 1.5px solid var(--border-16);
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.demo__step.is-done {
  opacity: 1;
}

.demo__step.is-done::before {
  border-color: var(--accent);
  background: var(--accent) var(--icon-check) center / 0.875rem no-repeat;
}

.sources {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.sources__title {
  font-size: var(--text-small);
  letter-spacing: var(--track-small);
  color: var(--fg-muted);
}

.sources__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

@media (min-width: 48rem) {
  .demo__box {
    padding: 2.5rem;
  }

  .demo__prompt {
    font-size: 1.625rem;
  }
}

/* Uses and plans */
.uses,
.plans {
  padding-block: calc(var(--space-section) / 2);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface-6);
}

.tile__title {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.tile__text {
  color: var(--fg-muted);
}

.plan__price {
  font-size: var(--text-small);
  letter-spacing: var(--track-small);
  color: var(--fg-muted);
}

.plan__features {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-block: 0.75rem 1.5rem;
}

.plan__features li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.plan__features li::before {
  content: "";
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.1875rem;
  border-radius: 50%;
  background: var(--fg) var(--icon-check) center / 0.6875rem no-repeat;
}

.plan .pill {
  align-self: flex-start;
  margin-top: auto;
}

.plan .pill--secondary {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border-16);
}

.plan .pill--secondary:hover {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}

@media (min-width: 48rem) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tile {
    padding: 2rem;
  }
}

/* Principle */
.principle {
  padding-block: var(--space-section);
  text-align: center;
}

.principle__quote {
  max-width: 48rem;
  margin-inline: auto;
}

.principle__quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: calc(var(--text-h2) * 1.15);
  line-height: 1.1;
  text-wrap: balance;
}

.principle__caption {
  margin-top: 1.5rem;
  font-size: var(--text-small);
  letter-spacing: var(--track-small);
  color: var(--fg-muted);
}

/* Promo */
.promo {
  padding-block: calc(var(--space-section) / 2);
}

.promo__card {
  padding: clamp(3rem, 7vw, 6rem) 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--fg);
  color: var(--bg);
  text-align: center;
}

.promo__title {
  max-width: 44rem;
  margin-inline: auto;
}

.promo__text {
  max-width: 32rem;
  margin: 1.25rem auto 0;
  font-size: 1.125rem;
  color: color-mix(in srgb, var(--bg) 72%, var(--fg));
}

.promo__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  margin-top: 1.25rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.promo__link:focus-visible {
  outline-color: var(--bg);
}

/* CTA */
.cta {
  padding-block: var(--space-section);
  text-align: center;
}

.cta__title {
  max-width: 52rem;
  margin-inline: auto;
  font-size: clamp(2.25rem, 1.4rem + 4.4vw, 5rem);
  letter-spacing: var(--track-hero);
}

/* Footer */
.footer {
  padding-block: 4rem 2rem;
  border-top: 1px solid var(--border-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 1rem;
}

.footer__brand {
  grid-column: 1 / -1;
}

.footer__heading {
  margin-bottom: 0.5rem;
  font-size: var(--text-small);
  font-weight: 600;
}

.footer__links a,
.footer__legal a {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  font-size: var(--text-small);
  color: var(--fg-muted);
  text-decoration: none;
}

.footer__links a:hover,
.footer__legal a:hover {
  color: var(--fg);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-8);
  font-size: var(--text-small);
  letter-spacing: var(--track-small);
  color: var(--fg-muted);
}

.footer__legal {
  display: flex;
  gap: 1.5rem;
}

@media (min-width: 64rem) {
  .footer__grid {
    grid-template-columns: 2fr repeat(3, 1fr);
  }

  .footer__brand {
    grid-column: auto;
    align-self: start;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee {
    overflow-x: auto;
  }

  .marquee__track {
    animation: none;
  }

  .demo__caret {
    display: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
