/* ============================================
   DIGITAL MASS — GLOBAL STYLES
   Ghost Theme: Excelsior
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Brand Colors */
    --dm-teal: #00a878;
    --dm-teal-rgb: 0, 168, 120;
    --dm-teal-dark: #008a63;
    --dm-teal-light: #00c98f;
    --dm-dark-blue: #132333;
    --dm-dark-blue-rgb: 19, 35, 51;
    --dm-navy: #0a1628;
    --dm-black: #000000;
    --dm-white: #ffffff;
    --dm-gray: #cddbde;
    --dm-gray-dark: #8a9fa3;
    --dm-gray-darker: #4a5c60;
    --dm-green: #5FB709;
    --dm-copper: #BF7345;

    /* Semantic Colors */
    --bg-primary: #060d13;
    --bg-secondary: #0b1420;
    --bg-tertiary: #111b27;
    --bg-card: rgba(19, 35, 51, 0.6);
    --bg-card-hover: rgba(0, 168, 120, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #cddbde;
    --text-muted: #8a9fa3;
    --text-accent: #00a878;
    --border-color: rgba(0, 168, 120, 0.15);
    --border-color-hover: rgba(0, 168, 120, 0.4);

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Urbanist', sans-serif;

    /* Font Sizes - Fluid */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.3vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.35rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
    --text-4xl: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
    --text-5xl: clamp(3rem, 1.8rem + 4.5vw, 5.5rem);
    --text-6xl: clamp(3.5rem, 2rem + 6vw, 8rem);
    --text-hero: clamp(2.5rem, 1rem + 8vw, 10rem);

    /* Spacing */
    --space-xs: clamp(0.25rem, 0.2rem + 0.2vw, 0.5rem);
    --space-sm: clamp(0.5rem, 0.4rem + 0.4vw, 0.75rem);
    --space-md: clamp(1rem, 0.8rem + 0.8vw, 1.5rem);
    --space-lg: clamp(1.5rem, 1.2rem + 1.2vw, 2.5rem);
    --space-xl: clamp(2rem, 1.5rem + 2vw, 4rem);
    --space-2xl: clamp(3rem, 2rem + 4vw, 6rem);
    --space-3xl: clamp(4rem, 2.5rem + 6vw, 10rem);
    --space-section: clamp(5rem, 3rem + 8vw, 12rem);

    /* Layout */
    --container-max: 1400px;
    --container-narrow: 900px;
    --container-wide: 1600px;
    --gutter: clamp(1.25rem, 1rem + 1.5vw, 3rem);

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
    --duration-fast: 0.2s;
    --duration-base: 0.4s;
    --duration-slow: 0.8s;
    --duration-slower: 1.2s;

    /* Z-index */
    --z-behind: -1;
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-cursor: 500;
    --z-toast: 600;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--dm-teal) var(--bg-primary);
}

html::-webkit-scrollbar {
    width: 6px;
}

html::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

html::-webkit-scrollbar-thumb {
    background: var(--dm-teal);
    border-radius: var(--radius-full);
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
    background: rgba(0, 168, 120, 0.3);
    color: var(--dm-white);
}

/* --- Links --- */
a {
    color: var(--text-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out-quart);
}

a:hover {
    color: var(--dm-teal-light);
}

a:focus-visible {
    outline: 2px solid var(--dm-teal);
    outline-offset: 3px;
    border-radius: 2px;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

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 {
    margin-bottom: 1.5em;
}

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

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

/* --- Layout --- */
.dm-container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.dm-container--narrow {
    max-width: var(--container-narrow);
}

.dm-container--wide {
    max-width: var(--container-wide);
}

.dm-section {
    padding-top: var(--space-section);
    padding-bottom: var(--space-section);
    position: relative;
}

.dm-grid {
    display: grid;
    gap: var(--gutter);
}

.dm-grid--2 { grid-template-columns: repeat(2, 1fr); }
.dm-grid--3 { grid-template-columns: repeat(3, 1fr); }
.dm-grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .dm-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .dm-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

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

/* --- Noise Overlay --- */
.noise-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-behind);
    pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Cursor Glow --- */
.cursor-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-behind);
    background: radial-gradient(circle, rgba(var(--dm-teal-rgb), 0.07) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
    will-change: transform;
}

@media (max-width: 768px) {
    .cursor-glow { display: none; }
}

/* --- Utility Classes --- */
.dm-text-gradient {
    background: linear-gradient(135deg, var(--dm-teal-light), var(--dm-teal), var(--dm-teal-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dm-text-center { text-align: center; }
.dm-text-left { text-align: left; }
.dm-text-right { text-align: right; }

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

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

/* --- Section Dividers --- */
.dm-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    border: none;
}

.dm-divider--glow {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 168, 120, 0.5), transparent);
    box-shadow: 0 0 20px rgba(var(--dm-teal-rgb), 0.3);
    filter: blur(0.5px);
}

/* --- Skip Link --- */
.dm-skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dm-teal);
    color: var(--dm-black);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: var(--z-toast);
    transition: top 0.3s;
}

.dm-skip-link:focus {
    top: 1rem;
}

/* --- Content Link Hover Animation (Runway-inspired) --- */
.dm-content a {
    background-image: linear-gradient(var(--dm-teal), var(--dm-teal));
    background-size: 0% 1px;
    background-position: 0% 100%;
    background-repeat: no-repeat;
    transition: background-size cubic-bezier(0.8, 0, 0.2, 1) 400ms, color var(--duration-fast) var(--ease-out-quart);
}

.dm-content a:hover {
    background-size: 100% 1px;
}

/* Ghost-specific overrides */
.gh-post-upgrade-cta,
.gh-navigation-menu .nav-signup,
.footer-cta { display: none !important; }
