html {
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y; /* stop Safari from treating sideways swipes as page panning */
}

body {
    margin: 0px;
    padding-top: 0px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 0px;
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    color: #000000;
    box-sizing: border-box;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    font-size: 14px;
    text-decoration: none;
}

.skip-link:focus {
    left: 8px;
    top: 8px;
}

* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.banner {
    width: fit-content;
    margin: 0 auto;
}


.hello {
    display: block !important;
    visibility: visible !important;
    opacity: .9 !important;
    padding-top: 10px;
    padding-bottom: 0px;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
    margin: 0 auto;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.hello svg {
    display: block;
    height: 20pt;
    max-height: 20pt;
    fill: currentColor;
    color: #000;
}

.hello .hello-full {
    width: auto;
}

.hello .hello-compact {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: 20pt;
    opacity: 0;
    pointer-events: none;
}


.project-entry {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 10px;
}

.project-title-col {
    flex-shrink: 0;
    width: 175px;
    margin-right: 20px;
    cursor: pointer;
}

/* On small screens the title/stats column is moved into .project-container
   (see script4.js) so it scrolls with the rest of the row; the container's
   own gap replaces the standalone margin. */
.project-container > .project-title-col {
    margin-right: 0;
}

.project-row {
    display: flex;
    align-items: flex-start; /* keep children pinned top to avoid Safari gutter gap */
    flex-direction: row;
    overflow-x: auto; /* keep default for non-expanded */
    justify-content: flex-start;
    scroll-snap-type: x mandatory;
    /* remove global hiding of scrollbars here */
    flex-wrap: nowrap; /* Prevents rearranging */
}

.project-row:not(.expanded) .project-box.photos {
    cursor: pointer;
}

/* Collapsed rows: no scrolling, no clipping */
.project-row:not(.expanded) {
    overflow-x: visible;
    scrollbar-width: none; /* Firefox */
}
.project-row:not(.expanded)::-webkit-scrollbar {
    display: none; /* WebKit */
}

/* When a row is opened, always show a horizontal scrollbar underneath */
.project-row.expanded {
    justify-content: flex-start;
    align-items: flex-start;
    overflow-x: scroll; /* force visible horizontal scrollbar */
    scroll-snap-type: none; /* disable snapping so rows stay put at scroll end */
    padding-bottom: 2px; /* let the native scrollbar sit flush without extra gap */
    cursor: grab; /* indicate draggable surface */
    overscroll-behavior-x: none; /* prevent horizontal scroll/swipe from chaining up to page navigation on iOS */
    touch-action: pan-x pan-y; /* on mobile this row covers most of the screen, so it must allow vertical panning too or touching an image blocks page scroll entirely */
}

.project-row.expanded .project-container,
.project-row.expanded .project-container > .project-title-col,
.project-row.expanded .project-box,
.project-row.expanded .project-box *,
.project-row.expanded .scrollable-images,
.project-row.expanded .scrollable-images img {
    cursor: grab;
}

.project-row.expanded.is-dragging {
    cursor: grabbing; /* active drag feedback */
}

.project-row.expanded.is-dragging .project-container,
.project-row.expanded.is-dragging .project-container > .project-title-col,
.project-row.expanded.is-dragging .project-box,
.project-row.expanded.is-dragging .project-box *,
.project-row.expanded.is-dragging .scrollable-images,
.project-row.expanded.is-dragging .scrollable-images img {
    cursor: grabbing;
}

/* Style the visible scrollbar for expanded rows */
.project-row.expanded::-webkit-scrollbar {
    height: 8px;
}
.project-row.expanded::-webkit-scrollbar-track {
    background: transparent;
}
.project-row.expanded::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 6px;
}


.project-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    scroll-snap-align: start;
}

.project-box {
    padding: 0;
    box-sizing: border-box;
    border: 0px solid #ddd;
    background-color: transparent;
}

.project-box.photos {
    flex: 0 0 auto;
    margin-right: -8px;
    line-height: 0;
}

.project-box.photos img {
    display: block;
    width: auto !important;
    height: 500px !important;
    object-fit: cover;
    /* cursor removed here so we can control it by row state */
}

.project-row.expanded .project-box.photos img,
.project-row.expanded .scrollable-images img {
    cursor: zoom-in;
}

.scrollable-images {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-left: 0px;
    line-height: 0;
    scrollbar-width: none; /* For Firefox - hidden by default when rows are collapsed */
    touch-action: pan-x pan-y; /* same as .project-row.expanded — must allow vertical panning or it blocks page scroll on mobile */
}

/* Hide scrollbars on the inner image strip by default; show when row is expanded */
.scrollable-images::-webkit-scrollbar {
    display: none; /* default: hidden */
}

.project-row.expanded .scrollable-images {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.18) transparent;
    padding-bottom: 8px;
}
.project-row.expanded .scrollable-images::-webkit-scrollbar {
    height: 8px;
}
.project-row.expanded .scrollable-images::-webkit-scrollbar-track {
    background: transparent;
}
.project-row.expanded .scrollable-images::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 6px;
}

.scrollable-images img {
    width: auto;
    height: 500px !important;
    object-fit: cover;
    cursor: pointer;
}

/* Closed rows: show smaller photos; expanded rows keep the full current size */
.project-row:not(.expanded) .project-box.photos img {
    height: 300px !important;
}

.fullscreen-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.fullscreen-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-out;
}

.project-box.title {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
    text-align: right;
    justify-content: flex-start;
    font-size: 1rem;
    font-weight: bold;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    padding-right: 0px;
    margin-top: -3px;
    line-height: 1.4;
    align-self: flex-start;
    width: 175px;
}

.project-box.stats {
    font-size: 0.875rem;
    color: #555;
    margin: 0;
    line-height: 1.4;
    max-width: 175px;
    text-align: right;
}

/* When a title's stats are split into two boxes (location, then time/school),
   this restores the visual gap the old <br><br> used to provide. Targets
   .stats2 directly since it's no longer a DOM-adjacent sibling of .stats1
   (.stats1 is nested inside .title-stack). Applied unconditionally so
   single-stats-box entries (no .stats1) get the same gap below the title
   that .stats2 would otherwise only get next to a .stats1 box. */
.title-stack + .stats2 {
    margin-top: 10px;
}

.project-star {
    color: #c9a227;
    font-size: 1em;
    margin-right: 0.25em;
}

.extra-text-box {
    font-family: Arial, sans-serif; /* Ensure consistency */
    color: #555; /* Match the existing text color */
    font-size: 0.875rem; /* Match the existing text size */
    line-height: 1.4; /* Match the existing line height */
    text-align: right;
    box-sizing: border-box;
    margin: 0;
    max-width: 175px;
    padding-top: 249px;
    font-style: italic;
}

.project-box.text-box {
    font-size: 0.875rem; /* Slightly smaller font size */
    line-height: 1.385; /* Improve readability */
    display: block; /* Use flexbox to align text inline */
    flex-direction: row; /* Ensure content flows inline */
    align-items: baseline; /* Align inline content to text baseline */
    padding: 0px; /* Keep padding */
    text-align: left; /* Align text properly */
    width: 300px; /* Dynamic width */
    height: 500px; /* Dynamic height */
    box-sizing: border-box;
    white-space: normal; /* Allow wrapping */
    border: 0;
    overflow-wrap: break-word;
    margin-top: -3px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.18) transparent;
}

.project-box.text-box::-webkit-scrollbar {
    width: 8px;
}
.project-box.text-box::-webkit-scrollbar-track {
    background: transparent;
}
.project-box.text-box::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 6px;
}

.project-box.text-box.secondary-text {
    /* they already inherit width/height from .project-box.text-box,
       but you can explicitly set or tweak here */
    width: 300px;
    height: 500px;
    align-self: flex-start; /* keep aligned with photos/top of row */
}

.first-project-text-stack {
    display: flex;
    flex-direction: column;
    width: 300px;
    gap: 0;
}

.project-row:not(.expanded) .first-project-text-stack {
    display: none !important;
}

.project-box.text-box.first-project-text-duplicate {
    width: 300px;
    height: 1.385em;
    min-height: 1.385em;
    max-height: 1.385em;
    line-height: 1.385;
    margin-top: -14px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
}

.project-box.text-box i {
    display: inline;
    font-style: italic;
    margin: 0;
    padding: 0;
    line-height: inherit;
}

img {
    -webkit-user-drag: none; /* WebKit-based browsers */
    user-select: none; /* Prevent text/image selection in modern browsers */
}

.project-container {
    flex-wrap: nowrap; /* Prevents unintended line breaks */
}

.project-row:not(.expanded) .project-box.text-box,
.project-row:not(.expanded) .scrollable-images {
    display: none !important;
}

.project-row.expanded .project-box.text-box {
    animation: row-content-fade-in 180ms ease-out;
}

.project-row.expanded .scrollable-images {
    display: flex !important;
    animation: row-content-fade-in 180ms ease-out;
}


@keyframes row-content-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 500px) {
    .hello .hello-full {
        display: none;
    }
    .hello .hello-compact {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        margin: 0 auto;
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 475px) {
    .blurry {
        min-height: 39px;
    }
}

@media (max-width: 800px) {
    /* Title/stats sit above, as a full-width box. Everything else (the
       row's content) keeps the exact same mechanism as the full-size page
       — a horizontally-scrolling strip with native touch scrolling — just
       narrower. All rows are expanded by default on mobile (see script8.js),
       so there's no accordion tap-to-open step. */
    .project-entry {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-bottom: 30px;
    }

    /* .title-stack (title + a leading location box, when present) and the
       time/school box are two independent flex siblings, top-aligned —
       each sized by its own content only. This avoids the row-spanning
       ambiguity that grid-template-areas had, where the right box's height
       could inflate the row the location box sat in and push it down. */
    .project-title-col {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        text-align: left;
    }

    .title-stack {
        flex: 1 1 auto;
        min-width: 0;
    }

    .project-box.title {
        width: auto;
        max-width: 100%;
        text-align: left;
    }

    .project-box.stats1 {
        width: 100%;
        max-width: 100%;
        text-align: left;
        margin-top: 0;
    }

    .project-box.stats2 {
        flex: 0 0 auto;
        width: auto;
        max-width: 50%;
        /* Overrides the desktop "+ .project-box.stats" gap rule, which has
           higher specificity and isn't scoped to desktop — without
           !important it would still push this box down on mobile. */
        margin-top: 0 !important;
        text-align: right;
    }

    .project-row-wrapper,
    .project-row {
        width: 100%;
    }

    /* The row's own height is set explicitly by JS (syncRowHeightToPhoto)
       to match the lead photo. Clip anything taller rather than letting it
       stretch the row — the description scrolls internally instead. */
    .project-row {
        overflow-y: hidden;
    }

    /* The first image leads (full width, sets the row's height); the
       description sits to its right as the next thing you scroll to,
       followed by the gallery. Visual order only — DOM order (and
       therefore desktop's layout) is untouched. */
    .project-container {
        width: 100%;
        height: 100%;
        align-items: stretch;
    }
    .project-box.photos {
        order: 0;
        flex: 0 0 100%;
        width: 100%;
        margin-right: 0;
    }
    .project-box.photos img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover;
    }
    /* This slide shrinks to the description's own capped width (300px)
       instead of staying full viewport width like the other slides — the
       only way to honor the 300px cap without leaving empty space next
       to it. */
    .first-project-text-stack {
        order: 1;
        flex: 0 0 auto;
        width: auto;
        max-width: 300px;
        height: 100%;
    }
    .project-box.text-box,
    .project-box.text-box.secondary-text {
        width: 100%;
        max-width: 300px;
        height: 100%;
        overflow-y: auto;
    }
    /* Unlike the first description, this one is a direct flex child of
       .project-container rather than being wrapped in
       .first-project-text-stack — it needs its own order/sizing to take
       its place in the scrollable row instead of falling outside it. */
    .project-box.text-box.secondary-text {
        order: 1;
        flex: 0 0 auto;
    }
    .scrollable-images {
        order: 2;
        flex: 0 0 auto;
        height: 100%;
    }
    .scrollable-images img {
        height: 100% !important;
        width: auto !important;
        object-fit: cover;
    }

    .scroll-arrow {
        display: none;
    }

    /* The arrows are hidden outright on mobile (not via their .visible
       class), so the right-arrow-hidden rule that normally shifts the
       counter to the edge never fires — it stays offset as if an arrow
       were still there. Pin it to the edge unconditionally here. */
    .image-counter {
        right: 10px !important;
    }

    /* The last regular project (right before the BONUS toggle) and the last
       project inside the BONUS group shouldn't carry the full between-
       projects gap forward into the space below them. */
    .project-entry:has(+ .extra-group),
    .extra-group > .project-entry:last-child {
        margin-bottom: 10px;
    }
}

.blurry {
    display: none;
}

/* Recycled Shed only, desktop row layout: pull the photo closer to its
   description. Horizontal-layout-only hack, so it's scoped out of the
   mobile column stack rather than left as an inline style. */
@media (min-width: 801px) {
    .shed-text-stack {
        margin-right: -120px;
    }
    .shed-photo {
        margin-left: -40px;
    }
}

/* Footer scrolls with the page until it reaches the top, then stays pinned there */
footer {
    position: -webkit-sticky; /* iOS Safari requires the prefix for sticky to work */
    position: sticky;
    top: 0;
    width: 100vw;
    margin-left: calc(50% - 50vw); /* full-bleed regardless of body's side padding */
    z-index: 999;
    text-align: center;
    font-size: 0.875rem;
    color: #000;
    padding-top: 5px;
    padding-bottom: 5px;
    margin-bottom: 10px;
    background: #fff;
}

/* Center when the viewport is wide enough */
@media (min-width: 801px) {
    .project-row:not(.open) {
        justify-content: center;
    }
    .project-entry:not(.expanded) {
        justify-content: center;
        transform: translateX(-97.5px);
    }

    /* When expanded, center the whole group (title/stats + content) as a
       unit — rather than centering inside the scrollable row, which fights
       with scroll/drag positioning. JS sets an exact pixel width here when
       the content fits (see updateRowOverflowState); CSS shrink-to-fit
       keywords can't be used because they can't measure through the row's
       overflow-x:scroll boundary, which left a stray few px of scroll. */
    .project-entry.expanded {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Subtle white fade on collapsed row photos on hover */
.project-row:not(.expanded) .project-box.photos {
    position: relative;
}
.project-row:not(.expanded) .project-box.photos::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0);
    transition: background-color 0.15s ease;
    pointer-events: none;
}
.project-row:not(.expanded) .project-box.photos:hover::after {
    background-color: rgba(255, 255, 255, 0.35);
}



/* Scroll indicators for expanded project rows */
.project-row-wrapper {
    position: relative;
    overflow-y: clip;
}

.project-entry.expanded .project-row-wrapper {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.scroll-arrow {
    position: absolute;
    top: 0;
    width: 40px;
    height: 500px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s ease;
    background: white;
}

.scroll-arrow.visible {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.scroll-arrow-left {
    left: 0;
}

.scroll-arrow-left::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 250px solid transparent;
    border-bottom: 250px solid transparent;
    border-right: 30px solid rgba(0, 0, 0, 0.1);
    transition: border-right-color 0.15s ease;
}

.scroll-arrow-left:hover::after {
    border-right-color: rgba(0, 0, 0, 0.18);
}

.scroll-arrow-right {
    right: 0;
}

.scroll-arrow-right::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 250px solid transparent;
    border-bottom: 250px solid transparent;
    border-left: 30px solid rgba(0, 0, 0, 0.1);
    transition: border-left-color 0.15s ease;
}

.scroll-arrow-right:hover::after {
    border-left-color: rgba(0, 0, 0, 0.18);
}

/* Image count / progress indicator for expanded project rows */
.image-counter {
    position: absolute;
    top: 10px;
    right: 50px;
    padding: 3px 9px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 0.75rem;
    line-height: 1.4;
    border-radius: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, right 0.15s ease;
    z-index: 11;
}

.image-counter.visible {
    opacity: 1;
}

/* Shift the counter toward the edge once the right arrow has hidden
   (e.g. scrolled to the end), so it doesn't leave a large empty gap. */
.scroll-arrow-right:not(.visible) ~ .image-counter {
    right: 10px;
}

/* "Extra" group: a collapsed entry hidden behind its own toggle */
.extra-toggle {
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    padding-bottom: 7px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.extra-toggle:hover {
    opacity: 0.6;
}

.extra-toggle::after {
    content: '▾';
    display: inline-block;
    margin-left: 6px;
    transition: transform 0.15s ease;
}

.extra-group.open .extra-toggle::after {
    transform: rotate(-180deg);
}

.extra-item {
    display: none;
}

.extra-group.open .extra-item {
    display: flex;
}


