/* =========================================================
   SITE FOUNDATION
   Tokens, typefaces, reset, masthead, footer, transitions.
   Loaded by every page.
   ========================================================= */

:root {
    /* Surface */
    --bg:            #050505;
    --bg-raised:     #0e0e0e;
    --bg-sunken:     #161616;

    /* Ink */
    --ink:           #ffffff;
    --ink-muted:     #a8a8a8;
    --ink-faint:     #6a6a6a;

    /* Line */
    --rule:          rgba(255, 255, 255, 0.12);
    --rule-strong:   rgba(255, 255, 255, 0.28);

    /* Measure */
    --measure:       1200px;
    --gutter:        40px;

    /* Rhythm */
    --space-xs:      8px;
    --space-sm:      16px;
    --space-md:      32px;
    --space-lg:      64px;
    --space-xl:      120px;

    /* Motion — one easing curve everywhere */
    --ease:          cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast:      0.3s;
    --dur:           0.6s;
    --dur-slow:      0.9s;
}

/* ---------------------------------------------------------
   TYPEFACE
   --------------------------------------------------------- */
@font-face {
    font-family: 'Helvetica Neue';
    src: url('/fonts/HelveticaNeue-Roman.woff2') format('woff2'),
         url('/fonts/HelveticaNeue-Roman.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('/fonts/HelveticaNeue-Italic.woff2') format('woff2'),
         url('/fonts/HelveticaNeue-Italic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('/fonts/HelveticaNeue-Bold.woff2') format('woff2'),
         url('/fonts/HelveticaNeue-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Helvetica Neue';
    src: url('/fonts/HelveticaNeue-Heavy.woff2') format('woff2'),
         url('/fonts/HelveticaNeue-Heavy.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

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

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

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--ink);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

::selection { background: var(--ink); color: var(--bg); }

/* Keyboard focus is visible everywhere; mouse clicks stay clean. */
:focus-visible {
    outline: 1px solid var(--ink);
    outline-offset: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------------
   MASTHEAD
   A gradient scrim keeps the fixed wordmark legible over
   whatever scrolls beneath it.
   --------------------------------------------------------- */
.masthead {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--gutter);
    z-index: 50;
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-md);
}

.masthead::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(5,5,5,0.92) 0%, rgba(5,5,5,0.7) 45%, rgba(5,5,5,0) 100%);
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity var(--dur) ease;
}

/* Only draw the scrim once the page has actually scrolled. */
.masthead.is-scrolled::before { opacity: 1; }

.masthead > * { pointer-events: auto; }

.wordmark {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1;
    white-space: nowrap;
}

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

.wordmark a:hover { opacity: 0.6; }

.role {
    font-size: 1rem;
    font-weight: 400;
    margin: 4px 0 0 0;
    color: var(--ink-muted);
    letter-spacing: -0.01em;
}

/* ---------------------------------------------------------
   PILL LINK — the one button style on the site
   --------------------------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    flex: none;
    padding: 11px 22px;
    border: 1px solid var(--rule-strong);
    border-radius: 100px;
    background: rgba(5, 5, 5, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--ink);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease);
}

.pill:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

/* The arrow leans back toward the homepage on hover. */
.pill .arrow-back {
    display: inline-block;
    transition: transform var(--dur-fast) var(--ease);
}

.pill:hover .arrow-back { transform: translateX(-3px); }

/* Masthead actions sit as one group on the right. */
.masthead-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */
.site-footer {
    width: 100%;
    padding: var(--space-lg) var(--gutter) var(--space-md);
    border-top: 1px solid var(--rule);
    margin-top: var(--space-xl);
    background-color: var(--bg);
}

.footer-inner {
    max-width: var(--measure);
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.footer-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: -0.03em;
}

.footer-role {
    font-size: 1rem;
    font-weight: 400;
    color: var(--ink-muted);
    margin: 4px 0 0 0;
}

.footer-contact {
    display: flex;
    gap: var(--space-md);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.footer-contact a {
    color: var(--ink-faint);
    text-decoration: none;
    transition: color var(--dur-fast) ease;
}

.footer-contact a:hover { color: var(--ink); }

/* ---------------------------------------------------------
   PAGE TRANSITION
   A single black veil that lifts on arrival and falls on exit,
   so moving between pages reads as one continuous surface.
   --------------------------------------------------------- */
.veil {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9000;
    pointer-events: none;

    /* Default state is transparent and the lift is a CSS animation, so a
       stalled or blocked script can never strand the page behind a black
       rectangle. JS only ever drives the exit. */
    opacity: 0;
    animation: veil-lift var(--dur) ease forwards;
    transition: opacity var(--dur-fast) ease;
}

@keyframes veil-lift {
    from { opacity: 1; }
    to   { opacity: 0; }
}

body.is-leaving .veil {
    animation: none;
    opacity: 1;
}

/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */
@media (max-width: 768px) {
    :root { --gutter: 20px; --space-xl: 80px; --space-lg: 48px; }

    .wordmark { font-size: 1.15rem; }
    .role     { font-size: 0.85rem; }

    /* Too narrow for the wordmark and two pills on one line: drop the
       actions onto their own row rather than let them stack vertically. */
    .masthead {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }

    /* Home stays under the wordmark; About is pushed to the far edge so
       the two read as separate moves rather than a pair of buttons. */
    .masthead-actions { justify-content: space-between; }

    .masthead-actions .pill {
        padding: 9px 16px;
        font-size: 0.65rem;
        letter-spacing: 0.06em;
    }

    .footer-inner { flex-direction: column; align-items: flex-start; }
    .footer-contact { flex-direction: column; gap: var(--space-xs); }
}

/* ---------------------------------------------------------
   REDUCED MOTION
   The site is built on movement; honour the request to stop it.
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
