/* Easy Quizy landing page. Colours and type come from the app and the Figma draft:
   deep navy #0C1927, cream #FFF4DC, one orange accent #F75831, Satoshi at a tight letter-spacing. */

/* Satoshi (Indian Type Foundry, ITF Free Font License, fonts/FFL.txt). The licence allows self-hosting on one's own website through @font-face. These are the two
   official, unmodified WOFF2 files from Fontshare: the licence forbids changing, subsetting or converting the font files, so they must stay as they are. */
@font-face { font-family: 'Satoshi'; src: url('fonts/Satoshi-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url('fonts/Satoshi-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --bg: #0C1927;
  --bg-2: #13283D;              /* a little lighter: the page is one gradient from --bg at the top to --bg-2 at the bottom */
  --ink: #FFF4DC;
  --ink-2: rgba(255, 244, 220, 0.74);
  --ink-3: rgba(255, 244, 220, 0.5);
  --accent: #F75831;
  --font: 'Satoshi', 'Avenir Next', 'Helvetica Neue', system-ui, sans-serif;
  --col: 496px;
  --gutter: 20px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* one frame, no sections: the gradient runs over the whole page */
body {
  margin: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font: 400 16px/1.4 var(--font);
  letter-spacing: -0.03em;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
h1 { margin: 0; font-weight: 500; }

#dust { position: fixed; top: 0; left: 50%; width: min(560px, 100vw); height: 100%; transform: translateX(-50%); z-index: 5; pointer-events: none; visibility: hidden; }  /* a column in the middle, not the whole screen */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main { position: relative; z-index: 1; }
.col { width: min(var(--col), 100% - 2 * var(--gutter)); margin-inline: auto; position: relative; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* hero */
.hero { padding: 217px 0 0; min-height: 80vh; }
.hero-star { position: absolute; left: -175px; top: -15px; width: 132px; height: 132px; }
.hero-star img { position: absolute; }
.hero-star .big { left: 0; top: 0; width: 132px; height: 132px; }
.hero-star .s1 { left: 92px; top: 3px; opacity: 0.9; }
.hero-star .s2 { left: 14px; top: 100px; opacity: 0.9; }
.hero-star .s3 { left: 112px; top: 22px; opacity: 0.9; }
.ask { font-weight: 500; line-height: 1.1; letter-spacing: -0.04em; }
.word-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 18px; margin-top: 19px; }
.word-line .en { font-size: 20px; letter-spacing: -0.04em; transition: opacity 0.35s ease; }
.word-line .en i { font-style: italic; opacity: 0.7; }
.story { max-width: 269px; margin-top: 32px; text-wrap: pretty; line-height: 1.1; letter-spacing: -0.02em; }
.story .grey { color: #d9d9d9; }

/* the split-flap board: every letter flips like a card on an airport board or an old clock (no backing, only the letters) */
.board { display: inline-flex; gap: 0; flex-wrap: nowrap; font-size: 28px; letter-spacing: -0.04em; font-weight: 500; line-height: 1.3; min-height: 1.3em; }
.cell { position: relative; flex: none; width: 0.5em; transition: width 0.1s ease; height: 1.3em; text-align: center; color: var(--ink); }
.cell .h { position: absolute; left: 0; right: 0; height: 50%; clip-path: inset(0 -6px); }
.cell .h span { position: absolute; left: -6px; right: -6px; height: 1.3em; line-height: 1.3em; }
.cell .t, .cell .ft { top: 0; }
.cell .t span, .cell .ft span { top: 0; }
.cell .b, .cell .fb { bottom: 0; }
.cell .b span, .cell .fb span { bottom: 0; }
.cell .ft { transform-origin: 50% 100%; }
.cell .fb { transform-origin: 50% 0; }
.cell .f { visibility: hidden; z-index: 2; }

/* the circle scene: a tall stretch of page; the stage stays put while the ring draws itself */
.draw { position: relative; height: 340vh; }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
.stage { position: relative; width: min(320px, 86vw, 50vh); aspect-ratio: 1; }  /* the size of the circle in the app */
.stage canvas { position: absolute; left: -72px; top: -72px; width: calc(100% + 144px); height: calc(100% + 144px); }  /* room for the glow */
.stage-word, .stage-meaning { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; transition: opacity 0.7s ease; }
.stage-word { flex-direction: column; }
.stage-word .art { font-size: 15px; color: var(--ink-3); }
.stage-word .lemma { font-size: 34px; font-weight: 500; letter-spacing: -0.04em; }
.stage-meaning { padding: 0 14%; text-align: center; font-size: 22px; line-height: 1.15; letter-spacing: -0.04em; opacity: 0; }
.stage.rated .stage-word { opacity: 0; }
.stage.rated .stage-meaning { opacity: 1; }
.caption { min-height: 1.4em; font-weight: 500; letter-spacing: -0.04em; color: var(--ink-2); text-align: center; transition: opacity 0.16s ease; }

/* the waitlist form: glass field and the one orange button, as in the app; it fades in when the ring has closed */
.wait { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(400px, 100% - 2 * var(--gutter)); }
.hero .wait { justify-content: flex-start; width: 100%; max-width: 400px; margin-top: 40px; }
.wait input[type="email"] { flex: 1 1 180px; min-width: 0; height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.07); color: var(--ink); font: inherit; font-size: 15px; letter-spacing: -0.02em; }
.wait input::placeholder { color: var(--ink-3); }
.wait input:focus-visible, .button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.button { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 20px; border: 0; border-radius: 20px; background: var(--accent); color: #fff; font: inherit; font-size: 15px; font-weight: 500; letter-spacing: -0.02em; cursor: pointer; transition: transform 0.2s ease, filter 0.2s ease; }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button:disabled { opacity: 0.6; cursor: default; transform: none; }
.wait-note { flex: 0 0 100%; text-align: left; font-size: 13px; color: var(--ink-3); transition: opacity 0.2s ease; }
.wait-note.error { color: #ffb45e; }
.wait.sent input, .wait.sent .button { display: none; }
.wait.sent .wait-note { font-size: 18px; color: var(--ink); }

/* the bento grid: frosted, see-through cards over the starry sky; they appear one by one (main.js adds .in) */
.bento { padding: 40px 0 72px; }
.grid { width: min(1000px, 100% - 2 * var(--gutter)); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: auto; gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; padding: 24px; overflow: hidden;
  border-radius: 24px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08); min-height: 190px;
}
.card h3 { font-size: 20px; font-weight: 500; line-height: 1.15; letter-spacing: -0.04em; margin-bottom: 8px; }
.card p { font-size: 15px; line-height: 1.35; color: var(--ink-2); max-width: 36ch; }
.c-circle { grid-column: 1 / 3; grid-row: 1 / 3; min-height: 396px; }
.c-levels { grid-column: 3 / 5; }
.c-explore { grid-column: 3 / 5; }
.c-map { grid-column: 2 / 4; }
.grid.armed .card { opacity: 0; transform: translateY(26px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.grid.armed .card.in { opacity: 1; transform: none; }
.viz { flex: 1; min-height: 70px; display: flex; align-items: center; }
.c-circle .viz { justify-content: center; min-height: 230px; }
.viz svg { display: block; max-width: 100%; height: auto; overflow: visible; }  /* a star's glow may reach past its picture */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.1); font-size: 14px; letter-spacing: -0.02em; }
.dots15 { gap: 6px; flex-wrap: wrap; align-content: center; }
.dots15 i { width: 10px; height: 10px; border-radius: 50%; background: #4068d8; opacity: 0.45; }
.dots15 i.lit { background: #fff4dc; opacity: 1; box-shadow: 0 0 10px rgba(255, 150, 55, 0.7); }
.gaps { gap: 0; }
.gaps i { width: 10px; height: 10px; border-radius: 50%; background: #ffb45e; box-shadow: 0 0 12px rgba(255, 150, 55, 0.7); flex: none; }
.gaps i:nth-child(1) { margin-right: 14px; } .gaps i:nth-child(2) { margin-right: 30px; } .gaps i:nth-child(3) { margin-right: 54px; }
.gaps i:nth-child(4) { margin-right: 86px; } .gaps i:nth-child(5) { opacity: 0.55; }
@keyframes twinkle { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.tw { animation: twinkle 3s ease-in-out infinite; }

/* three phones with the real screens; they appear one by one */
.screens { padding: 160px 0 180px; }
.row { width: min(1080px, 100% - 2 * var(--gutter)); margin: 0 auto; display: flex; justify-content: center; align-items: flex-start; gap: clamp(20px, 5vw, 76px); }
.shot { --w: min(272px, 27vw); margin: 0; width: var(--w); flex: none; }  /* --w is the width of a phone: its frame and home bar are measured from it */
.shot:nth-child(odd) { margin-top: 44px; }
/* Parallax: the middle phone runs a little faster than the page. This is the browser's own scroll animation (it runs with the scroll, never a frame behind,
   which is what a script would do), so browsers without it simply show the phones still. */
@media (min-width: 561px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .shot:nth-child(2) { animation: lift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    @keyframes lift { from { translate: 0 150px; } to { translate: 0 -150px; } }
  }
}
.phone {
  position: relative; width: 100%; aspect-ratio: 402 / 874; border-radius: calc(var(--w) * 0.19); overflow: hidden; background: #0c1927;
  border: calc(var(--w) * 0.03) solid #0a0c10; box-shadow: 0 0 0 1.5px #3b4048, 0 0 0 3px #14171c, 0 28px 48px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.phone > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home { position: absolute; bottom: calc(var(--w) * 0.029); left: 50%; width: 36%; height: max(3px, calc(var(--w) * 0.0167)); transform: translateX(-50%); border-radius: 2px; background: rgba(255, 255, 255, 0.55); }
.shot figcaption { margin-top: 22px; text-align: left; padding: 0 6px; }
.shot figcaption b { display: block; font-size: 20px; font-weight: 500; letter-spacing: -0.04em; margin-bottom: 4px; }
.shot figcaption span { display: block; font-size: 15px; line-height: 1.3; color: var(--ink-2); max-width: 24ch; }
.shot { will-change: transform, opacity; }  /* each phone keeps its own layer all the time: a layer created or dropped in the middle of the fade-in or the scroll is a visible hitch */
.shot:nth-child(2) { will-change: transform, opacity, translate; }
.row.armed .shot { opacity: 0; transform: translateY(40px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1); }
.row.armed .shot.in { opacity: 1; transform: none; }
.join { min-height: 100vh; min-height: 100svh; padding: 25px 0 0; display: flex; align-items: center; justify-content: center; }  /* a full screen of its own, so at the bottom of the page the email field sits in the middle of the screen (the 25px of top padding moves the block down half of that, so the field itself, not field plus note, is at the centre) */
.join { position: relative; }
.join .wait { justify-content: center; }
/* a quiet footer: the copyright line and the privacy link */
.foot { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; margin: 0; padding: 0 clamp(20px, 4vw, 48px) 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; font-size: 13px; letter-spacing: -0.02em; color: var(--ink-3); }
.foot a { color: inherit; text-underline-offset: 3px; text-decoration-color: rgba(255, 244, 220, 0.25); }
.foot a:hover { color: var(--ink-2); }
.foot.in-flow { position: static; width: auto; padding: 0; margin: 56px 0 0; }

@media (max-width: 1000px) {
  .hero-star { position: relative; left: 0; top: 0; margin-bottom: 36px; }
  .hero { padding-top: 120px; }
}
@media (max-width: 900px) {
  .shot figcaption b { font-size: 16px; }
  .shot figcaption span { font-size: 13px; }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .c-circle { grid-column: 1 / -1; grid-row: auto; }
  .c-levels, .c-explore, .c-map { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  /* on a phone the three screens sit in a row you swipe through */
  .row { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 0 8px; gap: 20px; width: 100%; padding-inline: var(--gutter); scrollbar-width: none; }
  .row::-webkit-scrollbar { display: none; }
  .shot { --w: min(68vw, 270px); flex: none; scroll-snap-align: center; }
  .shot figcaption b { font-size: 18px; }
  .shot figcaption span { font-size: 14px; }
}
@media (max-width: 400px) {
  .board { font-size: 24px; }
  .word-line .en { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; }
  .tw { animation: none; }
}

/* the privacy page */
.legal { width: min(560px, 100% - 2 * var(--gutter)); margin: 0 auto; padding: 72px 0 140px; }
.legal .back { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 56px; color: var(--ink-2); text-decoration: none; font-weight: 500; letter-spacing: -0.03em; }
.legal .back:hover { color: var(--ink); }
.legal h1 { font-size: 47px; line-height: 1; letter-spacing: -0.06em; margin-bottom: 20px; }
.legal .lead { font-size: 20px; line-height: 1.25; letter-spacing: -0.04em; color: var(--ink); margin-bottom: 8px; }
.legal h2 { font-size: 20px; line-height: 1.15; letter-spacing: -0.04em; margin: 36px 0 8px; }
.legal p { color: var(--ink-2); margin: 0 0 12px; line-height: 1.45; }
.legal a { color: var(--ink); text-underline-offset: 3px; }
.legal .updated { margin-top: 48px; font-size: 13px; color: var(--ink-3); }
