/* KotoDachi site. Palette follows the pitch deck: deep night purple, amber,
   pink, with lavender cards on the light sections. Every pair used for text
   is WCAG AA (ratios noted where they are close to the line). */

:root {
  --night: #2b1d4f;
  --night-2: #3b2a66;
  --night-3: #1d1530;
  --paper: #fbf9fe;
  --card: #f0ecf8;
  --card-edge: #e2dbf1;

  --ink: #2b1d4f;
  --ink-soft: #57507a; /* 6.4:1 on --card */
  --on-night: #ffffff;
  --on-night-soft: #cfc6e6; /* 7.5:1 on --night-2 */

  --amber: #f4a940; /* dark sections only: 6.2:1 on --night-2 */
  --pink: #c8285f; /* 4.6:1 on --card, 5.4:1 under white */
  --pink-soft: #ff7aa8; /* dark only: 5.8:1 on the chat bubble */
  --violet: #7552b0;
  --violet-text: #6a48a8;
  --teal: #237f6b; /* 4.9:1 under white */

  --font-display: "M PLUS Rounded 1c", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --tap: 44px;
  --radius: 20px;
  --gutter: 16px;
  --header: 64px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-padding-top: calc(var(--header) + 12px);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}
ol,
ul {
  padding: 0;
  list-style: none;
}
img {
  max-width: 100%;
}
button {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
}
main:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 6px;
}
.section--light :focus-visible {
  outline-color: var(--pink);
}

.skip-link {
  position: fixed;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--night);
  font-weight: 700;
  text-decoration: none;
  top: -100px;
}
.skip-link:focus {
  top: 8px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
}
.icon--lg {
  width: 26px;
  height: 26px;
}

/* ---- Header --------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header);
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
  background: rgba(29, 21, 48, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--on-night);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  color: inherit;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
}
.portrait--logo {
  width: 36px;
  font-size: 0.5rem;
  border: 2px solid var(--pink-soft);
}
.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--on-night-soft);
  transition:
    color 0.2s,
    background-color 0.2s;
}
.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
}
.scroll-progress__bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--pink), var(--amber));
  transform: scaleX(0);
  transform-origin: left;
}

/* ---- Buttons -------------------------------------------------------------- */

/* `.btn` sets its own display, which would otherwise beat the attribute. */
.btn[hidden] {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-pop),
    box-shadow 0.2s,
    background-color 0.2s;
}
.btn--primary,
.btn--small {
  background: var(--pink);
  color: #fff;
}
.btn--primary {
  box-shadow: 0 10px 30px -10px rgba(200, 40, 95, 0.7);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px rgba(200, 40, 95, 0.85);
}
.btn--primary:active {
  transform: translateY(0) scale(0.98);
}
.btn--small {
  min-height: var(--tap);
  padding: 0 16px;
  font-size: 0.92rem;
  margin-left: 8px;
  gap: 6px;
}
.btn--ghost {
  border: 2px solid currentColor;
  background: transparent;
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}
.btn--download {
  min-height: 64px;
  padding: 0 28px 0 22px;
  gap: 14px;
}
.btn__stack {
  display: grid;
  text-align: left;
  line-height: 1.2;
}
.btn__main {
  font-size: 1.08rem;
}
.btn__sub {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.92;
}
/* No release.json yet: the button stays visible but goes nowhere. */
[data-apk][aria-disabled="true"] {
  background: var(--night-2);
  color: var(--on-night-soft);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.site-footer [data-apk][aria-disabled="true"] {
  background: none;
}

.download {
  display: grid;
  justify-items: start;
  gap: 10px;
}
.download__meta {
  font-size: 0.9rem;
  color: var(--on-night-soft);
  font-variant-numeric: tabular-nums;
}

/* ---- Sections ------------------------------------------------------------- */

.section {
  position: relative;
  padding: clamp(72px, 11vh, 128px)
    max(var(--gutter), env(safe-area-inset-right)) clamp(72px, 11vh, 128px)
    max(var(--gutter), env(safe-area-inset-left));
}
.section--dark {
  color: var(--on-night);
  background:
    radial-gradient(
      60rem 40rem at 85% 10%,
      rgba(200, 40, 95, 0.2),
      transparent 60%
    ),
    radial-gradient(
      50rem 40rem at 5% 100%,
      rgba(117, 82, 176, 0.32),
      transparent 60%
    ),
    var(--night);
}
.section--light {
  color: var(--ink);
  background:
    radial-gradient(
      50rem 30rem at 100% 0%,
      rgba(117, 82, 176, 0.08),
      transparent 60%
    ),
    var(--paper);
}
/* Two light sections in a row read as one unless something marks the seam. */
.section--light + .section--light {
  border-top: 1px solid var(--card-edge);
}

.section__inner {
  width: min(1160px, 100%);
  margin: 0 auto;
}
/* Grid columns default to min-width: auto, so the mood table's own scroller
   would widen its column (and the page) instead of scrolling. */
.section__inner > *,
.section__inner > * > * {
  min-width: 0;
}

/* Scroll reveal. app.js adds .is-in as each element enters the viewport and
   staggers the ones that arrive together through --i. Scoped to .js so the
   page is fully visible without script. */
.js [data-anim] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.55s ease,
    transform 0.75s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.js [data-anim].is-in {
  opacity: 1;
  transform: none;
}

/* ---- Type ----------------------------------------------------------------- */

.eyebrow {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--amber);
}
.eyebrow--ink {
  color: var(--pink);
}
.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.title--xl {
  font-size: clamp(2rem, 5vw, 3.5rem);
}
.lede {
  margin-top: 14px;
  max-width: 60ch;
  font-size: clamp(1.02rem, 1.6vw, 1.18rem);
  color: var(--ink-soft);
}
.section--dark .lede {
  color: var(--on-night-soft);
}
.fineprint {
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--on-night-soft);
}

.num {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
}
.num--pink {
  background: var(--pink);
}

/* ---- Portraits --------------------------------------------------------------
   Art is not in Git (build_assets.py fills assets/). A missing file falls back
   to a gradient with the initial, like the app's MoodPortrait. */

.portrait {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--violet));
}
.portrait::after {
  content: attr(data-initial);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2em;
}
.portrait img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait.is-missing img {
  display: none;
}

/* ---- Hero ----------------------------------------------------------------- */

.section--hero {
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding-top: calc(var(--header) + 40px);
}
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 32px;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.hero__etym {
  margin-top: 16px;
  color: var(--amber);
  font-size: clamp(1rem, 1.7vw, 1.15rem);
}
.hero__etym span {
  font-family: var(--font-display);
  font-weight: 700;
}
.hero__lede {
  margin: 22px 0 32px;
  max-width: 24ch;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.35;
}
.hero__note {
  margin-top: 18px;
  max-width: 44ch;
  font-size: 0.92rem;
  color: var(--on-night-soft);
}
.hero__note a {
  color: #fff;
  font-weight: 600;
  text-underline-offset: 3px;
}

.hero__stage {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 520px);
  justify-self: center;
}
.hero__p {
  position: absolute;
  font-size: 1.8rem;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  border: 4px solid rgba(255, 255, 255, 0.9);
}
.hero__p--suzu {
  width: 50%;
  left: 25%;
  top: 22%;
  z-index: 3;
}
.hero__p--yuki {
  width: 36%;
  left: 2%;
  top: 8%;
  z-index: 2;
}
.hero__p--nagi {
  width: 36%;
  right: 2%;
  bottom: 6%;
  z-index: 2;
}
/* Finite loops: decoration that moves forever needs a pause control (WCAG 2.2.2).
   app.js sets .is-offscreen while the hero is scrolled away; dropping the
   animation and giving it back restarts every loop from the top. */
.section--hero.is-offscreen .portrait--float,
.section--hero.is-offscreen .greet,
.section--hero.is-offscreen .scroll-cue {
  animation: none;
}
.portrait--float {
  animation: bob 6s ease-in-out 3;
}
.hero__p--yuki {
  animation-delay: -2s;
}
.hero__p--nagi {
  animation-delay: -4s;
}
@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-12px) rotate(1deg);
  }
}

.greet {
  position: absolute;
  z-index: 4;
  padding: 8px 14px;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  white-space: nowrap;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  animation: greet 7s var(--ease-out) 2;
}
.greet:nth-of-type(even) {
  background: var(--pink);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
.greet--1 {
  left: 58%;
  top: 4%;
  animation-delay: 0.6s;
}
.greet--2 {
  left: 0%;
  top: 50%;
  animation-delay: 1.6s;
}
.greet--3 {
  right: 0%;
  top: 30%;
  animation-delay: 2.6s;
}
.greet--4 {
  left: 18%;
  bottom: 6%;
  animation-delay: 3.6s;
}
.greet--5 {
  left: 42%;
  top: 0%;
  animation-delay: 4.6s;
}
.greet--6 {
  right: 6%;
  top: 62%;
  animation-delay: 5.6s;
}
.greet--7 {
  left: 6%;
  top: 38%;
  animation-delay: 6.6s;
}
@keyframes greet {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(8px);
  }
  6%,
  30% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  40%,
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(-10px);
  }
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 20px;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin-left: calc(var(--tap) / -2);
  border-radius: 50%;
  color: var(--on-night-soft);
  animation: cue 2s ease-in-out 4;
}
.scroll-cue .icon {
  width: 28px;
  height: 28px;
}
@keyframes cue {
  50% {
    transform: translateY(6px);
  }
}

/* ---- Problem -------------------------------------------------------------- */

.problem {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
}
.numbered {
  display: grid;
  gap: 18px;
}
.numbered__item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.numbered__item h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 4px;
}
.numbered__item p {
  color: var(--on-night-soft);
}

/* ---- Characters (flip cards) ------------------------------------------------ */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
}
.flip-card {
  perspective: 1400px;
}
.flip-card__inner {
  display: grid;
  height: 100%;
}
.face {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--card-edge);
}
.face--back {
  background:
    radial-gradient(
      24rem 16rem at 100% 0%,
      rgba(200, 40, 95, 0.3),
      transparent 60%
    ),
    var(--night);
  color: var(--on-night);
  border-color: transparent;
}
/* Both faces share one grid cell, so the card is as tall as its taller face. */
.js .flip-card__inner {
  transform-style: preserve-3d;
  transition: transform 0.75s var(--ease-out);
  cursor: pointer;
}
.js .face {
  grid-area: 1 / 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.js .face--back {
  transform: rotateY(180deg);
}
.js .flip-card.is-flipped .flip-card__inner {
  transform: rotateY(180deg);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .js .flip-card:not(.is-flipped):hover .flip-card__inner {
    transform: rotateY(-8deg);
  }
}

.portrait--card {
  width: 100%;
  aspect-ratio: 5 / 4;
  border-radius: 18px;
  margin-bottom: 6px;
  font-size: 1.8rem;
}
.portrait--card img {
  object-position: 50% 25%;
}
.face__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.face__head h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
}
.face__role {
  font-style: italic;
  font-weight: 600;
  color: var(--violet-text);
}
.face__text {
  color: var(--ink-soft);
}
.tag {
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tag--easy {
  background: var(--teal);
}
.tag--normal {
  background: var(--violet);
}
.tag--hard {
  background: var(--pink);
}

.flip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  min-height: var(--tap);
  margin-top: auto;
  padding: 0 16px;
  border: 1.5px solid var(--card-edge);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.flip-btn:hover {
  border-color: var(--pink);
}
.flip-btn--back {
  border-color: rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
}
.flip-btn--back:hover {
  border-color: #fff;
}

.face__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}
.bubble {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.45;
}
.bubble--me {
  align-self: flex-end;
  background: var(--pink);
  border-bottom-right-radius: 4px;
}
.bubble--them {
  align-self: flex-start;
  background: var(--night-2);
  border-bottom-left-radius: 4px;
}
.bubble mark {
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(244, 169, 64, 0.28);
  color: #fff;
  font-weight: 700;
}
.face__style {
  margin-top: 4px;
  color: var(--on-night-soft);
}
.face__style strong {
  color: #fff;
}
.face__moods {
  font-size: 0.85rem;
  color: var(--on-night-soft);
}

/* ---- How it works (chat demo) --------------------------------------------- */

.demo {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
}
.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 28px;
  margin-top: 28px;
}
.features h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--amber);
}
.features p {
  color: var(--on-night-soft);
}
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.langs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
}
.langs img {
  width: 22px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
}

.phone {
  justify-self: center;
  width: min(340px, 100%);
  padding: 10px;
  border-radius: 44px;
  background: linear-gradient(160deg, #3d3260, #120c22);
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.phone__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
  border-radius: 34px;
  background: var(--night-3);
}
.phone__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 12px;
  background: linear-gradient(180deg, rgba(200, 40, 95, 0.25), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.portrait--avatar {
  width: 44px;
  font-size: 0.8rem;
  border: 2px solid var(--pink-soft);
}
.phone__name {
  font-weight: 700;
}
.phone__mood {
  font-size: 0.8rem;
  color: #b9b0d6;
}
#demo-mood {
  display: inline-block;
  color: var(--pink-soft);
  font-weight: 700;
}
#demo-mood.is-changed,
.moods__label strong.is-changed {
  animation: pop 0.5s var(--ease-pop);
}
@keyframes pop {
  from {
    transform: scale(0.4);
  }
  to {
    transform: scale(1);
  }
}
.phone__lang {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 700;
}

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px;
  overflow-y: auto;
  font-size: 0.92rem;
}
.msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.45;
  animation: msg-in 0.4s var(--ease-out) both;
}
.msg--them {
  align-self: flex-start;
  background: #2f2450;
  border-bottom-left-radius: 6px;
}
.msg--me {
  align-self: flex-end;
  background: var(--pink);
  border-bottom-right-radius: 6px;
}
@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.tap-word {
  padding: 0 1px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--pink-soft);
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: background-color 0.2s;
}
.tap-word:hover,
.tap-word.is-tapped {
  background: rgba(255, 122, 168, 0.18);
}
.tap-word.is-tapped {
  animation: tap 0.5s ease;
}
@keyframes tap {
  40% {
    transform: scale(0.9);
  }
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 14px 16px;
}
.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9b0d6;
  animation: typing 1s ease-in-out infinite;
}
.typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typing {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.lookup {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 76px;
  z-index: 2;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  animation: lookup-in 0.35s var(--ease-pop);
}
.chat.has-lookup {
  padding-bottom: 140px;
}
.lookup[hidden] {
  display: none;
}
@keyframes lookup-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
}
.lookup__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.lookup__word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
}
.lookup__pos {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-soft);
}
.lookup__gloss {
  margin-top: 2px;
}
.lookup__saved {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--teal);
}

.phone__input {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.phone__field {
  flex: 1;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #b9b0d6;
  font-size: 0.85rem;
}
.phone__send {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--pink);
}
.phone__send svg {
  width: 18px;
  fill: #fff;
}

/* ---- Moods ---------------------------------------------------------------- */

.moods {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: center;
  gap: 48px;
}
.moods__stage {
  display: grid;
  justify-items: center;
}
.moods__frame {
  --mood-glow: rgba(200, 40, 95, 0.3);
  display: grid;
  justify-items: center;
  gap: 18px;
}
.portrait--mood {
  width: min(340px, 72vw);
  font-size: 2.6rem;
  border: 6px solid #fff;
  box-shadow:
    0 0 0 10px var(--mood-glow),
    0 40px 70px -30px rgba(43, 29, 79, 0.6);
  transition: box-shadow 0.6s ease;
}
.portrait--mood .mood-img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.5s ease,
    transform 0.8s var(--ease-out);
}
.portrait--mood .mood-img.is-shown {
  opacity: 1;
  transform: none;
}
.moods__label {
  font-size: 1.15rem;
  color: var(--ink-soft);
}
.moods__label strong {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--pink);
}

.slots {
  margin-top: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.slots__row {
  display: grid;
  grid-template-columns: 56px repeat(6, minmax(76px, 1fr));
  align-items: center;
  gap: 6px;
  min-width: 540px;
}
.slots__row + .slots__row {
  margin-top: 6px;
}
.slots__who {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.slot {
  min-height: var(--tap);
  padding: 0 6px;
  border: 1.5px solid var(--card-edge);
  border-radius: 12px;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.3s,
    color 0.3s,
    border-color 0.3s;
}
.slot:hover {
  border-color: var(--pink);
}
.slot.is-on {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
}
.flav {
  padding: 8px 4px;
  border-radius: 10px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
  transition:
    background-color 0.3s,
    color 0.3s;
}
.flav.is-on {
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
}

/* ---- Different ------------------------------------------------------------ */

.different {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 48px;
}
.compare {
  margin-top: 24px;
}
.compare__row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--card-edge);
}
.compare__row dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--violet-text);
}
.compare__row dd {
  color: var(--ink-soft);
}
.callout {
  padding: 36px;
  border-radius: 28px;
  background:
    radial-gradient(
      30rem 20rem at 100% 0%,
      rgba(200, 40, 95, 0.35),
      transparent 60%
    ),
    var(--night);
  color: var(--on-night);
  box-shadow: 0 40px 80px -40px rgba(43, 29, 79, 0.8);
}
.callout__kicker {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--amber);
}
.callout__body {
  margin-top: 14px;
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.5;
}
/* A full-height highlighter swipe. The old bottom-band gradient sat in the
   font's descender area, so it read as a thick underline drawn below the
   words. White on this amber over --night stays above 7:1. */
.callout mark {
  padding: 0.05em 0.15em;
  border-radius: 5px;
  color: inherit;
  background: linear-gradient(
      rgba(244, 169, 64, 0.34),
      rgba(244, 169, 64, 0.34)
    )
    no-repeat 0 0 / 0% 100%;
  transition: background-size 0.8s var(--ease-out);
  /* A mark that wraps is one inline box split across lines; clone gives each
     line its own full background instead of slicing one between them. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.callout.is-in mark {
  background-size: 100% 100%;
}
.callout.is-in mark:nth-of-type(1) {
  transition-delay: 0.6s;
}
.callout.is-in mark:nth-of-type(2) {
  transition-delay: 0.9s;
}
.callout.is-in mark:nth-of-type(3) {
  transition-delay: 1.2s;
}
.callout.is-in mark:nth-of-type(4) {
  transition-delay: 1.5s;
}

/* ---- Plans ---------------------------------------------------------------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 360px));
  gap: 20px;
  margin-top: 36px;
}
.plan {
  padding: 28px;
  border-radius: 24px;
  background: var(--night-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.plan--premium {
  border: 2px solid var(--amber);
  box-shadow:
    0 0 0 6px rgba(244, 169, 64, 0.12),
    0 30px 60px -30px rgba(0, 0, 0, 0.6);
}
.plan__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--amber);
}
.plan__price {
  margin: 10px 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 6vw, 4.2rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.plan__per {
  margin-left: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--on-night-soft);
}
.plan__desc {
  color: var(--on-night-soft);
}

/* ---- Roadmap -------------------------------------------------------------- */

.timeline {
  position: relative;
  display: grid;
  max-width: 760px;
  margin-top: 36px;
}
.timeline__step {
  --rail-x: calc(
    150px + 20px + 14px
  ); /* when column + gap + half the dot column */
  position: relative;
  display: grid;
  grid-template-columns: 150px 28px 1fr;
  grid-template-areas: "when dot body";
  gap: 20px;
  padding-bottom: 26px;
}
/* The rail: each step draws its own segment, from its dot to the next one. */
.timeline__step::before {
  content: "";
  position: absolute;
  left: calc(var(--rail-x) - 1.5px);
  top: 22px;
  bottom: -4px;
  width: 3px;
  background: rgba(117, 82, 176, 0.35);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.8s var(--ease-out) 0.3s;
}
.timeline__step.is-in::before {
  transform: scaleY(1);
}
.timeline__step:last-child::before {
  display: none;
}
.timeline__when {
  grid-area: when;
  padding-top: 2px;
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.timeline__dot {
  grid-area: dot;
  position: relative;
  justify-self: center;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--violet);
  z-index: 1;
}
.timeline__body {
  grid-area: body;
}
.timeline__body h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}
.timeline__body p {
  margin-top: 4px;
  color: var(--ink-soft);
}
.is-now .timeline__dot {
  background: var(--pink);
  border-color: var(--pink);
  box-shadow: 0 0 0 6px rgba(200, 40, 95, 0.18);
}
.is-now .timeline__when {
  color: var(--pink);
}
.timeline__step--goal .timeline__dot {
  width: 26px;
  height: 26px;
  margin-top: 0;
  background: var(--amber);
  border-color: var(--night);
}
.timeline__step--goal h3 {
  font-size: 1.45rem;
}
.timeline__step--goal .timeline__when {
  color: var(--ink);
  font-size: 1.05rem;
}
.pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---- Contact -------------------------------------------------------------- */

.contact {
  display: grid;
  justify-items: center;
  text-align: center;
}
.contact .lede {
  margin-inline: auto;
}
.contact__faces {
  display: flex;
  margin-bottom: 20px;
}
.portrait--face {
  width: 84px;
  font-size: 1rem;
  border: 3px solid var(--night);
}
.portrait--face + .portrait--face {
  margin-left: -18px;
}
.portrait--face:nth-child(2) {
  z-index: 1;
  transform: translateY(-8px) scale(1.1);
}
.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  margin-top: 32px;
}
.contact .download {
  justify-items: center;
}
.contact .btn--ghost {
  min-height: 64px;
}

.install {
  width: min(560px, 100%);
  margin-top: 36px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}
.install summary {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 20px;
  font-weight: 700;
  cursor: pointer;
}
.install ol {
  display: grid;
  gap: 10px;
  padding: 0 20px 20px 42px;
  list-style: decimal;
  color: var(--on-night-soft);
}
.install strong {
  color: #fff;
}

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
  padding: 56px max(var(--gutter), env(safe-area-inset-right))
    calc(24px + env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
  background: var(--night-3);
  color: var(--on-night-soft);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  width: min(1160px, 100%);
  margin: 0 auto;
}
.site-footer .brand {
  color: #fff;
}
.site-footer__brand p {
  margin-top: 10px;
  max-width: 32ch;
}
.site-footer h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}
.site-footer__col a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  text-decoration: none;
}
.site-footer__col a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  width: min(1160px, 100%);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
}

/* ---- Narrow screens ---------------------------------------------------------
   The audience is on phones: below 860px every section is one column. */

@media (max-width: 860px) {
  :root {
    --header: 60px;
  }
  .site-nav {
    display: none;
  }
  .btn--small {
    margin-left: auto;
  }
  .hero,
  .problem,
  .demo,
  .moods,
  .different {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .section--hero {
    padding-top: calc(var(--header) + 24px);
  }
  .hero__stage {
    order: -1;
    width: min(100%, 300px);
  }
  .scroll-cue {
    display: none;
  }
  .cards,
  .plans,
  .features {
    grid-template-columns: 1fr;
  }
  .compare__row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .phone__screen {
    height: 560px;
  }
  .callout {
    padding: 28px 22px;
  }
  .timeline__step {
    grid-template-columns: 28px 1fr;
    grid-template-areas:
      "dot when"
      "dot body";
    gap: 2px 16px;
    --rail-x: 14px;
  }
  .timeline__dot {
    align-self: start;
  }
  .timeline__when {
    text-align: left;
  }
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 380px) {
  .brand__name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  /* The greetings would freeze on their first, invisible frame. */
  .greet {
    display: none;
  }
}
