/* ==========================================================================
   GeminiEraser — Open source styling
   Digital Box Store
   ========================================================================== */

:root {
    --bg:            #0a0c10;
    --bg-elev:       #101319;
    --bg-inset:      #0d1016;
    --surface:       #12161d;
    --surface-2:     #161b23;

    --border:        #1e242d;
    --border-strong: #2a323d;

    --text:          #e7eaee;
    --text-dim:      #9aa4b2;
    --text-faint:    #626c7a;

    --accent:        #34d399;
    --accent-strong: #10b981;
    --accent-soft:   rgba(52, 211, 153, 0.10);
    --accent-line:   rgba(52, 211, 153, 0.30);

    --danger:        #f87171;

    --radius:        10px;
    --radius-sm:     7px;
    --radius-lg:     16px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;

    --maxw: 1080px;
}

/* Light theme overrides */
:root[data-theme="light"] {
    --bg:            #f5f7fa;
    --bg-elev:       #ffffff;
    --bg-inset:      #eceff3;
    --surface:       #ffffff;
    --surface-2:     #f1f4f8;

    --border:        #e2e7ee;
    --border-strong: #cbd3dd;

    --text:          #131820;
    --text-dim:      #545e6b;
    --text-faint:    #8a94a2;

    --accent:        #059669;
    --accent-strong: #047857;
    --accent-soft:   rgba(5, 150, 105, 0.10);
    --accent-line:   rgba(5, 150, 105, 0.28);

    --danger:        #dc2626;
}
:root[data-theme="light"] body {
    background-image: radial-gradient(900px 500px at 50% -10%, rgba(5, 150, 105, 0.07), transparent 70%);
}
:root[data-theme="light"] .navbar { background: rgba(255, 255, 255, 0.78); }
:root[data-theme="light"] .btn-primary { color: #ffffff; }
:root[data-theme="light"] .cmp-knob { color: #ffffff; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-image:
        radial-gradient(900px 500px at 50% -10%, rgba(52, 211, 153, 0.06), transparent 70%);
    background-repeat: no-repeat;
}

a { color: inherit; }

.mono { font-family: var(--font-mono); }

/* ------------------------------------------------------------------ layout */
.wrap {
    width: 92%;
    max-width: var(--maxw);
    margin: 0 auto;
}

section { scroll-margin-top: 80px; }

/* ------------------------------------------------------------------ navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.72);
    backdrop-filter: saturate(140%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    width: 92%;
    max-width: var(--maxw);
    margin: 0 auto;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    font-size: 0.95rem;
}

.brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.2px;
}
.brand-text .dim { color: var(--text-faint); font-weight: 600; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 26px;
    margin-left: auto;
}
.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

.nav-by {
    font-size: 0.78rem;
    color: var(--text-faint);
    font-family: var(--font-mono);
}
.nav-by b { color: var(--text-dim); font-weight: 600; }

@media (max-width: 720px) {
    .nav-links { display: none; }
}

/* nav controls: language + theme */
.nav-controls { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-links + .nav-controls { margin-left: 0; }
.lang-select {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    max-width: 130px;
}
.lang-select:hover { border-color: var(--border-strong); }
.theme-toggle {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: var(--surface);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); }

/* ------------------------------------------------------------------ hero */
.hero {
    text-align: center;
    padding: 72px 0 40px;
}

.meta-badges {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 26px;
}
.chip {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip i { color: var(--text-faint); }

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.1rem);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 18px;
}
.hero h1 .accent { color: var(--accent); }

.hero p.lead {
    color: var(--text-dim);
    font-size: 1.08rem;
    max-width: 620px;
    margin: 0 auto 30px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* terminal-ish accent line */
.hero-terminal {
    margin: 34px auto 0;
    max-width: 520px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    text-align: left;
    overflow: hidden;
}
.hero-terminal .tbar {
    display: flex;
    gap: 6px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.hero-terminal .tbar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.hero-terminal .tbody { padding: 14px 16px; color: var(--text-dim); }
.hero-terminal .tbody .g { color: var(--accent); }
.hero-terminal .tbody .c { color: var(--text-faint); }

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.16s ease;
    white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #04140d; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--text-faint); background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ------------------------------------------------------------------ tool / workspace */
.tool { padding: 10px 0 40px; }

.tool-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}
.tool-head .label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-faint);
}
.tool-head .label b { color: var(--accent); font-weight: 600; }

.seg {
    display: inline-flex;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
}
.seg button {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 7px 18px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s;
    font-family: var(--font-sans);
}
.seg button.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}
.file-tag {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-tag i { color: var(--accent); }
.link-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.link-btn:hover { color: var(--text); }

/* dropzone */
.dropzone {
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 70px 20px;
    text-align: center;
    background: var(--bg-inset);
    cursor: pointer;
    transition: all 0.18s;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
}
.dz-icon {
    font-size: 2.4rem;
    color: var(--accent);
    margin-bottom: 14px;
}
.dz-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.dz-sub { color: var(--text-faint); font-size: 0.85rem; font-family: var(--font-mono); }

/* media stage */
.stage {
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 18px;
}
.stage video, .stage img {
    max-width: 100%;
    max-height: 62vh;
    object-fit: contain;
    display: block;
}

.panel-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.result-ok {
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}

/* processing */
.processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 56px 0;
}
.spinner {
    width: 46px;
    height: 46px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing h3 { font-size: 1.15rem; margin-bottom: 6px; }
.processing p { color: var(--text-dim); margin-bottom: 24px; font-family: var(--font-mono); font-size: 0.82rem; }
.progress {
    width: 100%;
    max-width: 380px;
    height: 6px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress > div {
    height: 100%;
    width: 10%;
    background: var(--accent);
    transition: width 0.3s ease;
}

/* ------------------------------------------------------------------ scanner */
.scan-stage {
    position: relative;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 18px;
}
.scan-stage video, .scan-stage img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}
.scan-overlay { position: absolute; inset: 0; pointer-events: none; }
/* moving scan line */
.scan-line {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 14px 3px var(--accent), 0 0 40px 8px rgba(52,211,153,0.35);
    animation: scanSweep 2.1s cubic-bezier(.5,0,.5,1) infinite;
}
.scan-line::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -60px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(52,211,153,0.18));
}
@keyframes scanSweep {
    0%   { top: 2%;  opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { top: 98%; opacity: 0; }
}
/* faint animated grid */
.scan-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(52,211,153,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(52,211,153,0.08) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 78%);
    opacity: 0.7;
}
/* framing corners */
.scan-corner {
    position: absolute; width: 26px; height: 26px;
    border: 2px solid var(--accent);
}
.scan-corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.scan-corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.scan-corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.scan-corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }
/* reticle that homes onto the corner where the mark lives */
.scan-reticle {
    position: absolute;
    right: 7%; bottom: 8%;
    width: 60px; height: 60px;
    border: 1.5px dashed var(--accent);
    border-radius: 50%;
    animation: reticlePulse 1.4s ease-in-out infinite;
}
.scan-reticle::before, .scan-reticle::after {
    content: ""; position: absolute; background: var(--accent);
}
.scan-reticle::before { left: 50%; top: 20%; bottom: 20%; width: 1px; transform: translateX(-50%); }
.scan-reticle::after  { top: 50%; left: 20%; right: 20%; height: 1px; transform: translateY(-50%); }
@keyframes reticlePulse { 0%,100% { transform: scale(1); opacity: 0.55; } 50% { transform: scale(1.12); opacity: 1; } }

.scan-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.scan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* ------------------------------------------------------------------ compare slider */
.cmp-hint { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.78rem; display: inline-flex; align-items: center; gap: 6px; }
.cmp {
    position: relative;
    width: 100%;
    max-height: 62vh;
    margin: 0 auto 18px;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    user-select: none;
    touch-action: none;
    cursor: ew-resize;
    --x: 50%;
}
.cmp-pane { position: absolute; inset: 0; }
.cmp-pane video, .cmp-pane img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
.cmp-before { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.cmp-divider {
    position: absolute; top: 0; bottom: 0;
    left: var(--x);
    width: 2px;
    background: var(--accent);
    transform: translateX(-1px);
    box-shadow: 0 0 10px rgba(52,211,153,0.5);
    pointer-events: none;
}
.cmp-knob {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #04140d;
    display: grid; place-items: center;
    font-size: 0.8rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.cmp-tag {
    position: absolute; bottom: 12px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--border-strong);
    color: var(--text);
    backdrop-filter: blur(4px);
    pointer-events: none;
}
.cmp-tag.left  { left: 12px; }
.cmp-tag.right { right: 12px; color: var(--accent); border-color: var(--accent-line); }

/* ------------------------------------------------------------------ sections */
.section { padding: 56px 0; border-top: 1px solid var(--border); }

.sec-head { max-width: 640px; margin: 0 auto 34px; text-align: center; }
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}
.sec-head h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 10px; }
.sec-head p { color: var(--text-dim); }

/* before/after demo */
.demo-frame {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
}
.demo-frame video {
    width: 100%;
    max-height: 560px;
    object-fit: contain;
    border-radius: var(--radius);
    background: #000;
    display: block;
}
.demo-caption {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-top: 12px;
}

/* features */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.18s;
}
.card:hover { border-color: var(--border-strong); }
.card .ic {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 9px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent);
    margin-bottom: 14px;
    font-size: 1.05rem;
}
.card h3 { font-size: 1.02rem; margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: 0.9rem; }

/* steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    counter-reset: step;
}
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
}
.step .n {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    border: 1px solid var(--accent-line);
    background: var(--accent-soft);
    width: 30px; height: 30px;
    border-radius: 8px;
    display: grid; place-items: center;
    margin-bottom: 14px;
}
.step h4 { font-size: 1rem; margin-bottom: 6px; }
.step p { color: var(--text-dim); font-size: 0.88rem; }

/* compare table */
.compare-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.compare {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    font-size: 0.92rem;
    background: var(--surface);
}
.compare thead th {
    text-align: center;
    padding: 18px 16px;
    font-weight: 600;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    background: var(--bg-inset);
    vertical-align: middle;
}
.compare thead th.feat-col { text-align: left; color: var(--text-faint); font-family: var(--font-mono); font-size: 0.8rem; }
.compare thead th.ours { color: var(--text); }
.compare thead th.ours span { display: block; font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); font-weight: 500; margin-top: 3px; }
.compare tbody td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
}
.compare tbody tr:last-child td { border-bottom: none; }
.compare td.feat { text-align: left; color: var(--text); font-weight: 500; }
.compare col, .compare td.ours, .compare th.ours {
    background: var(--accent-soft);
}
.compare td.ours { color: var(--text); font-weight: 600; }
.compare i.yes { color: var(--accent); margin-right: 5px; }
.compare i.no  { color: var(--danger); margin-right: 5px; }
.compare i.mid { color: var(--text-faint); margin-right: 5px; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.faq-q {
    width: 100%;
    padding: 18px 20px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    font-family: var(--font-sans);
}
.faq-q i { color: var(--text-faint); transition: transform 0.25s; flex-shrink: 0; }
.faq-a {
    max-height: 0;
    overflow: hidden;
    color: var(--text-dim);
    padding: 0 20px;
    transition: all 0.28s ease;
    font-size: 0.92rem;
}
.faq-item.active { border-color: var(--border-strong); }
.faq-item.active .faq-q i { transform: rotate(180deg); color: var(--accent); }
.faq-item.active .faq-a { max-height: 320px; padding: 0 20px 20px; }

/* ------------------------------------------------------------------ footer */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-elev);
    padding: 52px 0 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 36px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand p { color: var(--text-dim); font-size: 0.88rem; margin: 14px 0; max-width: 320px; }
.footer-col h5 {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer-col a, .footer-col button {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    background: none; border: none; padding: 0; cursor: pointer;
    font-family: var(--font-sans);
    text-align: left;
    transition: color 0.15s;
}
.footer-col a:hover, .footer-col button:hover { color: var(--accent); }

.footer-bottom {
    max-width: var(--maxw);
    width: 92%;
    margin: 34px auto 0;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-faint);
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

/* ------------------------------------------------------------------ modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 9, 0.78);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-card {
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 620px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}
.modal-x {
    position: absolute;
    top: 18px; right: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    display: grid; place-items: center;
}
.modal-x:hover { color: var(--text); border-color: var(--border-strong); }
.modal-card h2 { font-size: 1.4rem; margin-bottom: 4px; }
.modal-kicker { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.78rem; margin-bottom: 22px; }
.legal h4 { font-size: 0.98rem; margin: 18px 0 6px; }
.legal p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 10px; }
.legal ul { color: var(--text-dim); font-size: 0.9rem; margin: 0 0 10px 18px; }
.legal li { margin-bottom: 6px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; color: var(--text-dim); margin-bottom: 6px; font-family: var(--font-mono); }
.input, .textarea {
    width: 100%;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.92rem;
}
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); }
.contact-meta {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* coffee button under result */
.result-coffee { margin-top: 12px; }
.btn-coffee {
    background: linear-gradient(135deg, #FFDD00 0%, #FBB034 100%);
    color: #000000;
    font-weight: 800;
    border: none;
    box-shadow: 0 4px 14px rgba(251, 176, 52, 0.35);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.btn-coffee:hover { 
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(251, 176, 52, 0.5);
    filter: brightness(1.05); 
}
.btn-coffee:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 8px rgba(251, 176, 52, 0.3);
}

/* coffee / donation popup */
.coffee-card { max-width: 420px; text-align: center; }
.coffee-emoji {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 12px;
    animation: coffeeBob 2.2s ease-in-out infinite;
}
@keyframes coffeeBob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.coffee-card h2 { font-size: 1.35rem; }
.coffee-card .modal-kicker { margin-bottom: 22px; font-family: var(--font-sans); color: var(--text-dim); }
.coffee-amounts {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}
.coffee-amount {
    flex: 1;
    padding: 14px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    transition: all 0.15s;
}
.coffee-amount:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); transform: translateY(-2px); }
.coffee-card .btn-primary { margin-top: 2px; }
.coffee-later {
    display: block;
    margin: 14px auto 0;
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-sans);
}
.coffee-later:hover { color: var(--text-dim); }

.hidden { display: none !important; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: flex !important; /* Keep it flex for transition, but pointer-events none handles the hide */
}
.modal-card {
    background: #09090b;
    border: 1px solid #27272a;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
}
.modal-overlay.hidden .modal-card {
    transform: translateY(20px);
}
.modal-x {
    position: absolute;
    top: 15px; right: 15px;
    background: none; border: none;
    color: #a1a1aa; font-size: 1.5rem;
    cursor: pointer;
}
.modal-x:hover {
    color: white;
}
