:root {

    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-muted: #5c5c5c;
    --color-border: #e0e0e0;
    --color-accent: #1a1a1a;
    --color-shadow: rgba(0, 0, 0, 0.08);


    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
    --font-size-base: 1rem;
    --line-height-base: 1.6;


    --container-width: 820px;
    --title-width: 840px;
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2.5rem;
    --space-5: 4rem;
    --space-6: 6rem;

    --header-height: 64px;
    --progress-height: 3px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --color-bg: #121212;
        --color-text: #ececec;
        --color-muted: #a0a0a0;
        --color-border: #2a2a2a;
        --color-accent: #ececec;
        --color-shadow: rgba(0, 0, 0, 0.35);
    }
}

/* manual toggle overrides win regardless of OS preference */
:root[data-theme="dark"] {
    --color-bg: #121212;
    --color-text: #ececec;
    --color-muted: #a0a0a0;
    --color-border: #2a2a2a;
    --color-accent: #ececec;
    --color-shadow: rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-muted: #5c5c5c;
    --color-border: #e0e0e0;
    --color-accent: #1a1a1a;
    --color-shadow: rgba(0, 0, 0, 0.08);
}


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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a {
    color: inherit;
}

h1, h2, h3, h4 {
    line-height: 1.25;
    margin: 0 0 var(--space-2);
    overflow-wrap: break-word;
}

h1, h2 {
    /* was a fixed `width`, which forced an 840px-wide box even on
       phones and pushed text past the viewport edge instead of
       wrapping. max-width caps it on desktop; width:100% lets it
       shrink to fit narrow screens. */
    width: 100%;
    max-width: var(--title-width);
}

p {
    margin: 0 0 var(--space-2);
    overflow-wrap: break-word;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}


@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}


a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}


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


.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-bg);
    color: var(--color-text);
    padding: var(--space-1) var(--space-2);
    z-index: 1200;
}

.skip-link:focus {
    left: var(--space-2);
    top: var(--space-2);
}


.container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: var(--space-2);
}

.container-title {
    width: 100%;
    max-width: var(--title-width);
    margin-inline: auto;
    padding-inline: var(--space-2);
}

.section {
    padding-block: var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.section:last-of-type {
    border-bottom: none;
}


/* ---- scroll progress bar ---- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: var(--progress-height);
    width: 0%;
    background-color: var(--color-accent);
    z-index: 1101;
    transition: width 0.12s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .scroll-progress {
        transition: none;
    }
}


.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding-inline: var(--space-2);
}

@media (min-width: 1024px) {
    .header-inner {
        padding-inline: var(--space-4);
    }
}

.logo {
    font-weight: 600;
    text-decoration: none;
}

.nav-cluster {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.primary-nav ul {
    display: flex;
    gap: var(--space-3);
}

.primary-nav a {
    position: relative;
    text-decoration: none;
    color: var(--color-muted);
    padding-bottom: 3px;
    transition: color 0.2s ease;
}

.primary-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 0%;
    background-color: var(--color-text);
    transition: width 0.25s ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
    color: var(--color-text);
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.nav-toggle-bar {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-text);
}


/* ---- dashboard link ---- */
.dashboard-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text);
    padding: 0;
    transition: border-color 0.2s ease, transform 0.3s ease;
}

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

.dashboard-link:active {
    transform: scale(0.92);
}

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


/* ---- hero ---- */
.hero {
    padding-block: var(--space-6);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--space-1);
    opacity: 0;
    animation: fade-up-in 0.7s ease forwards;
}

.hero-subtitle {
    color: var(--color-muted);
    font-size: 1.125rem;
    margin: 0;
    opacity: 0;
    animation: fade-up-in 0.6s ease forwards;
}

.hero-subtitle:nth-of-type(1) { animation-delay: 0.15s; }
.hero-subtitle:nth-of-type(2) { animation-delay: 0.3s; }
.hero-subtitle:nth-of-type(3) { animation-delay: 0.45s; }

@keyframes fade-up-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}


/* ---- scroll reveal (project cards, gallery entries, etc.) ---- */
.reveal.reveal-init {
    opacity: 0;
    transform: translateY(28px);
}

.reveal {
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--reveal-delay, 0s);
}

.reveal.reveal-init.is-visible {
    opacity: 1;
    transform: none;
}


.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.project {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 220px;
    padding: var(--space-3);
    margin-inline: calc(var(--space-3) * -1);
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--color-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-thumb {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-border);
}

.project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    transform: scale(1.1);          /* creates horizontal room to pan into */
    transform-origin: -70% 50%;      /* shifts the visible crop rightward */
    display: block;
}

/* horizontal fade so the image "flows" behind the text instead of
   competing with it — solid near the copy, transparent toward the image */
.project::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to top,
            var(--color-bg) 0%,
            transparent 65%),
        linear-gradient(to right,
            var(--color-bg) 0%,
            var(--color-bg) 42%,
            transparent 90%);
    pointer-events: none;
}

.project-body {
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 0;
    text-shadow: 0 1px 12px var(--color-bg);
}

.project:hover,
.project:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px var(--color-shadow);
}

.project h3 {
    margin-bottom: var(--space-1);
}

.project h3 a {
    text-decoration: none;
}

.project h3 a:hover,
.project h3 a:focus-visible {
    text-decoration: underline;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-2);
    color: var(--color-muted);
    font-size: 0.875rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1) var(--space-3);
    color: var(--color-muted);
}


.continue-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-1);
    padding: var(--space-2) var(--space-3);
    margin-inline: calc(var(--space-3) * -1);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    color: var(--color-text);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.continue-link:hover,
.continue-link:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px var(--color-shadow);
    background-color: var(--color-border);
}

.continue-link .arrow {
    transition: transform 0.25s ease;
}

.continue-link:hover .arrow,
.continue-link:focus-visible .arrow {
    transform: translateX(4px);
}

/* ---- timeline page ---- */
.timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    padding-left: var(--space-4);
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0.4rem;
    bottom: 0.4rem;
    left: 0.5rem;
    width: 2px;
    background-color: var(--color-border);
}

.timeline-entry {
    position: relative;
    padding-bottom: var(--space-4);
}

.timeline-entry:last-child {
    padding-bottom: 0;
}

.timeline-entry::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 0.4rem;
    transform: translateX(-650%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-bg);
}

.timeline-era {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: var(--space-1);
}

.timeline-entry h3 {
    margin-bottom: var(--space-1);
}

.timeline-entry p {
    margin-bottom: var(--space-1);
}


.contact-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.contact-list a {
    text-decoration: none;
}

.contact-list a:hover,
.contact-list a:focus-visible {
    text-decoration: underline;
}


.gallery-section {
    padding-inline: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

@media (min-width: 1024px) {
    .gallery-section {
        padding-inline: var(--space-4);
    }
}

.gallery-entry {
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.gallery-entry.is-reverse {
    flex-direction: row-reverse;
}

.gallery-image {
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
}

.gallery-placeholder {
    width: 100%;
    background-color: var(--color-border);
    transition: transform 0.5s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-entry:hover .gallery-placeholder,
.gallery-entry:hover .gallery-item img {
    transform: scale(1.04);
}

.gallery-caption {
    flex: 1;
    min-width: 0;
}

.gallery-index {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
    border-top: 2px solid var(--color-accent);
    padding-top: var(--space-1);
    margin-bottom: var(--space-1);
}

.gallery-caption p {
    color: var(--color-muted);
    margin: 0;
}

/* Size modifiers: how much of the row the image claims.
   The caption fills whatever's left, so a "bigger" image
   reads as visually dominant and a "smaller" one leaves
   more room for text. Aspect ratio is set per size to
   roughly match the kind of shot (wide vs tall). */

.gallery-entry--large .gallery-image {
    width: 70%;
}
.gallery-entry--large .gallery-placeholder {
    aspect-ratio: 16 / 9;
}

.gallery-entry--medium .gallery-image {
    width: 52%;
}
.gallery-entry--medium .gallery-placeholder {
    aspect-ratio: 4 / 3;
}

.gallery-entry--small .gallery-image {
    width: 34%;
}
.gallery-entry--small .gallery-placeholder {
    aspect-ratio: 3 / 4;
}



.site-footer {
    padding-block: var(--space-3);
}

.site-footer p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.875rem;
}

@media (max-width: 640px) {
    .nav-toggle {
        display: flex;
    }

    .primary-nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.2s ease;
    }

    .primary-nav.is-open {
        max-height: 300px;
    }

    .primary-nav ul {
        flex-direction: column;
        gap: 0;
        padding: var(--space-2);
    }

    .primary-nav li {
        padding-block: var(--space-1);
    }

    .section {
        padding-block: var(--space-4);
    }

    .hero {
        padding-block: var(--space-5);
    }

    .project,
    .continue-link {
        margin-inline: 0;
    }

    .project {
        min-height: 160px;
    }

    .project::before {
        background:
            linear-gradient(to top,
                var(--color-bg) 0%,
                transparent 70%),
            linear-gradient(to right,
                var(--color-bg) 0%,
                var(--color-bg) 55%,
                transparent 95%);
    }

    .gallery-entry,
    .gallery-entry.is-reverse {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }

    .gallery-entry--large .gallery-image,
    .gallery-entry--medium .gallery-image,
    .gallery-entry--small .gallery-image {
        width: 100%;
    }

    .gallery-entry--small .gallery-placeholder {
        aspect-ratio: 4 / 3;
    }
}

.pdf-viewer {
    width: 100%;
    margin-top: 2rem; /* Optional: adds space between the link and the PDF */
}

.pdf-embed {
    width: 100%;
    height: 100vh; /* Makes the PDF exactly as tall as the user's screen */
    min-height: 800px; /* Ensures it doesn't get too small on short screens */
    border: none;
    display: block;
}