/* ═══════════════════════════════════════════
   BASE — Reset · Variables · Typography · Layout · Utilities
   ═══════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design tokens ── */
:root {
  /* Ink palette */
  --ink:    #1a1814;
  --ink2:   #4a4640;
  --ink3:   #8a8480;

  /* Paper palette */
  --paper:  #faf8f3;
  --paper2: #f2efe8;
  --paper3: #e8e3d8;

  /* Accent colours */
  --accent:  #c8401a;
  --accent2: #e8691e;
  --gold:    #c9a227;
  --green:   #2a6e3a;
  --blue:    #1e4d8a;

  /* Shared values */
  --radius:    12px;
  --shadow:    0 2px 12px rgba(26,24,20,0.10);
  --shadow-lg: 0 8px 32px rgba(26,24,20,0.15);

  /* Overlay colour reused across all overlays */
  --overlay-bg: rgba(26,24,20,0.55);

  /* Transition speeds */
  --t-fast: 0.1s;
  --t-std:  0.15s;
}

/* ── Base ── */
html { font-size: 16px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

/* ── App wrapper ── */
.app { max-width: 680px; margin: 0 auto; padding: 0 16px 80px; }

/* ── Header ── */
.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 10px;
  margin-bottom: 28px;
  border-bottom: 1.5px solid var(--paper3);
}

/* Logo link */
.logo-svg-wrap {
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.logo-svg-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}
.logo-svg {
  height: 60px;
  width: auto;
  display: block;
}

/* Header right group: date + menu */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

/* ── Eyebrow label — shared utility ──
   Used for section labels, date label, clue headings, countdown label, etc.
   Extend with a modifier (e.g. .label-eyebrow--sm) where size differs.       */
.label-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink3);
  line-height: 1;
}

/* Convenience aliases that map existing class names to the shared style */
.date-label,
.section-label,
.profile-section-label,
.cw-clues-title,
.countdown-label,
.cal-dow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink3);
  line-height: 1;
}
/* Per-element spacing that differs */
.section-label       { margin-bottom: 12px; margin-top: 28px; }
.date-label          { letter-spacing: 0.12em; }
.profile-section-label { margin-bottom: 10px; }
.cw-clues-title      { margin-bottom: 6px; letter-spacing: 0.08em; }
.countdown-label     { letter-spacing: 0.14em; font-size: 13px; }
.cal-dow             { padding: 4px 0 8px; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-align: center; }

/* ── Button utilities ──
   Shared base styles for the ink→accent "primary" action button pattern.
   Apply .btn-primary to any <button> that follows this pattern.             */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--t-std);
}
.btn-primary:hover    { background: var(--accent); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

/* Secondary / ghost button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--paper2);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border: 1.5px solid var(--paper3);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t-std), border-color var(--t-std);
}
.btn-secondary:hover { background: var(--paper3); }

/* ── Chip / card surface — shared base for streak chips, cal-stat etc. ── */
.surface-chip {
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: var(--radius);
}

/* ── Menu button (hamburger) ── */
#menuBtn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--paper2);
  border: 1.5px solid var(--paper3);
  border-radius: 10px;
  cursor: pointer;
  padding: 9px 10px;
  flex-shrink: 0;
  transition: background var(--t-std), border-color var(--t-std);
}
#menuBtn:hover { background: var(--paper3); border-color: var(--ink3); }
#menuBtn span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  transition: background var(--t-std);
}

/* ── Loading spinner ── */
.loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(250,248,243,0.8);
  z-index: 10;
  border-radius: 8px;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--paper3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Shared animations ── */
@keyframes popIn {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes shake {
  0%,100% { transform: translateX(0);  }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px);  }
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0.5; }
  to   { transform: translateY(0);    opacity: 1;   }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0);    }
}
