/* ============================================================
   W — Dithered grain-gradient design language
   Ported from iOS GrainGradient.swift / AmbientBackground.swift
   Pure black → monochrome value-ramp of one hue + tiled film grain
   ============================================================ */

:root {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --accent: #FFD700;              /* pureGold 1.0, 0.84, 0.0 */
    --accent-trophy: #FFC740;       /* W badge 1.0, 0.78, 0.25 */
    --accent-dim: rgba(255, 215, 0, 0.6);
    --accent-glow: rgba(255, 215, 0, 0.12);
    --accent-border: rgba(255, 215, 0, 0.18);
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.70);
    --text-tertiary: rgba(255, 255, 255, 0.40);
    --text-muted: rgba(255, 255, 255, 0.55); /* darkTheme secondary */
    --glass: rgba(255, 215, 0, 0.06);
    --glass-white: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.10);
    --card-radius: 24px;
    --button-height: 52px;
    --margin: 24px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    /* Grain-gradient ramp (black → gold hue, monochrome) */
    --grain-0: #000000;
    --grain-1: #0a0800;   /* ~30% of gold brightness, desat */
    --grain-2: #2a2200;   /* ~65% */
    --grain-3: #4a3c00;   /* full hue whisper */
}

/* Full-viewport grain wash — the app's soul */
.grain-root {
    position: relative;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100%;
}

.grain-root::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(
            160deg,
            var(--grain-0) 0%,
            var(--grain-1) 35%,
            var(--grain-2) 70%,
            rgba(255, 215, 0, 0.09) 100%
        );
    opacity: 1;
}

/* Tiled film grain (SVG fractal noise) — matches iOS cached noise tile */
.grain-root::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.055;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
}

.grain-root > * {
    position: relative;
    z-index: 2;
}

/* Glass cards — DesignSystem radius 24, gold-tinted glass */
.glass {
    background: linear-gradient(
        145deg,
        rgba(255, 215, 0, 0.07) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
    border: 0.5px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--card-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.glass:hover {
    border-color: rgba(255, 215, 0, 0.22);
}

/* Accent kicker */
.kicker {
    color: var(--accent) !important;
}

/* Pill CTA — height 52, white fill like auth dark theme CTAs */
.pill-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--button-height);
    padding: 0 48px;
    border-radius: 50px;
    background: #fff;
    color: #000;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.03em;
    text-decoration: none;
    transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease);
}

.pill-cta:hover {
    transform: scale(1.03);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.12);
}

/* W badge seal */
.w-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFC740, rgba(255, 199, 64, 0.65));
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 900;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(255, 199, 64, 0.4);
    vertical-align: middle;
}

/* Yellow→purple morph bar (cinematic accent) */
.morph-bar {
    height: 2px;
    width: 100%;
    max-width: 120px;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        #FFD700,
        #FFA64D,
        #FF7380,
        #E64DBF,
        #9D00FF
    );
    margin: 16px 0 0;
}
