/* ═════════════════════════════════════════════════════════════
   LOST IN THE CLOUD — Dark storm Harry Potter theme
   ═════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
:root {
  /* Dark storm palette */
  --c-bg-1: #050518;
  --c-bg-2: #0a0a2a;
  --c-bg-3: #1a0a2a;
  --c-card: rgba(15, 18, 42, 0.78);
  --c-card-2: rgba(20, 24, 52, 0.65);
  --c-card-border: rgba(120, 100, 180, 0.28);
  --c-paper: rgba(20, 22, 48, 0.85);
  --c-paper-2: rgba(28, 30, 62, 0.60);
  --c-paper-soft: rgba(20, 22, 48, 0.72);
  --c-ink: #eef1fb;
  --c-ink-soft: #b8c0d8;
  --c-muted: #7a83a8;
  --c-accent: #d4af37;          /* gold */
  --c-accent-2: #b8901e;
  --c-accent-3: #f0c85a;
  --c-gold: #d4af37;
  --c-gold-light: #f7dd7e;
  --c-lavender: #b39ddb;
  --c-lavender-2: #9575cd;
  --c-rose: #d97c6e;
  --c-border: rgba(180, 190, 230, 0.14);
  --c-border-soft: rgba(120, 130, 180, 0.10);
  --c-warn: #ef5350;
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-strong: 0 22px 60px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 30px 80px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(212, 175, 55, 0.08);
  --shadow-prompt: 0 6px 22px rgba(0, 0, 0, 0.45);
  --shadow-gold: 0 6px 22px rgba(212, 175, 55, 0.30);
  --radius: 18px;
  --radius-lg: 26px;
  --radius-sm: 10px;
  --font-serif: 'Fraunces', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --content-max: 720px;
}

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-ink);
  background: linear-gradient(180deg, #030312 0%, #0a0a24 40%, #14092e 80%, #1e1a3e 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--c-accent-3); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-gold-light); text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  color: var(--c-ink);
}
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin: 0 0 0.4em; color: var(--c-ink); }
h3 { font-size: 1.3rem; margin: 0 0 0.4em; }
em { font-style: italic; color: var(--c-accent-3); font-weight: 500; }

/* ─── Full-viewport 3D canvas + floating layers ─── */
#scene-canvas {
  position: fixed; inset: 0;
  z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
#goodwords-layer {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  perspective: 1400px;
}
.goodword-drop {
  position: absolute;
  color: rgba(220, 220, 240, 0.55);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.02rem;
  letter-spacing: 0.3px;
  max-width: 28ch;
  text-shadow: 0 0 20px rgba(180, 200, 255, 0.35);
  white-space: nowrap;
  user-select: none;
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
@media (max-width: 720px) {
  .goodword-drop { font-size: 0.9rem; max-width: 20ch; }
}

/* ─── HEADER ─── */
main { position: relative; z-index: 2; }
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 32px;
  max-width: 1400px; margin: 0 auto;
  transition: background 0.3s;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--c-ink);
  text-decoration: none;
}
.brand .seal {
  font-size: 1.3rem;
  color: var(--c-gold);
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4));
}
.brand .brand-text {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--c-ink);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
.site-header nav { display: flex; gap: 22px; font-size: 0.95rem; align-items: center; }
.site-header nav a { color: var(--c-ink-soft); }
.site-header nav a:hover { color: var(--c-gold); }
.lang-switch {
  border: 1px solid var(--c-card-border);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 1px;
  font-weight: 600;
  color: var(--c-ink-soft) !important;
  text-decoration: none !important;
  background: rgba(20, 24, 52, 0.5);
  backdrop-filter: blur(8px);
}
.lang-switch:hover { background: var(--c-gold); color: var(--c-bg-1) !important; border-color: var(--c-gold); }

@media (max-width: 600px) {
  .site-header { padding: 14px 16px; }
  .site-header nav { font-size: 0.82rem; gap: 12px; }
  .brand .brand-text { font-size: 0.72rem; letter-spacing: 2px; }
}

/* ─── HERO ─── */
.hero {
  text-align: center;
  padding: clamp(60px, 14vh, 160px) 24px clamp(80px, 16vh, 200px);
  max-width: var(--content-max); margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}
.hero-title,
.hero-sub,
.hero-tagline {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  color: #ffffff;
  letter-spacing: -0.5px;
  margin: 0 0 26px;
  text-shadow:
    0 2px 32px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(180, 200, 255, 0.18);
}
.hero-sub {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.6;
  color: rgba(230, 236, 250, 0.88);
  max-width: 46ch;
  margin: 0 auto 32px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}
.hero-tagline {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--c-gold);
  margin: 0;
  position: relative;
  display: inline-block;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6), 0 0 24px rgba(212, 175, 55, 0.5);
}
.hero-appear { opacity: 1; transform: translateY(0); }

/* Golden sparkle burst behind the tagline */
.hero-tagline.sparkle-burst::before,
.hero-tagline.sparkle-burst::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c-gold) 0%, transparent 70%);
  opacity: 0;
  animation: sparkle-fly 1.8s ease-out forwards;
}
.hero-tagline.sparkle-burst::before { left: -30px; }
.hero-tagline.sparkle-burst::after  { right: -30px; animation-name: sparkle-fly-right; animation-delay: 0.3s; }
@keyframes sparkle-fly {
  0%   { opacity: 0; transform: translate(0, -50%) scale(0.5); box-shadow: 0 0 0 rgba(212,175,55,0); }
  30%  { opacity: 1; transform: translate(-50px, -80%) scale(2.5); box-shadow: 0 0 32px rgba(212,175,55,0.9); }
  100% { opacity: 0; transform: translate(-100px, -120%) scale(0.3); box-shadow: 0 0 60px rgba(212,175,55,0); }
}
@keyframes sparkle-fly-right {
  0%   { opacity: 0; transform: translate(0, -50%) scale(0.5); box-shadow: 0 0 0 rgba(212,175,55,0); }
  30%  { opacity: 1; transform: translate(50px, -80%) scale(2.5); box-shadow: 0 0 32px rgba(212,175,55,0.9); }
  100% { opacity: 0; transform: translate(100px, -120%) scale(0.3); box-shadow: 0 0 60px rgba(212,175,55,0); }
}

.scroll-cue {
  position: absolute;
  bottom: 5vh;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--c-gold);
  text-decoration: none;
  opacity: 0;
  animation: hero-fade-in 1.4s 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.4));
}
@keyframes hero-fade-in { to { opacity: 1; } }
.scroll-cue-hint {
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 500;
}
.scroll-cue-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ─── PROGRESSIVE REVEAL ─── */
.reveal-target {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal-target.is-revealed { opacity: 1; transform: translateY(0); }
.site-header.reveal-target { transform: translateY(-14px); }
.site-header.reveal-target.is-revealed { transform: translateY(0); }

/* ─── LIGHTNING FLASH: card illumination when body has .storm-flash ─── */
.writer-card-glass,
.status-card, .goodword-card, .donate-card {
  transition: box-shadow 0.15s, filter 0.15s;
}
body.storm-flash .writer-card-glass,
body.storm-flash .status-card,
body.storm-flash .goodword-card,
body.storm-flash .donate-card {
  filter: brightness(1.18);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(180, 200, 255, 0.32),
    0 0 30px rgba(212, 175, 55, 0.16);
}
body.storm-flash .hero-title {
  text-shadow:
    0 2px 32px rgba(0, 0, 0, 0.65),
    0 0 100px rgba(180, 200, 255, 0.45);
}

/* ─── CARDS (dark glass) ─── */
.writer { padding: 0 16px 80px; max-width: var(--content-max); margin: 0 auto; }
.writer-card,
.writer-card-glass {
  background: var(--c-card);
  backdrop-filter: blur(24px) saturate(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
  border: 1px solid var(--c-card-border);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  padding: clamp(24px, 4vw, 36px);
}
.card {
  background: var(--c-card);
  backdrop-filter: blur(20px) saturate(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(1.05);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--c-card-border);
}

/* ─── TABS ─── */
.writer-topbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--c-border);
}
.tabs-track {
  position: relative;
  display: inline-flex;
  background: rgba(30, 34, 60, 0.6);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--c-card-border);
  backdrop-filter: blur(8px);
  align-self: flex-start;
}
.tab {
  position: relative;
  z-index: 2;
  border: none; background: transparent;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--c-ink-soft);
  font-weight: 500;
  transition: color .25s;
}
.tab.is-active { color: var(--c-bg-1); }
.tabs-indicator {
  position: absolute;
  top: 4px; left: 4px;
  height: calc(100% - 8px);
  background: linear-gradient(135deg, var(--c-gold-light), var(--c-gold));
  border-radius: 999px;
  transition: transform .35s cubic-bezier(0.4,0,0.2,1), width .35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow-gold);
  z-index: 1;
}
.plan-description {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--c-ink-soft);
  margin: 0;
}

/* ─── FORM FIELDS ─── */
.field { display: block; margin-bottom: 18px; }
.field-compact { margin-bottom: 14px; }
.field.is-hidden, .is-hidden { display: none !important; }
.label-text {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.label-text small { font-weight: normal; color: var(--c-muted); font-size: 0.75rem; text-transform: none; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"], textarea, select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 12px 14px;
  background: rgba(15, 18, 42, 0.55);
  border: 1px solid var(--c-card-border);
  border-radius: 12px;
  color: var(--c-ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder {
  color: rgba(180, 190, 220, 0.42);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--c-gold);
  background: rgba(20, 24, 52, 0.75);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

/* ─── THE PROMPT (magic textarea) ─── */
.prompt-shell {
  position: relative;
  background: rgba(15, 18, 42, 0.55);
  border: 1px solid var(--c-card-border);
  border-radius: 20px;
  padding: 4px;
  margin: 10px 0 22px;
  box-shadow: var(--shadow-prompt);
  transition: border-color .25s, box-shadow .25s;
}
.prompt-shell:focus-within {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18), var(--shadow-prompt);
}

.prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 10px 16px;
  flex-wrap: wrap;
}
.prompt-actions-left,
.prompt-actions-right {
  display: flex; align-items: center; gap: 8px;
}
.pill-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--c-card-border);
  background: rgba(30, 34, 60, 0.6);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--c-ink-soft);
  cursor: pointer;
  transition: all 0.15s;
}
.pill-action:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--c-gold);
  color: var(--c-gold);
  transform: translateY(-1px);
}
.pill-action:active { transform: translateY(0); }
.pill-action .pill-icon { font-size: 0.95rem; }
.pill-action .pill-label { letter-spacing: 0.2px; }

.char-pill {
  font-size: 0.78rem;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  background: rgba(30, 34, 60, 0.5);
  border-radius: 999px;
}

/* ─── SEAL BUTTON (gold pill) ─── */
.seal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--c-gold-light) 0%, var(--c-gold) 60%, var(--c-accent-2) 100%);
  color: #1a1428;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: var(--shadow-gold);
}
.seal-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(212, 175, 55, 0.5); }
.seal-btn:disabled { opacity: 0.5; cursor: wait; transform: none; }
.seal-btn .seal-icon { font-size: 1.05rem; }

/* ─── MAGIC TYPEWRITER (real delay + golden cursor) ─── */
.magic-shell {
  position: relative;
  width: 100%;
}
.magic-shell textarea {
  position: relative;
  background: transparent;
  color: transparent !important;
  caret-color: transparent;
  z-index: 2;
  padding: 18px 20px;
  min-height: 160px;
  resize: none;
  border: none;
}
.magic-shell textarea:focus { box-shadow: none; background: transparent; }

.magic-render {
  position: absolute;
  inset: 0;
  z-index: 1;
  color: #ffffff;
  padding: 18px 20px;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  pointer-events: none;
  overflow-y: auto;
  min-height: 160px;
}
.magic-char {
  display: inline;
  color: #ffffff;
}
.magic-char-enter {
  animation: magic-char-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes magic-char-in {
  0%   { opacity: 0; filter: blur(4px); color: var(--c-gold); text-shadow: 0 0 12px var(--c-gold); }
  60%  { opacity: 1; filter: blur(1px); color: var(--c-gold-light); text-shadow: 0 0 8px var(--c-gold); }
  100% { opacity: 1; filter: blur(0);  color: #ffffff;  text-shadow: 0 0 4px rgba(212, 175, 55, 0.25); }
}
.magic-char-exit {
  animation: magic-char-out 0.22s ease-in forwards;
}
@keyframes magic-char-out {
  0%   { opacity: 1; filter: blur(0); color: #ffffff; }
  100% { opacity: 0; filter: blur(3px); color: var(--c-gold); text-shadow: 0 0 12px var(--c-gold); }
}
.magic-cursor {
  color: var(--c-gold);
  animation: cursor-blink 0.9s steps(1, end) infinite;
  text-shadow:
    0 0 8px var(--c-gold),
    0 0 16px rgba(212, 175, 55, 0.6);
  font-weight: 400;
  margin-left: 1px;
}
@keyframes cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ─── CHECKBOX / RECIPIENT / MEDIA ─── */
.checkbox {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 12px 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--c-ink-soft);
}
.checkbox input { margin-top: 3px; accent-color: var(--c-gold); }
.checkbox small { color: var(--c-muted); }

.recipient-row { display: flex; gap: 8px; margin-bottom: 8px; }
.recipient-row input { flex: 1; }
.recipient-row button {
  background: transparent; border: none; color: var(--c-warn);
  font-size: 1.2rem; cursor: pointer; padding: 0 8px;
}

.media-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 6px;
}
.media-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(15, 18, 42, 0.55);
  border: 1.5px dashed var(--c-card-border);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.media-drop:hover { border-color: var(--c-gold); background: rgba(212, 175, 55, 0.06); }
.media-drop input[type="file"] { display: none; }
.media-icon { font-size: 1.5rem; }
.media-label { font-size: 0.85rem; line-height: 1.4; color: var(--c-ink-soft); }
.media-label small { color: var(--c-muted); }
.media-list { list-style: none; padding: 0; margin: 12px 0 0; }
.media-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: rgba(20, 24, 52, 0.6);
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--c-ink);
}
.media-list .remove {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--c-warn); font-size: 1.1rem; padding: 0 4px;
}

/* ─── PRESETS + DATETIME ─── */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.preset {
  background: rgba(30, 34, 60, 0.55);
  border: 1px solid var(--c-card-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--c-ink-soft);
  transition: all .15s;
}
.preset:hover { background: var(--c-gold); color: var(--c-bg-1); border-color: var(--c-gold); }
.preset.is-premium {
  background: linear-gradient(135deg, var(--c-gold), var(--c-accent-2));
  color: var(--c-bg-1);
  border-color: transparent;
}
.datetime-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.datetime-row input[type="date"] { flex: 2; }
.datetime-row input[type="time"] { flex: 1; max-width: 130px; }
@media (max-width: 480px) {
  .datetime-row { flex-direction: column; }
  .datetime-row input[type="time"] { max-width: none; }
}

/* ─── HINTS / ERRORS ─── */
.hint { display: block; font-size: 0.8rem; color: var(--c-muted); margin-top: 6px; }
.hint.warning { color: var(--c-warn); }
.form-error {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(239, 83, 80, 0.15);
  border-left: 3px solid var(--c-warn);
  border-radius: 10px;
  color: #ffb0a8;
  font-size: 0.9rem;
}

/* ─── PASSPHRASE / UPGRADE / CTA ─── */
.passphrase-inputs {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 8px;
  padding: 12px;
  background: rgba(15, 18, 42, 0.55);
  border-radius: 12px;
}
.upgrade-box {
  background: rgba(15, 18, 42, 0.6);
  border: 1px solid var(--c-card-border);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 12px 0;
}
.upgrade-box h3 { margin: 0 0 6px; font-size: 1rem; color: var(--c-gold); }
.upgrade-row { display: flex; gap: 8px; margin-top: 8px; }
.upgrade-row input {
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.upgrade-row button {
  background: var(--c-gold); color: var(--c-bg-1);
  border: none; border-radius: 10px;
  padding: 0 18px; cursor: pointer; font-size: 0.95rem; font-weight: 600;
}
.upgrade-cta {
  margin-top: 20px;
  padding: 22px 26px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.14) 0%, rgba(147, 112, 219, 0.14) 100%);
  border-radius: 18px;
  border: 1px solid var(--c-card-border);
}
.upgrade-cta h3 { margin: 0 0 8px; color: var(--c-gold); }
.upgrade-cta button {
  background: linear-gradient(135deg, var(--c-gold), var(--c-accent-2));
  color: var(--c-bg-1);
  border: none; border-radius: 10px;
  padding: 12px 22px; cursor: pointer;
  font-size: 1rem; font-weight: 600;
  margin-top: 10px;
}
.upgrade-cta small { display: block; margin-top: 8px; color: var(--c-muted); font-size: 0.82rem; }
.upgrade-cta .runway-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
  color: var(--c-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.upgrade-cta .runway-note a { color: var(--c-gold); text-decoration: none; }
.upgrade-cta .runway-note a:hover { text-decoration: underline; }

/* ─── COMMON SECTIONS ─── */
.status-section, .donate-section, .goodword-section {
  padding: 0 16px 60px;
  max-width: var(--content-max);
  margin: 0 auto;
}
.status-card, .goodword-card, .donate-card {
  background: var(--c-card);
  backdrop-filter: blur(20px) saturate(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(1.05);
  border: 1px solid var(--c-card-border);
  box-shadow: var(--shadow-soft);
}
.status-row, .donate-row, .goodword-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center;
}
.status-row input { flex: 1; min-width: 200px; }
.status-row button, .goodword-row button {
  background: var(--c-gold); color: var(--c-bg-1);
  border: none; border-radius: 10px;
  padding: 12px 22px; cursor: pointer; font-size: 0.9rem; font-weight: 600;
}
.donate-btn {
  background: transparent;
  border: 1.5px solid var(--c-gold);
  color: var(--c-gold);
  border-radius: 12px;
  padding: 14px 26px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all .2s;
}
.donate-btn:hover { background: var(--c-gold); color: var(--c-bg-1); box-shadow: var(--shadow-gold); transform: translateY(-1px); }
.status-result { margin-top: 16px; }
.status-result .item {
  padding: 12px 14px;
  background: rgba(15, 18, 42, 0.55);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: var(--c-ink);
}
.status-result .item strong { color: var(--c-gold); }
.muted { color: var(--c-muted); font-size: 0.92rem; margin-top: 0; }

.goodword-section input {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  padding: 14px 18px;
  margin-top: 12px;
}
.goodword-row { justify-content: space-between; margin-top: 8px; }
.char-counter { font-size: 0.82rem; color: var(--c-muted); }

.link-btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--c-gold), var(--c-accent-2));
  color: var(--c-bg-1);
  border-radius: 10px;
  text-decoration: none;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-gold);
}
.link-btn:hover { color: var(--c-bg-1); text-decoration: none; box-shadow: 0 12px 32px rgba(212, 175, 55, 0.5); }
.link-btn.ghost {
  background: transparent;
  color: var(--c-gold);
  border: 1px solid var(--c-gold);
  box-shadow: none;
  padding: 8px 16px;
  font-size: 0.85rem;
}
.link-btn.ghost:hover { background: rgba(212, 175, 55, 0.14); }

/* ─── FOOTER ─── */
.site-footer {
  text-align: center;
  padding: 40px 16px 32px;
  font-size: 0.85rem;
  color: var(--c-muted);
}
.site-footer a { color: var(--c-ink-soft); }
.site-footer a:hover { color: var(--c-gold); text-decoration: none; }
.site-footer span { margin: 0 8px; }

/* ─── TOASTS ─── */
#toasts {
  position: fixed; top: 20px; right: 20px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 320px;
  pointer-events: none;
}
.toast {
  background: rgba(20, 24, 52, 0.95);
  border-left: 3px solid var(--c-gold);
  color: var(--c-ink);
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-strong);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity .25s, transform .25s;
  pointer-events: auto;
  backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: none; }
.toast.error { border-left-color: var(--c-warn); }
.toast.success { border-left-color: #7dd977; }

/* ─── AMBIENT SOUND TOGGLE ─── */
.ambient-toggle {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--c-card-border);
  background: rgba(20, 24, 52, 0.85);
  backdrop-filter: blur(8px);
  color: var(--c-ink-soft);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 30;
  transition: all .2s;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}
.ambient-toggle:hover { color: var(--c-gold); background: rgba(30, 34, 60, 0.95); transform: scale(1.06); }
.ambient-toggle:active { transform: scale(0.95); }
.ambient-toggle.is-on {
  color: var(--c-bg-1);
  background: var(--c-gold);
  border-color: var(--c-gold);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.5);
}
.ambient-toggle.is-on::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--c-gold);
  opacity: 0.5;
  animation: ambient-pulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ambient-pulse {
  0%   { transform: scale(1); opacity: 0.5; }
  60%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ─── INSPIRE BUBBLE ─── */
.inspire-bubble {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--c-gold-light), var(--c-gold));
  color: var(--c-bg-1);
  font-size: 1.55rem;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(212, 175, 55, 0.4), 0 0 0 3px rgba(20, 24, 52, 0.55);
  z-index: 30;
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s;
}
.inspire-bubble:hover { transform: scale(1.07); }
.inspire-bubble:active { transform: scale(0.95); }
.inspire-bubble-icon { position: relative; z-index: 2; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.inspire-bubble-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--c-gold-light);
  opacity: 0.55;
  animation: bubble-pulse 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes bubble-pulse {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* ─── INSPIRE PANEL ─── */
.inspire-panel {
  position: fixed; inset: 0; z-index: 100;
  visibility: hidden; pointer-events: none;
}
.inspire-panel.is-open { visibility: visible; pointer-events: auto; }
.inspire-panel-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 5, 24, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s;
}
.inspire-panel.is-open .inspire-panel-backdrop { opacity: 1; }
.inspire-panel-drawer {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(420px, 100%);
  background: rgba(15, 18, 42, 0.96);
  backdrop-filter: blur(24px);
  color: var(--c-ink);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--c-card-border);
}
.inspire-panel.is-open .inspire-panel-drawer { transform: translateX(0); }
.inspire-panel-header {
  padding: 28px 28px 18px;
  border-bottom: 1px solid var(--c-border);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
}
.inspire-panel-header h3 { margin: 0 0 6px; font-size: 1.3rem; color: var(--c-gold); font-weight: 500; }
.inspire-panel-header .muted { font-size: 0.9rem; margin: 0; }
.inspire-panel-close {
  background: transparent; border: none;
  font-size: 1.8rem; color: var(--c-muted); cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; line-height: 1;
  transition: background .15s, color .15s;
}
.inspire-panel-close:hover { background: rgba(212, 175, 55, 0.12); color: var(--c-gold); }
.inspire-panel-body { flex: 1; overflow-y: auto; padding: 12px 0 28px; }
.inspire-category { border-bottom: 1px solid var(--c-border); }
.inspire-category-header {
  width: 100%; background: transparent; border: none; text-align: left;
  padding: 14px 28px;
  font-family: var(--font-sans); font-size: 1rem; font-weight: 500;
  color: var(--c-ink); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  transition: background .15s;
}
.inspire-category-header:hover { background: rgba(212, 175, 55, 0.08); }
.inspire-category-arrow { transition: transform .3s; color: var(--c-muted); font-size: 0.9rem; }
.inspire-category.is-open .inspire-category-arrow { transform: rotate(180deg); }
.inspire-prompts { max-height: 0; overflow: hidden; transition: max-height .4s cubic-bezier(0.4,0,0.2,1); }
.inspire-category.is-open .inspire-prompts { max-height: 600px; }
.inspire-prompt {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none;
  padding: 12px 28px 12px 44px;
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.95rem;
  color: var(--c-ink-soft);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
  line-height: 1.5;
}
.inspire-prompt:hover {
  background: rgba(212, 175, 55, 0.08);
  border-left-color: var(--c-gold);
  color: var(--c-ink);
}

/* ─── STATIC PAGES (promessa, error, grazie, etc.) ─── */
.page-static body, .page-static {
  background: linear-gradient(180deg, #030312 0%, #0a0a24 50%, #14092e 100%) fixed;
  min-height: 100vh;
  color: var(--c-ink);
}
.page-static .site-header { position: relative; }
.static-main { max-width: var(--content-max); margin: 0 auto; padding: 40px 24px 80px; }
.static-main.center { display: flex; align-items: center; justify-content: center; min-height: 70vh; }
.prose {
  background: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: clamp(24px, 5vw, 48px);
  backdrop-filter: blur(20px);
  color: var(--c-ink);
}
.prose.center-text { text-align: center; }
.prose h1 { font-weight: 500; color: var(--c-ink); }
.prose .lead { font-size: 1.1rem; color: var(--c-ink-soft); font-family: var(--font-sans); }
.prose h2 { margin-top: 1.6em; font-size: 1.4rem; color: var(--c-gold); }
.prose ul { padding-left: 1.4em; }
.prose li { margin-bottom: 6px; color: var(--c-ink-soft); }
.prose .signoff { margin-top: 2em; text-align: center; font-size: 1.1rem; color: var(--c-gold); font-style: italic; }
.big-seal { font-size: 4rem; color: var(--c-gold); margin-bottom: 12px; filter: drop-shadow(0 0 24px rgba(212, 175, 55, 0.5)); }

/* ─── CEREMONY (letter opening — dark storm variant) ─── */
.page-ceremony body, .page-ceremony {
  background: linear-gradient(180deg, #050518 0%, #0a0a2a 50%, #14092e 100%) fixed;
  min-height: 100vh;
}
.ceremony-stage {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  z-index: 2;
  perspective: 1600px;
}
.ceremony-spotlight {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px;
  background: radial-gradient(ellipse at center top,
    rgba(212, 175, 55, 0.28) 0%,
    rgba(212, 175, 55, 0.12) 35%,
    transparent 65%);
  pointer-events: none; z-index: 1;
  filter: blur(3px);
}
.envelope {
  position: relative;
  width: min(440px, 88vw);
  height: 270px;
  z-index: 10;
  transition: transform 1.2s cubic-bezier(0.5, 0, 0.2, 1), opacity 1.2s, filter 1.2s;
}
.envelope.open {
  transform: translateY(40px) scale(0.55);
  opacity: 0.25; filter: blur(3px);
  pointer-events: none;
}
.envelope-body {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #e6d5b0 0%, #d0b98a 100%);
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), inset 0 -20px 40px rgba(120, 90, 40, 0.24);
}
.envelope-shadow {
  position: absolute; bottom: -30px; left: 10%; right: 10%;
  height: 30px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.7), transparent 70%);
  filter: blur(8px); z-index: -1;
}
.envelope-flap {
  position: absolute; top: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(180deg, #d5c090 0%, #b8a068 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 1.0s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 8px rgba(90, 60, 30, 0.3);
  z-index: 3;
}
.envelope.open .envelope-flap { transform: rotateX(-175deg); }

.wax-seal {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%);
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f08770 0%, #c14530 35%, #8a2418 70%, #5a0e08 100%);
  box-shadow:
    0 6px 20px rgba(120, 30, 20, 0.65),
    inset 0 -8px 16px rgba(60, 0, 0, 0.5),
    inset 0 6px 12px rgba(255, 180, 160, 0.35);
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; z-index: 5;
  transition: transform 0.25s;
}
.wax-seal:hover { transform: translateX(-50%) scale(1.06); }
.wax-seal:active { transform: translateX(-50%) scale(0.95); }
.wax-seal-mark {
  font-family: var(--font-serif);
  font-size: 1.9rem; font-weight: 600;
  color: #fef0d4;
  text-shadow: 0 1px 2px rgba(50, 0, 0, 0.5);
}
.wax-seal.cracked { animation: wax-vanish 0.6s ease-out forwards; }
@keyframes wax-vanish {
  30% { transform: translateX(-50%) scale(1.18); }
  100% { transform: translateX(-50%) scale(0.2); opacity: 0; }
}

.wax-shard {
  position: fixed;
  width: 14px; height: 14px;
  border-radius: 50% 30% 60% 40%;
  background: radial-gradient(circle at 30% 30%, #d05a45, #6e1c10);
  box-shadow: 0 2px 4px rgba(80, 10, 10, 0.5);
  top: var(--start-y); left: var(--start-x);
  z-index: 50; pointer-events: none;
  transform: translate(-50%, -50%);
  animation: shard-fall 1.8s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}
@keyframes shard-fall {
  0%   { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
  100% {
    transform: translate(calc(-50% + var(--fall-dx)), calc(-50% + var(--fall-dy))) rotate(var(--rot));
    opacity: 0;
  }
}

.letter-paper {
  position: relative;
  width: min(680px, 92vw);
  background: linear-gradient(135deg, #f5ebd0 0%, #e6d8b0 100%);
  border-radius: 4px;
  padding: clamp(36px, 6vw, 64px) clamp(28px, 5vw, 56px);
  color: #2a1f10;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(212, 175, 55, 0.2),
    inset 0 0 60px rgba(180, 130, 30, 0.1);
  margin-top: 30px;
  opacity: 0;
  transform: translateY(50px) scale(0.85);
  transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
}
.letter-paper.visible { opacity: 1; transform: translateY(0) scale(1); }
.letter-paper-inner { min-height: 200px; }
.paper-occasion {
  font-family: var(--font-serif); font-style: italic;
  color: rgba(60, 40, 15, 0.7);
  margin: 0 0 12px; text-align: center;
  font-size: 0.95rem; letter-spacing: 1px; text-transform: uppercase;
}
.paper-subject {
  font-family: var(--font-serif); font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: #2a1f10;
  margin: 0 0 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(160, 120, 40, 0.28);
}
.paper-body {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.85;
  color: #2a1f10;
  white-space: pre-wrap;
  min-height: 160px; position: relative;
}
.paper-body.is-typing::after {
  content: '▍';
  display: inline-block;
  color: #b8901e;
  margin-left: 2px;
  animation: cursor-blink 0.9s steps(1, end) infinite;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.paper-media {
  margin-top: 36px;
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: center;
}
.media-item {
  opacity: 0;
  transform: translateY(28px) rotate(-4deg) scale(0.9);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
.media-item:nth-child(even) { transform: translateY(28px) rotate(4deg) scale(0.9); }
.media-item:nth-child(3n)   { transform: translateY(28px) rotate(-2deg) scale(0.9); }
.media-item.visible { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
.media-photo img {
  max-width: 220px; max-height: 220px; border-radius: 4px;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.4),
    0 0 0 8px white,
    0 0 0 9px rgba(160, 130, 40, 0.3);
  background: white;
  cursor: pointer;
  transition: transform 0.3s;
}
.media-photo img:hover { transform: scale(1.04) rotate(1deg); }
.media-audio { width: 100%; max-width: 480px; }
.media-audio audio { width: 100%; border-radius: 32px; }
.paper-footer {
  text-align: center; margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid rgba(160, 120, 40, 0.28);
  opacity: 0;
  transition: opacity 1.2s ease-in;
}
.paper-footer.visible { opacity: 1; }
.paper-footer p {
  color: rgba(60, 40, 15, 0.65);
  font-size: 0.92rem; font-style: italic;
  margin-bottom: 18px;
}

.passphrase-stage {
  background: var(--c-card);
  border: 1px solid var(--c-card-border);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  max-width: 380px;
  margin: 30px auto;
  z-index: 20;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.8s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--c-ink);
}
.passphrase-stage.visible { opacity: 1; transform: translateY(0) scale(1); }
.passphrase-stage h2 { font-weight: 500; color: var(--c-gold); }
.passphrase-stage input {
  font-size: 1.1rem;
  text-align: center;
  max-width: 320px; margin: 16px auto;
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .media-grid { grid-template-columns: 1fr; }
  .donate-row { flex-direction: column; }
  .donate-btn { width: 100%; }
  .status-row { flex-direction: column; align-items: stretch; }
  .upgrade-row { flex-direction: column; }
  .upgrade-row button { width: 100%; padding: 12px; }
  .writer-card, .writer-card-glass { padding: 20px 18px; border-radius: 22px; }
  .prompt-actions { padding: 8px 10px; }
  .pill-action { padding: 6px 12px; font-size: 0.8rem; }
  .pill-action .pill-label { display: none; }
  .hero-tagline { font-size: 0.72rem; letter-spacing: 3px; }
  .ambient-toggle { left: 16px; bottom: 16px; width: 40px; height: 40px; font-size: 15px; }
  .inspire-bubble { right: 16px; bottom: 16px; width: 54px; height: 54px; font-size: 1.35rem; }
}

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

/* ═════════════════════════════════════════════════════════════
   CINEMATIC EMERGENCE — for brand letters, hero words, hero sub chars
   ═════════════════════════════════════════════════════════════ */

/* Brand letters emerge from mist on page load, staggered */
.cinematic-letter {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(8px);
  animation: letter-emerge 1.4s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  animation-delay: 0s;
}
@keyframes letter-emerge {
  0%   { opacity: 0; filter: blur(8px); transform: translateY(10px) scale(1.05); }
  55%  { opacity: 0.7; filter: blur(3px); transform: translateY(4px) scale(1.02); text-shadow: 0 0 20px rgba(212, 175, 55, 0.35); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
}

/* Hero title words emerge from mist, staggered by ScrollTrigger */
.cinematic-word {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(24px);
  animation: word-emerge 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes word-emerge {
  0%   { opacity: 0; filter: blur(12px); transform: translateY(28px) scale(1.08); }
  60%  { opacity: 0.85; filter: blur(3px); transform: translateY(6px) scale(1.02); text-shadow: 0 0 40px rgba(255, 255, 255, 0.25); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); text-shadow: 0 2px 32px rgba(0, 0, 0, 0.65), 0 0 60px rgba(180, 200, 255, 0.18); }
}

/* Subtitle char-by-char typewriter reveal */
.cinematic-char {
  display: inline;
  opacity: 0;
  animation: char-reveal 0.5s ease-out forwards;
}
@keyframes char-reveal {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.cinematic-cursor {
  color: var(--c-gold);
  animation: cursor-blink 0.9s steps(1, end) infinite;
  text-shadow: 0 0 8px var(--c-gold), 0 0 16px rgba(212, 175, 55, 0.6);
  margin-left: 1px;
  font-weight: 400;
}

/* When the hero-appear class is added by JS, the parent already animates from
   the reveal-target rule below; the .cinematic-* children handle the deeper motion. */

/* Ensure hero-appear override works with cinematic elements */
.hero-title.hero-appear,
.hero-sub.hero-appear,
.hero-tagline.hero-appear {
  opacity: 1;
  transform: translateY(0);
}

/* Writer card rises from below with a bit more drama than the default reveal */
[data-reveal="writer"].reveal-target {
  transform: translateY(60px) scale(0.94);
  filter: blur(4px);
}
[data-reveal="writer"].reveal-target.is-revealed {
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition:
    opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.4s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scroll cue starts invisible, JS fades it in during intro */
.scroll-cue { opacity: 0; }

/* ═════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER + MODAL
   ═════════════════════════════════════════════════════════════ */

.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 500;
  background: rgba(15, 18, 42, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--c-card-border);
  border-radius: 16px;
  padding: 18px 22px;
  max-width: 780px;
  margin: 0 auto;
  color: var(--c-ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s;
}
.cookie-banner.is-visible { transform: translateY(0); opacity: 1; }
.cookie-banner-inner {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.cookie-banner-text { flex: 1; min-width: 280px; }
.cookie-banner-text strong {
  display: block; margin-bottom: 4px;
  font-size: 0.95rem; color: var(--c-gold);
}
.cookie-banner-text p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--c-ink-soft);
  line-height: 1.5;
}
.cookie-banner-text a { color: var(--c-gold); }
.cookie-banner-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.cookie-btn {
  padding: 9px 18px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--c-card-border);
  background: transparent;
  color: var(--c-ink);
  transition: all 0.15s;
}
.cookie-btn:hover { border-color: var(--c-gold); color: var(--c-gold); }
.cookie-btn-primary {
  background: linear-gradient(135deg, var(--c-gold-light), var(--c-gold));
  color: var(--c-bg-1);
  font-weight: 700;
  border-color: transparent;
}
.cookie-btn-primary:hover { color: var(--c-bg-1); box-shadow: var(--shadow-gold); }
.cookie-btn-text {
  background: transparent;
  border-color: transparent;
  color: var(--c-ink-soft);
  padding-left: 8px;
  padding-right: 8px;
}

@media (max-width: 600px) {
  .cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 14px 16px; }
  .cookie-banner-actions { width: 100%; justify-content: stretch; }
  .cookie-btn { flex: 1; text-align: center; }
}

/* Cookie preferences modal */
.cookie-modal {
  position: fixed; inset: 0; z-index: 600;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.cookie-modal.is-open { display: flex; }
.cookie-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 5, 22, 0.75);
  backdrop-filter: blur(6px);
}
.cookie-modal-dialog {
  position: relative;
  background: rgba(15, 18, 42, 0.98);
  border: 1px solid var(--c-card-border);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  display: flex; flex-direction: column;
  color: var(--c-ink);
  backdrop-filter: blur(24px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.cookie-modal-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--c-border);
  display: flex; justify-content: space-between; align-items: center;
}
.cookie-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--c-gold);
  font-family: var(--font-serif);
  font-weight: 500;
}
.cookie-modal-close {
  background: transparent; border: none;
  font-size: 1.8rem;
  color: var(--c-muted);
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 50%;
  line-height: 1;
}
.cookie-modal-close:hover { color: var(--c-gold); }
.cookie-modal-body { flex: 1; overflow-y: auto; padding: 20px 26px; }
.cookie-category {
  padding: 14px 0;
  border-bottom: 1px solid var(--c-border-soft);
}
.cookie-category:last-child { border-bottom: none; }
.cookie-category-row {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  margin-bottom: 6px;
}
.cookie-category-row input[type="checkbox"] {
  accent-color: var(--c-gold);
  width: 18px; height: 18px;
  cursor: pointer;
}
.cookie-category-row input:disabled { cursor: not-allowed; opacity: 0.7; }
.cookie-category-title {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--c-ink);
}
.cookie-category-body {
  margin: 0 0 0 30px;
  font-size: 0.85rem;
  color: var(--c-muted);
  line-height: 1.5;
}
.cookie-modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--c-border);
  display: flex; justify-content: flex-end;
}
