/* Swat waitlist. Colours come only from tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--focus); color: var(--ground); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: var(--margin); top: -100px; background: var(--focus); color: var(--ground); padding: 12px 16px; border-radius: var(--radius); font-weight: 700; z-index: 10; }
.skip:focus { top: 12px; }

.num { font-family: var(--font-display); font-stretch: 125%; font-variant-numeric: tabular-nums; }
.reward { color: var(--reward); }
.ink-muted { color: var(--muted); }

/* Type steps */
.display, .title, .wordmark, .foot-handle {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.display { font-size: var(--step-display); line-height: 0.98; }
.display span { display: block; }
.title { font-size: var(--step-title); line-height: 1.02; }
:lang(ko) .display, :lang(ko) .title { font-family: var(--font-body); font-stretch: normal; font-weight: 800; letter-spacing: -0.035em; line-height: 1.08; }
.lede { font-size: var(--step-body); max-width: 34em; }

/* Frame */
.chapter { padding: var(--gap-section) var(--margin); }
.bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--margin);
  min-height: 72px;
}
.wordmark { font-size: 22px; text-decoration: none; letter-spacing: 0; font-weight: 900; }
.lang {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--surface); color: var(--text);
  text-decoration: none; font-size: 15px; font-weight: 600;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.lang:hover { background: var(--line); }
.lang:active { transform: scale(0.97); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 24px; width: 100%;
  border-radius: var(--radius); border: 0;
  font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms var(--ease-out), opacity 160ms;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--focus); color: var(--ground); }
.btn-primary:hover { background: var(--text); }
.btn-primary[disabled] { opacity: 0.6; cursor: progress; }
.btn-secondary { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-secondary:hover { background: var(--line); }
.btn-ground { background: var(--ground); color: var(--text); width: auto; }
.btn-ground:hover { background: var(--surface); }

/* Hero */
.hero { padding-top: clamp(24px, 5vw, 72px); }
.hero h1 { max-width: none; }
:lang(ko) .hero h1 { max-width: none; }
.hero-grid {
  display: grid; gap: 56px;
  margin-top: clamp(32px, 4vw, 64px);
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(48px, 6vw, 120px); align-items: start; }
}
.hero-copy .lede { font-size: clamp(18px, 1.5vw, 22px); max-width: 30em; }

/* Form */
.form { margin-top: 32px; display: grid; gap: 14px; position: relative; }
@media (min-width: 900px) { .form, .success { max-width: 520px; } }
.anchor { position: absolute; top: -96px; }
.field-label { font-weight: 600; font-size: 15px; }
input[type="email"] {
  width: 100%; min-height: 56px; padding: 0 18px;
  background: var(--surface); color: var(--text);
  border: 0; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 17px;
}
input[type="email"]::placeholder { color: var(--muted); }
input[type="email"]:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); outline: none; }
input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--reward); }
.checks { display: grid; gap: 4px; margin-top: 4px; }
.check {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start;
  padding: 10px 0; font-size: 16px; line-height: 1.45; cursor: pointer;
}
.check input {
  appearance: none; width: 24px; height: 24px; margin: 0; margin-top: 1px;
  border-radius: 7px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--muted);
  display: grid; place-content: center; cursor: pointer;
  transition: background-color 120ms var(--ease-out);
}
.check input::after {
  content: ""; width: 12px; height: 7px; border: solid var(--ground); border-width: 0 0 3px 3px;
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform 120ms var(--ease-out);
}
.check input:checked { background: var(--focus); box-shadow: none; }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check a { color: var(--text); text-decoration: underline; }
.summary { color: var(--text); font-size: 16px; line-height: 1.55; max-width: 60ch; }
.check span { max-width: 60ch; }
.status { min-height: 1.5em; font-size: 15px; color: var(--reward); }
.status:empty { min-height: 0; }
.meta { color: var(--muted); font-size: var(--step-caption); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile:empty { display: none; }
.success { margin-top: 32px; padding: 28px; border-radius: var(--radius); background: var(--surface); outline: none; }
.success-title { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: var(--step-headline); margin-bottom: 8px; }
:lang(ko) .success-title { font-family: var(--font-body); font-stretch: normal; }
.success a { color: var(--focus); }

/* App fragments (data-ui keep the app's own conventions) */
.screen, .summary-card, .story-card {
  background: var(--ground);
  border-radius: 32px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.hero-phone { display: grid; justify-items: center; gap: 16px; }
@media (min-width: 900px) { .hero-phone { justify-items: end; } .split > [data-ui] { justify-self: end; } }
.screen {
  position: relative; width: min(100%, 360px);
  padding: 28px 22px 22px;
  display: grid; justify-items: center; gap: 14px;
}
.screen-status { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.ring { position: relative; width: min(100%, 230px); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: var(--line); }
.ring-fill { stroke: var(--focus); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring-time {
  position: absolute; inset: 0; display: grid; place-content: center;
  font-size: clamp(48px, 5vw, 64px); font-weight: 800; color: var(--focus); letter-spacing: -0.02em;
}
.pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pill {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px;
  border-radius: 999px; font-weight: 700; font-size: 14px;
}
.pill-reward { background: var(--reward); color: var(--ground); }
.pill-outline { box-shadow: inset 0 0 0 1px var(--line); color: var(--reward); }
.pill-outline.cracked { color: var(--muted); }
.btn-set { min-height: 64px; font-size: 18px; margin-top: 4px; }
.screen .btn-secondary { min-height: 48px; font-size: 15px; }

.shield {
  position: absolute; inset: 0; border-radius: 32px; background: var(--surface);
  padding: 32px 22px 22px; display: grid; align-content: end; gap: 12px; text-align: center;
  animation: rise 260ms var(--ease-out);
}
.shield[hidden] { display: none; }
.shield-title { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
:lang(ko) .shield-title { font-family: var(--font-body); font-stretch: normal; }
.shield-sub { color: var(--muted); font-size: 15px; }
.shield .shield-sub:last-of-type { margin-bottom: 20px; }
.btn[disabled] { cursor: default; }

/* Chapters */
.chapter-surface { background: var(--surface); }
.chapter-reward { background: var(--reward); color: var(--ground); }
.chapter-focus { background: var(--focus); color: var(--ground); }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center; }
.split > * { min-width: 0; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(48px, 6vw, 120px); }
}
.split-text .lede { margin-top: 24px; font-size: clamp(18px, 1.5vw, 22px); }

.summary-card {
  width: min(100%, 420px); justify-self: center; color: var(--text);
  padding: 28px 24px 24px;
}
.summary-session { color: var(--muted); font-size: 15px; }
.summary-xp { font-size: clamp(56px, 6vw, 80px); font-weight: 800; color: var(--reward); line-height: 1; margin: 8px 0 20px; letter-spacing: -0.02em; }
.summary-unit { font-size: 20px; color: var(--muted); letter-spacing: 0; }
.rows { display: grid; }
.rows div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; box-shadow: inset 0 -1px 0 var(--line); font-size: 15px; }
.rows div:last-child { box-shadow: none; }
.rows dt { color: var(--muted); }
.rows dd { font-size: 16px; }
.close .display { max-width: none; }
.earn .title { font-size: var(--step-display); }
:lang(ko) .close .display { max-width: none; }
.close-row { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; }
.close-row .lede { font-size: clamp(18px, 1.5vw, 22px); max-width: 28em; font-weight: 500; }

.demo-hint { color: var(--muted); font-size: 15px; text-align: center; width: min(100%, 360px); }
.fine { color: var(--muted); font-size: 15px; }
.split-text > p + p { margin-top: 16px; }
.split-text .fine { margin-top: 24px; }

/* Blocking demo: a home screen of locked apps */
.home { min-height: 460px; align-content: center; gap: 28px; }
.apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 28px; }
.app {
  display: grid; justify-items: center; gap: 8px; background: none; border: 0; padding: 4px;
  color: var(--text); font-size: 14px; cursor: pointer; border-radius: var(--radius);
}
.app[disabled] { cursor: default; }
.app-icon {
  position: relative; width: 76px; height: 76px; border-radius: 20px; background: var(--line);
  display: grid; place-content: center; font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 28px;
  transition: transform 140ms var(--ease-out), background-color 160ms;
}
.app:hover .app-icon { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.app:active .app-icon { transform: scale(0.94); }
.lock {
  position: absolute; right: -6px; bottom: -6px; width: 26px; height: 26px; border-radius: 999px;
  background: var(--focus); box-shadow: 0 0 0 3px var(--ground);
}
.lock::before { content: ""; position: absolute; left: 8px; top: 11px; width: 10px; height: 8px; border-radius: 2px; background: var(--ground); }
.lock::after { content: ""; position: absolute; left: 9.5px; top: 5px; width: 7px; height: 8px; border: 2px solid var(--ground); border-bottom: 0; border-radius: 5px 5px 0 0; }
.app.is-open .lock { display: none; }
.app-free .app-icon { color: var(--muted); }
.home-hint { color: var(--muted); font-size: 15px; }
.block-note { min-height: 1.6em; margin-top: 20px; font-weight: 600; color: var(--focus); }
.block-note:empty { min-height: 0; margin-top: 0; }
.block .split-text .block-note + p { margin-top: 20px; }

/* How XP works */
.bonuses { list-style: none; padding: 0; margin-top: 28px; display: grid; max-width: 30em; }
.bonuses li {
  display: flex; justify-content: space-between; gap: 16px; padding: 14px 0;
  font-size: clamp(18px, 1.5vw, 22px); font-weight: 600; box-shadow: inset 0 -2px 0 var(--ground);
}
.bonuses li:first-child { box-shadow: inset 0 2px 0 var(--ground), inset 0 -2px 0 var(--ground); }
.bonuses .num { font-weight: 800; }
.bonuses + p { margin-top: 24px; }

/* Share card */
.story { display: grid; justify-items: center; gap: 16px; margin: 0; width: 100%; }
@media (min-width: 900px) { .story { justify-self: end; } }
.story-card {
  width: min(100%, 320px); aspect-ratio: 9 / 16; padding: 28px 24px;
  display: flex; flex-direction: column; border-radius: 24px;
}
.story-top { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 13px; }
.story-mark { color: var(--text); font-family: var(--font-display); font-stretch: 125%; font-weight: 900; font-size: 17px; }
.story-title { margin-top: 18%; font-family: var(--font-display); font-stretch: 125%; font-weight: 900; font-size: 44px; line-height: 0.92; letter-spacing: -0.02em; }
.story-mult { margin-top: 14px; color: var(--reward); font-weight: 900; font-size: 64px; line-height: 1; letter-spacing: -0.03em; }
.story-x { font-size: 0.45em; margin-right: 2px; }
.story-label { color: var(--muted); font-size: 14px; margin-top: 4px; }
.story-stats { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 14px; box-shadow: inset 0 1px 0 var(--line); }
.story-stats p { display: grid; gap: 2px; font-size: 12px; color: var(--muted); min-width: 0; word-break: normal; overflow-wrap: anywhere; }
.story-stats .num { color: var(--text); font-size: 24px; font-weight: 800; }
.story-share {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px;
}
.pop { animation: pop 420ms var(--ease-out); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* Footer */
.foot { padding-top: clamp(80px, 10vw, 160px); padding-bottom: 32px; }
.foot-label { color: var(--muted); font-size: 15px; }
.foot-handle {
  display: inline-block; margin-top: 8px; text-decoration: none;
  font-size: clamp(36px, 9vw, 150px); line-height: 1; color: var(--text);
  transition: color 160ms var(--ease-out);
}
.foot-handle:hover { color: var(--focus); }
.foot-row {
  margin-top: clamp(48px, 6vw, 96px); display: flex; flex-wrap: wrap; gap: 8px 32px;
  justify-content: space-between; color: var(--muted); font-size: var(--step-caption);
}
.foot-row a { color: var(--text); min-height: 44px; display: inline-flex; align-items: center; }
@media (max-width: 600px) { .foot-row { flex-direction: column; } }

/* Privacy and 404 */
.doc { max-width: 720px; padding: clamp(32px, 6vw, 96px) var(--margin) var(--gap-section); }
.doc h1 { font-size: var(--step-title); }
.doc .version { color: var(--muted); margin-top: 12px; font-size: 15px; }
.doc h2 { font-size: var(--step-headline); margin-top: 40px; margin-bottom: 8px; font-family: var(--font-body); }
.doc p, .doc li { max-width: 68ch; }
.doc ul { padding-left: 1.2em; display: grid; gap: 6px; }
.doc a { color: var(--focus); }
.doc .back { display: inline-flex; margin-top: 40px; min-height: 44px; align-items: center; }

/* Motion: content is visible without script; .js only adds the entrance */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms var(--ease-out), transform 700ms var(--ease-out); }
  .js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ring-fill, .btn, .shield, .pop { transition: none; animation: none; }
}

/* Korean: break lines between words, never inside one */
:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
