/* ═══════════════════════════════════════════════════════════
   HIVECRISP BASE — Signal from Noise
   Reset + Geist-Typografie + GLOBALER Hex-Grid-BG + Mouse-Spotlight
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────── */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

img, video, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }

/* ── Body ───────────────────────────────────────────────── */

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'ss01', 'cv11', 'tnum';
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

/* ═══════════════════════════════════════════════════════════
   GLOBALER HEX-GRID HINTERGRUND
   body::before = statisches dezentes Hex-Grid (fixed, inset: 0)
   body::after  = Teal-Spotlight der der Maus folgt (--mx/--my)
   ═══════════════════════════════════════════════════════════ */

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='34.641' viewBox='0 0 60 34.641'><g fill='none' stroke='%230A0C10' stroke-width='1' stroke-opacity='0.05' stroke-linecap='square'><path d='M30 34.641 L40 17.32 L30 0 L10 0 L0 17.32 L10 34.641'/><path d='M40 17.32 L60 17.32'/></g></svg>");
    background-size: 60px 34.641px;
}

[data-theme="dark"] body::before {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='34.641' viewBox='0 0 60 34.641'><g fill='none' stroke='%23F3F4F6' stroke-width='1' stroke-opacity='0.055' stroke-linecap='square'><path d='M30 34.641 L40 17.32 L30 0 L10 0 L0 17.32 L10 34.641'/><path d='M40 17.32 L60 17.32'/></g></svg>");
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='34.641' viewBox='0 0 60 34.641'><g fill='none' stroke='%230D9488' stroke-width='1' stroke-opacity='0.32' stroke-linecap='square'><path d='M30 34.641 L40 17.32 L30 0 L10 0 L0 17.32 L10 34.641'/><path d='M40 17.32 L60 17.32'/></g></svg>");
    background-size: 60px 34.641px;
    mask-image: radial-gradient(circle 150px at var(--mx, -999px) var(--my, -999px), rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.12) 55%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle 150px at var(--mx, -999px) var(--my, -999px), rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.12) 55%, transparent 85%);
}

[data-theme="dark"] body::after {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='34.641' viewBox='0 0 60 34.641'><g fill='none' stroke='%232DD4BF' stroke-width='1' stroke-opacity='0.42' stroke-linecap='square'><path d='M30 34.641 L40 17.32 L30 0 L10 0 L0 17.32 L10 34.641'/><path d='M40 17.32 L60 17.32'/></g></svg>");
}

/* main / footer brauchen z-index, um über dem body::after Spotlight zu liegen.
   header ist bereits sticky mit eigenem z-index. */
main { position: relative; z-index: 1; }
footer.footer { position: relative; z-index: 1; }

/* ── Headings ───────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
}

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

/* Italic-em in Headlines → Teal */
h1 em, h2 em, h3 em, .hero__headline em {
    font-style: italic;
    font-weight: var(--font-medium);
    color: var(--teal);
    letter-spacing: -0.035em;
}

/* ── Paragraph & Body Text ──────────────────────────────── */

p {
    line-height: var(--leading-normal);
    color: var(--text-soft);
}

small {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

strong { font-weight: var(--font-semibold); color: var(--text); }

/* ── Code & Mono ────────────────────────────────────────── */

code, .mono {
    font-family: var(--font-mono);
    font-size: 0.875em;
    font-feature-settings: 'tnum';
}

code {
    background: var(--surface-2);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    color: var(--teal);
}

/* ── Links ──────────────────────────────────────────────── */

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--dur-fast) ease;
}

/* ── Buttons Reset ──────────────────────────────────────── */

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* ── HR ─────────────────────────────────────────────────── */

hr {
    border: none;
    height: 1px;
    background: var(--line);
    margin: var(--space-8) 0;
}

/* ── Selection ──────────────────────────────────────────── */

::selection {
    background: var(--teal-soft);
    color: var(--text);
}

/* ── Scrollbar ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint, var(--text-muted)); }

/* ── Focus Visible ──────────────────────────────────────── */

:focus-visible {
    outline: var(--ring-width) solid var(--teal);
    outline-offset: var(--ring-offset);
    border-radius: var(--radius-sm);
}

/* ── Reduced Motion ─────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    body::after { display: none; }
}

/* ═══ UTILITY ═══ */

.container {
    width: 100%;
    max-width: var(--max-w-content);
    margin-inline: auto;
    padding-inline: var(--space-8);
}

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

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
}

/* Mono-Utility-Klasse */
.mono { font-family: var(--font-mono); }
