@font-face {
  font-family: "Peace Sans";
  src: url("/assets/fonts/peace-sans.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sauce";
  src: url("/assets/fonts/open-sauce-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Open Sauce";
  src: url("/assets/fonts/open-sauce-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --terracotta: #C2410C;
  --ink: #2A1206;
  --bark: #3B1D0C;
  --cream: #FFF6E8;
  --cream-muted: #F3DDBE;
  --tan: #D9B48F;
  --muted: #6B4A33;
  --line: #E6D3BA;
  --line-dark: #4E2C17;
  --accent: #FFCF7A;
  --emerald: #0B7A57;
  /* The app's own surfaces and buttons (sand warm theme). */
  --app-bg: #FAF8F5;
  --app-text: #451A03;
  --app-line: #E5DACB;
  --app-primary: #B45309;
  --right: #1F7A45;
  --wrong: #C2352B;
  --display: "Peace Sans", "Open Sauce", system-ui, sans-serif;
  --body: "Open Sauce", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

img,
video,
canvas {
  display: block;
  max-width: 100%;
}

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

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  text-wrap: balance;
}

:lang(ko) h1,
:lang(ko) h2,
:lang(ko) .score {
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

:lang(ko) p,
:lang(ko) td,
:lang(ko) h3 {
  word-break: keep-all;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

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

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Header and hero share the terracotta field. */

.bar {
  background: var(--terracotta);
  color: var(--cream);
}

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1;
}

.brand img {
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(42, 18, 6, 0.25);
}

:lang(ko) .brand {
  font-family: var(--body);
  font-weight: 700;
}

.bar-install {
  display: none;
}

.bar-install img {
  height: 40px;
  width: auto;
}

.hero {
  background: var(--terracotta);
  color: var(--cream);
  padding: 8px 0 56px;
}

.hero-grid {
  display: grid;
  gap: 28px;
}

.hero h1 {
  font-size: clamp(2.75rem, 1.4rem + 5.6vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

:lang(tr) .hero h1 {
  font-size: clamp(2.35rem, 1.2rem + 5vw, 5rem);
}

:lang(ko) .hero h1 {
  font-size: clamp(2.25rem, 1.3rem + 4.4vw, 4.4rem);
  line-height: 1.12;
}

.lede {
  margin-top: 18px;
  max-width: 34ch;
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.45;
}

.install {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 28px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.badge {
  display: inline-block;
  border-radius: 10px;
}

/* site.js marks phones; each sees only its own store's badge. */
[data-device="ios"] .badge[data-store="google_play"],
[data-device="android"] .badge[data-store="app_store"] {
  display: none;
}

.badge img {
  height: 56px;
  width: auto;
}

.qr {
  display: none;
}

.install-note {
  margin-top: 14px;
  font-size: 0.9375rem;
}

/* The puzzle card is drawn like the app's own quiz screen. */

.quiz {
  display: none;
  background: var(--app-bg);
  color: var(--app-text);
  border-radius: 14px;
  padding: 14px;
}

.js .quiz {
  display: block;
}

.quiz-count {
  font-size: 0.875rem;
  font-weight: 700;
  color: #7A4B2A;
  margin: 2px 2px 10px;
  min-height: 1.4em;
}

.quiz-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.panel {
  background: #FFFFFF;
  border: 1px solid var(--app-line);
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  transition: border-color 200ms ease;
}

.panel.match {
  border-color: var(--right);
}

.panel canvas {
  width: 100%;
  height: 100%;
}

.quiz-ask,
.quiz-result,
.quiz-end {
  margin-top: 14px;
  min-height: 132px;
}

.quiz-prompt {
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.35;
  margin: 0 2px 12px;
}

.quiz-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quiz-answers button {
  min-height: 52px;
  padding: 8px 12px;
  border: 1.5px solid #D6C6B1;
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--app-text);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.quiz-answers button:hover {
  border-color: var(--app-primary);
}

.quiz-answers button:disabled {
  cursor: default;
}

.quiz :focus-visible {
  outline-color: var(--app-primary);
}

.quiz-result {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.quiz-result[hidden],
.quiz-ask[hidden],
.quiz-end[hidden] {
  display: none;
}

.quiz-why {
  flex: 1;
  min-width: 0;
}

.verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.verdict svg {
  flex: none;
}

.verdict.right {
  color: var(--right);
}

.verdict.wrong {
  color: var(--wrong);
}

.quiz-why p:last-child {
  font-size: 0.9875rem;
  line-height: 1.45;
}

.next,
.again {
  flex: none;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.next {
  border: 0;
  background: var(--app-primary);
  color: #FFFFFF;
}

.next:hover {
  background: #9A4507;
}

.quiz-end .score {
  font-family: var(--display);
  font-size: 2.25rem;
  line-height: 1.05;
  margin-bottom: 6px;
}

.quiz-end-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 14px;
}

.quiz-end .badge img {
  height: 50px;
}

.again {
  border: 1.5px solid #D6C6B1;
  background: #FFFFFF;
  color: var(--app-text);
}

.again:hover {
  border-color: var(--app-primary);
}

/* Sections */

.modes,
.daily,
.plans {
  background: var(--cream);
  color: var(--ink);
  padding: 64px 0;
}

.explain,
.tests {
  background: var(--ink);
  color: var(--cream);
  padding: 64px 0;
}

section h2 {
  font-size: clamp(2.1rem, 1.4rem + 2.8vw, 3.4rem);
  line-height: 1.02;
  max-width: 18ch;
}

:lang(ko) section h2 {
  line-height: 1.18;
}

.section-lede {
  margin-top: 14px;
  max-width: 54ch;
  font-size: 1.125rem;
}

.modes .section-lede {
  color: var(--muted);
}

.mode-grid {
  list-style: none;
  padding: 0;
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 14px;
}

.mode-grid.collapsed li:nth-child(n + 7) {
  display: none;
}

.tile {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  padding: 10px;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mode-grid h3 {
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.3;
}

.mode-grid p {
  margin-top: 2px;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--muted);
}

.pro {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px 2px;
  border-radius: 5px;
  background: var(--emerald);
  color: #FFFFFF;
  font-size: 0.75rem;
  line-height: 1.4;
  vertical-align: 2px;
}

.more {
  margin-top: 28px;
  min-height: 48px;
  padding: 0 20px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.more:hover {
  background: var(--ink);
  color: var(--cream);
}

.modes :focus-visible,
.daily :focus-visible,
.plans :focus-visible {
  outline-color: var(--terracotta);
}

/* Phones hold real app screens. */

.phone {
  border: 8px solid var(--ink);
  border-radius: 30px;
  overflow: hidden;
  background: var(--app-bg);
}

.explain .phone {
  border-color: #120702;
  box-shadow: 0 0 0 1px var(--line-dark);
}

.phone img,
.phone video {
  width: 100%;
  height: auto;
}

.explain-grid {
  display: grid;
  gap: 36px;
  align-items: center;
}

.phone-video {
  max-width: 320px;
  width: 100%;
  margin: 0 auto;
}

.explain-copy p {
  margin-top: 16px;
  max-width: 44ch;
  font-size: 1.125rem;
}

.daily-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}

.daily-copy h3 {
  margin-top: 28px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.daily-copy h2 + h3 {
  margin-top: 28px;
}

.daily-copy p {
  margin-top: 6px;
  max-width: 46ch;
  color: var(--muted);
}

.daily-screens {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 520px;
}

.daily-screens .phone {
  border-width: 6px;
  border-radius: 24px;
}

.tests table {
  margin-top: 32px;
  width: 100%;
  max-width: 860px;
  border-collapse: collapse;
}

.tests th {
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tan);
  padding: 0 16px 10px 0;
}

.tests td {
  padding: 14px 16px 14px 0;
  border-top: 1px solid var(--line-dark);
  vertical-align: top;
}

.tests td:first-child {
  width: 52%;
}

.tests td:last-child {
  color: var(--accent);
  font-weight: 700;
}

.tests-note {
  margin-top: 24px;
  max-width: 60ch;
  font-size: 0.9375rem;
  color: var(--tan);
}

.plan-grid {
  display: grid;
  gap: 14px;
  margin-top: 32px;
  max-width: 920px;
}

.plan {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}

.plan-pro {
  border: 2px solid var(--emerald);
}

.plan h3 {
  font-size: 1.25rem;
  line-height: 1.3;
}

.plan p {
  margin-top: 8px;
  color: var(--muted);
}

.privacy {
  margin-top: 28px;
  max-width: 60ch;
}

.final {
  background: var(--terracotta);
  color: var(--cream);
  padding: 64px 0;
  overflow: hidden;
}

.final h2 {
  color: var(--cream);
}

.final-grid {
  display: grid;
  gap: 24px;
  align-items: center;
}

.final-mark {
  display: none;
}

/* Footer */

.foot {
  background: var(--ink);
  color: var(--cream-muted);
  padding: 44px 0 calc(110px + env(safe-area-inset-bottom));
  font-size: 0.9375rem;
}

.foot-grid {
  display: grid;
  gap: 28px;
}

.foot-brand {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--cream);
  margin-bottom: 4px;
}

:lang(ko) .foot-brand {
  font-family: var(--body);
  font-weight: 700;
}

.foot-links,
.lang-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 12px;
}

.foot-links a {
  display: inline-block;
  padding: 6px 0;
}

.foot-label {
  color: var(--tan);
}

.lang-list {
  margin-top: 4px;
}

.lang-list button,
.lang-list span {
  display: inline-block;
  padding: 6px 0;
  background: none;
  border: 0;
  font-size: inherit;
}

.lang-list button {
  text-decoration: underline;
  cursor: pointer;
  color: var(--cream-muted);
}

.lang-list span {
  color: var(--cream);
  font-weight: 700;
}

.foot-tm {
  margin-top: 28px;
  font-size: 0.8125rem;
  color: var(--tan);
}

/* Install bar for phones, shown once the page's own buttons scroll away. */

.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--ink);
  color: var(--cream);
  border-top: 1px solid var(--line-dark);
  transform: translateY(110%);
  transition: transform 200ms ease;
}

.sticky.show {
  transform: none;
}

.sticky > img {
  border-radius: 9px;
  flex: none;
}

.sticky-text {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.sticky-text strong,
.sticky-text span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-text strong {
  font-size: 0.9375rem;
}

.sticky-text span {
  font-size: 0.8125rem;
  color: var(--tan);
}

.sticky .badges {
  flex: none;
  flex-wrap: nowrap;
  gap: 8px;
}

.sticky .badge img {
  height: 44px;
}

@media (min-width: 560px) {
  .mode-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .plan-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .bar-install {
    display: flex;
    gap: 10px;
  }
  .hero {
    padding: 24px 0 88px;
  }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
    gap: 64px;
    align-items: center;
  }
  .quiz {
    padding: 20px;
  }
  .quiz-stage {
    gap: 14px;
  }
  .quiz-prompt {
    font-size: 1.1875rem;
  }
  .modes,
  .daily,
  .plans,
  .explain,
  .tests,
  .final {
    padding: 96px 0;
  }
  .mode-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 32px 18px;
  }
  .mode-grid.collapsed li:nth-child(n + 7) {
    display: list-item;
  }
  .more {
    display: none;
  }
  .explain-grid {
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 80px;
  }
  .phone-video {
    margin: 0;
  }
  .daily-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 64px;
  }
  .daily-screens {
    justify-self: end;
    width: 100%;
  }
  .final-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
  .final-mark {
    display: block;
  }
  .foot {
    padding-bottom: 44px;
  }
  .foot-grid {
    grid-template-columns: 1fr auto;
  }
  .sticky {
    display: none;
  }
}

/* A QR code only helps someone reading on a computer. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .qr {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    line-height: 1.35;
    max-width: 230px;
  }
  .qr img {
    width: 88px;
    height: 88px;
    padding: 8px;
    border-radius: 8px;
    background: var(--cream);
    flex: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sticky,
  .panel,
  .quiz-answers button {
    transition: none;
  }
}
