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

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

:root {
    --bg:           #FAFAF8;
    --bg-alt:       #F3F2EF;
    --text:         #1C1C1C;
    --text-muted:   #6E6E6E;
    --border:       #E3E3DE;
    --border-hover: #BBBBB4;
    --white:        #FFFFFF;
    --font:         'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --nav-h:        60px;
    --pad-section:  96px;
    --max-w:        1100px;
    --radius:       8px;
    --ease:         0.2s ease;
    --glow:         rgba(85, 125, 255, 0.10);
    --glow-mid:     rgba(85, 125, 255, 0.04);
    --dot:          #D4D2CC;
    --cursor-color:       rgba(28,  28,  28,  0.90);
    --cursor-ring-color:  rgba(28,  28,  28,  0.32);
    --cursor-ring-hover:  rgba(28,  28,  28,  0.12);
    --cursor-ring-fill:   rgba(28,  28,  28,  0.04);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

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


/* ============================================================
   LAYOUT
   ============================================================ */

.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 28px;
}

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

.section-alt {
    background: var(--bg-alt);
}

.section-header {
    margin-bottom: 52px;
}

.section-title {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    letter-spacing: -0.025em;
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 480px;
    line-height: 1.6;
}


/* ============================================================
   NAV
   ============================================================ */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    background: rgba(250, 250, 248, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    z-index: 100;
    transition: border-color var(--ease);
}

.nav.scrolled {
    border-bottom-color: var(--border);
}

.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--text);
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-block;
    transition: transform var(--ease);
}

.nav-logo:hover {
    transform: scale(1.07);
}

.logo-first {
    font-weight: 400;
}

.logo-last {
    font-weight: 700;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 34px;
    margin-right: 8px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    transition: color var(--ease), transform var(--ease);
    position: relative;
    display: inline-block;
}

.nav-links a:hover {
    transform: scale(1.07);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transition: transform var(--ease);
    transform-origin: left;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
}

.nav-links a.active::after {
    transform: scaleX(1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 2px;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}


/* ============================================================
   HOME
   ============================================================ */

.section-home {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-h);
    /* Subtle dot grid */
    background-image: radial-gradient(circle, var(--dot) 1.5px, transparent 1.5px);
    background-size: 28px 28px;
}

/* Faint monogram watermark */
.section-home::after {
    content: 'EA';
    position: absolute;
    right: -0.02em;
    bottom: -0.08em;
    font-size: min(42vw, 520px);
    font-weight: 700;
    letter-spacing: -0.06em;
    line-height: 0.85;
    color: transparent;
    -webkit-text-stroke: 1px rgba(28, 28, 28, 0.045);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* Cursor-driven spotlight overlay */
.hero-spotlight {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    background: radial-gradient(
        680px circle at var(--mx, 30%) var(--my, 60%),
        var(--glow) 0%,
        var(--glow-mid) 40%,
        transparent 70%
    );
    transition: opacity 0.55s ease;
}

.home-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
}

.home-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.home-eyebrow span:last-child {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow-line {
    display: block;
    width: 36px;
    height: 1px;
    background: var(--border-hover);
    flex-shrink: 0;
}

.home-name {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 22px;
    line-height: 1.0;
}

.name-first {
    display: block;
    font-size: clamp(48px, 9.5vw, 90px);
    font-weight: 300;
    letter-spacing: -0.035em;
}

.name-last {
    display: block;
    font-size: clamp(48px, 9.5vw, 90px);
    font-weight: 600;
    letter-spacing: -0.04em;
}

.home-tagline {
    font-size: clamp(18px, 3vw, 23px);
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    margin-bottom: 24px;
}

.home-bio {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.75;
    margin-bottom: 40px;
}

.home-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    padding: 11px 22px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    border: 1.5px solid transparent;
    transition: background var(--ease), border-color var(--ease), color var(--ease),
                transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

.btn-primary {
    background: var(--text);
    color: var(--white);
    border-color: var(--text);
}

.btn-primary:hover {
    background: #3a3a3a;
    border-color: #3a3a3a;
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    border-color: var(--text);
}


/* ============================================================
   GRID
   ============================================================ */

.grid {
    display: grid;
    gap: 20px;
}

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


/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.card-icon {
    font-size: 14px;
    color: var(--border-hover);
}

.card-tags {
    display: flex;
    gap: 6px;
}

.tag {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-alt);
    padding: 3px 8px;
    border-radius: 4px;
}

.section-alt .card .tag {
    background: var(--bg);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.015em;
}

.card-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.65;
    flex: 1;
}

.card-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-top: 6px;
    display: inline-block;
    transition: opacity var(--ease);
}

.card-link:hover {
    opacity: 0.5;
}

/* Playground card variant */
.card-play {
    background: var(--bg);
}

.section-alt .card-play {
    background: var(--white);
}

.play-icon {
    font-size: 22px;
    color: var(--border-hover);
    margin-bottom: 2px;
}


/* ============================================================
   POSTS (THINK)
   ============================================================ */

.posts {
    display: flex;
    flex-direction: column;
}

.post {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 28px;
    align-items: start;
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
}

.post:first-child {
    border-top: 1px solid var(--border);
}

.post-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 2px;
}

.post-meta time {
    font-size: 13px;
    color: var(--text-muted);
}

.post-tag {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.3;
    margin-bottom: 9px;
}

.post-title a {
    transition: opacity var(--ease);
}

.post-title a:hover {
    opacity: 0.5;
}

.post-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 580px;
}


/* ============================================================
   ABOUT
   ============================================================ */

.about-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 64px;
    align-items: start;
}

.about-photo {
    display: flex;
    justify-content: flex-start;
}

.photo-placeholder {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.about-content {
    max-width: 620px;
}

.about-lead {
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.45;
    margin-bottom: 22px;
}

.about-content p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 14px;
}

.about-links {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.about-actions {
    margin-top: 30px;
}

.social-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
    transition: border-color var(--ease);
}

.social-link:hover {
    border-color: var(--text);
}


/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-name {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}


/* ============================================================
   FADE-IN ANIMATIONS
   ============================================================ */

.fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for grid children */
.grid .fade-in:nth-child(2) { transition-delay: 60ms; }
.grid .fade-in:nth-child(3) { transition-delay: 120ms; }
.grid .fade-in:nth-child(4) { transition-delay: 60ms; }
.grid .fade-in:nth-child(5) { transition-delay: 120ms; }
.grid .fade-in:nth-child(6) { transition-delay: 180ms; }

.posts .fade-in:nth-child(2) { transition-delay: 60ms; }
.posts .fade-in:nth-child(3) { transition-delay: 120ms; }
.posts .fade-in:nth-child(4) { transition-delay: 180ms; }


/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */

@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .about-photo {
        justify-content: flex-start;
    }
}


/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */

@media (max-width: 640px) {
    :root {
        --pad-section: 64px;
    }

    .container {
        padding: 0 20px;
    }

    .nav-inner {
        padding: 0 20px;
    }

    /* Mobile nav */
    .nav-toggle {
        display: flex;
    }

    .nav-right {
        gap: 2px;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-h);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        margin-right: 0;
        padding: 12px 0;
        transform: translateY(-110%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.28s ease, opacity 0.28s ease;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-links li a {
        display: block;
        padding: 13px 20px;
        font-size: 15px;
    }

    .nav-links a::after {
        display: none;
    }

    .nav-gear {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
    }

    /* Grid */
    .grid-3 {
        grid-template-columns: 1fr;
    }

    /* Posts */
    .post {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .post-meta {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    /* Home */
    .home-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 0 16px;
    }

    .nav-inner {
        padding: 0 16px;
    }
}


/* ============================================================
   CUSTOM CURSOR
   ============================================================ */

body.has-custom-cursor,
body.has-custom-cursor * {
    cursor: none !important;
}

.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
}

.cursor-dot {
    width: 5px;
    height: 5px;
    background: var(--cursor-color);
    z-index: 10000;
    transition: opacity 0.2s ease, background 0.2s ease;
    will-change: left, top;
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--cursor-ring-color);
    transition: width 0.35s ease, height 0.35s ease,
                border-color 0.35s ease, background 0.35s ease,
                opacity 0.2s ease;
    will-change: left, top;
}

/* Hover state — ring expands, dot stays visible */
.cursor-ring.is-hovering {
    width: 56px;
    height: 56px;
    border-color: var(--cursor-ring-hover);
    background: var(--cursor-ring-fill);
}

/* Hidden when mouse is outside window */
.cursor-dot.is-hidden,
.cursor-ring.is-hidden {
    opacity: 0;
}


/* ============================================================
   COMING SOON BANNER
   ============================================================ */

.coming-soon-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
}

.coming-soon-banner {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    background: rgba(20, 20, 19, 0.68);
}

html[data-theme="light"] .coming-soon-banner {
    background: rgba(250, 250, 248, 0.68);
}

.coming-soon-banner span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 9px 20px;
    border-radius: 100px;
    background: var(--bg);
    user-select: none;
}


/* ============================================================
   GEAR & SETTINGS DROPDOWN
   ============================================================ */

.nav-gear {
    position: relative;
    margin-left: 4px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.gear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--ease), background var(--ease), transform var(--ease);
}

.gear-btn:hover {
    color: var(--text);
    background: var(--bg-alt);
    transform: scale(1.12);
}

.gear-btn.is-open {
    color: var(--text);
    background: var(--bg-alt);
}

.gear-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 192px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    z-index: 200;
}

.gear-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.gear-option {
    display: block;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    border-radius: 5px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: background var(--ease);
    white-space: nowrap;
}

.gear-option:hover {
    background: var(--bg-alt);
}


/* ============================================================
   THEME TRANSITION (applied briefly during switch)
   ============================================================ */

.theme-transition,
.theme-transition *,
.theme-transition *::before,
.theme-transition *::after {
    transition: background-color 0.35s ease, border-color 0.35s ease,
                color 0.35s ease, box-shadow 0.35s ease !important;
}


/* ============================================================
   DARK MODE
   ============================================================ */

html[data-theme="dark"] {
    --bg:           #141413;
    --bg-alt:       #1C1C1A;
    --text:         #EDECE8;
    --text-muted:   #888885;
    --border:       #2C2C28;
    --border-hover: #424240;
    --white:        #1F1F1D;
    --glow:         rgba(85, 125, 255, 0.22);
    --glow-mid:     rgba(85, 125, 255, 0.08);
    --dot:          #2E2E2A;
    --cursor-color:       rgba(237, 236, 232, 0.90);
    --cursor-ring-color:  rgba(237, 236, 232, 0.38);
    --cursor-ring-hover:  rgba(237, 236, 232, 0.14);
    --cursor-ring-fill:   rgba(237, 236, 232, 0.06);
}

html[data-theme="dark"] .nav {
    background: rgba(20, 20, 19, 0.92);
}

html[data-theme="dark"] .section-home::after {
    -webkit-text-stroke: 1px rgba(237, 236, 232, 0.04);
}

html[data-theme="dark"] .btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

html[data-theme="dark"] .btn-primary:hover {
    background: #D8D7D3;
    border-color: #D8D7D3;
}

html[data-theme="dark"] .gear-dropdown {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .nav-links {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
