﻿:root {
  --bg: #e7e2db;
  --bg-soft: #f6f3ef;
  --panel: rgba(248, 244, 239, 0.9);
  --panel-dark: #23272e;
  --signup: #9f8c78;
  --signup-text: #f8f4ef;
  --text: #181818;
  --muted: #625d58;
  --line: rgba(27, 26, 24, 0.12);
  --shadow: 0 24px 80px rgba(28, 24, 20, 0.12);
  --slate: #363d44;
  --brown: #8d7969;
  --nav-1: #d9d1c6;
  --nav-2: #c9c0b5;
  --nav-3: #bbb2a8;
  --nav-4: #aaa198;
  --nav-5: #e7ddd0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Quicksand", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(141, 121, 105, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(54, 61, 68, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

.page {
  width: 100%;
  margin: 0;
}

.topbar,
.card,
.resource-card,
.faq-item,
.pill-row,
.toolbar-card,
.topic-card,
.table-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  background: var(--panel-dark);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 34px rgba(23, 24, 27, 0.16);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #f3eee8;
  font-weight: 700;
  flex: 0 0 auto;
  margin-right: 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4a525b, #67717c);
  color: white;
}

.topbar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 520px);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 8px;
}

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

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  flex: 0 0 auto;
  color: rgba(243, 239, 234, 0.84);
}

.topbar-item:hover,
.topbar-item.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: #f5efe8;
}

.topbar-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

.auth-link,
.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.auth-link {
  color: rgba(243, 239, 234, 0.84);
}

.auth-button {
  background: var(--signup);
  color: var(--signup-text);
}

.icon {
  width: 20px;
  height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
}

.tone-1 { color: var(--nav-1); }
.tone-2 { color: var(--nav-2); }
.tone-3 { color: var(--nav-3); }
.tone-4 { color: var(--nav-4); }
.tone-5 { color: var(--nav-5); }

.content-shell {
  width: min(80%, 1320px);
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  padding: 38px 4px 28px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: #50565c;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1, h2, h3 { margin: 0; line-height: 1.08; }

h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  letter-spacing: -0.04em;
  max-width: 11ch;
}

p, li {
  color: var(--muted);
  line-height: 1.75;
}

.card,
.toolbar-card,
.topic-card,
.table-card {
  border-radius: 28px;
  padding: 24px;
}

.stat-grid,
.resource-grid,
.section-grid-3,
.feature-grid {
  display: grid;
  gap: 18px;
}

.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.mini-stat strong {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.pill-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 6px;
  padding: 18px 20px;
  border-radius: 24px;
  font-weight: 600;
}

.pill-row span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 9px;
  background: var(--brown);
}

.section { padding-top: 76px; }

.section-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
}

.filters,
.level-row,
.topic-row,
.vocab-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn,
.level-btn,
.topic-btn,
.state-btn {
  border: 1px solid rgba(18, 27, 45, 0.12);
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn.active,
.level-btn.is-active,
.topic-btn.is-active,
.state-btn.is-active {
  background: var(--panel-dark);
  color: white;
  border-color: transparent;
}

.resource-card {
  border-radius: 24px;
  padding: 22px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.meta span,
.vocab-meta span,
.vocab-summary span {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(141, 121, 105, 0.12);
  color: #6e6156;
  font-size: 0.84rem;
  font-weight: 700;
}

.resource-card a {
  display: inline-flex;
  margin-top: 14px;
  color: #232a31;
  font-weight: 700;
  text-decoration: none;
}

.vocab-shell {
  display: grid;
  gap: 18px;
}

.topic-card {
  display: grid;
  gap: 14px;
}

.search-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(18, 27, 45, 0.12);
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
  color: var(--text);
}

.table-card {
  overflow: auto;
}

.vocab-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1320px;
}

.vocab-table th,
.vocab-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(18, 27, 45, 0.08);
  vertical-align: top;
}

.vocab-table th {
  color: #40464d;
  font-size: 0.95rem;
}

.word-main {
  font-weight: 700;
  color: var(--text);
}

.word-gender {
  color: var(--brown);
  font-weight: 700;
}

.ipa {
  font-family: "Times New Roman", serif;
  color: #414141;
  white-space: nowrap;
}

.status-stack,
.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill,
.mini-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.is-new {
  background: rgba(80, 86, 92, 0.12);
  color: #50565c;
}

.status-pill.is-learned {
  background: rgba(101, 123, 102, 0.16);
  color: #49584a;
}

.status-pill.is-review {
  background: rgba(159, 140, 120, 0.18);
  color: #7a6350;
}

.mini-fav {
  background: rgba(35, 39, 46, 0.12);
  color: #23272e;
}

.state-btn {
  padding: 8px 11px;
  font-size: 0.84rem;
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(18, 27, 45, 0.12);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.empty-state {
  color: var(--muted);
  font-weight: 600;
}

.load-error {
  padding: 24px;
  border-radius: 20px;
  border: 1px dashed rgba(18, 27, 45, 0.18);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero,
  .resource-grid,
  .section-grid-3,
  .pill-row,
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .content-shell { width: min(100% - 24px, 1000px); }
  .topbar { padding: 10px 12px; }
  .topbar-nav {
    position: static;
    transform: none;
    max-width: none;
    justify-content: flex-start;
    order: 3;
    width: 100%;
    padding: 0;
  }
  .topbar-auth { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
}
