:root {
  color-scheme: light dark;
  --bg: #f3efe7;
  --surface: #ffffff;
  --surface-soft: #ece7dc;
  --text: #182030;
  --muted: #5a6070;
  --line: #d9d2c4;
  --accent: #0e2f68;
  --accent-2: #935f1c;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-lg: 0 18px 42px rgba(16, 20, 35, 0.12);
  --max-width: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131a;
    --surface: #171b25;
    --surface-soft: #1e2430;
    --text: #edf2ff;
    --muted: #b1bbcf;
    --line: #2b3242;
    --accent: #9fc0ff;
    --accent-2: #ffd9a8;
    --shadow-lg: 0 20px 46px rgba(0, 0, 0, 0.45);
  }

  body {
    background:
      radial-gradient(circle at 10% -10%, rgba(178, 124, 48, 0.22), transparent 34%),
      radial-gradient(circle at 90% 6%, rgba(70, 104, 168, 0.22), transparent 32%),
      var(--bg);
  }

  .site-header {
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  }

  .hero-points li {
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    border-color: color-mix(in srgb, var(--line) 86%, transparent);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe7;
  --surface: #ffffff;
  --surface-soft: #ece7dc;
  --text: #182030;
  --muted: #5a6070;
  --line: #d9d2c4;
  --accent: #0e2f68;
  --accent-2: #935f1c;
  --shadow-lg: 0 18px 42px rgba(16, 20, 35, 0.12);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10131a;
  --surface: #171b25;
  --surface-soft: #1e2430;
  --text: #edf2ff;
  --muted: #b1bbcf;
  --line: #2b3242;
  --accent: #9fc0ff;
  --accent-2: #ffd9a8;
  --shadow-lg: 0 20px 46px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 10% -10%, rgba(178, 124, 48, 0.22), transparent 34%),
    radial-gradient(circle at 90% 6%, rgba(70, 104, 168, 0.22), transparent 32%),
    var(--bg);
}

html[data-theme="dark"] .site-header {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

html[data-theme="dark"] .hero-points li {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-color: color-mix(in srgb, var(--line) 86%, transparent);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 10% -10%, rgba(236, 175, 83, 0.2), transparent 34%),
    radial-gradient(circle at 90% 6%, rgba(71, 121, 222, 0.2), transparent 32%),
    var(--bg);
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.page-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.page-shell > main {
  flex: 1;
}

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

a {
  color: inherit;
}

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

.container {
  width: min(100% - 40px, var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  text-decoration: none;
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nav-store-badge-top {
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  text-decoration: none;
  line-height: 0;
  order: 3;
}

.nav-store-badge-top img {
  width: 132px;
  height: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-left: auto;
  order: 2;
}

.nav-links a:not(.nav-store-badge) {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.nav-links a:not(.nav-store-badge):hover {
  color: var(--text);
}

.nav-links .nav-store-badge {
  display: none;
}

.nav-links .nav-store-badge img {
  width: 132px;
  height: auto;
  display: block;
}

.theme-toggle {
  appearance: none;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--muted);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.theme-toggle:hover {
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--line));
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent-2) 18%, transparent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle-icon {
  font-size: 1.05rem;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.theme-toggle:hover .theme-toggle-icon {
  color: var(--text);
  transform: rotate(10deg) scale(1.04);
}

.theme-toggle-nav {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  order: 4;
}

.theme-toggle-footer {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 34px;
  align-items: start;
  padding: 52px 0 16px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.76rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
}

.hero h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
}

.hero-lead {
  margin: 14px 0 0;
  color: var(--muted);
  max-width: 62ch;
  font-size: 1.07rem;
}

.cta-row {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.badge-link {
  display: inline-flex;
  border-radius: 12px;
}

.badge-link img {
  width: 180px;
  height: auto;
}

.text-cta {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
}

.hero-points {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-points li {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: 0.86rem;
}

.hero-image {
  width: min(100%, 390px);
  height: auto;
  justify-self: center;
  align-self: start;
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.section {
  padding: 52px 0 12px;
}

#library {
  padding-bottom: 24px;
}

.section-compact {
  padding-top: 14px;
  padding-bottom: 4px;
}

.section-head {
  max-width: 880px;
}

.section-head h2 {
  margin-top: 8px;
  font-size: clamp(1.6rem, 3.3vw, 2.6rem);
}

.value-grid,
.feature-grid,
.steps-grid,
.mode-grid {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.value-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.steps-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.vocab-section {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 20px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.section-head + .vocab-section {
  margin-top: 22px;
}

.vocab-copy h2 {
  margin-top: 8px;
  font-size: clamp(1.5rem, 3.1vw, 2.2rem);
}

.vocab-copy p {
  margin: 12px 0 0;
  color: var(--muted);
}

.vocab-points {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.vocab-points li + li {
  margin-top: 8px;
}

.vocab-section > img {
  width: min(100%, 330px);
  height: auto;
  justify-self: center;
  border: 0;
  background: transparent;
}

.value-card,
.feature-card,
.step-card,
.mode-card,
.trust,
.cta-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.value-card,
.feature-card {
  padding: 18px;
}

.value-card h3,
.feature-card h3 {
  font-size: 1.25rem;
}

.value-card p,
.feature-card p,
.step-card p,
.trust-copy p,
.cta-panel p,
.site-footer p {
  margin: 10px 0 0;
  color: var(--muted);
}

.step-card {
  padding: 16px;
}

.mode-card {
  padding: 0;
  display: block;
  overflow: hidden;
}

.mode-card > img {
  width: min(76%, 280px);
  height: auto;
  margin: 16px auto 6px;
  border-radius: 12px;
  border: 0;
  background: transparent;
}

.mode-body {
  padding: 12px 16px 16px;
}

.mode-body h3 {
  font-size: 1.35rem;
}

.mode-points {
  margin: 12px 0 0;
  padding-left: 18px;
  list-style: disc;
  color: var(--muted);
}

.step-number {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.step-card img {
  margin-top: 14px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 0;
  background: transparent;
}

.trust {
  padding: 24px;
}

.policy-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 3vw, 34px);
}

.policy-card h1 {
  font-size: clamp(1.85rem, 3.4vw, 2.7rem);
}

.policy-card h2 {
  margin-top: 24px;
  font-size: 1.45rem;
}

.policy-card h3 {
  margin-top: 16px;
  font-size: 1.18rem;
}

.policy-card p,
.policy-card li {
  margin-top: 10px;
  color: var(--muted);
}

.policy-card ul {
  margin-top: 8px;
  padding-left: 20px;
}

.trust h2 {
  margin-top: 8px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.link-arrow {
  display: inline-block;
  margin-top: 14px;
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
}

.cta-panel {
  text-align: center;
  padding: 28px 20px;
  margin-top: 20px;
}

.cta-panel h2 {
  font-size: clamp(1.5rem, 3.1vw, 2.3rem);
}

.cta-panel .badge-link {
  margin-top: 14px;
}

.support-line {
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.footer-inner {
  padding: 24px 0 28px;
  font-size: 0.96rem;
}

.footer-inner p {
  margin: 0;
}

.footer-inner p:first-child {
  color: var(--text);
  font-weight: 600;
}

.footer-inner p + p {
  margin-top: 8px;
}

.locale-switcher {
  display: none;
  margin-top: 10px;
}

.locale-switcher-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.locale-switcher-label {
  font-weight: 600;
}

.locale-switcher-select {
  appearance: auto;
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.locale-switcher-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 1100px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .value-grid,
  .feature-grid,
  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vocab-section {
    grid-template-columns: 1fr;
    text-align: left;
  }

}

@media (max-width: 760px) {
  .container {
    width: min(100% - 28px, var(--max-width));
  }

  .nav-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
  }

  .brand {
    font-size: 1.35rem;
    order: 1;
  }

  .nav-store-badge-top {
    display: inline-flex;
    order: 2;
    margin-left: auto;
  }

  .nav-store-badge-top img {
    width: 118px;
  }

  .nav-links {
    order: 3;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 0 14px 2px 10px;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-links a:not(.nav-store-badge) {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 999px;
    white-space: nowrap;
    border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
    background: color-mix(in srgb, var(--surface) 76%, transparent);
  }

  .nav-links .nav-store-badge img {
    width: 120px;
  }

  .nav-links .nav-store-badge {
    display: none;
  }

  .theme-toggle-nav {
    position: fixed;
    top: max(
      calc(env(safe-area-inset-top, 0px) + 10px),
      var(--mobile-theme-toggle-dynamic-top, calc(env(safe-area-inset-top, 0px) + 10px))
    );
    right: 14px;
    display: inline-grid;
    place-items: center;
    order: 2;
    margin-left: 0;
    z-index: 45;
  }

  .theme-toggle-footer {
    display: none;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .hero {
    padding-top: 30px;
    gap: 22px;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 8.6vw, 2.45rem);
  }

  .hero-lead {
    font-size: 1rem;
  }

  .cta-row {
    margin-top: 18px;
    gap: 10px;
  }

  .text-cta {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .hero-points {
    margin-top: 14px;
    gap: 8px;
  }

  .hero-points li {
    font-size: 0.82rem;
    padding: 7px 10px;
  }

  .locale-switcher-control {
    width: 100%;
    justify-content: space-between;
  }

  .hero-image {
    width: min(100%, 340px);
  }

  .section {
    padding: 36px 0 10px;
  }

  #library {
    padding-bottom: 18px;
  }

  .section-head h2 {
    font-size: clamp(1.45rem, 7.4vw, 2rem);
  }

  .value-card,
  .feature-card,
  .step-card,
  .mode-body {
    padding: 14px;
  }

  .value-grid,
  .feature-grid,
  .steps-grid,
  .mode-grid {
    grid-template-columns: 1fr;
  }

  .vocab-section {
    padding: 18px;
  }

  .vocab-section > img {
    width: min(100%, 300px);
  }

  .cta-panel {
    padding: 22px 16px;
    margin-top: 18px;
  }

  .footer-inner {
    padding: 20px 0 24px;
  }

}
