/* Theme and reset */
:root {
    --text: #d8ffd2;
    --muted: #65b85c;
    --accent: #7cff67;
    --border: rgba(124, 255, 103, 0.24);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #050a05;
    color: #63ff63;
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

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

/* Site chrome */
header {
    border-bottom: 1px solid var(--border);
    background: rgba(7, 16, 8, 0.92);
    backdrop-filter: blur(10px);
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.18rem;
    color: #ffffff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-links a {
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.95rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

/* Homepage hero */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 6rem;
}

.hero {
    max-width: 980px;
    padding-top: 1rem;
    scroll-margin-top: 7rem;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18rem;
}

.eyebrow img {
    background: rgba(124, 255, 103, 0.04);
    border: 2px solid rgba(124, 255, 103, 0.9);
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(124, 255, 103, 0.12), 0 0 18px rgba(124, 255, 103, 0.2);
    flex-shrink: 0;
    height: 280px;
    object-fit: cover;
    object-position: center 58%;
    padding: 0.2rem;
    width: 280px;
}

.hero-identity {
    align-items: center;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    margin-bottom: 0.75rem;
    width: 100%;
}

.identity-copy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: center;
    min-height: 230px;
    text-align: right;
    width: 100%;
}

.identity-name {
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.04rem;
    text-align: right;
}

.identity-role {
    font-size: 0.9rem;
    letter-spacing: 0.18rem;
    text-align: right;
}

.identity-copy .hero-description {
    color: var(--muted);
    font-size: 0.9rem;
    font-family: "Share Tech Mono", "Courier New", monospace;
    margin: 0;
    max-width: 620px;
    text-align: right;
    width: min(100%, 620px);
    align-self: flex-end;
    text-shadow: none;
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 0.98;
    letter-spacing: -0.05em;
    max-width: 15ch;
}


.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.button {
    border: 1px solid currentColor;
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.08rem;
    padding: 0.7rem 0.9rem;
    text-transform: uppercase;
}

.button-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #071008;
}

.button-secondary {
    color: var(--accent);
}

.button:hover,
.button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Homepage sections */
.content-section {
    border-top: 1px solid var(--border);
    margin-top: 8rem;
    padding-top: 2rem;
    scroll-margin-top: 6rem;
}

.section-heading {
    max-width: 620px;
}

.section-kicker,
.work-number {
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 0.14rem;
    margin: 0 0 0.75rem;
}

h2 {
    color: var(--text);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
    margin: 0;
    max-width: 14ch;
}

.section-heading > p:last-child,
.contact-section > p:not(.section-kicker),
.skill-groups p {
    color: var(--muted);
}

.skill-groups h3 {
    color: var(--text);
    margin: 0;
}

.profile-layout {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 3rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 2rem;
    padding-top: 2rem;
}

.profile-lede {
    color: var(--text);
    font-size: 1.35rem;
    margin: 0;
}

.timeline-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 2rem;
}

.filter-label {
    color: var(--muted);
    font-size: 0.8rem;
    margin-right: 0.25rem;
}

.filter-button {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    letter-spacing: 0.06rem;
    padding: 0.5rem 0.7rem;
    text-transform: uppercase;
}

.filter-button:hover,
.filter-button:focus-visible,
.filter-button.is-active {
    background: rgba(124, 255, 103, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

.timeline-shell {
    background:
        linear-gradient(180deg, rgba(124, 255, 103, 0.08), transparent 4rem),
        linear-gradient(0deg, rgba(124, 255, 103, 0.08), transparent 4rem),
        rgba(5, 10, 5, 0.35);
    border: 1px solid var(--border);
    margin-top: 1.5rem;
    max-height: 680px;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    position: relative;
    scrollbar-color: var(--accent) rgba(124, 255, 103, 0.1);
    scrollbar-width: thin;
    scroll-behavior: smooth;
}

.timeline-shell::-webkit-scrollbar {
    width: 0.7rem;
}

.timeline-shell::-webkit-scrollbar-track {
    background: rgba(124, 255, 103, 0.08);
    border-left: 1px solid rgba(124, 255, 103, 0.12);
}

.timeline-shell::-webkit-scrollbar-thumb {
    background: var(--terminal-dim);
    border: 2px solid var(--terminal-black);
    border-radius: 999px;
    min-height: 3rem;
}

.timeline-shell::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.timeline-scroll-hint {
    align-items: center;
    animation: timeline-hint-pulse 2s ease-in-out infinite;
    bottom: 0.8rem;
    color: var(--terminal-dim);
    display: flex;
    font-size: 0.68rem;
    gap: 0.45rem;
    letter-spacing: 0.1rem;
    margin: 0;
    pointer-events: none;
    position: sticky;
    right: 0;
    text-align: right;
    text-transform: uppercase;
    z-index: 2;
}

.timeline-scroll-arrow {
    color: var(--accent);
    font-size: 1rem;
}

.project-timeline {
    margin: 0 auto;
    max-width: 920px;
    padding: 0.5rem 0;
    position: relative;
    scroll-snap-type: y proximity;
}

.project-timeline::before {
    background: var(--terminal-dim);
    bottom: 0;
    content: "";
    left: 50%;
    position: absolute;
    top: 0;
    width: 1px;
}

.timeline-item {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 1fr) 12rem minmax(0, 1fr);
    margin-bottom: 2rem;
    position: relative;
    scroll-snap-align: start;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    align-items: center;
    background: var(--terminal-black);
    border: 1px solid var(--accent);
    color: var(--accent);
    display: flex;
    font-size: 0.7rem;
    height: 2rem;
    justify-content: center;
    letter-spacing: 0.06rem;
    padding: 0 1.5rem;
    white-space: nowrap;
    position: relative;
    width: 12rem;
    z-index: 1;
    grid-column: 2;
    align-self: center;
}

.timeline-marker::before,
.timeline-marker::after {
    color: var(--terminal-dim);
    position: absolute;
}

.timeline-marker::before {
    content: "[";
    left: 0.5rem;
}

.timeline-marker::after {
    content: "]";
    right: 0.5rem;
}

.timeline-card {
    background: rgba(7, 16, 8, 0.72);
    border: 1px solid var(--border);
    color: inherit;
    cursor: pointer;
    display: block;
    font: inherit;
    padding: 1.25rem;
    position: relative;
    text-align: left;
    transition: none;
    width: 100%;
}

.timeline-item:nth-child(odd) .timeline-card {
    grid-column: 3;
}

.timeline-item:nth-child(even) .timeline-card {
    grid-column: 1;
    grid-row: 1;
}

.timeline-item:nth-child(odd) .timeline-card::before,
.timeline-item:nth-child(even) .timeline-card::before {
    background: var(--terminal-dim);
    content: "";
    height: 1px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
}

.timeline-item:nth-child(odd) .timeline-card::before {
    left: -1.5rem;
}

.timeline-item:nth-child(even) .timeline-card::before {
    right: -1.5rem;
}

.timeline-card:hover,
.timeline-card:focus-visible {
    border-color: var(--accent);
}

.timeline-meta {
    color: var(--accent);
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    margin: 0 0 0.6rem;
}

.timeline-title {
    color: var(--text);
    display: block;
    font-size: 1.17rem;
    font-weight: 700;
    margin: 0;
}

.timeline-card > p:not(.timeline-meta) {
    color: var(--muted);
    margin: 0.65rem 0 0;
}

.timeline-link {
    display: inline-block;
}

.timeline-item.is-hidden {
    display: none;
}

.timeline-media {
    align-self: center;
    border: 1px solid var(--terminal-green);
    display: block;
    grid-column: 1;
    grid-row: 1;
    height: 220px;
    object-fit: cover;
    width: 100%;
}

.timeline-media-lbm {
    clip-path: inset(4%);
    object-fit: cover;
    object-position: center top;
    overflow: hidden;
    transform: scale(1.1);
}

.timeline-media-lnswd {
    object-position: center bottom;
}

.timeline-item:nth-child(odd) .timeline-media {
    grid-column: 1;
}

.timeline-item:nth-child(even) .timeline-media {
    grid-column: 3;
}

.timeline-scroll-mobile {
    display: none;
}

.skill-groups {
    display: grid;
    gap: 1.5rem;
}

.skill-groups p {
    margin: 0.35rem 0 0;
}

.contact-section {
    margin-bottom: 5rem;
    max-width: 700px;
}

.contact-section > p:not(.section-kicker) {
    max-width: 560px;
}

.contact-section .button {
    margin-top: 1rem;
}

.contact-layout {
    display: grid;
    gap: 3rem;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    margin-top: 2rem;
}

.contact-copy h2 {
    margin-bottom: 1.25rem;
}

.contact-copy p {
    color: var(--muted);
    max-width: 34rem;
}

.contact-email {
    color: var(--accent);
}

.contact-email:hover,
.contact-email:focus-visible {
    color: var(--text);
    text-decoration: underline;
}

.contact-form {
    background: rgba(16, 24, 39, 0.55);
    border: 1px solid var(--border);
    display: grid;
    gap: 0.55rem;
    padding: 1.25rem;
}

.contact-form label {
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 0.1rem;
    margin-top: 0.35rem;
    text-transform: uppercase;
}

.contact-form input,
.contact-form textarea {
    background: rgba(5, 10, 5, 0.8);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font: inherit;
    padding: 0.7rem;
    resize: vertical;
    width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent);
    outline: 2px solid rgba(124, 255, 103, 0.2);
    outline-offset: 1px;
}

.contact-form .button {
    cursor: pointer;
    margin-top: 0.75rem;
    width: fit-content;
}

.contact-form-help {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 1rem 0 0;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contact-actions .button {
    margin-top: 0;
}

.contact-action {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}

.contact-action:hover,
.contact-action:focus-visible {
    background: var(--accent);
    color: #071008;
}

/* Project details */
.projects {
    max-width: 900px;
}

.back-link {
    color: var(--accent);
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 0.06rem;
    margin-bottom: 5rem;
    text-transform: uppercase;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--text);
}

.projects-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 4rem;
}

.projects-header h1 {
    color: var(--text);
    max-width: none;
}

.projects-lede {
    color: var(--muted);
    font-size: 1.35rem;
    margin: 1.5rem 0 0;
    max-width: 650px;
}

.project-meta {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, 1fr);
    margin: 3rem 0 0;
}

.project-meta div {
    border-left: 1px solid var(--accent);
    padding-left: 0.9rem;
}

.project-meta dt {
    color: var(--accent);
    font-size: 0.7rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
}

.project-meta dd {
    color: var(--text);
    margin: 0.35rem 0 0;
}

.projects-section {
    border-bottom: 1px solid var(--border);
    padding: 5rem 0;
    scroll-margin-top: 6rem;
}

.projects-section h2 {
    max-width: 650px;
}

.projects-section > p:not(.section-kicker),
.projects-copy p,
.process-grid p {
    color: var(--muted);
    max-width: 650px;
}

.projects-split {
    display: grid;
    gap: 4rem;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.projects-copy {
    padding-top: 2rem;
}

.projects-copy strong {
    color: var(--text);
}

.process-grid {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 3rem;
}

.process-grid article {
    background: rgba(16, 24, 39, 0.7);
    border: 1px solid var(--border);
    min-height: 190px;
    padding: 1.5rem;
}

.process-grid h3 {
    color: var(--text);
    margin: 0;
}

.outcome-section {
    border-bottom: 0;
    margin-bottom: 4rem;
}

/* Responsive layout */
@media (max-width: 600px) {
    nav {
        align-items: center;
        display: grid;
        gap: 0.75rem;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: calc(0.8rem + env(safe-area-inset-top)) 1rem 0.8rem;
    }

    .nav-links {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 0;
        width: 100%;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .nav-links a {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }

    .boot-toggle {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        justify-self: end;
    }

    .hero-identity {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .eyebrow img {
        height: 120px;
        width: 120px;
    }

    .identity-copy {
        min-height: auto;
    }

    .identity-name {
        font-size: 1.8rem;
    }

    h1 {
        font-size: clamp(1.2rem, 6vw, 5rem);
    }

    .hero-description {
        font-size: 0.9rem;
    }

    main {
        padding-top: 1.5rem;
    }

    .content-section {
        margin-top: 5rem;
    }

    .profile-layout,
    .contact-layout,
    .projects-split,
    .process-grid,
    .project-meta {
        grid-template-columns: 1fr;
    }

    .profile-layout {
        gap: 2rem;
    }

    .timeline-shell {
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 1.5rem;
        scrollbar-color: var(--accent) rgba(124, 255, 103, 0.1);
        touch-action: pan-x;
    }

    .project-timeline {
        display: flex;
        gap: 1rem;
        min-width: max-content;
        padding: 1rem 0 0;
        scroll-snap-type: x proximity;
    }

    .project-timeline::before {
        bottom: auto;
        height: 1px;
        left: 0;
        right: 0;
        top: 2.35rem;
        width: auto;
    }

    .timeline-item {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 0;
        width: min(76vw, 300px);
    }

    .timeline-item:nth-child(odd) .timeline-card,
    .timeline-item:nth-child(even) .timeline-card {
        grid-column: auto;
        grid-row: auto;
    }

    .timeline-media {
        grid-column: auto;
        grid-row: auto;
        height: 180px;
        order: 2;
    }

    .timeline-card {
        order: 3;
    }

    .timeline-item:nth-child(odd) .timeline-card::before,
    .timeline-item:nth-child(even) .timeline-card::before {
        display: none;
    }

    .timeline-shell::-webkit-scrollbar {
        height: 0.7rem;
        width: auto;
    }

    .timeline-shell::-webkit-scrollbar-track {
        border-left: 0;
        border-top: 1px solid rgba(124, 255, 103, 0.12);
    }

    .timeline-scroll-desktop {
        display: none;
    }

    .timeline-scroll-mobile {
        display: inline;
    }

    .timeline-scroll-hint {
        bottom: 0.65rem;
        justify-content: flex-end;
    }

    .timeline-scroll-arrow {
        transform: rotate(-90deg);
    }

    .timeline-marker {
        flex-shrink: 0;
        align-self: auto;
        width: 12rem;
    }

    @keyframes timeline-hint-pulse {
        0%, 100% { opacity: 0.55; }
        50% { opacity: 1; }
    }

    @media (prefers-reduced-motion: reduce) {
        .timeline-shell {
            scroll-behavior: auto;
        }
    }

    .timeline-card {
        height: 100%;
    }

    .back-link {
        margin-bottom: 3rem;
    }

    .projects-lede {
        font-size: 1.1rem;
    }

    .projects-section {
        padding: 3rem 0;
    }
}
