/* ============================================================
   BASE — Reset, Custom Properties, Typography
   ============================================================ */

/* ── Design Tokens (SecureQR-inspired) ─────────────────────── */
:root {
    --color-primary:        #06b6d4;
    --color-primary-dark:   #0891b2;
    --color-primary-darker: #164e63;
    --color-primary-light:  #0e7490;
    --color-primary-soft:   #d9fbff;
    --color-success:        #22c55e;
    --color-success-light:  #dcfce7;
    --color-success-border: #86efac;
    --color-success-dark:   #166534;
    --color-danger:         #ef4444;
    --color-danger-light:   #fee2e2;
    --color-danger-border:  #fca5a5;
    --color-danger-dark:    #991b1b;
    --color-warning:        #d97706;
    --color-warning-light:  #fef3c7;
    --color-bg:             #f7fbfc;
    --color-bg-alt:         #e8f7fb;
    --color-bg-card:        #ffffff;
    --color-surface-alt:    #f6fafb;
    --color-text:           #12313f;
    --color-text-muted:     #526b78;
    --color-border:         #d8e8ee;
    --color-border-strong:  #b8dbe4;
    --color-border-focus:   #06b6d4;
    --color-gray-100:       #f3f4f6;
    --color-gray-200:       #e5e7eb;
    --color-gray-400:       #9ca3af;
    --color-gray-600:       #4b5563;
    --color-gray-800:       #1f2937;
    --radius:               8px;
    --radius-lg:            12px;
    --radius-xl:            16px;
    --radius-2xl:           24px;
    --shadow-sm:            0 1px 2px 0 rgba(0,0,0,.05);
    --shadow-md:            0 10px 24px rgba(18,49,63,.08);
    --shadow-lg:            0 18px 50px rgba(18,49,63,.12);
    --shadow-primary:       0 10px 22px rgba(6,182,212,.22);
    --shadow-card:          0 18px 48px rgba(18,49,63,.08), 0 1px 2px rgba(18,49,63,.04);
    --font-sans:            'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono:          ui-monospace,"Cascadia Code","Fira Code",Menlo,Consolas,monospace;
    --transition:         200ms ease;
    --transition-standard: all .3s ease;
    --max-width:          1120px;
    --header-height:      68px;
}

/* Keep the privacy-tool UI light and consistent across OS themes. */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light;
    }
}

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

[hidden] {
    display: none !important;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main {
    flex: 1;
    outline: none;
}

img, svg, video {
    display: block;
    max-width: 100%;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text);
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); margin-bottom: .75rem; line-height: 1.1; }
h2 { font-size: clamp(1.375rem, 3vw, 2rem);   margin-bottom: .625rem; }
h3 { font-size: clamp(1.125rem, 2vw, 1.375rem); margin-bottom: .5rem; }

p   { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition);
}
a:hover  { color: var(--color-primary-dark); }
a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

ul, ol { padding-left: 1.5rem; }
li     { margin-bottom: .25rem; }

code {
    font-family: var(--font-mono);
    font-size: .875em;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: .1em .35em;
    border-radius: 4px;
}

pre {
    font-family: var(--font-mono);
    font-size: .875rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Layout Utilities ───────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 768px)  { .container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container { padding-inline: 2rem; } }

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

.visually-hidden {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: .5rem;
    padding: .5rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    z-index: 1000;
    transition: top var(--transition);
}
.skip-link:focus { top: .5rem; }

/* Margin utilities */
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }

/* Font utilities */
.font-mono { font-family: var(--font-mono); }
