/* The landing page, in the app's look: one content width, calm headings, cards on the paper. */
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 24px; }
.wrap--narrow { max-width: 760px; }

.top { display: flex; align-items: center; gap: 24px; padding-block: 20px; }
.top nav { display: flex; gap: 28px; margin-left: auto; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--body); transition: color 140ms; }
.top nav a:hover { color: var(--ink); }

main > section { margin-top: 128px; }
main > section:first-child { margin-top: 0; }

h1 { font-weight: 700; font-size: clamp(44px, 5.6vw, 72px); line-height: 1.02; letter-spacing: -0.04em; }
h2 { font-weight: 700; font-size: clamp(32px, 3.6vw, 48px); line-height: 1.08; letter-spacing: -0.035em; }
h3 { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.word { font-family: var(--word); font-weight: 600; }

.section-head { display: grid; gap: 12px; max-width: 620px; margin-bottom: 40px; }
.section-head p { color: var(--body); font-size: 18px; }

/* ── Hero: words left, Carmen's card right ── */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding-top: 48px; min-height: min(78svh, 760px); }
.hero-copy { display: grid; gap: 24px; justify-items: start; }
.lede { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.45; color: var(--body); max-width: 30ch; }
.hero-note { color: var(--muted); font-size: 15px; }
.hero-card { margin: 0; position: relative; border-radius: 28px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.hero-card img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.hero-card figcaption { position: absolute; left: 16px; right: 16px; bottom: 16px; display: grid; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--surface); box-shadow: 0 8px 24px rgba(14, 13, 12, 0.18); }
.hero-card .who { font-size: 13px; color: var(--muted); }
.hero-card .word { font-size: 19px; line-height: 1.3; }

/* ── Try it: a real fragment of the app ── */
.try { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.try .section-head { margin-bottom: 0; }
.picker { display: grid; gap: 12px; margin-top: 12px; }
.langs, .people { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--raised); font-weight: 600; font-size: 15px; cursor: pointer; transition: background 140ms, color 140ms, transform 140ms; }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--canvas); }
.people .chip { padding-left: 4px; }
.people .chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }

.phone { background: var(--surface); border-radius: 28px; padding: 16px; box-shadow: 0 0 0 1px var(--line); display: grid; gap: 12px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); }
.chat-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--raised); }
.chat-head strong { display: block; font-size: 16px; }
.chat-head span { color: var(--body); font-size: 14px; }
.chat { display: grid; gap: 8px; }
.bubble { max-width: 86%; padding: 12px 14px; border-radius: 18px; display: grid; gap: 4px; }
.bubble .word { font-size: 18px; line-height: 1.3; }
.bubble--them { background: var(--raised); border-top-left-radius: 6px; }
.bubble--me { justify-self: end; background: var(--primary); color: var(--on-primary); border-top-right-radius: 6px; }
.bubble--me .grade { font-size: 13px; font-weight: 600; }
.translate { justify-self: start; padding: 0; border: 0; background: none; color: var(--body); font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.translation { color: var(--body); font-size: 14px; }
.more { color: var(--muted); font-size: 14px; padding-inline: 4px; }
.replies { display: grid; gap: 8px; }
.reply { text-align: left; min-height: 52px; padding: 10px 14px; border: 0; border-radius: 14px; background: var(--canvas); cursor: pointer; transition: background 140ms, transform 140ms; }
.reply .word { font-size: 16px; }
.reply small { display: block; color: var(--muted); font-size: 13px; font-family: var(--text); }
.reply:hover, .reply[aria-pressed='true'] { background: var(--raised); }
.reply:active { transform: scale(0.98); }
.typing { grid-auto-flow: column; justify-content: start; gap: 5px; padding: 15px 16px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.1s infinite; }
.typing span:nth-child(2) { animation-delay: 160ms; }
.typing span:nth-child(3) { animation-delay: 320ms; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.noscript { color: var(--body); font-size: 15px; }
.bubble-in { animation: bubble 260ms var(--ease) both; }
@keyframes bubble { from { opacity: 0; transform: translateY(8px); } }

/* ── The app: three screens rebuilt from the app's own layout and tokens (sizes at ~0.8 of a phone's points) ── */
.screens { list-style: none; margin: 0; padding: 32px 0 8px; display: flex; justify-content: center; align-items: flex-start; }
.screens > li { flex: 0 0 280px; position: relative; }
.screens > li + li { margin-left: -16px; }
.screens > li:nth-child(2) { z-index: 1; }
.shot { margin: 0; display: grid; gap: 20px; justify-items: center; transition: transform 500ms var(--ease); }
.screens > li:nth-child(odd) .shot { transform: translateY(40px) scale(0.93); }
.shot figcaption { max-width: 22ch; text-align: center; font-weight: 600; font-size: 17px; line-height: 1.35; letter-spacing: -0.01em; }

.device {
  width: 280px; aspect-ratio: 280 / 590; padding: 9px; border-radius: 46px; background: #0b0a09;
  box-shadow: 0 0 0 1px var(--line), 0 40px 70px -34px rgba(42, 33, 24, 0.5), 0 14px 28px -18px rgba(42, 33, 24, 0.35);
  transition: transform 400ms var(--ease);
}
.screens > li:nth-child(2) .device { box-shadow: 0 0 0 1px var(--line), 0 50px 90px -30px rgba(42, 33, 24, 0.55), 0 18px 36px -18px rgba(42, 33, 24, 0.4); }
.shot:hover .device { transform: translateY(-6px); }
.a-screen {
  position: relative; height: 100%; overflow: hidden; border-radius: 37px; background: var(--canvas); color: var(--ink);
  display: flex; flex-direction: column; font-size: 12px; line-height: 1.45; text-align: left; user-select: none;
}
.a-screen p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-screen .a-wrap, .a-greeting p { white-space: normal; }
.a-screen svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.a-screen svg .fill { fill: currentColor; stroke: none; }
.a-screen svg .cut { stroke: var(--surface); stroke-width: 1.8; }

.a-status { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 6px 22px 0 26px; font-weight: 700; font-size: 12px; flex: none; }
.a-island { width: 74px; height: 22px; border-radius: 999px; background: #0b0a09; }
.a-battery { width: 20px; height: 10px; border-radius: 3px; border: 1.5px solid currentColor; opacity: 0.85; background: linear-gradient(90deg, currentColor 70%, transparent 70%) content-box; padding: 1px; }

.a-bar, .a-content, .a-lead, .a-lead-text { grid-template-columns: minmax(0, 1fr); }
.a-bar { display: grid; gap: 1px; padding: 4px 16px 12px; flex: none; }
.a-bar-row { display: flex; align-items: center; gap: 4px; min-height: 28px; margin-bottom: 5px; }
.a-spacer { flex: 1; }
.a-chip, .a-me { display: inline-flex; align-items: center; gap: 4px; height: 27px; padding: 0 9px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 0.5px var(--line), 0 0 0 0.5px var(--line); font-weight: 600; font-variant-numeric: tabular-nums; }
.a-me { width: 27px; padding: 0; justify-content: center; }
.a-down svg { width: 9px; height: 9px; color: var(--muted); transform: rotate(90deg); }
.a-chip--xp svg, .a-chip--streak svg { color: var(--warning); }
.a-chip--coin svg { color: var(--primary); }
.a-chip--streak { height: 24px; margin-top: 6px; }
.a-title { font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -0.03em; }
.a-heading { font-weight: 700; font-size: 16px; letter-spacing: -0.015em; }
.a-section { font-weight: 600; font-size: 13px; margin-top: 4px; }
.a-strong { font-weight: 600; }
.a-small { color: var(--body); font-size: 11px; line-height: 1.4; }
.a-caption { color: var(--muted); font-size: 10px; line-height: 1.35; }

.a-content { display: grid; gap: 10px; padding: 0 16px; align-content: start; }
.a-card { border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 0.5px var(--line), 0 4px 16px rgba(42, 33, 24, 0.06); }
.a-lead { display: grid; gap: 12px; padding: 10px 10px 12px; }
.a-lead-art { width: 100%; height: 104px; object-fit: cover; border-radius: 11px; background: var(--raised); }
.a-lead-text { display: grid; gap: 4px; padding-inline: 6px; }
.a-greeting { justify-self: start; display: grid; gap: 1px; padding: 6px 10px; border-radius: 11px; border-top-left-radius: 5px; background: var(--raised); }
.a-greeting .word { font-size: 14px; line-height: 1.35; }
.a-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: 12px; }
.a-rows { padding: 2px 12px; }
.a-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding-block: 5px; }
.a-row + .a-row { border-top: 0.5px solid var(--line); }
.a-row-text { flex: 1; min-width: 0; }
.a-row > svg { width: 11px; height: 11px; color: var(--muted); }
.a-thumb { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--raised); }
.a-thumb--top { object-position: top; }
.a-goal { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.a-screen .a-ring { width: 46px; height: 46px; stroke: var(--raised); stroke-width: 3; }
.a-ring .lit { stroke: var(--primary); }

/* Review: the card fills the room between the header and the buttons */
.a-meter { height: 5px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.a-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.a-meter--ink { height: 3px; margin: 0 16px; flex: none; }
.a-meter--ink i { background: var(--ink); }
.a-table { position: relative; flex: 1; margin: 16px 16px 20px; }
.a-face, .a-behind { position: absolute; inset: 0; border-radius: 16px; background: var(--surface); box-shadow: 0 0 0 0.5px var(--line), 0 4px 16px rgba(42, 33, 24, 0.06); }
.a-behind--1 { transform: translateY(8px) scale(0.95); opacity: 0.65; }
.a-behind--2 { transform: translateY(16px) scale(0.9); opacity: 0.3; }
.a-face { display: grid; place-content: center; justify-items: center; gap: 14px; padding: 20px; text-align: center; }
.a-word-xl { font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; max-width: 210px; }
.a-strength { display: grid; gap: 4px; width: 150px; text-align: center; }
.a-screen .a-hint { text-align: center; padding: 0 20px; white-space: normal; flex: none; }
.a-actions { display: flex; justify-content: center; gap: 14px; padding: 10px 0 78px; flex: none; }
.a-actions span { display: grid; justify-items: center; gap: 3px; color: var(--body); font-size: 10px; }
.a-actions svg { box-sizing: content-box; width: 18px; height: 18px; padding: 12px; border-radius: 50%; background: var(--raised); color: var(--ink); }
.a-again svg { color: var(--negative); }
.a-knew svg { color: var(--positive); }

/* The tab bar floats over the content, as on iOS */
.a-tabs {
  position: absolute; left: 10px; right: 10px; bottom: 12px; display: flex; justify-content: space-between; padding: 4px;
  border-radius: 999px; background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 0 0 0.5px var(--line), 0 6px 20px rgba(14, 13, 12, 0.12);
}
.a-tabs span { flex: 1; display: grid; justify-items: center; gap: 1px; padding: 5px 0 4px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 8.5px; }
.a-tabs svg { width: 17px; height: 17px; stroke-width: 1.9; }
.a-tabs .on { color: var(--primary); background: color-mix(in srgb, var(--primary) 13%, transparent); }

/* ── How it works: four steps as cards ── */
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stages li { display: grid; align-content: start; gap: 8px; padding: 24px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.stages strong { font-size: 18px; letter-spacing: -0.01em; }
.stages p { color: var(--body); font-size: 16px; }
.stages .stage--accent { background: var(--primary); box-shadow: none; }
.stages .stage--accent strong, .stages .stage--accent p { color: var(--on-primary); }

/* ── Levels: four cards, each with its two paintings ── */
.level-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.level { display: grid; align-content: start; gap: 8px; padding: 12px 12px 20px; border-radius: 20px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.level-paintings { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin-bottom: 8px; } /* one painting per course, side by side */
.level-paintings img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.level h3, .level p { padding-inline: 8px; }
.level h3 span { color: var(--primary); }
.level p { color: var(--body); font-size: 15px; }

/* ── Questions ── */
.faq-list { display: grid; gap: 8px; }
details { border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px 24px; font-size: 18px; font-weight: 600; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; flex: none; width: 9px; height: 9px; margin-top: -4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 200ms var(--ease); }
details[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
details p { padding: 0 24px 22px; color: var(--body); font-size: 16px; max-width: 62ch; }
details a { color: var(--primary); }

/* ── Close ── */
.cta-card { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 64px 24px; border-radius: 28px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.cta-card p { color: var(--body); }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 80px; padding-block: 32px 48px; border-top: 1px solid var(--line); }
.foot nav { display: flex; flex-wrap: wrap; gap: 24px; margin-left: auto; font-size: 15px; }
.foot nav a { text-decoration: none; color: var(--body); }
.foot nav a:hover { color: var(--ink); }
.credits { flex-basis: 100%; color: var(--muted); font-size: 13px; }

/* ── Tablet and phone ── */
@media (max-width: 960px) {
  .stages, .level-grid { grid-template-columns: repeat(2, 1fr); }
  /* The screens become a row to swipe through, edge to edge */
  .screens { justify-content: flex-start; gap: 16px; margin-inline: -24px; padding: 8px 24px 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 24px; scrollbar-width: none; }
  .screens::-webkit-scrollbar { display: none; }
  .screens > li { flex-basis: min(76vw, 280px); scroll-snap-align: center; }
  .screens > li + li { margin-left: 0; }
  .screens > li:nth-child(odd) .shot { transform: none; }
  .device { width: 100%; }
}
@media (max-width: 760px) {
  .wrap { padding-inline: 16px; }
  .top nav { display: none; }
  .theme { margin-left: auto; }
  main > section { margin-top: 88px; }
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 16px; min-height: 0; }
  .try { grid-template-columns: 1fr; gap: 24px; }
  .stages { grid-template-columns: 1fr; }
  .section-head { margin-bottom: 24px; }
  .foot nav { margin-left: 0; }
  .screens { margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
}
@media (max-width: 420px) {
  .level-grid { grid-template-columns: 1fr; }
}

/* ── Motion: present without script; rises only once the script is running ── */
.js .rise { opacity: 0; transform: translateY(16px); transition: opacity 500ms var(--ease), transform 500ms var(--ease); transition-delay: var(--d, 0ms); }
.js .rise.in { opacity: 1; transform: none; }
.hero-card img { transition: transform 1600ms var(--ease); }
.hero-card:hover img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) {
  .js .rise { opacity: 1; transform: none; transition: none; }
  .bubble-in, .typing span { animation: none; }
  .shot, .device { transition: none; }
  .shot:hover .device { transform: none; }
  html { scroll-behavior: auto; }
}
