:root {
  --bg: #fafaf7;
  --fg: #0e0e0e;
  --muted: #5c5c5c;
  --border: #e5e3dc;
  --accent: #0f4c5c;
  --accent-hover: #0b3a47;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(14, 14, 14, 0.04), 0 8px 24px rgba(14, 14, 14, 0.04);
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Germania One", Georgia, "Times New Roman", serif;
  --maxw: 42rem;
  --step-0: 0.8125rem;
  --step-1: 0.9375rem;
  --step-2: 1.0625rem;
  --step-3: 1.3125rem;
  --step-4: 1.75rem;
  --step-5: 2.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1416;
    --fg: #f2f0e9;
    --muted: #9aa3a5;
    --border: #1f2a2d;
    --accent: #5fb3c4;
    --accent-hover: #7dc5d3;
    --card: #131b1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

:root[data-theme="dark"] {
  --bg: #0e1416;
  --fg: #f2f0e9;
  --muted: #9aa3a5;
  --border: #1f2a2d;
  --accent: #5fb3c4;
  --accent-hover: #7dc5d3;
  --card: #131b1e;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-2);
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 768px) {
  .wrap {
    padding: 0 2rem;
  }
}

header.site {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-weight: 600;
  font-size: var(--step-2);
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  appearance: none;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn svg {
  width: 1rem;
  height: 1rem;
}

.icon-btn .sun {
  display: none;
}

:root[data-theme="dark"] .icon-btn .sun,
:root:not([data-theme="light"]) .icon-btn .sun {
  display: inline;
}

:root[data-theme="dark"] .icon-btn .moon,
:root:not([data-theme="light"]) .icon-btn .moon {
  display: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-btn .sun {
    display: none;
  }
  :root:not([data-theme="dark"]) .icon-btn .moon {
    display: inline;
  }
}

.lang {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: var(--step-0);
  font-weight: 500;
}

.lang a {
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.lang a:hover {
  color: var(--fg);
}

.lang a.current {
  color: var(--fg);
  background: var(--border);
}

main.wrap {
  padding-top: 4rem;
  padding-bottom: 6rem;
}

main > section {
  margin-bottom: 4rem;
}

main > section:last-child {
  margin-bottom: 0;
}

h1 {
  font-size: var(--step-5);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-weight: 600;
}

h2 {
  font-size: var(--step-4);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.75rem;
  font-weight: 600;
}

h3 {
  font-size: var(--step-3);
  line-height: 1.3;
  margin: 0 0 0.5rem;
  font-weight: 600;
}

p {
  margin: 0 0 1rem;
  color: var(--fg);
}

.lede {
  font-size: var(--step-3);
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 2rem;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 150ms ease;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: var(--step-1);
  text-decoration: none;
  border: 1px solid var(--accent);
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
}

.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}

.feature h3 {
  font-size: var(--step-2);
  margin-bottom: 0.375rem;
}

.feature p {
  color: var(--muted);
  font-size: var(--step-1);
  margin: 0;
}

.mock-wrap {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.phone {
  width: 17.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2.25rem;
  padding: 0.75rem;
  box-shadow: var(--shadow);
  position: relative;
}

.phone-notch {
  position: absolute;
  top: 0.875rem;
  left: 50%;
  transform: translateX(-50%);
  width: 5rem;
  height: 0.375rem;
  background: var(--border);
  border-radius: 999px;
}

.phone-screen {
  background: var(--bg);
  border-radius: 1.75rem;
  padding: 2.5rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--step-0);
  color: var(--muted);
  padding: 0 0.25rem 0.5rem;
}

.screen-header .dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--accent);
}

.word-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.word-card.active {
  border-left: 3px solid var(--accent);
  padding-left: calc(0.875rem - 2px);
}

.lemma {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-2);
  letter-spacing: 0.01em;
  color: var(--fg);
}

.gloss {
  font-size: var(--step-0);
  color: var(--muted);
}

.sentence {
  font-size: var(--step-0);
  color: var(--fg);
  font-style: italic;
  line-height: 1.4;
}

footer.site {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  font-size: var(--step-1);
  color: var(--muted);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--fg);
}

.foot-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

article.prose h2 {
  margin-top: 2.5rem;
}

article.prose h2:first-of-type {
  margin-top: 0;
}

article.prose ul {
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}

article.prose li + li {
  margin-top: 0.25rem;
}

article.prose p,
article.prose li {
  color: var(--fg);
}

.muted {
  color: var(--muted);
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}
