/* ============================================================
   PDF Editor — Base Styles (base.css)
   Reset, typography, global elements
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--weight-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── Background Mesh Gradient ────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, var(--accent-soft) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 80%, var(--accent-soft) 0%, transparent 50%),
        radial-gradient(ellipse 50% 60% at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    opacity: var(--mesh-opacity, 0.5);
    pointer-events: none;
    z-index: -1;
}

/* ── Noise Texture Overlay ───────────────────────────────── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    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)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
    opacity: var(--noise-opacity, 0.025);
    pointer-events: none;
    z-index: -1;
    mix-blend-mode: overlay;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out-expo);
}
a:hover { color: var(--accent-secondary); }

strong { font-weight: var(--weight-semibold); }
code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.15em 0.4em;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}

/* ── Selection ───────────────────────────────────────────── */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ── Focus Styles ────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ── Images ──────────────────────────────────────────────── */
img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Lists ───────────────────────────────────────────────── */
ul, ol { list-style: none; }

/* ── Utility Classes ─────────────────────────────────────── */
.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent-primary); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
