/* ============================================================
   RISE — design tokens
   ============================================================ */
:root {
  /* surfaces */
  --void:        #050505;
  --surface-1:   #0a0a0b;
  --surface-2:   #0e0d0c;

  /* glass */
  --glass-bg:        rgba(255, 255, 255, 0.045);
  --glass-bg-strong:  rgba(255, 255, 255, 0.07);
  --glass-border:    rgba(255, 255, 255, 0.09);
  --glass-shadow:    0 20px 60px -20px rgba(0, 0, 0, 0.85);

  /* ink */
  --white:       #f5f3ee;
  --white-72:    rgba(245, 243, 238, 0.72);
  --white-50:    rgba(245, 243, 238, 0.5);
  --white-30:    rgba(245, 243, 238, 0.3);
  --white-12:    rgba(245, 243, 238, 0.12);

  /* signature accent — warm champagne gold, the only color in the system */
  --gold:        #c9a876;
  --gold-bright: #f3d9a4;
  --gold-dim:    rgba(201, 168, 118, 0.35);
  --gold-04:     rgba(201, 168, 118, 0.04);

  /* type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-ui:      'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'Space Mono', 'SFMono-Regular', Menlo, monospace;

  /* motion */
  --ease-out:     cubic-bezier(.16, 1, .3, 1);
  --ease-in-out:  cubic-bezier(.65, 0, .35, 1);
  --dur-fast:     0.22s;
  --dur-med:      0.55s;
  --dur-slow:     1.1s;

  /* cursor glow coords, updated by JS */
  --mx: 50%;
  --my: 40%;
}

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

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--void);
  color: var(--white);
  font-family: var(--font-ui);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 1.5px solid var(--gold-bright);
  outline-offset: 4px;
  border-radius: 4px;
}

blockquote { margin: 0; }
p { margin: 0; }

::selection {
  background: var(--gold-dim);
  color: var(--white);
}

/* ============================================================
   Background — base gradient
   ============================================================ */
body {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(201, 168, 118, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 110%, rgba(120, 90, 50, 0.08), transparent 60%),
    linear-gradient(180deg, var(--surface-2) 0%, var(--void) 45%, #020202 100%);
  background-attachment: fixed;
}

/* ============================================================
   Particles canvas
   ============================================================ */
#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

/* ============================================================
   Light beams
   ============================================================ */
.beams {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
}

.beam {
  position: absolute;
  top: -20%;
  width: 38vw;
  height: 140vh;
  background: linear-gradient(180deg, transparent 0%, rgba(201, 168, 118, 0.10) 45%, transparent 100%);
  filter: blur(40px);
  transform-origin: top center;
  will-change: transform;
}

.beam-1 { left: -10%; transform: rotate(12deg); animation: beamDrift1 26s ease-in-out infinite; }
.beam-2 { left: 38%;  transform: rotate(-8deg); opacity: 0.7; animation: beamDrift2 32s ease-in-out infinite; }
.beam-3 { left: 78%;  transform: rotate(16deg); opacity: 0.5; animation: beamDrift1 38s ease-in-out infinite reverse; }

@keyframes beamDrift1 {
  0%, 100% { transform: rotate(12deg) translateX(0); }
  50%      { transform: rotate(8deg) translateX(3vw); }
}
@keyframes beamDrift2 {
  0%, 100% { transform: rotate(-8deg) translateX(0); }
  50%      { transform: rotate(-13deg) translateX(-4vw); }
}

/* ============================================================
   Fog
   ============================================================ */
.fog {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fog-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
}

.fog-1 {
  width: 60vw; height: 60vw;
  left: -15%; bottom: -25%;
  background: radial-gradient(circle, rgba(60, 48, 30, 0.5), transparent 70%);
  animation: fogFloat 50s ease-in-out infinite;
}

.fog-2 {
  width: 50vw; height: 50vw;
  right: -10%; top: -15%;
  background: radial-gradient(circle, rgba(30, 28, 26, 0.6), transparent 70%);
  animation: fogFloat 60s ease-in-out infinite reverse;
}

@keyframes fogFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(4%, -3%) scale(1.08); }
}

/* ============================================================
   Cursor glow
   ============================================================ */
.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(243, 217, 164, 0.07), transparent 70%);
  transition: opacity 0.4s ease;
  opacity: 0;
}

body.has-pointer .cursor-glow { opacity: 1; }

/* ============================================================
   Vignette + grain
   ============================================================ */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

/* ============================================================
   App shell
   ============================================================ */
.app {
  position: relative;
  z-index: 4;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 3vw, 36px) clamp(20px, 5vw, 56px);
}

/* ============================================================
   HUD bar
   ============================================================ */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  animation: dropIn var(--dur-slow) var(--ease-out) both;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
}

.brand-mark {
  display: inline-flex;
  color: var(--gold);
  animation: markSpin 14s linear infinite;
}

@keyframes markSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.brand-name {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.32em;
}

.hud-readout {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--glass-shadow);
}

.hud-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 64px;
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white-30);
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.hud-divider {
  width: 1px;
  height: 24px;
  background: var(--glass-border);
}

/* ============================================================
   Stage (main quote area)
   ============================================================ */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
  padding: clamp(32px, 6vh, 64px) 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: clamp(20px, 4vh, 36px);
  opacity: 0;
  animation: eyebrowIn var(--dur-med) var(--ease-out) 0.15s both;
}

.eyebrow.refresh {
  animation: eyebrowIn var(--dur-med) var(--ease-out) both;
}

@keyframes eyebrowIn {
  from { opacity: 0; transform: translateY(8px); letter-spacing: 0.5em; }
  to   { opacity: 1; transform: translateY(0); letter-spacing: 0.28em; }
}

/* ---- the quote itself ---- */
.quote {
  font-family: var(--font-display);
  font-weight: 440;
  font-style: italic;
  color: var(--white);
  line-height: 1.18;
  letter-spacing: -0.01em;
  max-width: 18ch;
  margin: 0 auto;
  transition: filter var(--dur-fast) ease, opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.quote.len-short  { font-size: clamp(2.4rem, 3vw + 2.2rem, 5.6rem); max-width: 16ch; }
.quote.len-medium { font-size: clamp(2rem, 2.4vw + 1.8rem, 4.4rem); max-width: 20ch; }
.quote.len-long   { font-size: clamp(1.6rem, 1.8vw + 1.4rem, 3.3rem); max-width: 26ch; }

.quote:hover .word-inner {
  text-shadow: 0 0 28px var(--gold-dim), 0 0 60px rgba(243, 217, 164, 0.18);
}

.word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.08em;
}

.word-inner {
  display: inline-block;
  animation: wordIn 0.9s var(--ease-out) both;
  transition: text-shadow 0.4s ease;
}

@keyframes wordIn {
  from {
    opacity: 0;
    transform: translateY(70%) rotate(2deg);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
    filter: blur(0);
  }
}

.quote.quote-out .word-inner,
.author.quote-out {
  animation: none !important;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(-14px);
}

/* ---- author ---- */
.author {
  font-family: var(--font-ui);
  font-size: clamp(0.8rem, 0.4vw + 0.7rem, 0.95rem);
  letter-spacing: 0.08em;
  color: var(--white-50);
  margin-top: clamp(18px, 3vh, 28px);
  opacity: 0;
  animation: authorIn var(--dur-med) var(--ease-out) 0.4s both;
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease, filter var(--dur-fast) ease;
}

.author.author-in {
  animation: authorIn var(--dur-med) var(--ease-out) both;
}

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

/* ============================================================
   Actions
   ============================================================ */
.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: clamp(40px, 7vh, 64px);
  opacity: 0;
  animation: riseIn var(--dur-slow) var(--ease-out) 0.5s both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 70%);
  color: #1a1408;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  overflow: hidden;
  box-shadow: 0 8px 30px -8px rgba(201, 168, 118, 0.55), 0 2px 0 0 rgba(255,255,255,0.25) inset;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}

.btn-primary .btn-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255,255,255,0.55), transparent 60%);
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.5s ease, transform 0.6s ease;
  pointer-events: none;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 14px 40px -10px rgba(201, 168, 118, 0.7), 0 2px 0 0 rgba(255,255,255,0.3) inset;
}

.btn-primary:hover .btn-glow {
  opacity: 0.5;
  transform: scale(1);
}

.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-key {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(0,0,0,0.18);
  color: rgba(26,20,8,0.7);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: var(--glass-shadow);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--white-50);
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}

.icon-btn:hover {
  color: var(--white);
  background: var(--glass-bg-strong);
  transform: translateY(-1px);
}

.icon-btn:active { transform: translateY(0) scale(0.94); }

.icon-btn.is-active {
  color: var(--gold);
}

#favBtn.is-active svg {
  fill: var(--gold);
  stroke: var(--gold);
}

.icon-btn.is-active svg { animation: pop 0.4s var(--ease-out); }

@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ============================================================
   Counter
   ============================================================ */
.counter {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-30);
  margin-top: clamp(28px, 5vh, 44px);
  opacity: 0;
  animation: riseIn var(--dur-slow) var(--ease-out) 0.65s both;
}

.counter .counter-num {
  color: var(--gold);
  font-weight: 700;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: clamp(24px, 4vh, 40px);
  opacity: 0;
  animation: dropIn var(--dur-slow) var(--ease-out) 0.2s both;
}

.footer-rule {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

.footer-line {
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 0.4vw + 0.55rem, 0.74rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--white-30);
  text-align: center;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: clamp(20px, 5vh, 48px);
  transform: translate(-50%, 16px);
  z-index: 50;
  padding: 12px 22px;
  border-radius: 100px;
  background: rgba(15, 14, 12, 0.85);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  box-shadow: var(--glass-shadow);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
  .hud-label { display: none; }
  .hud-readout { gap: 12px; padding: 7px 14px; }
  .hud-divider { height: 18px; }
  .hud-value { font-size: 0.7rem; }
  .brand-name { font-size: 0.8rem; letter-spacing: 0.24em; }

  .actions {
    flex-direction: column;
    width: 100%;
  }
  .btn-primary {
    width: 100%;
    justify-content: center;
  }
  .toolbar { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .hud-readout { display: none; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .beam, .fog-blob, .brand-mark { animation: none !important; }
}
