/* ---------------------------------------------------------------
   directionary — design tokens
   bg: lavender-white · accent: periwinkle · highlights: bubblegum
   pink + mint · display: Baloo 2 (rounded, playful) · body: Nunito
----------------------------------------------------------------- */
:root {
  --bg: #fbf8ff;
  --surface: #ffffff;
  --ink: #2b2640;
  --muted: #6b6580;
  --accent: #7c5cff;
  --accent-ink: #5b3df0;
  --accent-pink: #ff8fa3;
  --accent-mint: #18a497;
  --border: #e7e0fa;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;

  --shadow-sm: 0 2px 8px rgba(43, 38, 64, 0.06);
  --shadow-md: 0 12px 28px rgba(124, 92, 255, 0.16);

  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top 0.15s ease;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

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

/* ---------------------------------------------------------------
   header
----------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
}

.wordmark:hover {
  text-decoration: none;
  color: var(--accent-ink);
}

.site-nav {
  display: flex;
  gap: 0.5rem;
}

.site-nav a {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
}

.site-nav a:hover {
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

/* ---------------------------------------------------------------
   hero / homepage
----------------------------------------------------------------- */
.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px dashed var(--border);
}

.wordmark-large {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  color: var(--accent-ink);
  margin: 0;
  line-height: 1;
}

.pronunciation {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-style: italic;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.search {
  position: relative;
  flex: 0 1 320px;
  min-width: 240px;
  margin-top: 0.4rem;
}

.search input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}

.search input::placeholder {
  color: var(--muted);
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.15);
}

.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.4rem;
  z-index: 10;
  max-height: 320px;
  overflow-y: auto;
}

.search-results__item {
  display: block;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
}

.search-results__item:hover {
  background: var(--bg);
  text-decoration: none;
}

.search-results__empty {
  margin: 0;
  padding: 0.6rem 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------
   word of the day heading
----------------------------------------------------------------- */
.word-of-day {
  padding: 2.5rem 0 1rem;
}

.word-of-day h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  color: var(--accent-mint);
  margin: 0 0 1rem;
}

/* ---------------------------------------------------------------
   word card — used for word-of-day (JS-filled) and full entry pages
----------------------------------------------------------------- */
.word-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px dashed var(--accent-pink);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow-md);
  max-width: 560px;
}

.word-card--full {
  max-width: none;
  margin-top: 1rem;
}

.word-card__loading {
  margin: 0;
  color: var(--muted);
}

.word-card__eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-pink);
  background: rgba(255, 143, 163, 0.12);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  margin: 0 0 0.6rem;
}

.word-card__word {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 0.2rem;
  color: var(--ink);
}

.word-card__pronunciation {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-style: italic;
}

.word-card__pos {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-mint);
  background: rgba(24, 164, 151, 0.12);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  margin-bottom: 0.9rem;
}

.word-card__meaning {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}

.word-card__example {
  margin: 0 0 0.75rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
  font-style: italic;
}

.word-card__meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.word-card__notes {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.word-card__link {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 700;
  color: var(--accent-ink);
}

/* ---------------------------------------------------------------
   alphabet tiles
----------------------------------------------------------------- */
.alphabet {
  padding: 2.5rem 0 1rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 0.6rem;
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tile:hover {
  text-decoration: none;
  transform: translateY(-3px) rotate(-2deg);
  box-shadow: var(--shadow-md);
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tile--big {
  width: 88px;
  height: 88px;
  font-size: 2.4rem;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------
   letter page
----------------------------------------------------------------- */
.letter-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.5rem 0;
}

.letter-count {
  color: var(--muted);
  margin: 0;
}

.word-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.word-list__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  color: var(--ink);
}

.word-list__item:hover {
  text-decoration: none;
  background: rgba(124, 92, 255, 0.06);
  border-color: var(--accent);
}

.word-list__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
}

.word-list__pos {
  font-size: 0.8rem;
  color: var(--accent-mint);
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 1.5rem 0;
}

/* ---------------------------------------------------------------
   breadcrumb
----------------------------------------------------------------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 1.25rem;
}

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

.breadcrumb span {
  color: var(--ink);
  font-weight: 700;
}

/* ---------------------------------------------------------------
   contribute / prose page
----------------------------------------------------------------- */
.prose {
  max-width: 640px;
  margin-top: 1rem;
}

.prose h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--accent-ink);
}

.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.85rem;
}

.prose code {
  background: rgba(124, 92, 255, 0.08);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

.prose pre code {
  background: none;
  padding: 0;
}

/* ---------------------------------------------------------------
   footer
----------------------------------------------------------------- */
.site-footer {
  max-width: 980px;
  margin: 2rem auto 0;
  padding: 1.5rem 1.5rem 3rem;
  border-top: 1px dashed var(--border);
  text-align: center;
}

.site-footer p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------
   responsive
----------------------------------------------------------------- */
@media (max-width: 640px) {
  .hero {
    flex-direction: column;
  }

  .search {
    flex-basis: auto;
    width: 100%;
  }

  .word-card {
    padding: 1.4rem 1.4rem;
  }

  .tile--big {
    width: 64px;
    height: 64px;
    font-size: 1.8rem;
  }
}

/* ---------------------------------------------------------------
   motion preference
----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
