/* ── PALETTE TOKENS ───────────────────────────────────────────────────────── */
:root {
  --bg:       #0A140D;
  --text:     #FFFFFF;
  --accent:   #D4A843;
  --muted:    rgba(255, 255, 255, 0.60);
  --border:   rgba(255, 255, 255, 0.14);
  --input-bg: rgba(255, 255, 255, 0.06);
  --err:      #ff8080;
}

/* ── TYPOGRAPHY TOKENS — Stack E (Latin default) ──────────────────────────── */
:root {
  --f-display: 'Libre Caslon Display', Georgia, serif;
  --f-body:    'Crimson Pro', Georgia, serif;
  --f-ui:      'Outfit', system-ui, sans-serif;
}

/* Arabic / RTL */
[lang="ar"] {
  --f-display: 'Scheherazade New', serif;
  --f-body:    'Scheherazade New', serif;
  --f-ui:      'Noto Sans Arabic', system-ui, sans-serif;
}

/* Hebrew */
[lang="he"] {
  --f-display: 'Frank Ruhl Libre', serif;
  --f-body:    'Frank Ruhl Libre', serif;
  --f-ui:      'Noto Sans Hebrew', system-ui, sans-serif;
}

/* CJK */
[lang="zh"], [lang="zh-TW"], [lang="ja"], [lang="ko"] {
  --f-display: 'Noto Serif CJK SC', serif;
  --f-body:    'Noto Serif CJK SC', serif;
  --f-ui:      'Noto Sans CJK SC', system-ui, sans-serif;
}

/* Cyrillic */
[lang="ru"] {
  --f-display: 'Spectral', serif;
  --f-body:    'Spectral', serif;
  --f-ui:      'Outfit', system-ui, sans-serif;
}

/* Devanagari */
[lang="hi"] {
  --f-display: 'Tiro Devanagari Hindi', serif;
  --f-body:    'Tiro Devanagari Hindi', serif;
  --f-ui:      'Noto Sans Devanagari', system-ui, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ── VELVET DEPTH ────────────────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 18%, rgba(255,255,255,0.045) 0%, transparent 65%),
    radial-gradient(ellipse 55% 40% at 85% 88%, rgba(212,168,67,0.055) 0%, transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, transparent 38%, rgba(0,0,0,0.28) 100%);
}

/* ── GRAIN OVERLAY ───────────────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* ── STAGE SWITCHING ──────────────────────────────────────────────────────── */
.v2-stage {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  position: relative;
}

.v2-stage.v2-off {
  display: none;
}

/* ── WRAPPER ──────────────────────────────────────────────────────────────── */
.v2-wrap {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 32px 24px 28px;
  position: relative;
  z-index: 1;
}

/* ── LOGO ─────────────────────────────────────────────────────────────────── */
.v2-logo {
  width: 56px;
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
}

/* ── LOGO WRAP & GLOW ─────────────────────────────────────────────────────── */
.v2-logo-wrap {
  position: relative;
  display: block;
  width: fit-content;
  margin: 0 auto 20px;
}

@keyframes v2-glow-pulse {
  0%   { opacity: 0.65; transform: translate(-50%, -50%) scale(1);    }
  100% { opacity: 1;    transform: translate(-50%, -50%) scale(1.14); }
}

.v2-logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(ellipse, rgba(212, 168, 67, 0.20) 0%, transparent 68%);
  pointer-events: none;
  will-change: opacity, transform;
  animation: v2-glow-pulse 4s ease-in-out infinite alternate;
}

/* ── HEADING & SUBHEAD ────────────────────────────────────────────────────── */
.v2-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  text-align: center;
}

.v2-subhead {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
  text-align: center;
}

/* ── SCREEN 1 — ACCUSATION ───────────────────────────────────────────────── */
.v2-s1-hero {
  font-family: var(--f-display);
  font-size: clamp(1.75rem, 6vw, 2.1rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--text);
  margin-bottom: 18px;
}

.v2-s1-hero em {
  font-style: normal;
  color: var(--accent);
}

.v2-s1-subhead {
  font-family: var(--f-body);
  font-size: clamp(1rem, 3.2vw, 1.125rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
  letter-spacing: 0.025em;
  word-spacing: 0.02em;
  text-align: center;
  margin: 0 auto 14px;
  max-width: 340px;
}

.v2-s1-body {
  font-family: var(--f-body);
  font-size: clamp(0.875rem, 2.8vw, 0.9375rem);
  font-weight: 300;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  letter-spacing: 0.02em;
  word-spacing: 0.015em;
  text-align: center;
  margin: 0 auto 22px;
  max-width: 320px;
}

.v2-s1-promise {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-align: center;
  margin-bottom: 28px;
}

/* ── SCREEN 2 — COMMITMENT ───────────────────────────────────────────────── */
.v2-s2-hook {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-align: center;
  margin-bottom: 10px;
}

.v2-s2-prominent {
  font-family: var(--f-display);
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-align: center;
  margin-bottom: 4px;
}

.v2-s2-sub {
  font-family: var(--f-body);
  font-size: 0.9375rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.025em;
  word-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}

.v2-rule {
  width: 32px;
  height: 1px;
  background: rgba(212,168,67,0.35);
  margin: 0 auto 24px;
}

/* ── DONE SCREEN ─────────────────────────────────────────────────────────── */
.v2-done-heading {
  font-family: var(--f-display);
  font-size: clamp(2rem, 7vw, 2.5rem);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  text-align: center;
  margin-bottom: 6px;
}

.v2-done-position {
  font-family: var(--f-ui);
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--muted);
  text-align: center;
  margin-bottom: 24px;
}

.v2-done-cta {
  font-family: var(--f-body);
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 16px;
}

.v2-viral-cta {
  font-family: var(--f-body);
  font-size: 0.8125rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.35);
  text-align: center;
  margin-top: 8px;
}

/* ── FORM FIELDS ──────────────────────────────────────────────────────────── */
.v2-field {
  margin-bottom: 4px;
}

.v2-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.v2-input {
  width: 100%;
  height: 44px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.v2-input:focus {
  border-color: var(--accent);
}

.v2-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* ── OR DIVIDER ───────────────────────────────────────────────────────────── */
.v2-or {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 8px 0;
  position: relative;
}

.v2-or::before,
.v2-or::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 18px);
  height: 1px;
  background: var(--border);
}

.v2-or::before { left: 0; }
.v2-or::after  { right: 0; }


/* ── CTA BUTTON ───────────────────────────────────────────────────────────── */
.v2-btn {
  display: block;
  width: 100%;
  height: 52px;
  background: var(--accent);
  color: #000;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 14px;
  transition: opacity 0.15s;
  letter-spacing: -0.01em;
}

.v2-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.v2-btn:not(:disabled):active {
  opacity: 0.82;
}

.v2-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── FOOTER INFO (count + invite link) ────────────────────────────────────── */
.v2-footer {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.v2-count {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  min-height: 16px;
}

.v2-invite-link {
  font-size: 0.75rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.v2-invite-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.v2-invite-wrap {
  width: 100%;
  margin-top: 8px;
}

/* ── ERROR & PRIVACY ──────────────────────────────────────────────────────── */
.v2-err {
  font-size: 0.8125rem;
  color: var(--err);
  text-align: center;
  margin-top: 8px;
  min-height: 18px;
}

.v2-privacy {
  font-size: 0.6875rem;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* ── DONE SCREEN ──────────────────────────────────────────────────────────── */
#s-done .v2-logo, #s-full .v2-logo { margin: 0 auto 20px; }

.v2-done-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  text-align: center;
}

.v2-done-position {
  font-size: 1.125rem;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 20px;
  text-align: center;
}

.v2-done-cta {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 14px;
  text-align: center;
}

.v2-ref-url {
  font-size: 0.875rem;
  color: var(--accent);
  word-break: break-all;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  text-align: center;
  line-height: 1.5;
}

.v2-share-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.v2-share-btn {
  flex: 1;
  height: 48px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s;
}

.v2-share-btn:active {
  border-color: var(--accent);
}

.v2-share-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── FULL SCREEN ──────────────────────────────────────────────────────────── */
.v2-full-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.375rem;
  font-weight: 500;
  margin-bottom: 8px;
  text-align: center;
}

.v2-full-body {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}

/* ── ICON FIELD ───────────────────────────────────────────────────────────── */
.v2-icon-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.v2-app-icon {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  will-change: transform;
}

@keyframes v2-float-a {
  0%   { transform: translate(0px,  0px) rotate(-12deg) scale(0.82); }
  100% { transform: translate(3px, -6px) rotate(-10deg) scale(0.84); }
}
@keyframes v2-float-b {
  0%   { transform: translate( 0px, 0px) rotate(8deg)  scale(0.78); }
  100% { transform: translate(-4px,-5px) rotate(10deg) scale(0.80); }
}
@keyframes v2-float-c {
  0%   { transform: translate(0px, 0px) rotate(14deg)  scale(0.80); }
  100% { transform: translate(5px, 4px) rotate(12deg)  scale(0.82); }
}
@keyframes v2-float-d {
  0%   { transform: translate( 0px, 0px) rotate(-7deg) scale(0.76); }
  100% { transform: translate(-3px, 5px) rotate(-9deg) scale(0.78); }
}
@keyframes v2-float-e {
  0%   { transform: translate(0px,  0px) rotate(5deg)  scale(0.72); }
  100% { transform: translate(4px, -4px) rotate(7deg)  scale(0.74); }
}
@keyframes v2-float-f {
  0%   { transform: translate( 0px, 0px) rotate(-5deg) scale(0.74); }
  100% { transform: translate(-5px, 3px) rotate(-7deg) scale(0.76); }
}

.v2-icon-wa {
  background: #25D366;
  top: 48px; left: 28px;
  opacity: 0.14;
  animation: v2-float-a 5s ease-in-out infinite alternate;
}
.v2-icon-ig {
  background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  top: 100px; left: 12px;
  opacity: 0.12;
  animation: v2-float-b 4s ease-in-out infinite alternate;
  animation-delay: -1.5s;
}
.v2-icon-tg {
  background: #2AABEE;
  top: 48px; right: 28px;
  opacity: 0.13;
  animation: v2-float-c 6s ease-in-out infinite alternate;
  animation-delay: -2s;
}
.v2-icon-tt {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.20);
  top: 100px; right: 12px;
  opacity: 0.15;
  animation: v2-float-d 3.5s ease-in-out infinite alternate;
  animation-delay: -0.8s;
}
.v2-icon-gm {
  background: #EA4335;
  bottom: 160px; left: 20px;
  opacity: 0.11;
  animation: v2-float-e 7s ease-in-out infinite alternate;
  animation-delay: -3s;
}
.v2-icon-tw {
  background: #111;
  border: 1px solid rgba(255,255,255,0.18);
  bottom: 160px; right: 20px;
  opacity: 0.12;
  animation: v2-float-f 4.5s ease-in-out infinite alternate;
  animation-delay: -1s;
}

.v2-icon-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 72% 75% at 50% 44%, var(--bg) 38%, transparent 78%);
}

/* ── PAGE FOOTER ──────────────────────────────────────────────────────────── */
.v2-page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  z-index: 10;
  pointer-events: none;
}

.v2-page-footer > * {
  pointer-events: auto;
}

.v2-copyright {
  font-size: 0.6875rem;
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.03em;
}

.v2-privacy-link {
  font-family: var(--f-ui);
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.v2-privacy-link:hover {
  color: var(--accent);
}

/* ── LANGUAGE SWITCHER (v2) ───────────────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--muted);
  user-select: none;
}

.lang-current {
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

.lang-switcher:hover .lang-current {
  color: var(--text);
  text-decoration-color: var(--accent);
}

.lang-sep { color: rgba(255, 255, 255, 0.25); }

.lang-en-quick {
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s;
}

.lang-en-quick:hover { color: var(--text); }

/* ── LANGUAGE OVERLAY (v2) ────────────────────────────────────────────────── */
#lang-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 3rem 1.25rem 3.5rem;
}

.lang-overlay-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  max-width: 360px;
  width: 100%;
  backdrop-filter: blur(12px);
}

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

.lang-opt {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  text-align: left;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.lang-opt:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.lang-opt--active {
  color: var(--text);
  border-left: 2px solid var(--accent);
  padding-left: calc(0.5rem - 2px);
}

[dir="rtl"] .lang-en-quick   { margin-right: 0; margin-left: 0.35rem; }
[dir="rtl"] .lang-opt--active { border-left: none; border-right: 2px solid var(--accent); padding-left: 0.5rem; padding-right: calc(0.5rem - 2px); }

/* ── REDUCED MOTION ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .v2-logo-glow {
    animation: none;
  }
  .v2-icon-wa,
  .v2-icon-ig,
  .v2-icon-tg,
  .v2-icon-tt,
  .v2-icon-gm,
  .v2-icon-tw {
    animation: none;
  }
}
