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

:root {
  --bg: #F0CF61;
  --fg: #E7E6E1;
  --transition: 0.5s ease;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  transition: background-color var(--transition), color var(--transition);
  font-family: 'Source Serif 4', serif;
}

/* ── Header ───────────────────────────────── */
header {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 1rem;
  color: var(--fg);
  transition: color var(--transition);
  text-transform: lowercase;
  flex-shrink: 0;
}

/* ── Main stage ───────────────────────────── */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 2rem;
}

/* ── Quote ────────────────────────────────── */
.quote-wrap {
  width: 100%;
  max-width: 780px;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

blockquote {
  font-size: clamp(1.4rem, 3.5vw, 2.6rem);
  line-height: 1.35;
  font-style: normal;
  text-align: center;
  color: var(--fg);
  transition: color var(--transition), opacity 0.3s ease;
  opacity: 1;
  quotes: none;
}

blockquote::before { content: "\201C"; }
blockquote::after  { content: "\201D"; }

cite {
  font-style: normal;
  font-size: clamp(0.9rem, 1.8vw, 1.4rem);
  text-align: right;
  color: var(--fg);
  transition: color var(--transition), opacity 0.3s ease;
  opacity: 1;
}

cite::before { content: "— "; }

/* ── Refresh button ───────────────────────── */
#refreshBtn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--fg);
  transition: color var(--transition), opacity 0.3s ease, transform 0.6s ease;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#refreshBtn svg {
  width: 28px;
  height: 28px;
  display: block;
}

#refreshBtn:hover {
  transform: rotate(360deg);
}

#refreshBtn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ── Footer ───────────────────────────────── */
footer {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: var(--fg);
  transition: color var(--transition);
  text-transform: lowercase;
  flex-shrink: 0;
}

footer a {
  color: inherit;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s;
}

footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ── Font classes ─────────────────────────── */
.font-source-serif { font-family: 'Source Serif 4', serif; }
.font-fraunces     { font-family: 'Fraunces', serif; }
.font-lora         { font-family: 'Lora', serif; }
.font-ibm-plex     { font-family: 'IBM Plex Sans', sans-serif; font-weight: 300; }

/* ── Fade state ───────────────────────────── */
.fading {
  opacity: 0 !important;
}

/* ── Mobile ───────────────────────────────── */
@media (max-width: 600px) {
  main { padding: 1.5rem 1.25rem; gap: 1.5rem; }
  #refreshBtn svg { width: 22px; height: 22px; }
}
