/* ============================================
   Site design — editorial dark, calm surfaces
   ============================================ */

/* ============================================
   DESIGN SYSTEM
   ============================================ */

:root {
    --color-bg: #08090c;
    --color-bg-elevated: #0f1117;
    --color-surface: rgba(255, 255, 255, 0.04);
    --color-fg: #e8e9ed;
    --color-fg-muted: #8b909d;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-strong: rgba(255, 255, 255, 0.14);
    --color-accent: #9eb6ff;
    --color-accent-dim: rgba(158, 182, 255, 0.14);
    --color-accent-soft: #a8b0c4;

    --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;

    --space-xs: 0.375rem;
    --space-sm: 0.75rem;
    --space-md: 1.25rem;
    --space-lg: 2rem;
    --space-xl: 2.5rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    --container-lg: 1200px;
    --container-md: 1000px;
    --container-sm: 800px;

    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   RESET & BASE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--color-bg);
    color: var(--color-fg);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Skip link — visually hidden until focused */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    background: var(--color-accent);
    color: #08090c;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 1rem;
}

/* Screen-reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus ring — visible on keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Remove focus ring for mouse/touch users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   TYPOGRAPHY
   Intention: Large, bold, confident typography
   that carries the entire design
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--color-fg);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 8rem);
    font-weight: 600;
    line-height: 0.95;
    letter-spacing: -0.045em;
    margin: 0;
    text-align: center;
    color: #f4f5f8;
    text-shadow: 0 0 100px rgba(158, 182, 255, 0.18);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 2vw, 1.85rem);
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: rgba(244, 245, 248, 0.88);
    text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
    text-align: center;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: clamp(2rem, 5vw, 5rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    color: var(--color-fg-muted);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.body-large {
    font-family: var(--font-body);
    font-size: clamp(1.125rem, 1.5vw, 1.5rem);
    line-height: 1.65;
    color: var(--color-fg-muted);
}

.body-regular {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-fg-muted);
}

.caption {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    color: var(--color-accent);
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 500;
}

/* ============================================
   NAVIGATION
   Intention: Minimal, fixed top nav that doesn't
   compete with content. Almost invisible until needed.
   ============================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-md) var(--space-lg);
    background: rgba(8, 9, 12, 0.78);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.3s var(--ease-smooth), border-color 0.3s var(--ease-smooth);
}

/* Homepage: no top navigation — subpages only */
.home-page .nav {
    display: none !important;
}

.nav-container {
    max-width: var(--container-lg);
    margin: 0 auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-logo {
    display: none;
}

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--color-fg-muted);
    font-weight: 500;
    transition: color 0.2s var(--ease-smooth);
    letter-spacing: -0.01em;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-fg);
}

.nav-link.active {
    color: var(--color-accent);
}

/* Mobile Menu Toggle */
.nav-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.nav-mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-fg);
    margin: 5px 0;
    transition: all 0.3s var(--ease-smooth);
}

.nav-mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.nav-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   LAYOUT CONTAINERS
   Intention: Generous whitespace, asymmetric
   layouts that feel premium and curated
   ============================================ */

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

.container-md {
    max-width: var(--container-md);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-sm {
    max-width: var(--container-sm);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section {
    padding: var(--space-xl) 0;
}

.section-tight {
    padding: var(--space-lg) 0;
}

/* ============================================
   HERO SECTION
   Intention: Fullscreen, massive typography,
   immediate visual impact
   ============================================ */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--space-2xl) 0;
    box-shadow: 0 4rem 6rem -2.5rem rgba(0, 0, 0, 0.65);
}

/* Feather the hero bottom into the page background (below .hero-content, above Vanta) */
.hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: clamp(4.5rem, 18vh, 11rem);
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(8, 9, 12, 0.35) 45%,
        rgba(8, 9, 12, 0.88) 88%,
        var(--color-bg) 100%
    );
}

/* Vanta.js Background Container */
#vanta-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    filter: brightness(0.92);
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-content {
    width: 100%;
    max-width: var(--container-md);
    padding: 0 var(--space-lg);
    text-align: center;
    margin: 0 auto;
}

.hero-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.5;
    margin-bottom: var(--space-md);
    font-weight: 500;
}

.hero-title-wrapper {
    margin-bottom: var(--space-md);
    width: 100%;
    display: flex;
    justify-content: center;
}

.hero-meta {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    flex-wrap: wrap;
    justify-content: center;
}

.hero-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    align-items: center;
    text-align: center;
}

.hero-meta-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.4;
    font-weight: 500;
    color: var(--color-fg);
}

.hero-meta-value {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    color: var(--color-fg);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    opacity: 0.38;
    color: var(--color-fg-muted);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.scroll-indicator-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--color-accent));
    opacity: 0.7;
}

.scroll-indicator-text {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    writing-mode: vertical-rl;
}

/* ============================================
   GRID SYSTEM
   Intention: Flexible, asymmetric grids for
   showcasing content as design moments
   ============================================ */

.grid {
    display: grid;
    gap: var(--space-md);
}

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

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

.grid-asymmetric {
    grid-template-columns: 2fr 1fr;
}

.grid-feature {
    grid-template-columns: 1.5fr 1fr;
}

/* ============================================
   CARD COMPONENTS
   Intention: Minimal cards with subtle borders,
   clean hover states, no heavy shadows
   ============================================ */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: border-color 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth);
}

.card:hover {
    border-color: var(--color-border-strong);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.card-number {
    font-family: var(--font-display);
    font-size: 0.75rem;
    opacity: 0.3;
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.card-title {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    margin-bottom: var(--space-xs);
    line-height: 1.2;
}

.card-description {
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--color-fg-muted);
    margin-bottom: var(--space-md);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    text-decoration: none;
    color: var(--color-fg);
    font-weight: 500;
    opacity: 0.7;
    transition: all 0.2s var(--ease-smooth);
}

.card-link:hover {
    opacity: 1;
    gap: var(--space-md);
}

.card-link svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   BUTTONS
   Intention: Minimal, confident, not overdesigned
   ============================================ */

/* Primary control — filled, inverts on hover */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 1rem 2rem;
    min-height: 3.25rem;
    box-sizing: border-box;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-fg);
    background-color: var(--color-fg);
    color: var(--color-bg);
    cursor: pointer;
    transition: background-color 0.25s var(--ease-smooth), color 0.25s var(--ease-smooth), border-color 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth);
    letter-spacing: -0.01em;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

a.btn:link,
a.btn:visited {
    color: var(--color-bg);
    background-color: var(--color-fg);
    border-color: var(--color-fg);
}

a.btn:hover,
button.btn:hover,
.btn:hover {
    background-color: transparent;
    color: var(--color-fg);
    border-color: var(--color-border-strong);
    box-shadow: 0 8px 32px rgba(158, 182, 255, 0.08);
}

a.btn:active,
button.btn:active,
.btn:active {
    background-color: var(--color-surface);
    color: var(--color-fg);
}

.btn-full {
    width: 100%;
    max-width: 100%;
    justify-content: center;
}

/* Hero CTA — glassy milky-white */
.btn-hero {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.32);
    color: #f0f1f4;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow:
        0 2px 24px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    letter-spacing: 0.01em;
}

.btn-hero:hover,
a.btn-hero:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    box-shadow:
        0 4px 32px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

a.btn-hero:link,
a.btn-hero:visited {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.32);
    color: #f0f1f4;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

/* Section CTAs — matches CI: calm outline, accent on interaction */
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.875rem 1.75rem;
    min-height: 3rem;
    box-sizing: border-box;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    letter-spacing: -0.01em;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-strong);
    background: var(--color-surface);
    color: var(--color-fg);
    cursor: pointer;
    transition:
        background-color 0.25s var(--ease-smooth),
        border-color 0.25s var(--ease-smooth),
        color 0.25s var(--ease-smooth),
        box-shadow 0.25s var(--ease-smooth);
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

a.btn-outline:link,
a.btn-outline:visited {
    color: var(--color-fg);
    background: var(--color-surface);
    border-color: var(--color-border-strong);
}

a.btn-outline:hover,
button.btn-outline:hover,
.btn-outline:hover {
    border-color: rgba(158, 182, 255, 0.55);
    background: var(--color-accent-dim);
    color: #fff;
    box-shadow:
        0 4px 28px rgba(0, 0, 0, 0.2),
        0 0 40px -8px rgba(158, 182, 255, 0.15);
}

a.btn-outline:active,
button.btn-outline:active,
.btn-outline:active {
    background: rgba(158, 182, 255, 0.12);
    border-color: var(--color-accent);
}

.btn-outline:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.btn-outline svg {
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.25s var(--ease-smooth), opacity 0.25s var(--ease-smooth);
}

.btn-outline:hover svg {
    opacity: 1;
    transform: translateX(4px);
}

/* ============================================
   ANIMATIONS
   Intention: Subtle, smooth, enhancing clarity
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s var(--ease-smooth) forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* Scroll-triggered animations (via JS) */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s var(--ease-smooth);
}

.scroll-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Alternative: Animate on scroll (commented out for instant visibility)
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
}
*/

/* ============================================
   RESPONSIVE
   ============================================ */

/* ── Accessibility ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Large screens ────────────────────────────── */
@media (max-width: 1200px) {
    :root {
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 2.5rem;
        --space-3xl: 3rem;
    }
}

/* ── iPad / Medium tablet (landscape + portrait) ─ */
@media (max-width: 1024px) {
    :root {
        --space-2xl: 2.25rem;
        --space-3xl: 2.75rem;
    }

    .container,
    .container-md,
    .container-sm {
        padding: 0 1.5rem;
    }

    .hero-meta {
        gap: var(--space-md);
    }
}

/* ── Tablet / iPad portrait — show hamburger menu ─ */
@media (max-width: 900px) {
    .nav {
        padding: var(--space-sm) var(--space-md);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: min(75%, 320px);
        height: 100vh;
        height: 100dvh;
        background: rgba(8, 9, 12, 0.97);
        flex-direction: column;
        padding: 5.5rem 2rem 2rem;
        gap: var(--space-md);
        transition: transform 0.4s var(--ease-smooth);
        transform: translateX(110%);
        box-shadow: -10px 0 30px rgba(255, 255, 255, 0.06);
        border-left: 1px solid var(--color-border);
        z-index: 1002;
        backdrop-filter: blur(24px) saturate(140%);
        -webkit-backdrop-filter: blur(24px) saturate(140%);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        pointer-events: none;
    }

    .nav-links li {
        border-bottom: 1px solid var(--color-border);
        padding-bottom: var(--space-sm);
    }

    .nav-links .nav-link {
        font-size: 1.125rem;
        font-weight: 500;
        display: block;
        padding: 0.5rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .nav-links.active {
        transform: translateX(0);
        pointer-events: auto;
    }

    .nav-mobile-toggle {
        display: flex;
        position: relative;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: flex-end;
        z-index: 1003;
    }

    body.menu-open {
        overflow: hidden;
        touch-action: none;
    }

    body.menu-open .nav {
        z-index: 1100;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    body.home-page.menu-open .nav {
        display: none !important;
    }
    body.home-page.menu-open::after {
        display: none;
    }

    body.menu-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.8);
        z-index: 1090;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        pointer-events: auto;
    }

    .grid-2,
    .grid-3,
    .grid-asymmetric,
    .grid-feature {
        grid-template-columns: 1fr;
    }
}

/* ── Mobile ───────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --space-lg: 1.25rem;
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
        --space-3xl: 2.5rem;
    }

    .container,
    .container-md,
    .container-sm {
        padding: 0 1.125rem;
    }

    .hero-meta {
        gap: var(--space-sm);
        flex-wrap: wrap;
    }

    .hero-meta-item {
        flex: 1 1 auto;
        min-width: 100px;
    }

    .btn,
    .btn-outline {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }
}

/* ── Small mobile ─────────────────────────────── */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero-meta {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }

    .scroll-indicator {
        display: none;
    }
}

/* ── Touch device improvements ────────────────── */
@media (hover: none) and (pointer: coarse) {
    .card:hover,
    .service-card:hover,
    .work-item-link:hover .work-item-title {
        transform: none;
    }

    .btn,
    .btn-outline,
    a,
    button {
        -webkit-tap-highlight-color: transparent;
    }
}
