:root {
    --bg-0: #050303;
    --bg-1: #0c0807;
    --bg-2: #15100d;
    --ink: #f5e7d4;
    --ink-dim: #b39c83;
    --ink-faint: #6f5c47;
    --amber: #ff7a18;
    --amber-2: #ffb347;
    --amber-soft: rgba(255, 122, 24, 0.18);
    --amber-glow: rgba(255, 122, 24, 0.55);
    --amber-line: rgba(255, 122, 24, 0.85);
    --shadow-deep: 0 20px 80px rgba(0, 0, 0, 0.6);

    --tone-clarity: #6db4ff;
    --tone-energy: #ff7a18;
    --tone-motivation: #c46bff;
    --tone-peace: #4be39a;

    --maxw: 1200px;
}

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

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg-0);
    color: var(--ink);
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
    font-weight: 400;
    line-height: 1.5;
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    overscroll-behavior: none;
}

button {
    font-family: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    letter-spacing: 0.04em;
}

.hidden {
    display: none !important;
}

.kiosk {
    position: fixed;
    inset: 0;
    background: var(--bg-0);
    overflow: hidden;
    isolation: isolate;
}

.kiosk::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(180deg,
            rgba(255, 255, 255, 0.025) 0px,
            rgba(255, 255, 255, 0.025) 1px,
            transparent 1px,
            transparent 3px);
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 3;
}

.kiosk::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 122, 24, 0.10), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 122, 24, 0.06), transparent 55%);
    pointer-events: none;
    z-index: 3;
    mix-blend-mode: screen;
}

/* ----------------- Mirror background (live webcam) ----------------- */
.mirror-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 40%, #2a1a0e 0%, #0c0807 45%, #050303 100%);
    transition: opacity 0.6s ease;
}

.mirror-bg video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    filter: brightness(0.55) contrast(0.95) saturate(0.65);
    opacity: 0;
    transition: opacity 1.6s ease;
}

.mirror-bg.live video { opacity: 1; }

/* When live, pull back the radial gradient slightly so face is visible */
.mirror-bg.live { background: #050303; }

.mirror-scrim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0.15) 0%, rgba(5, 3, 3, 0.55) 45%, rgba(5, 3, 3, 0.92) 100%),
        linear-gradient(180deg, rgba(5, 3, 3, 0.55) 0%, rgba(5, 3, 3, 0.35) 35%, rgba(5, 3, 3, 0.7) 100%);
    pointer-events: none;
}

.mirror-bg.live .mirror-scrim {
    background:
        radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0.05) 0%, rgba(5, 3, 3, 0.35) 50%, rgba(5, 3, 3, 0.85) 100%),
        linear-gradient(180deg, rgba(5, 3, 3, 0.35) 0%, rgba(5, 3, 3, 0.20) 40%, rgba(5, 3, 3, 0.65) 100%);
}

.mirror-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 122, 24, 0.06) 1px, transparent 1px) 0 0 / 60px 60px,
        linear-gradient(0deg,  rgba(255, 122, 24, 0.06) 1px, transparent 1px) 0 0 / 60px 60px;
    mix-blend-mode: screen;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse at center, transparent 30%, black 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, black 75%);
    pointer-events: none;
}

/* On capture stage we hide the mirror background — the cam frame already
   shows the visitor inside its own bordered viewport. */
.kiosk[data-current-stage="capture"] .mirror-bg { opacity: 0; }

/* ----------------- HUD frame ----------------- */
.hud-frame {
    position: absolute;
    inset: 28px;
    border: 1px solid rgba(255, 122, 24, 0.18);
    border-radius: 18px;
    pointer-events: none;
    z-index: 5;
    box-shadow:
        0 0 0 1px rgba(255, 122, 24, 0.05) inset,
        0 0 80px rgba(255, 122, 24, 0.12) inset;
}

.bracket {
    position: absolute;
    width: 64px;
    height: 64px;
    border: 2px solid var(--amber);
    border-radius: 6px;
    filter: drop-shadow(0 0 12px var(--amber-glow));
}

.bracket.tl {
    top: -3px;
    left: -3px;
    border-right: none;
    border-bottom: none;
}

.bracket.tr {
    top: -3px;
    right: -3px;
    border-left: none;
    border-bottom: none;
}

.bracket.bl {
    bottom: -3px;
    left: -3px;
    border-right: none;
    border-top: none;
}

.bracket.br {
    bottom: -3px;
    right: -3px;
    border-left: none;
    border-top: none;
}

.hud-bar {
    position: absolute;
    left: 28px;
    right: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ink-dim);
}

.hud-bar.top {
    top: -10px;
}

.hud-bar.bottom {
    bottom: -10px;
}

.brand {
    background: var(--bg-0);
    padding: 4px 10px;
    color: var(--amber);
    font-weight: 700;
    letter-spacing: 0.08em;
    border: 1px solid rgba(255, 122, 24, 0.4);
    border-radius: 4px;
}

.brand b {
    color: var(--ink);
    font-weight: 800;
    margin-right: 2px;
}

.brand .ultra {
    color: var(--amber);
    font-weight: 600;
}

.hud-status,
.hud-meta {
    background: var(--bg-0);
    padding: 4px 10px;
    border-radius: 4px;
}

.hud-status {
    color: var(--amber);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dots {
    display: inline-flex;
    gap: 3px;
}

.dots i {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--amber);
    border-radius: 50%;
    opacity: 0.3;
    animation: dot-pulse 1.4s infinite;
}

.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
.dots i:nth-child(4) { animation-delay: 0.45s; }
.dots i:nth-child(5) { animation-delay: 0.6s; }

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--amber-line) 30%,
            #fff 50%,
            var(--amber-line) 70%,
            transparent);
    box-shadow: 0 0 24px var(--amber-glow);
    animation: scan-sweep 6s ease-in-out infinite;
    border-radius: 2px;
    opacity: 0.7;
}

.vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
    border-radius: 18px;
    pointer-events: none;
}

/* ----------------- Stages base ----------------- */
.stage {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 80px 6vw;
    z-index: 2;
    overflow: hidden;
}

.stage.stage-capture { padding: 70px 5vw; }

.stage.active {
    display: flex;
}

.stage.entering {
    animation: stage-in 0.7s cubic-bezier(.2,.8,.2,1) both;
}

.stage.leaving {
    animation: stage-out 0.4s ease both;
}

/* ----------------- Common typography ----------------- */
h1, h2, h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

p { margin: 0; }

.action-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--amber);
    text-transform: uppercase;
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid rgba(255, 122, 24, 0.4);
    border-radius: 999px;
    background: rgba(255, 122, 24, 0.08);
}

.action-title {
    font-size: clamp(28px, 4vw, 48px);
    margin-top: 18px;
}

.action-sub {
    color: var(--ink-dim);
    margin-top: 10px;
    font-size: clamp(14px, 1.4vw, 17px);
}

/* ----------------- Buttons ----------------- */
.primary-cta {
    margin-top: 28px;
    padding: 16px 36px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bg-0);
    background: linear-gradient(135deg, var(--amber-2), var(--amber));
    border-radius: 999px;
    box-shadow:
        0 0 0 1px rgba(255, 179, 71, 0.4) inset,
        0 14px 40px rgba(255, 122, 24, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-cta:hover,
.primary-cta:active {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(255, 179, 71, 0.6) inset,
        0 18px 50px rgba(255, 122, 24, 0.5);
}

.ghost-cta {
    margin-top: 32px;
    padding: 12px 28px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ghost-cta:hover,
.ghost-cta:active {
    color: var(--amber);
    border-color: var(--amber-line);
    background: rgba(255, 122, 24, 0.06);
}

/* small screens */
@media (max-width: 720px) {
    .hud-frame { inset: 14px; }
    .stage { padding: 70px 22px; }
    .bracket { width: 40px; height: 40px; }
    .hud-bar { left: 14px; right: 14px; font-size: 9px; letter-spacing: 0.15em; }
}
