/* =====================================================
   Classy monochrome portfolio — iron-filings particle art
   ===================================================== */

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

:root {
    --bg: #0a0a0a;
    --fg: #f5f5f5;
    --fg-dim: #9a9a9a;
    --fg-muted: #707070;
    --hairline: rgba(255, 255, 255, 0.08);
    --hairline-strong: rgba(255, 255, 255, 0.18);

    /* Single accent, used sparingly — active/interactive states and a
       handful of signature moments (name highlight, loader). Structure,
       body copy and the particle field stay monochrome so the accent reads
       as a deliberate touch rather than a second theme. */
    --accent: #d9a55a;
    --accent-hairline: rgba(217, 165, 90, 0.35);

    --font-display: 'Geist Mono', 'Consolas', 'Monaco', monospace;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --dur: 0.35s;

    /* Layout gutters — single source of truth for both the DOM copy and the
       particle headlines. js/layout.js reads the rendered padding back off a
       section, so the canvas text always starts on this same left edge.
       Vertical padding is viewport-relative so the DOM block keeps clear of
       the particle title (whose y is a fraction of the viewport) on any
       screen height. */
    --content-left: 220px;
    --content-right: 80px;
    --section-pad-top: 34vh;
    --hero-pad-top: 58vh;
}

@media (max-width: 1024px) {
    :root {
        --content-left: 140px;
        --content-right: 60px;
    }
}

@media (max-width: 768px) {
    :root {
        --content-left: 24px;
        --content-right: 24px;
        --section-pad-top: 52vh;
        --hero-pad-top: 62vh;
    }
}

html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

html {
    background: var(--bg);
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.65;
    font-size: 15px;
    font-weight: 400;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.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;
}

/* =====================================================
   Loader
   ===================================================== */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    max-width: 560px;
    padding: 0 32px;
    text-align: center;
}

.loader-spinner {
    width: 28px;
    height: 28px;
    border: 1px solid var(--hairline-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-quote {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--fg-dim);
    letter-spacing: -0.01em;
    line-height: 1.5;
}

.loader-author {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* =====================================================
   Canvas (particle field)
   ===================================================== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
}

/* Viewport box for the hero </> 3D icon. Nothing is ever painted here — the
   element only defines the region the invisible Three.js geometry projects
   into, which the particle field then traces (see js/hero3DIcon.js). Sized to
   the right half of the viewport; the icon is centered via the camera setup. */
#hero-3d-canvas {
    position: fixed;
    top: 50%;
    right: 2vw;
    transform: translateY(-50%);
    width: 52vw;
    max-width: 900px;
    height: 92vh;
    max-height: 900px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

#hero-3d-canvas.active {
    opacity: 1;
}

@media (max-width: 768px) {
    #hero-3d-canvas {
        width: 100vw;
        max-width: none;
        right: 0;
        height: 55vh;
        max-height: none;
    }
}

main {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

main a,
main button,
main .btn,
main .project-card,
main .work-card,
main .skill-category,
main .journey-item,
main .contact-link,
main .about-details {
    pointer-events: auto;
}

/* =====================================================
   Section tracker (left rail)
   ===================================================== */
.section-tracker {
    position: fixed;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 18px;
    pointer-events: auto;
}

.tracker-line {
    display: none;
}

.tracker-item {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--fg-muted);
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    padding: 4px 0;
    position: relative;
    transition: color var(--dur) var(--ease);
}

.tracker-item::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 50%;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--dur) var(--ease);
}

.tracker-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border: 1px solid var(--hairline-strong);
    background: transparent;
    transition: background var(--dur) var(--ease),
                border-color var(--dur) var(--ease);
}

.tracker-label {
    display: inline-block;
    transition: color var(--dur) var(--ease);
}

.tracker-item:hover {
    color: var(--fg-dim);
}

.tracker-item:hover .tracker-dot {
    border-color: var(--fg-dim);
}

.tracker-item.active {
    color: var(--fg);
}

.tracker-item.active .tracker-dot {
    background: var(--accent);
    border-color: var(--accent);
}

.tracker-item.active::before {
    width: 16px;
}

.tracker-item-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    transition: gap var(--dur) var(--ease);
}

.tracker-item-group.expanded {
    gap: 10px;
}

.tracker-subsections {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 16px;
    margin-top: 2px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--dur) var(--ease), opacity var(--dur) var(--ease);
    border-left: 1px solid var(--hairline);
}

.tracker-item-group.expanded .tracker-subsections {
    max-height: 240px;
    opacity: 1;
}

.tracker-subsection {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--fg-muted);
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 2px 0;
    transition: color var(--dur) var(--ease);
}

.subsection-dot {
    width: 4px;
    height: 4px;
    border: 1px solid var(--hairline-strong);
    background: transparent;
    transition: background var(--dur) var(--ease),
                border-color var(--dur) var(--ease);
}

.tracker-subsection:hover {
    color: var(--fg-dim);
}

.tracker-subsection.active {
    color: var(--fg);
}

.tracker-subsection.active .subsection-dot {
    background: var(--accent);
    border-color: var(--accent);
}

/* =====================================================
   Section shell
   ===================================================== */
.section {
    min-height: 100vh;
    width: 100%;
    position: relative;
    padding: var(--section-pad-top) var(--content-right) 120px var(--content-left);
    display: flex;
    align-items: flex-start;
}

.section-content {
    width: 100%;
    max-width: 1200px;
}

/* Particle canvas renders big section titles; the DOM header is hidden */
.section-header {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: -9999px;
}

.section-number,
.section-title {
    font-family: var(--font-display);
}

/* =====================================================
   Hero
   ===================================================== */
#hero {
    padding-top: var(--hero-pad-top);
    padding-bottom: 96px;
}

.hero-content {
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.eyebrow {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: 40px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--fg);
}

.highlight {
    color: var(--accent);
    display: inline-block;
}

.hero-description {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--fg-dim);
    max-width: 540px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 500;
    text-decoration: none;
    color: var(--fg);
    background: transparent;
    border: 1px solid var(--hairline-strong);
    cursor: pointer;
    transition: background var(--dur) var(--ease),
                color var(--dur) var(--ease),
                border-color var(--dur) var(--ease);
}

.btn:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

.btn-primary {
    border-color: var(--accent-hairline);
    color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* =====================================================
   Projects (pinned, horizontal scroll)
   ===================================================== */
#projects {
    padding: 0;
    min-height: 100vh;
}

.projects-sticky-viewport {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: var(--section-pad-top) var(--content-right) 120px var(--content-left);
    /* Fade card content out before it slides under the fixed left-side
       tracker rail, so titles/text don't visually collide with the menu. */
    --tracker-gutter: 180px;
    --tracker-feather: 40px;
    -webkit-mask-image: linear-gradient(to right,
        transparent 0,
        transparent var(--tracker-gutter),
        black calc(var(--tracker-gutter) + var(--tracker-feather)),
        black 100%);
    mask-image: linear-gradient(to right,
        transparent 0,
        transparent var(--tracker-gutter),
        black calc(var(--tracker-gutter) + var(--tracker-feather)),
        black 100%);
}

.projects-sticky-viewport .section-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.projects-track {
    display: flex;
    gap: 32px;
    align-items: stretch;
    will-change: transform;
    padding-right: 80px;
}

.project-card {
    flex: 0 0 460px;
    min-height: 460px;
    padding: 40px;
    border: 1px solid var(--hairline);
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: border-color var(--dur) var(--ease);
}

.project-card:hover {
    border-color: var(--hairline-strong);
}

.project-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-index {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.2em;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--fg);
}

.project-tagline {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 14px;
    color: var(--fg-dim);
    line-height: 1.5;
}

.project-description {
    flex: 1;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
}

.project-description p {
    font-size: 14px;
    color: var(--fg-dim);
    line-height: 1.7;
}

.tech-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
}

.tech-label {
    font-family: var(--font-display);
    font-size: 10px;
    color: var(--fg-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.tech-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.tech-icon {
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--fg-dim);
    transition: color var(--dur) var(--ease);
    background: transparent;
    border: none;
    padding: 0;
    display: inline;
    width: auto;
    height: auto;
    position: relative;
}

.tech-icon:not(:last-child)::after {
    content: '·';
    margin-left: 14px;
    color: var(--fg-muted);
}

.project-card:hover .tech-icon,
.work-card:hover .tech-icon {
    color: var(--fg);
}

.project-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
}

.project-link {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--fg-dim);
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 0;
    transition: color var(--dur) var(--ease);
}

.project-link .arrow {
    transition: transform var(--dur) var(--ease);
}

.project-link:hover {
    color: var(--fg);
}

.project-link:hover .arrow {
    color: var(--accent);
    transform: translateX(4px);
}

/* =====================================================
   Experience
   ===================================================== */
#experience .section-content {
    max-width: 1100px;
}

.entries-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.work-card {
    padding: 40px;
    border: 1px solid var(--hairline);
    background: transparent;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    transition: border-color var(--dur) var(--ease);
}

.work-card:hover {
    border-color: var(--hairline-strong);
}

.work-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.work-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.work-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--fg);
    line-height: 1.3;
}

.work-company {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--fg-dim);
}

.work-period {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.12em;
}

.work-location {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.12em;
    padding-top: 14px;
    border-top: 1px solid var(--hairline);
}

.work-description {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.work-description p {
    font-size: 14px;
    color: var(--fg-dim);
    line-height: 1.75;
}

.work-highlights {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.work-highlights li {
    font-size: 13px;
    color: var(--fg-dim);
    line-height: 1.6;
    padding-left: 24px;
    position: relative;
}

.work-highlights li::before {
    content: '—';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--fg-muted);
    font-family: var(--font-display);
}

.work-card .tech-stack {
    grid-column: 1 / -1;
    margin-top: 8px;
}

/* =====================================================
   Skills
   ===================================================== */
#skills .section-content {
    max-width: 1000px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}

.skill-category {
    padding: 40px 32px;
    border-right: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition: background var(--dur) var(--ease);
}

.skill-category:last-child {
    border-right: none;
}

.skill-category:hover {
    background: rgba(255, 255, 255, 0.015);
}

.skill-category-title {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 500;
}

.skill-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--fg);
    font-weight: 400;
    letter-spacing: -0.01em;
    transition: transform var(--dur) var(--ease);
}

.skill-item:hover {
    transform: translateX(4px);
}

/* =====================================================
   About
   ===================================================== */
#about .section-content {
    max-width: 1100px;
}

.about-content {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 80px;
    margin-bottom: 96px;
    padding-bottom: 64px;
    border-bottom: 1px solid var(--hairline);
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-intro {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--fg);
    margin-bottom: 8px;
}

.about-text p {
    font-size: 15px;
    color: var(--fg-dim);
    line-height: 1.8;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.about-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--hairline);
}

.about-detail-item:first-child {
    border-top: 1px solid var(--hairline);
}

.detail-label {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.detail-value {
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--fg);
    letter-spacing: -0.01em;
}

.about-journey-title {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.journey-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 120px;
}

.journey-timeline::before {
    content: '';
    position: absolute;
    left: 100px;
    top: 14px;
    bottom: 14px;
    width: 1px;
    background: var(--hairline);
}

.journey-item {
    padding: 24px 0;
    position: relative;
    border-bottom: 1px solid var(--hairline);
}

.journey-item:last-child {
    border-bottom: none;
}

.journey-marker {
    position: absolute;
    left: -25px;
    top: 32px;
    width: 9px;
    height: 9px;
    border: 1px solid var(--hairline-strong);
    background: var(--bg);
    transition: border-color var(--dur) var(--ease),
                background var(--dur) var(--ease);
}

.journey-item:hover .journey-marker {
    border-color: var(--accent);
    background: var(--accent);
}

.journey-date {
    position: absolute;
    left: -120px;
    top: 24px;
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--fg-muted);
    letter-spacing: 0.08em;
    width: 60px;
}

.journey-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.journey-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 500;
    color: var(--fg);
    letter-spacing: -0.01em;
}

.journey-description {
    font-size: 14px;
    color: var(--fg-dim);
    line-height: 1.7;
}

/* =====================================================
   Contact
   ===================================================== */
#contact .section-content {
    max-width: 900px;
}

.contact-wrapper {
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.contact-intro {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.5;
    color: var(--fg);
    max-width: 640px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--hairline);
}

.contact-link {
    display: grid;
    grid-template-columns: 140px 1fr 40px;
    align-items: center;
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid var(--hairline);
    text-decoration: none;
    color: var(--fg-dim);
    transition: color var(--dur) var(--ease),
                padding-left var(--dur) var(--ease);
}

.contact-link:hover {
    color: var(--fg);
    padding-left: 12px;
}

.contact-label {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--fg-muted);
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.contact-value {
    font-family: var(--font-display);
    font-size: 20px;
    letter-spacing: -0.01em;
    color: inherit;
    font-weight: 500;
}

.contact-link .arrow {
    font-family: var(--font-display);
    font-size: 18px;
    color: inherit;
    justify-self: end;
    transition: transform var(--dur) var(--ease);
}

.contact-link:hover .arrow {
    color: var(--accent);
    transform: translateX(8px);
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 1024px) {
    /* Horizontal padding comes from --content-left / --content-right. */
    .section {
        padding-bottom: 80px;
    }

    .projects-sticky-viewport {
        padding-bottom: 80px;
        --tracker-gutter: 110px;
        --tracker-feather: 30px;
    }

    .section-tracker {
        left: 24px;
    }

    .tracker-label {
        display: none;
    }

    .tracker-subsections {
        display: none;
    }

    .hero-subtitle {
        font-size: 32px;
    }

    .work-card {
        grid-template-columns: 220px 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .section {
        padding-bottom: 60px;
    }

    .projects-sticky-viewport {
        padding-top: 44vh;
        padding-bottom: 60px;
        --tracker-gutter: 36px;
        --tracker-feather: 20px;
    }

    .section-tracker {
        left: 12px;
        gap: 14px;
    }

    .tracker-item {
        font-size: 0;
    }

    .tracker-item::before {
        display: none;
    }

    .hero-subtitle {
        font-size: 26px;
    }

    .hero-description {
        font-size: 14px;
    }

    .project-card {
        flex: 0 0 320px;
        min-height: 400px;
        padding: 28px;
    }

    .work-card {
        grid-template-columns: 1fr;
        padding: 28px;
        gap: 24px;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .skill-category {
        border-right: none;
        border-bottom: 1px solid var(--hairline);
        padding: 28px 20px;
    }

    .skill-category:last-child {
        border-bottom: none;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .journey-timeline {
        padding-left: 80px;
    }

    .journey-timeline::before {
        left: 60px;
    }

    .journey-date {
        left: -80px;
        width: 50px;
        font-size: 12px;
    }

    .contact-link {
        grid-template-columns: 1fr 24px;
        gap: 12px;
        padding: 20px 0;
    }

    .contact-label {
        grid-column: 1 / -1;
        margin-bottom: 4px;
    }

    .contact-value {
        font-size: 15px;
    }
}
