@font-face {
  font-family: Syne;
  src: url("fonts/syne.woff") format("woff");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url("fonts/fraunces-italic.woff") format("woff");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: Outfit;
  src: url("fonts/outfit.woff") format("woff");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #08080b;
  --bg-elev: #141418;
  --ink: #f6f1e8;
  --ink-dim: rgba(246, 241, 232, 0.74);
  --ink-faint: rgba(246, 241, 232, 0.52);
  --line: rgba(246, 241, 232, 0.14);
  --lime: #d8ff3e;
  --lime-ink: #14160a;
  --heart: #ff5c7a;
  --heart-fill: #ff5c7a;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-btn: 22px;
  --row: 13.75rem;
  --font-ui: Outfit, "Segoe UI", system-ui, sans-serif;
  --font-display: Syne, "Trebuchet MS", sans-serif;
  --font-hook: Fraunces, Georgia, "Times New Roman", serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.22, 1.35, 0.36, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  color-scheme: dark;
}

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

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

html {
  background: var(--bg);
  overflow-x: clip;
}

body {
  position: relative;
  font-family: var(--font-ui);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  will-change: transform;
}

.orb-a {
  width: min(72vw, 820px);
  height: min(72vw, 820px);
  top: -28%;
  left: 50%;
  margin-left: min(-36vw, -410px);
  background: radial-gradient(circle, rgba(216, 255, 62, 0.18) 0%, rgba(216, 255, 62, 0.04) 42%, transparent 70%);
  animation: driftA 18s var(--ease-out) infinite alternate;
}

.orb-b {
  width: min(60vw, 640px);
  height: min(60vw, 640px);
  right: -18%;
  bottom: -22%;
  background: radial-gradient(circle, rgba(255, 92, 122, 0.14) 0%, rgba(255, 92, 122, 0.04) 40%, transparent 70%);
  animation: driftB 22s var(--ease-out) infinite alternate;
}

@keyframes driftA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(6%, 8%, 0) scale(1.08); }
}

@keyframes driftB {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-10%, -6%, 0) scale(1.12); }
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.18;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.75rem 0 4.5rem;
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
}

.hero { text-align: center; padding: 0.5rem 0 1.25rem; }

.brand {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
}

.hero h1 {
  margin: 0 auto;
  max-width: 16ch;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6.2vw, 3.05rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.lede {
  margin: 0.8rem auto 0;
  max-width: 38rem;
  color: var(--ink-dim);
  font-size: clamp(1rem, 2.4vw, 1.125rem);
  font-weight: 400;
}

.stage-label {
  margin: 0 0 0.65rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-dim);
}

.stage-frame {
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02) 40%, rgba(8, 8, 11, 0.35));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 0 1px rgba(216, 255, 62, 0.06),
    0 28px 70px rgba(0, 0, 0, 0.5);
}

.stage-frame::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 42%;
  background: linear-gradient(180deg, rgba(216, 255, 62, 0.08), transparent);
  pointer-events: none;
  z-index: 1;
}

.stage-frame::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 120%, rgba(216, 255, 62, 0.08), transparent 50%);
  opacity: 0.9;
}

.viewport {
  position: relative;
  z-index: 2;
  height: var(--row);
  overflow: hidden;
}

.reel { will-change: transform, opacity; }

.hook {
  height: var(--row);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.35rem 1.5rem;
}

.hook-line {
  text-align: center;
  font-family: var(--font-hook);
  font-style: italic;
  font-weight: 600;
  font-optical-sizing: auto;
  font-size: clamp(1.9rem, 6.6vw, 3.2rem);
  line-height: 1.16;
  letter-spacing: -0.03em;
}

.word {
  display: inline-block;
  will-change: transform, opacity;
}

.actions { margin: 1.15rem 0 0; display: grid; gap: 0.75rem; }

.shuffle {
  appearance: none;
  position: relative;
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  background: transparent;
  color: var(--lime-ink);
  padding: 0;
  border-radius: var(--r-btn);
  isolation: isolate;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.shuffle-glow {
  position: absolute;
  inset: 4px 10px -6px;
  border-radius: inherit;
  background: var(--lime);
  opacity: 0.34;
  z-index: 0;
  filter: blur(16px);
  animation: glowPulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.26; transform: scaleX(0.96) scaleY(0.9); }
  50% { opacity: 0.5; transform: scaleX(1.02) scaleY(1.05); }
}

.shuffle-face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60px;
  padding: 1.05rem 1.25rem;
  border-radius: inherit;
  background:
    linear-gradient(180deg, #e8ff6a 0%, var(--lime) 48%, #c4eb2a 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 -2px 0 rgba(80, 100, 0, 0.18) inset,
    0 10px 24px rgba(216, 255, 62, 0.22);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 4.3vw, 1.8rem);
  letter-spacing: -0.04em;
  transform-origin: 50% 100%;
}

.shuffle:hover .shuffle-face {
  filter: brightness(1.04);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 -2px 0 rgba(80, 100, 0, 0.16) inset,
    0 14px 30px rgba(216, 255, 62, 0.3);
}

.shuffle:focus-visible {
  outline: none;
}

.shuffle:focus-visible .shuffle-face {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}

.shuffle:disabled { cursor: wait; }
.shuffle:disabled .shuffle-face { filter: none; }

.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.tool {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-dim);
  text-decoration: none;
  font: 500 0.8125rem/1 var(--font-ui);
  padding: 0.62rem 0.4rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.tool:hover {
  border-color: rgba(246, 241, 232, 0.32);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
}

.tool.is-on {
  border-color: rgba(255, 92, 122, 0.55);
  color: #ffd4dc;
  background: rgba(255, 92, 122, 0.08);
}

.tool-icon {
  position: relative;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  display: inline-block;
}

.tool-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.icon-check {
  opacity: 0;
  transform: scale(0.5);
}

.tool.is-copied {
  color: var(--ink);
  border-color: rgba(216, 255, 62, 0.45);
}

.tool.is-copied .icon-copy { opacity: 0; transform: scale(0.5); }
.tool.is-copied .icon-check { opacity: 1; transform: scale(1); }

.icon-copy, .icon-check {
  transition: opacity 0.2s var(--ease-out), transform 0.28s var(--ease-spring);
}

.heart {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  transform-origin: 50% 50%;
  transition: fill 0.2s var(--ease-out), stroke 0.2s var(--ease-out);
}

.tool.is-on .heart { fill: var(--heart-fill); stroke: var(--heart-fill); }

.chip:focus-visible,
.tool:focus-visible,
.custom input:focus-visible,
.dz-cta:focus-visible,
.fav-item button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

.filters {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.filter-label {
  margin: 0;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-dim);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font: 550 0.875rem/1 var(--font-ui);
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.chip:hover { border-color: rgba(246, 241, 232, 0.34); background: rgba(255, 255, 255, 0.06); }

.chip.is-on {
  background: var(--lime);
  color: var(--lime-ink);
  border-color: var(--lime);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 6px 16px rgba(216, 255, 62, 0.18);
  font-weight: 650;
}

.custom input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font: 400 0.95rem/1.3 var(--font-ui);
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.custom input::placeholder { color: var(--ink-faint); }

.custom input:hover { border-color: rgba(246, 241, 232, 0.28); }

.custom input:focus {
  outline: none;
  border-color: rgba(216, 255, 62, 0.65);
  box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.16);
}

.favorites { margin-top: 2.25rem; }

.fav-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.fav-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.fav-count {
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.fav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.fav-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.35rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transform-origin: 50% 0;
}

.fav-item p {
  margin: 0;
  font-family: var(--font-hook);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.fav-item button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font: 550 0.75rem/1 var(--font-ui);
  padding: 0.3rem 0.4rem;
  cursor: pointer;
  border-radius: 8px;
}

.fav-item button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }

.foot {
  margin-top: 2.75rem;
  text-align: center;
  display: grid;
  gap: 0.55rem;
}

.dz-cta {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(216, 255, 62, 0.7);
  padding-bottom: 0.1rem;
  justify-self: center;
  width: fit-content;
}

.dz-cta:hover { color: var(--lime); }

.dz-soon {
  margin: 0;
  justify-self: center;
  color: var(--ink-faint);
  font-size: 0.84rem;
}

.fine {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.35rem + env(safe-area-inset-bottom));
  translate: -50% 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--ink);
  color: var(--bg);
  font: 650 0.9rem/1 var(--font-ui);
  padding: 0.78rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  z-index: 30;
}

.toast.is-on {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: no-preference) {
  [data-enter] {
    animation: enter 0.38s var(--ease-out) both;
    animation-delay: calc(var(--d, 0) * 1ms);
  }

  .toast {
    transition: opacity 0.28s var(--ease-out), transform 0.36s var(--ease-spring);
  }
}

@keyframes enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 419px) {
  .page { width: min(680px, calc(100% - 1.5rem)); padding: 1.15rem 0 3.25rem; padding-bottom: calc(3.25rem + env(safe-area-inset-bottom)); }
  .hero { padding: 0.2rem 0 1rem; }
  :root { --row: 12.5rem; }
  .shuffle-face, .shuffle { min-height: 62px; }
  .favorites { margin-top: 1.75rem; }
  .foot { margin-top: 2rem; }
  .hook { padding: 1.15rem 1.15rem; }
}

@media (min-width: 720px) {
  .page { padding-top: 3rem; }
  :root { --row: 14.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .orb-a, .orb-b, .shuffle-glow, [data-enter], .toast, .icon-copy, .icon-check {
    animation: none !important;
    transition: none !important;
  }
  .toast.is-on { transform: none; }
  .shuffle-glow { opacity: 0.3; filter: blur(16px); }
}
