/* ═══════════════════════════════════════════════════════════════════════════
   ULTIMATE FLAGSHIP — Design System
   Restraint. Craft. Authority.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   DESIGN TOKENS
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    /* Color — Warm & Premium */
    --bg: #FAFAF8;
    --bg-subtle: #F5F5F2;
    --surface: #FFFFFF;

    --text: #1A1A1A;
    --text-secondary: #4D4D4D;
    --text-tertiary: #666666;

    --accent: #4338CA;
    --accent-hover: #3730A3;

    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);

    /* Typography */
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Satoshi', 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing — 8px base, generous rhythm */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    --space-10: 4rem;
    --space-12: 5rem;
    --space-16: 8rem;
    --space-20: 10rem;
    --space-24: 12rem;

    /* Layout */
    --max-width: 1100px;
    --content-width: 680px;

    /* Motion — Slow, purposeful */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 500ms;
    --duration-fast: 200ms;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESET
   ───────────────────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    letter-spacing: -0.01em;
    transition: opacity 0.4s var(--ease);
}

body.loading main,
body.loading nav,
body.loading footer {
    opacity: 0;
    visibility: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

::selection {
    background: rgba(67, 56, 202, 0.12);
    color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SPLASH SCREEN
   ───────────────────────────────────────────────────────────────────────────── */

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease-out, visibility 0.5s;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@keyframes splashFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-content {
    text-align: center;
    animation: splashFadeIn 0.8s var(--ease);
}

.splash-logo {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-6);
    filter: drop-shadow(0 4px 12px rgba(67, 56, 202, 0.1));
}

.splash-title {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 400;
    color: var(--text);
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
}

.splash-subtitle {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Loader Animation */
.loader {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: var(--space-6) auto 0;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.no-splash .splash-screen {
    display: none !important;
}

/* Ensure resume content behaves like main site */
body.loading .page {
    opacity: 0;
    visibility: hidden;
}

body:not(.loading) .page {
    opacity: 1;
    visibility: visible;
}

.no-splash .splash-screen {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────────────────────────────────────── */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ─────────────────────────────────────────────────────────────────────────────
   NAVIGATION
   ───────────────────────────────────────────────────────────────────────────── */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: var(--space-5) 0;
    transition: all var(--duration) var(--ease);
}

.nav.scrolled {
    background: rgba(250, 250, 248, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) 0;
}

.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: var(--space-8);
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--duration-fast) var(--ease);
}

.nav-link:hover {
    color: var(--text);
}

.nav-mobile-btn {
    display: none;
    padding: var(--space-2);
    color: var(--text);
}

.nav-mobile-btn svg {
    width: 22px;
    height: 22px;
}

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 99;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-6);
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    color: var(--text);
}

.mobile-menu a:hover {
    color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO
   ───────────────────────────────────────────────────────────────────────────── */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-24) 0 var(--space-20);
}

.hero-content {
    max-width: 720px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.75rem, 7vw, 4.25rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: var(--space-6);
}

.hero-subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-10);
}

.hero-status {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.hero-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #15803D;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    background: var(--text);
    color: var(--bg);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all var(--duration) var(--ease);
}

.hero-cta:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.hero-cta svg {
    width: 16px;
    height: 16px;
    transition: transform var(--duration) var(--ease);
}

.hero-cta:hover svg {
    transform: translateX(3px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   SECTIONS
   ───────────────────────────────────────────────────────────────────────────── */

.section {
    padding: var(--space-20) 0;
}

.section-line {
    width: 100%;
    height: 1px;
    background: var(--border);
    margin-bottom: var(--space-16);
}

.section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-tertiary);
    margin-bottom: var(--space-8);
}

/* ─────────────────────────────────────────────────────────────────────────────
   WORK
   ───────────────────────────────────────────────────────────────────────────── */

.work-item {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-12);
    align-items: center;
}

.work-visual {
    aspect-ratio: 4/3;
    background: #000000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    overflow: hidden;
}

.work-visual img {
    max-width: 55%;
    transition: transform var(--duration) var(--ease);
}

.work-visual.full img {
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-item:hover .work-visual img {
    transform: scale(1.03);
}

.work-content {
    max-width: 440px;
}

.work-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: var(--space-4);
}

.work-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
}

.work-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.work-tech span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    padding: var(--space-1) var(--space-3);
    background: var(--bg-subtle);
    border-radius: 4px;
}

.work-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text);
    transition: color var(--duration-fast) var(--ease);
}

.work-link:hover {
    color: var(--accent);
}

.work-link svg {
    width: 14px;
    height: 14px;
    transition: transform var(--duration) var(--ease);
}

.work-link:hover svg {
    transform: translateX(4px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   EXPERTISE
   ───────────────────────────────────────────────────────────────────────────── */

.expertise-text {
    font-size: 1.125rem;
    line-height: 1.75;
    color: var(--text-secondary);
    max-width: var(--content-width);
    margin-bottom: var(--space-8);
}

.expertise-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-6);
}

.expertise-item {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   CONTACT
   ───────────────────────────────────────────────────────────────────────────── */

.contact {
    padding: var(--space-24) 0;
}

.contact-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 400;
    margin-bottom: var(--space-5);
}

.contact-text {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 420px;
    margin-bottom: var(--space-8);
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 1.0625rem;
    font-weight: 500;
    color: var(--text);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-8);
    transition: all var(--duration-fast) var(--ease);
    cursor: pointer;
}

.contact-email:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.contact-email svg {
    width: 16px;
    height: 16px;
    opacity: 0.4;
    transition: opacity var(--duration-fast) var(--ease);
}

.contact-email:hover svg {
    opacity: 1;
}

.contact-email.copied {
    color: #16A34A;
    border-color: #16A34A;
}

.contact-links {
    display: flex;
    gap: var(--space-5);
}

.contact-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-tertiary);
    transition: color var(--duration-fast) var(--ease);
}

.contact-links a:hover {
    color: var(--text);
}

/* ─────────────────────────────────────────────────────────────────────────────
   AD PLACEMENTS
   ───────────────────────────────────────────────────────────────────────────── */

.ad-wrapper {
    display: flex;
    justify-content: center;
    margin: var(--space-12) auto;
    width: 100%;
    max-width: 970px;
    padding: 0 var(--space-md);
}

.ad-placeholder {
    width: 100%;
    height: 90px;
    background: var(--bg-subtle);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .ad-placeholder {
        height: 250px;
        max-width: 300px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────────── */

.footer {
    padding: var(--space-8) 0;
    border-top: 1px solid var(--border);
}

.footer p {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────────────────────────────────
   ANIMATIONS — Subtle, invisible until noticed
   ───────────────────────────────────────────────────────────────────────────── */

.reveal {
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition:
        opacity var(--duration) var(--ease),
        transform var(--duration) var(--ease),
        visibility var(--duration) var(--ease);
}

.reveal.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 80ms;
}

.delay-2 {
    transition-delay: 160ms;
}

.delay-3 {
    transition-delay: 240ms;
}

.delay-4 {
    transition-delay: 320ms;
}

/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .work-item {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .work-visual {
        order: -1;
    }
}

@media (max-width: 768px) {
    :root {
        --space-20: 6rem;
        --space-24: 8rem;
    }

    .nav-links {
        display: none;
    }

    .nav-mobile-btn {
        display: block;
    }

    .nav-logo {
        font-size: 0.8125rem;
        max-width: 60%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero {
        padding: var(--space-16) 0 var(--space-12);
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section {
        padding: var(--space-12) 0;
    }

    .section-line {
        margin-bottom: var(--space-10);
    }

    .work-visual img {
        max-width: 80%;
    }

    .work-title {
        font-size: 1.5rem;
    }

    .work-description {
        font-size: 0.9375rem;
    }

    .expertise-text {
        font-size: 1rem;
    }

    .contact {
        padding: var(--space-16) 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-4);
    }

    .nav-logo {
        font-size: 0.75rem;
        max-width: 50%;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 2.75rem);
    }

    .hero-subtitle {
        font-size: 0.9375rem;
    }

    .hero-cta {
        width: 100%;
        justify-content: center;
    }

    .work-item {
        gap: var(--space-6);
    }

    .work-visual img {
        max-width: 100%;
    }

    .work-title {
        font-size: 1.25rem;
    }

    .work-description {
        font-size: 0.875rem;
    }

    .work-tech {
        gap: var(--space-1) var(--space-2);
    }

    .work-tech span {
        font-size: 0.6875rem;
    }

    .expertise-text {
        font-size: 0.9375rem;
    }

    .expertise-list {
        gap: var(--space-2) var(--space-4);
    }

    .expertise-item {
        font-size: 0.75rem;
    }

    .contact-title {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .contact-text {
        font-size: 0.9375rem;
    }

    .contact-email {
        font-size: 0.9375rem;
    }

    .contact-links {
        gap: var(--space-4);
    }
}

/* ─────────────────────────────────────────────────────────────────────────────
   REDUCED MOTION
   ───────────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}