/* ==========================================================================
   Reticle — foundations
   Tokens, reset, typography, and the header/footer shared by every page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tokens

   Dark surface, one violet→blue accent ramp. The accent carries meaning:
   primary actions, active nav, focus, section kickers. Spending it elsewhere
   is the fastest way to lose the design.

   Everything structural is white at low alpha (--line, --surface*), which is
   what makes panels read as glass over the mesh rather than as flat grey
   boxes. Swap a --line for an opaque grey and the whole depth effect goes
   flat — that is the one rule worth protecting here.

   Error states deliberately use --danger, NOT the accent. On a violet-accented
   form, a violet error is invisible as an error.

   Type and spacing scale fluidly with clamp(), so there is one stylesheet
   rather than a desktop and a mobile fork.
   -------------------------------------------------------------------------- */
:root {
    --bg: #08080c;
    --bg-2: #0b0b11;

    --surface: rgba(255, 255, 255, 0.04);
    --surface-2: rgba(255, 255, 255, 0.055);
    --surface-3: rgba(255, 255, 255, 0.08);

    --text: #eceef5;
    --dim: #9195a8;
    --dim-2: #5f6377;

    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.16);

    --violet: #8b5cf6;
    --violet-2: #6d3ff0;
    --violet-soft: rgba(139, 92, 246, 0.16);
    --blue: #3b82f6;
    --pink: #ec4899;

    --ok: #22c55e;
    --danger: #f87171;

    --grad: linear-gradient(90deg, var(--violet), var(--blue));
    --grad-btn: linear-gradient(180deg, var(--violet), var(--violet-2));
    --glow: 0 8px 28px rgba(139, 92, 246, 0.42);
    --glow-lg: 0 12px 34px rgba(139, 92, 246, 0.55);

    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

    --r-sm: 8px;
    --r: 12px;
    --r-lg: 16px;
    --r-pill: 999px;

    --maxw: 1140px;
    --gutter: clamp(1.25rem, 4vw, 2rem);
    --header-h: 64px;

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    /* Fluid scale */
    --t-micro: 0.75rem;
    --t-small: 0.875rem;
    --t-body: 0.9375rem;
    --t-lead: clamp(1rem, 0.95rem + 0.3vw, 1.0625rem);
    --t-h3: 1rem;
    --t-h2: clamp(1.625rem, 1.2rem + 1.9vw, 2.5rem);
    --t-h1: clamp(2.375rem, 1.3rem + 4.6vw, 4.75rem);
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: var(--t-body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--violet);
    outline-offset: 3px;
    border-radius: 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;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   Primitives
   -------------------------------------------------------------------------- */
.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--gutter);
    position: relative;
    z-index: 1;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--violet);
    color: #fff;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    border-radius: 0 0 var(--r-sm) 0;
}

.skip-link:focus {
    left: 0;
}

/* Gradient mesh backdrop. Applied to a wrapper, not the body, so it can be
   scoped to the hero without bleeding into long-form content below. */
.mesh {
    position: relative;
    overflow: hidden;
}

.mesh::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto -10%;
    block-size: 720px;
    background:
        radial-gradient(closest-side, rgba(139, 92, 246, 0.3), transparent 70%) 22% 30% / 60% 70% no-repeat,
        radial-gradient(closest-side, rgba(59, 130, 246, 0.24), transparent 70%) 78% 18% / 55% 60% no-repeat,
        radial-gradient(closest-side, rgba(236, 72, 153, 0.12), transparent 70%) 55% 60% / 50% 50% no-repeat;
    filter: blur(20px);
    pointer-events: none;
}

.mesh::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, var(--line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
    opacity: 0.5;
}

/* Mono kicker above section titles. */
.kicker {
    font-family: var(--mono);
    font-size: var(--t-micro);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--violet);
}

/* Glass pill badge. */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.375rem 0.875rem 0.375rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    backdrop-filter: blur(8px);
    font-size: 0.8125rem;
    color: var(--dim);
}

.pill b {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
}

.mark {
    inline-size: 1.25rem;
    block-size: 1.25rem;
    flex: none;
    color: var(--violet);
}

/* Placeholder figures. Deliberately loud: no unresolved number should reach
   production quietly. Remove the class once real data is in. */
.ph {
    background: var(--violet-soft);
    border-bottom: 1px dotted var(--violet);
    border-radius: 3px;
    padding-inline: 0.2em;
    box-decoration-break: clone;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    font-size: var(--t-small);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
        border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.btn--primary {
    color: #fff;
    background: var(--grad-btn);
    box-shadow: var(--glow);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--glow-lg);
}

.btn--ghost {
    color: var(--text);
    border-color: var(--line);
    background: var(--surface);
    backdrop-filter: blur(8px);
}

.btn--ghost:hover {
    border-color: var(--line-2);
    background: var(--surface-2);
}

.btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-block-end: 1px solid var(--line);
    background: rgba(8, 8, 12, 0.55);
    backdrop-filter: blur(14px);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    block-size: var(--header-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.01em;
    flex: none;
}

.nav {
    display: none;
    align-items: center;
    gap: 1.75rem;
}

@media (min-width: 900px) {
    .nav {
        display: flex;
    }
}

.nav__link {
    position: relative;
    font-size: var(--t-small);
    color: var(--dim);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.nav__link:hover,
.nav__link[aria-current="true"] {
    color: var(--text);
}

.nav__link[aria-current="true"]::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: -0.5rem;
    block-size: 2px;
    border-radius: 2px;
    background: var(--grad);
}

.nav__link--ext::after {
    content: " ↗";
    color: var(--dim-2);
}

.header__cta {
    display: none;
}

@media (min-width: 900px) {
    .header__cta {
        display: inline-flex;
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
}

/* Mobile menu */
.menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
    padding: 0.5rem 0.75rem;
    font-size: var(--t-micro);
    cursor: pointer;
}

@media (min-width: 900px) {
    .menu-btn {
        display: none;
    }
}

.menu-btn__glyph {
    inline-size: 12px;
    block-size: 10px;
    position: relative;
}

.menu-btn__glyph::before,
.menu-btn__glyph::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    block-size: 1.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform 0.25s var(--ease);
}

.menu-btn__glyph::before {
    top: 0;
}

.menu-btn__glyph::after {
    bottom: 0;
}

.menu-btn[aria-expanded="true"] .menu-btn__glyph::before {
    transform: translateY(4.25px) rotate(45deg);
}

.menu-btn[aria-expanded="true"] .menu-btn__glyph::after {
    transform: translateY(-4.25px) rotate(-45deg);
}

.menu {
    display: none;
    border-block-start: 1px solid var(--line);
    background: rgba(8, 8, 12, 0.95);
    backdrop-filter: blur(14px);
}

.menu[data-open="true"] {
    display: block;
}

@media (min-width: 900px) {
    .menu[data-open="true"] {
        display: none;
    }
}

.menu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.875rem;
    border-block-end: 1px solid var(--line);
    font-size: var(--t-small);
    color: var(--dim);
    text-decoration: none;
}

.menu__link:last-child {
    border-block-end: 0;
}

.menu__link::after {
    content: "→";
    color: var(--dim-2);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    border-block-start: 1px solid var(--line);
    padding-block: clamp(3rem, 6vw, 4.5rem);
    background: var(--bg-2);
}

.footer__top {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 760px) {
    .footer__top {
        grid-template-columns: 1.6fr 1fr 1fr;
    }
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    font-size: 1.125rem;
}

.footer__tag {
    margin-block-start: 0.875rem;
    color: var(--dim);
    font-size: var(--t-small);
    max-inline-size: 34ch;
}

.footer__col-title {
    font-family: var(--mono);
    font-size: var(--t-micro);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dim-2);
    margin-block-end: 0.875rem;
}

.footer__link {
    display: block;
    padding-block: 0.375rem;
    font-size: var(--t-small);
    color: var(--dim);
    text-decoration: none;
    transition: color 0.2s var(--ease);
}

.footer__link:hover {
    color: var(--text);
}

.footer__bottom {
    margin-block-start: clamp(2.5rem, 5vw, 3.5rem);
    padding-block-start: 1.5rem;
    border-block-start: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    justify-content: space-between;
    font-size: var(--t-micro);
    color: var(--dim-2);
}
