/* ===================================================
   DNA.CSS — Editorial Brutalist Design System
   Drop into any website.
=================================================== */

/* ================================
   1. DESIGN TOKENS
================================ */

:root {
    /* Colors */
    --bg-main: #f4f3ef;
    --bg-surface: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #66645e;
    --border: #dcdad2;
    --accent: #ff4b2b;
    --selection: rgba(255, 75, 43, 0.2);

    /* Typography */
    --font-heading: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    /* Radius */
    --radius-sm: 2px;
    --radius-md: 6px;

    /* Shadows */
    --shadow-brutal: 4px 4px 0px #000;

    /* Motion */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

html[data-theme="dark"] {
    --bg-main: #121212;
    --bg-surface: #1e1e1e;
    --text-main: #ededed;
    --text-muted: #999999;
    --border: #333333;
    --accent: #8b5cf6;
    --selection: rgba(0, 230, 118, 0.2);
}

/* ================================
   2. RESET & BASE
================================ */

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

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    transition: background var(--transition-normal),
        color var(--transition-normal);
    overflow-x: hidden;
}

/* Subtle Grain */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.04;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ================================
   3. TYPOGRAPHY
================================ */

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
}

h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: -0.03em;
}

h2 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-xs);
}

p {
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

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

a:hover {
    color: var(--accent);
}

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

.accent {
    color: var(--accent);
}

/* ================================
   4. LAYOUT UTILITIES
================================ */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) 0;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.text-center {
    text-align: center;
}

/* ================================
   5. BUTTON SYSTEM
================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--text-main);
    color: var(--bg-main);
    border: 1px solid var(--text-main);
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-brutal);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--text-main);
}

/* ================================
   6. CARD SYSTEM
================================ */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: var(--space-md);
    transition: transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ================================
   7. NAVBAR STYLE
================================ */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    z-index: 100;
}

/* ================================
   8. SCROLL ANIMATIONS
================================ */

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease,
        transform 0.6s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================
   9. MODAL SYSTEM
================================ */

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal.show {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-surface);
    padding: var(--space-md);
    border: 1px solid var(--border);
    max-width: 500px;
    width: 90%;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.8);
}

/* ================================
   10. RESPONSIVE
================================ */

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .navbar {
        height: 70px;
    }
}