/* ============ erudaily — warm, cozy, natural ============ */

:root {
  --paper: #f7efe2;
  --paper-deep: #f1e5d1;
  --card: #fffaf1;
  --ink: #43331f;
  --ink-soft: #6f5b41;
  --ink-faint: #9a856a;
  --terracotta: #b65c38;
  --terracotta-deep: #96482a;
  --sage: #6f7f5c;
  --sage-deep: #55643f;
  --gold: #c9a24b;
  --line: #e3d3b8;
  --shadow: 0 18px 40px -18px rgba(94, 66, 34, 0.35);
  --serif-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --serif-body: "Newsreader", "Iowan Old Style", Georgia, serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--serif-body);
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 15% -5%, rgba(201, 162, 75, 0.12), transparent 60%),
    radial-gradient(900px 420px at 95% 0%, rgba(111, 127, 92, 0.10), transparent 55%),
    var(--paper);
}

/* soft paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.36 0 0 0 0 0.24 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.sky { display: none; }

header, main, footer { position: relative; z-index: 1; }

/* ============ header ============ */

.site-header {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.6rem 1.4rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-leaf {
  width: 1.7rem;
  height: 1.7rem;
  color: var(--sage-deep);
  transform: rotate(-8deg);
}

.brand-name {
  font-family: var(--serif-display);
  font-weight: 640;
  font-size: 1.55rem;
  letter-spacing: 0.01em;
}

.brand-accent { color: var(--terracotta); font-style: italic; font-weight: 560; }

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

.nav-link {
  font-family: var(--serif-body);
  font-size: 0.98rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-link:hover { color: var(--terracotta-deep); background: rgba(182, 92, 56, 0.08); }

.nav-link[aria-current="page"] {
  color: var(--terracotta-deep);
  background: rgba(182, 92, 56, 0.10);
  border-color: rgba(182, 92, 56, 0.25);
}

/* ============ word view ============ */

.word-view {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.2rem 1.4rem 2rem;
}

.date-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 0.4rem 0 1.1rem;
  font-size: 0.98rem;
  color: var(--ink-soft);
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}

.day-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.18s ease;
}

.day-arrow svg { width: 0.95rem; height: 0.95rem; }

.day-arrow:hover:not(:disabled) {
  color: var(--terracotta-deep);
  border-color: var(--terracotta);
  transform: translateY(-1px);
}

.day-arrow:disabled { opacity: 0.28; cursor: default; }

.word-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 2.4rem 2.6rem 2.1rem;
  animation: settle 0.5s ease both;
}

@keyframes settle {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.card-vine {
  color: var(--sage);
  opacity: 0.75;
  margin: -0.6rem auto 0.4rem;
  max-width: 220px;
}

.eyebrow {
  margin: 0;
  text-align: center;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.22em;
  font-size: 0.92rem;
  color: var(--gold);
  font-weight: 500;
}

.headword {
  margin: 0.15rem 0 0;
  text-align: center;
  font-family: var(--serif-display);
  font-weight: 560;
  font-size: clamp(2.6rem, 8vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.pron-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 0.35rem 0 1.4rem;
  min-height: 1.6rem;
}

.phonetic {
  font-size: 1.05rem;
  color: var(--ink-faint);
  font-style: italic;
}

.audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--sage-deep);
  cursor: pointer;
  transition: all 0.18s ease;
}

.audio-btn svg { width: 1.05rem; height: 1.05rem; }
.audio-btn:hover { color: var(--terracotta-deep); border-color: var(--terracotta); }

/* senses */

.sense-group { margin: 0 0 1.35rem; }

.pos {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 480;
  font-size: 1.12rem;
  color: var(--terracotta);
  margin: 0 0 0.4rem;
}

.defs {
  margin: 0;
  padding-left: 1.35rem;
  color: var(--ink);
}

.defs li { margin: 0 0 0.55rem; }
.defs li::marker { color: var(--gold); font-family: var(--serif-display); }

.def-text { margin: 0; }

.example {
  margin: 0.3rem 0 0;
  padding-left: 0.85rem;
  border-left: 2px solid var(--line);
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.99rem;
}

.example::before { content: "“"; color: var(--gold); }
.example::after { content: "”"; color: var(--gold); }

.section-label {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.18em;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--sage-deep);
  margin: 0 0 0.55rem;
}

.syn-block { border-top: 1px dashed var(--line); padding-top: 1.15rem; margin-top: 0.4rem; }

.syn-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.syn-list li {
  background: rgba(111, 127, 92, 0.10);
  border: 1px solid rgba(111, 127, 92, 0.28);
  color: var(--sage-deep);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  font-size: 0.95rem;
}

.attribution {
  margin: 1.4rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: center;
}

.loading-note {
  text-align: center;
  color: var(--ink-faint);
  font-style: italic;
  margin-top: 1rem;
}

/* ============ archive ============ */

.archive-view {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.4rem 1.4rem 2.5rem;
}

.archive-title {
  font-family: var(--serif-display);
  font-weight: 560;
  font-size: 2.1rem;
  margin: 0.4rem 0 0.2rem;
  text-align: center;
}

.archive-sub {
  text-align: center;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  font-style: italic;
}

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

.archive-item button {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  cursor: pointer;
  font-family: var(--serif-body);
  transition: all 0.18s ease;
}

.archive-item button:hover {
  border-color: var(--terracotta);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -14px rgba(94, 66, 34, 0.4);
}

.archive-word {
  font-family: var(--serif-display);
  font-weight: 560;
  font-size: 1.25rem;
  color: var(--ink);
}

.archive-word .archive-pos {
  font-style: italic;
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--terracotta);
  margin-left: 0.45rem;
}

.archive-date {
  color: var(--ink-faint);
  font-size: 0.88rem;
  white-space: nowrap;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.06em;
}

.archive-item.is-today .archive-date { color: var(--terracotta); }

.more-btn {
  display: block;
  margin: 1.4rem auto 0;
  font-family: var(--serif-body);
  font-size: 0.98rem;
  color: var(--sage-deep);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1.3rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.more-btn:hover { color: var(--terracotta-deep); border-color: var(--terracotta); }

/* ============ footer ============ */

.site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1.4rem 2.2rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.86rem;
}

.site-footer a { color: var(--sage-deep); }

.hidden { display: none !important; }

/* ============ small screens ============ */

@media (max-width: 560px) {
  .word-card { padding: 1.7rem 1.3rem 1.6rem; border-radius: 18px; }
  .site-header { flex-direction: column; gap: 0.5rem; padding-top: 1.2rem; }
}

/* ============ reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  .word-card { animation: none; }
  * { transition: none !important; }
}
