/* style.css */
:root {
  color-scheme: dark;
  --bg: #10131f;
  --surface: #181d2c;
  --surface-2: #20273a;
  --text: #f5f3ed;
  --muted: #a9b0c4;
  --line: #303950;
  --accent: #f5bd68;
  --accent-2: #a8d9cc;
  --danger: #ef8b82;
  --shadow: 0 18px 50px rgba(0, 0, 0, .18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f2eb;
  --surface: #fffdf8;
  --surface-2: #eee9df;
  --text: #252638;
  --muted: #737487;
  --line: #ddd6c9;
  --accent: #bc702f;
  --accent-2: #428778;
  --shadow: 0 18px 50px rgba(86, 65, 38, .11);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 85% 3%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28rem),
    var(--bg);
  color: var(--text);
}

button {
  font: inherit;
  cursor: pointer;
}

.app-shell {
  width: min(100% - 32px, 930px);
  margin: auto;
  padding: 24px 0 34px;
}

.topbar, .card-top, .section-heading, footer, .practice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.55rem, 4vw, 2rem); letter-spacing: -.06em; }
h2 { margin-bottom: 8px; font-size: clamp(1.45rem, 4vw, 2.2rem); letter-spacing: -.045em; }
h3 { margin-bottom: 8px; letter-spacing: -.035em; }
p { line-height: 1.55; }

.icon-button, .save-button, .text-button, .primary-button, .secondary-button, .learn-button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
button:hover { transform: translateY(-1px); }
button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.icon-button {
  width: 44px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.3rem;
}

.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 52px 0 30px;
}
.hero-copy { max-width: 610px; }
.hero-copy p:last-child { color: var(--muted); margin-bottom: 0; max-width: 560px; }

.progress-ring {
  display: grid;
  flex: 0 0 84px;
  aspect-ratio: 1;
  place-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.progress-ring strong { font-size: 1.1rem; }
.progress-ring span { color: var(--muted); font-size: .68rem; }

.tabs {
  display: flex;
  gap: 7px;
  padding: 5px;
  margin-bottom: 35px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}
.tab {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.tab.active { background: var(--accent); color: #1b1720; }

.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 0; }
.text-button {
  padding: 8px 12px;
  background: transparent;
  color: var(--accent);
  font-weight: 750;
}
.word-list { display: grid; gap: 14px; }

.word-card, .saved-card, .practice-card, .empty-state {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.word-card { padding: 20px; }
.word-card.learned { border-color: color-mix(in srgb, var(--accent-2) 75%, var(--line)); }
.word-number { color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .1em; }
.save-button {
  padding: 7px 12px;
  min-height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
}
.save-button.saved { border-color: var(--accent); color: var(--accent); }
.word-card h3 { margin: 20px 0 2px; font-size: clamp(1.65rem, 5vw, 2.3rem); }
.pronunciation {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent-2);
  font-size: .9rem;
  font-weight: 750;
}
.sound-mark {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: .65rem;
}
.meaning { margin: 17px 0; font-size: 1.05rem; }
.replace-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .83rem;
}
.replace-box div { display: flex; flex-wrap: wrap; gap: 6px; }
.replace-box b {
  padding: 4px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  color: var(--text);
  font-weight: 600;
}
details { margin: 17px 0; border-top: 1px solid var(--line); padding-top: 14px; }
summary { color: var(--accent); cursor: pointer; font-size: .9rem; font-weight: 700; }
.details-content { color: var(--muted); font-size: .9rem; padding-top: 12px; }
.details-content p { margin-bottom: 9px; }
.details-content strong { color: var(--text); }
.learn-button {
  width: 100%;
  background: var(--accent);
  color: #211921;
  font-weight: 800;
}
.learn-button.complete { background: var(--surface-2); color: var(--accent-2); }

.saved-card {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) 1.7fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
}
.saved-card h3 { margin-bottom: 4px; }
.saved-card span, .saved-card p { color: var(--muted); font-size: .9rem; }
.saved-card p { margin: 0; }

.practice-card { padding: clamp(22px, 6vw, 45px); }
.practice-card h3 { max-width: 650px; font-size: clamp(1.5rem, 5vw, 2.5rem); }
.practice-prompt { color: var(--muted); }
.answer {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 13px;
  min-height: 72px;
  margin: 22px 0;
  padding: 18px;
  border-radius: 14px;
  background: var(--surface-2);
}
.answer strong { font-size: 1.8rem; }
.answer span { color: var(--accent-2); font-weight: 700; }
.answer.blurred { color: var(--muted); }
.practice-example { color: var(--muted); font-style: italic; }
.primary-button, .secondary-button { padding: 9px 16px; font-weight: 800; }
.primary-button { background: var(--accent); color: #211921; }
.secondary-button { border: 1px solid var(--line); background: transparent; color: var(--text); }
.empty-state { padding: 42px 24px; text-align: center; }
.empty-state p { color: var(--muted); margin-bottom: 0; }

footer {
  margin-top: 35px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: .8rem;
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 22px, 930px); padding-top: 16px; }
  .hero { align-items: start; margin-top: 38px; }
  .progress-ring { flex-basis: 68px; }
  .saved-card { grid-template-columns: 1fr auto; }
  .saved-card p { grid-column: 1 / -1; grid-row: 2; }
  .saved-card .text-button { grid-column: 2; grid-row: 1; }
  .section-heading { align-items: start; }
  .section-heading .text-button { font-size: .75rem; padding-inline: 0; }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { color-scheme: light; }
}
