/*
 * Element Foundry design system
 * ------------------------------------------------------------------------
 * Token + component sheet for every public foundry.refinedelement.com page.
 * Same architecture as the Refined Element (re-xbk) design family — near-
 * black neutrals, single disciplined accent, gradient-clip headlines, glow
 * language, blueprint hero texture, offer-card pattern — carrying Element
 * Foundry's own sharpened-lime accent instead of re-xbk's.
 *
 * Dark-only. No light-mode branch. Pages consume this file plus a small,
 * page-local <style> block for layout; every color/type/spacing/motion
 * decision lives here.
 *
 * Type roles are assigned deliberately, not interchangeably:
 *   --font-base  system UI stack  -> structure: headings, nav, buttons, eyebrows, prices
 *   Source Sans 3 (subtitles only) -> reading prose: hero/section subtitles
 *   --font-mono  Roboto Mono       -> code/docs only (see Task 3)
 * ------------------------------------------------------------------------
 */

:root {
    /* Neutrals */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #202020;

    --text-primary: #ffffff;
    --text-secondary: #a3a3a3;
    --text-tertiary: #707070;
    --text-inverse: #0a0a0a;

    --border: rgba(255, 255, 255, 0.1);

    /* Accent — sharpened lime */
    --accent: #A3E635;
    --accent-hover: #bef264;
    --accent-dark: #4d7c0f;
    --accent-glow: rgba(163, 230, 53, .3);
    --accent-on-light: #3f6212; /* rare light surfaces only — never bright accent on white */

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #141414 0%, #1a1a1a 50%, #0f0f0f 100%);
    --gradient-card: linear-gradient(145deg, rgba(32, 32, 32, .8), rgba(20, 20, 20, .8));
    --gradient-accent: linear-gradient(90deg, #A3E635, #4d7c0f);

    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, .4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, .5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;

    /* Spacing — 4px rhythm at the small end, widening toward 128px at the
       top so a single 16-step scale can drive both tight component gaps
       and full section rhythm without a second scale. */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-7: 1.75rem;   /* 28px */
    --space-8: 2rem;      /* 32px */
    --space-9: 2.5rem;    /* 40px */
    --space-10: 3rem;     /* 48px */
    --space-11: 3.5rem;   /* 56px */
    --space-12: 4rem;     /* 64px */
    --space-13: 5rem;     /* 80px */
    --space-14: 6rem;     /* 96px */
    --space-15: 7rem;     /* 112px */
    --space-16: 8rem;     /* 128px */

    /* Motion */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Type */
    --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Roboto Mono', Consolas, monospace;
}

/* ---------------------------------------------------------------------- *
 * Base / reset
 * ---------------------------------------------------------------------- */

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

/* Horizontal-overflow containment applied at html (iOS Safari treats html as the
   viewport — body-only clipping doesn't suffice there). `clip` is preferred over
   `hidden` because it doesn't create a scroll container (preserves descendant
   position: sticky); `hidden` first for older-browser fallback.
   `overscroll-behavior-x: none` suppresses iOS Safari 16.4+ elastic rubber-band
   bounce on the horizontal axis, which registers as faint horizontal drag even
   when no real overflow exists. Descendants with legitimate overflow-x: auto
   (e.g. <pre> blocks) keep working — this property does not cascade restrictively. */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overflow-x: clip;
    overscroll-behavior-x: none;
}

body {
    margin: 0;
    font-family: var(--font-base);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-base);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 var(--space-4);
}

p { line-height: 1.5; }

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

/* Accent focus ring — every interactive element, not just links/buttons */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid rgba(163, 230, 53, .5);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------------------------------------------------------------------- *
 * Layout utility
 * ---------------------------------------------------------------------- */

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

/* Gradient-clip text utility — reused directly for wordmarks, headline
   accents, anything that isn't a full hero H1 (see .hero-title). */
.text-gradient {
    background: linear-gradient(135deg, #fff 30%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ---------------------------------------------------------------------- *
 * Buttons
 * ---------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-7);
    font-family: var(--font-base);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: transform var(--transition-base), box-shadow var(--transition-base),
                background var(--transition-base), border-color var(--transition-base),
                color var(--transition-base);
}

.btn:disabled, .btn[disabled] {
    opacity: .7;
    cursor: wait;
    pointer-events: none;
    transform: none;
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    background: linear-gradient(90deg, var(--accent-hover), var(--accent));
    color: var(--text-inverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-outline-accent {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}
.btn-outline-accent:hover {
    background: rgba(163, 230, 53, .1);
    color: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-outline-light {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline-light:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    padding: var(--space-3) var(--space-5);
}
.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, .05);
}

.btn-sm { padding: var(--space-2) var(--space-5); font-size: .875rem; }
.btn-lg { padding: var(--space-5) var(--space-9); font-size: 1.125rem; }

/* ---------------------------------------------------------------------- *
 * Card
 * ---------------------------------------------------------------------- */

.card {
    display: block;
    height: 100%;
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-7);
    transition: border-color var(--transition-base), box-shadow var(--transition-base),
                transform var(--transition-base);
}
.card:hover {
    border-color: var(--accent-glow);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-3);
}
.card p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin: 0 0 var(--space-4);
}
.card p:last-child { margin-bottom: 0; }
.card ul { list-style: none; padding: 0; margin: 0; }
.card ul li {
    padding: var(--space-1) 0;
    color: var(--text-tertiary);
    font-size: .9375rem;
}
.card ul li::before {
    content: '\2713';
    color: var(--accent);
    font-weight: 700;
    margin-right: var(--space-3);
}

/* Price / qualifier — used inside .card for the offer-card pattern.
   .price carries the full "Starting at $X" phrase; .price-note is a small
   caption near a price (e.g. a label above it); .qualifier is the muted
   line describing scope (e.g. "up to 10 content types"). Roboto Mono is
   scoped to code/docs (see header note on type roles) — prices use the
   base face. */
.price {
    display: inline-block;
    font-family: var(--font-base);
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.01em;
    color: var(--accent);
}
.price-note {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-1);
}
.qualifier {
    display: inline-block;
    font-size: .875rem;
    color: var(--text-secondary);
    margin-left: var(--space-2);
}

/* ---------------------------------------------------------------------- *
 * Sections
 * ---------------------------------------------------------------------- */

.section { padding: var(--space-13) var(--space-6); }
.section-alt { background: var(--bg-secondary); }

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-10);
}
.section-eyebrow {
    display: inline-block;
    font-family: var(--font-base);
    font-size: .875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
    margin-bottom: var(--space-3);
}
.section-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0 0 var(--space-4);
    color: var(--text-primary);
}
.section-subtitle {
    font-family: 'Source Sans 3', var(--font-base);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* ---------------------------------------------------------------------- *
 * Hero
 * ---------------------------------------------------------------------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: var(--space-16) var(--space-6);
    text-align: center;
    background: var(--gradient-hero);
}

/* Dot-grid + diagonal blueprint crosshatch, layered in one pseudo so the
   glow orbs (below) can own the other. Lime-tinted at re-xbk's opacities —
   single-accent discipline means no SECOND color, not withholding the
   accent from texture. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(163, 230, 53, .06) 1px, transparent 1.5px),
        repeating-linear-gradient(45deg, rgba(163, 230, 53, .03) 0, rgba(163, 230, 53, .03) 1px, transparent 1px, transparent 48px),
        repeating-linear-gradient(-45deg, rgba(163, 230, 53, .03) 0, rgba(163, 230, 53, .03) 1px, transparent 1px, transparent 48px);
    background-size: 18px 18px, auto, auto;
}

/* Two accent-tinted glow orbs, animated together via a single background-
   position keyframe (two radial-gradient layers, independent centers). */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 30%, var(--accent-glow) 0%, transparent 55%),
        radial-gradient(circle at 80% 75%, rgba(163, 230, 53, .2) 0%, transparent 55%);
    background-repeat: no-repeat;
    filter: blur(40px);
    opacity: .6;
    animation: foundryHeroGlow 8s ease-in-out infinite alternate;
}

@keyframes foundryHeroGlow {
    0%   { background-position: 20% 30%, 80% 75%; }
    100% { background-position: 26% 22%, 74% 82%; }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-6);
    padding-bottom: .1em;
    background: linear-gradient(135deg, #fff 30%, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.hero-subtitle {
    font-family: 'Source Sans 3', var(--font-base);
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 780px;
    margin: 0 auto var(--space-10);
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------------- *
 * Header / nav
 * ---------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 10, .95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}
/* Optional enhanced state a page may toggle via a scroll listener; the
   header already carries a baseline shadow so this is additive, not load-bearing. */
.site-header.scrolled { box-shadow: var(--shadow-md); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-secondary);
    font-size: .9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.nav-link:hover { color: var(--text-primary); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-base);
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-menu {
        display: none;
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: var(--space-6);
        gap: var(--space-4);
    }
    .nav-menu.active { display: flex; }
}

/* ---------------------------------------------------------------------- *
 * Award badge
 * ---------------------------------------------------------------------- */

.award-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(145deg, rgba(163, 230, 53, .14), rgba(163, 230, 53, .04));
    border: 2px solid var(--accent);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-glow);
    text-align: left;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.award-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 28px var(--accent-glow);
}
.award-badge-icon {
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--accent);
}
.award-badge-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.award-badge-eyebrow {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent);
}
.award-badge-title {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--text-primary);
}
.award-badge-subtitle {
    font-size: .8125rem;
    color: var(--text-secondary);
}

/* ---------------------------------------------------------------------- *
 * Footer
 * ---------------------------------------------------------------------- */

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-10);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    /* Full-bleed background with 1200px-centered content, no wrapper element required. */
    padding: var(--space-12) max(var(--space-6), calc((100% - 1200px) / 2));
}

.footer-column { display: flex; flex-direction: column; }
.footer-column h3, .footer-column h4 {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-3);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-links a {
    color: var(--text-tertiary);
    font-size: .875rem;
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    grid-column: 1 / -1;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: .8125rem;
    color: var(--text-tertiary);
}
.footer-bottom a { color: var(--text-tertiary); }
.footer-bottom a:hover { color: var(--accent); }

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-bottom { justify-content: center; text-align: center; }
}

/* ---------------------------------------------------------------------- *
 * Responsive rhythm
 * ---------------------------------------------------------------------- */

@media (max-width: 640px) {
    .section { padding: var(--space-10) var(--space-4); }
    .hero { padding: var(--space-12) var(--space-4); }
    .container { padding: 0 var(--space-4); }
}
