/* ============================================
   SEAN SULLIVAN — SHARED DESIGN SYSTEM
   Brand brief: Declassified future-archive
   Fonts: Clash Display, Playfair Display italic, Inter, JetBrains Mono
   ============================================ */

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

/* TOKENS */
:root {
    --ink:           #0a0d14;
    --navy-deep:     #0f1729;
    --navy-dim:      #1a2238;
    --warm-white:    #f5f1ea;
    --grey-bright:   #e8e8e8;
    --grey-mid:      #a8a8a8;
    --grey-dim:      #5a6070;
    --grey-darker:   #2a3040;
    --yellow-star:   #f5c542;
    --clash:   'Clash Display', sans-serif;
    --playfair:'Playfair Display', serif;
    --inter:   'Inter', sans-serif;
    --mono:    'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    font-family: var(--inter);
    background: var(--ink);
    color: var(--warm-white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--yellow-star); color: var(--ink); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
*:focus-visible { outline: 2px solid var(--yellow-star); outline-offset: 2px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 24px; }

/* ============================================
   FILM GRAIN
   ============================================ */
.film-grain {
    position: fixed; inset: 0; z-index: 9999; pointer-events: none;
    opacity: 0.09; mix-blend-mode: overlay;
    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)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* ============================================
   TEXTURES
   ============================================ */
.section-texture {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    animation: textureDrift 30s ease-in-out infinite alternate;
}

.texture-hybrid {
    background-image:
        radial-gradient(circle, rgba(168,168,168,0.2) 1px, transparent 1px),
        linear-gradient(rgba(168,168,168,0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168,168,168,0.12) 1px, transparent 1px);
    background-size: 12px 12px, 80px 80px, 80px 80px;
    mask-image: radial-gradient(ellipse 100% 85% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 100% 85% at 50% 50%, black 30%, transparent 100%);
}

.texture-dots {
    background-image:
        /* Fine dot grid — drafting paper feel */
        radial-gradient(circle, rgba(168,168,168,0.10) 0.5px, transparent 0.5px),
        /* Larger accent dots — scattered, very faint */
        radial-gradient(circle, rgba(168,168,168,0.06) 1px, transparent 1px),
        /* Soft graph lines — like faded engineering paper */
        linear-gradient(rgba(168,168,168,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168,168,168,0.03) 1px, transparent 1px),
        /* Major grid lines — wider spacing, barely visible */
        linear-gradient(rgba(168,168,168,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168,168,168,0.05) 1px, transparent 1px);
    background-size:
        20px 20px,
        37px 41px,
        20px 20px,
        20px 20px,
        100px 100px,
        100px 100px;
    background-position:
        0 0,
        7px 13px,
        0 0,
        0 0,
        0 0,
        0 0;
    mask-image: radial-gradient(ellipse 95% 80% at 50% 50%, black 30%, transparent 95%);
    -webkit-mask-image: radial-gradient(ellipse 95% 80% at 50% 50%, black 30%, transparent 95%);
}

.texture-graph {
    background-image:
        linear-gradient(rgba(168,168,168,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168,168,168,0.08) 1px, transparent 1px),
        linear-gradient(rgba(168,168,168,0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(168,168,168,0.15) 1px, transparent 1px);
    background-size: 12px 12px, 12px 12px, 60px 60px, 60px 60px;
    mask-image: radial-gradient(ellipse 95% 80% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 95% 80% at 50% 50%, black 30%, transparent 100%);
}

.has-texture { position: relative; overflow: hidden; }
.has-texture > .container,
.has-texture > .container-narrow { position: relative; z-index: 1; }

@keyframes textureDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(3%, 2%); }
}

@media (prefers-reduced-motion: reduce) {
    @keyframes textureDrift { 0%, 100% { transform: none; } }
    .section-texture { animation: none !important; }
}

/* ============================================
   CLASSIFICATION STRIP
   ============================================ */
.classification-strip {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 32px; display: flex; align-items: center; justify-content: center;
    background: rgba(10,13,20,0.9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--grey-darker);
    font-family: var(--mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.2em; text-transform: uppercase; color: var(--grey-dim);
}
.classification-strip .active-dot {
    display: inline-block; width: 6px; height: 6px;
    background: var(--yellow-star); border-radius: 50%; margin-right: 8px;
    animation: breathe 3s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(245,197,66,0.4);
}
@keyframes breathe {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(245,197,66,0.4); }
    50% { opacity: 0.5; box-shadow: 0 0 2px rgba(245,197,66,0.15); }
}
.classification-strip .sep { margin: 0 12px; color: var(--grey-darker); }

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    position: fixed; top: 32px; left: 0; right: 0; z-index: 99;
    padding: 16px 0; transition: background 0.3s ease;
}
nav.scrolled {
    background: rgba(10,13,20,0.88);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--grey-darker);
}
nav .container { display: flex; justify-content: space-between; align-items: center; }

.logo {
    font-family: var(--clash); font-weight: 600; font-size: 18px;
    letter-spacing: -0.02em; color: var(--warm-white);
}

.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a {
    font-family: var(--mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.15em; text-transform: uppercase; color: var(--grey-dim);
    transition: color 0.3s ease; position: relative;
}
.nav-links a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 1px; background: var(--yellow-star);
    transition: width 0.3s cubic-bezier(0.22,1,0.36,1);
}
.nav-links a:hover { color: var(--warm-white); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
    background: var(--yellow-star) !important; color: var(--ink) !important;
    padding: 10px 24px !important; border-radius: 2px; font-weight: 700 !important;
    transition: opacity 0.3s ease !important;
}
.nav-cta:hover { opacity: 0.88 !important; }

.menu-toggle {
    display: none; background: none; border: none;
    cursor: pointer; padding: 8px;
}
.menu-toggle span {
    display: block; width: 24px; height: 2px;
    background: var(--warm-white); margin: 5px 0;
    transition: all 0.3s ease;
}

/* ============================================
   SECTION MARKERS
   ============================================ */
.section-marker {
    font-family: var(--mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--grey-dim); margin-bottom: 48px;
}
.fig-num { color: var(--grey-mid); }

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--yellow-star); color: var(--ink);
    padding: 14px 28px;
    font-family: var(--mono); font-size: 12px; font-weight: 700;
    letter-spacing: 0.15em; text-transform: uppercase;
    border: none; border-radius: 2px; cursor: pointer;
    transition: opacity 0.3s ease;
}
.btn-primary:hover { opacity: 0.88; }

.btn-secondary {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--grey-mid); padding: 14px 28px;
    font-family: var(--mono); font-size: 12px; font-weight: 500;
    letter-spacing: 0.15em; text-transform: uppercase;
    border: 1px solid var(--grey-darker); border-radius: 2px;
    cursor: pointer; background: transparent;
    transition: all 0.3s ease;
}
.btn-secondary:hover { border-color: var(--grey-dim); color: var(--warm-white); }

/* ============================================
   BACK LINK
   ============================================ */
.back-link {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 11px; font-weight: 500;
    letter-spacing: 0.15em; text-transform: uppercase; color: var(--grey-dim);
    margin-bottom: 48px; padding-top: 96px;
    transition: color 0.3s ease;
}
.back-link:hover { color: var(--warm-white); }

/* ============================================
   ITALIC ACCENT (yellow, one per section)
   ============================================ */
.italic-accent {
    font-family: var(--playfair); font-weight: 900;
    font-style: italic; text-transform: none;
    color: var(--yellow-star);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    position: relative; z-index: 1;
    padding: 48px 0 32px; border-top: 1px solid var(--grey-darker);
}
.footer-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 48px; margin-bottom: 48px;
}
.footer-col h4 {
    font-family: var(--mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--grey-dim); margin-bottom: 16px;
}
.footer-col a, .footer-col p {
    display: block; font-family: var(--inter); font-size: 14px;
    color: var(--grey-mid); line-height: 2; transition: color 0.3s ease;
}
.footer-col a:hover { color: var(--warm-white); }

.footer-strip {
    font-family: var(--mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--grey-darker); text-align: center;
    padding-top: 32px; border-top: 1px solid var(--grey-darker);
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
    position: fixed; top: 0; left: 0; z-index: 9998;
    height: 2px; width: 0%;
    background: linear-gradient(90deg, var(--yellow-star), rgba(245,197,66,0.6));
    transition: width 0.05s linear;
    pointer-events: none;
}

/* ============================================
   CURSOR GLOW
   ============================================ */
.cursor-glow {
    position: fixed; z-index: 9997; pointer-events: none;
    width: 300px; height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245,197,66,0.04) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: opacity 0.4s ease;
    opacity: 0;
}
.cursor-glow.active { opacity: 1; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
                transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Section markers — tracking expands on reveal */
.section-marker, .case-section-marker, .case-hero-label {
    transition: letter-spacing 0.8s cubic-bezier(0.22,1,0.36,1),
                opacity 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible .section-marker,
.reveal.visible .case-section-marker,
.reveal.visible .case-hero-label {
    letter-spacing: 0.25em;
}

/* Images — smooth scale-in on reveal */
.reveal.visible img {
    animation: imageReveal 0.9s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes imageReveal {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

/* Footer links — gentle lift on hover */
.footer-col a {
    transition: color 0.3s ease, transform 0.3s ease;
}
.footer-col a:hover {
    color: var(--warm-white);
    transform: translateX(4px);
}

/* Back link — arrow shifts on hover */
.back-link {
    transition: color 0.3s ease, gap 0.3s ease;
}
.back-link:hover { gap: 12px; }

/* Award tags — subtle glow pulse */
.award-tag {
    transition: box-shadow 0.3s ease;
}
.award-tag:hover {
    box-shadow: 0 0 12px rgba(245,197,66,0.15);
}

.stagger-1 { transition-delay: 0s; }
.stagger-2 { transition-delay: 0.1s; }
.stagger-3 { transition-delay: 0.2s; }
.stagger-4 { transition-delay: 0.3s; }
.stagger-5 { transition-delay: 0.4s; }
.stagger-6 { transition-delay: 0.5s; }
.stagger-7 { transition-delay: 0.6s; }
.stagger-8 { transition-delay: 0.7s; }
.stagger-9 { transition-delay: 0.8s; }
.stagger-10 { transition-delay: 0.9s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { transition: none !important; transform: none !important; opacity: 1 !important; }
    .reveal.visible img { animation: none !important; }
    .cursor-glow { display: none; }
    .scroll-progress { display: none; }
    .classification-strip .active-dot { animation: none !important; }
    .film-grain { display: none; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex; flex-direction: column; position: fixed; inset: 0;
        background: var(--ink); justify-content: center; align-items: center;
        gap: 24px; z-index: 200;
    }
    .menu-toggle { display: block; z-index: 300; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}
