/* WordAndDay — Unified Editorial + Utility Design System */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-alt: #f3ede3;
  --ink: #1c1917;
  --ink-muted: #57534e;
  --border: #e5ddd0;
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-soft: #fef3c7;
  --dark-panel: #111827;
  --dark-border: #263253;
  --teal: #0d9488;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(28, 25, 23, 0.05);
  --shadow-md: 0 12px 30px rgba(28, 25, 23, 0.08);
  --font-serif: Georgia, "Times New Roman", Cambria, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  accent-color: var(--accent);
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

.container {
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 1.75rem);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 62px;
  flex-wrap: wrap;
  padding-block: 0.45rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.04rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: #faf7f2;
  font-family: var(--font-serif);
  font-size: 0.95rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--surface-alt);
  color: var(--ink);
}

/* Hero */
.hero {
  padding-block: clamp(1.4rem, 3.2vw, 2.4rem) 1.25rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0;
  max-width: 68ch;
  color: var(--ink-muted);
  font-size: clamp(0.96rem, 1.5vw, 1.06rem);
}

/* Panels & Grids */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.1rem, 2.5vw, 1.7rem);
  box-shadow: var(--shadow-sm);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.4rem;
  align-items: start;
  margin-bottom: 2rem;
}

@media (max-width: 860px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.step-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

.step-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* Table (Responsive Wrapper) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 620px;
}

table.data-table th,
table.data-table td {
  padding: 0.78rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

table.data-table th {
  background: var(--surface-alt);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

table.data-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-live {
  background: #dcfce7;
  color: #166534;
}

.badge-pending {
  background: var(--surface-alt);
  color: var(--ink-muted);
}

/* Buttons & Inputs */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  min-inline-size: 44px;
  padding: 0.62rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

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

.btn-dark {
  background: var(--ink);
  color: #faf7f2;
}

.btn-dark:hover {
  background: #292524;
  color: #faf7f2;
}

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

.btn-outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--surface-alt);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  padding-inline: 0.65rem;
}

.btn-ghost:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.field-group {
  margin-bottom: 1rem;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.text-input,
.num-input,
.select-input {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
}

.num-input {
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
}

.time-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.input-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.input-box span {
  font-size: 0.74rem;
  color: var(--ink-muted);
  text-transform: uppercase;
}

/* Mode Tabs & Quiz */
.mode-tabs {
  display: inline-flex;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
  margin-bottom: 1.15rem;
  width: 100%;
}

.mode-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.58rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}

.mode-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
}

.progress-bar {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.1rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.quiz-question {
  font-family: var(--font-serif);
  font-size: 1.24rem;
  margin: 0 0 0.9rem;
}

.option-list {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.94rem;
  cursor: pointer;
}

.option-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.option-key {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--surface-alt);
  font-size: 0.78rem;
  font-weight: 700;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  padding: 0.42rem 0.82rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  color: #faf7f2;
  border-color: var(--ink);
}

/* Generator Preview Card */
.preview-card {
  border-radius: var(--radius-md);
  padding: 1.85rem 1.4rem;
  text-align: center;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(28, 25, 23, 0.1);
  box-shadow: var(--shadow-md);
}

.preview-card[data-theme="linen"] {
  background: linear-gradient(160deg, #fbf8f1 0%, #f1e6d2 100%);
  color: #1c1917;
}

.preview-card[data-theme="midnight"] {
  background: linear-gradient(160deg, #171923 0%, #0f172a 100%);
  color: #f8fafc;
}

.preview-card[data-theme="sage"] {
  background: linear-gradient(160deg, #eef3eb 0%, #d8e4d1 100%);
  color: #1f2d1a;
}

.preview-card[data-theme="noir"] {
  background: linear-gradient(160deg, #1c1917 0%, #292524 100%);
  color: #faf7f2;
}

.preview-kicker {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.72;
  font-weight: 600;
}

.preview-word {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.8vw, 2.9rem);
  font-weight: 700;
  text-transform: uppercase;
  margin: 0.7rem 0 0.45rem;
  line-height: 1.1;
}

.preview-meaning {
  font-size: 0.96rem;
  max-width: 34ch;
  margin: 0 auto 0.9rem;
  opacity: 0.9;
}

.preview-anchor {
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.12);
  margin: 0 auto 0.85rem;
  max-width: 38ch;
}

.preview-verse {
  font-style: italic;
  font-size: 0.83rem;
  opacity: 0.84;
  margin-bottom: 0.75rem;
}

.preview-footer {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  opacity: 0.65;
  text-transform: uppercase;
}

.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.95rem 0;
}

.theme-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.theme-swatch[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.swatch-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

/* Midnight Sync Embedded Dark Display */
.sync-display {
  background: linear-gradient(155deg, #16203b 0%, #0d1428 100%);
  color: #f8fafc;
  border-radius: var(--radius-md);
  padding: 1.4rem 1.25rem;
  text-align: center;
  margin-bottom: 0.9rem;
}

.sync-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #fbbf24;
  font-weight: 700;
}

.sync-title {
  margin: 0.35rem 0 0.2rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.sync-moment {
  margin: 0 0 0.7rem;
  font-size: 0.86rem;
  color: #cbd5e1;
}

.sync-clock {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.sync-sub {
  font-size: 0.82rem;
  color: #5eead4;
  font-family: var(--font-mono);
  margin-top: 0.4rem;
}

.countdown-box {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-bottom: 0.9rem;
  text-align: center;
}

.countdown-box.alert-now {
  background: #fef3c7;
  border-color: #f59e0b;
}

.countdown-val {
  font-family: var(--font-mono);
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--ink);
}

.countdown-status {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Catalog / Timeline Cards */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.55rem;
}

.media-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.media-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
}

.media-start {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--teal);
}

.media-card h3 {
  margin: 0.2rem 0 0.15rem;
  font-size: 1rem;
}

.media-artist {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin: 0;
}

.media-moment {
  font-size: 0.84rem;
  color: var(--ink);
  margin: 0.2rem 0 0;
}

/* Copy Tip (Modern Web Guidance) */
.copy-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.copy-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.24rem 0.52rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.copy-wrap:has([data-copied]) .copy-tip,
.copy-wrap:has([data-failed]) .copy-tip {
  opacity: 1;
}

/* Sections & FAQ */
.content-section {
  padding-block: 1.75rem;
  border-top: 1px solid var(--border);
}

.content-section h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.32rem, 2.4vw, 1.7rem);
  margin: 0 0 0.8rem;
}

.faq-list {
  display: grid;
  gap: 0.65rem;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.88rem 1.05rem;
}

.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.15rem;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0.6rem 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.worksheet-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  box-shadow: var(--shadow-md);
  max-width: 760px;
  margin-inline: auto;
}

.worksheet-word {
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 5.5vw, 3.6rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0.45rem 0;
  text-align: center;
}

.worksheet-box {
  border: 1px dashed #c8bfb2;
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  margin-top: 0.95rem;
}

.worksheet-box h3 {
  margin: 0 0 0.4rem;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.error-msg {
  color: #be123c;
  font-size: 0.84rem;
  margin-top: 0.35rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.75rem 2.4rem;
  margin-top: 2rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .no-print {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .worksheet-sheet {
    border: 2px solid #1c1917;
    box-shadow: none;
    max-width: 100%;
    padding: 1.5cm;
  }
}
