/* ============================================================
   GT-America — Self-hosted custom font
   FONT FILES: Place .woff2, .woff, .ttf in /assets/fonts/
   Files expected:
     GT-America-Regular.woff2 / .woff / .ttf
     GT-America-Medium.woff2  / .woff / .ttf
   ============================================================ */

@font-face {
    font-family: 'GT-America';
    src: url('../fonts/GT-America-Regular.woff2') format('woff2'),
         url('../fonts/GT-America-Regular.woff')  format('woff'),
         url('../fonts/GT-America-Regular.ttf')   format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/*
 * GT-America Medium — TODO: add font files to /assets/fonts/
 * Expected: GT-America-Medium.woff2 / .woff / .ttf
 * Until then, weight 500 renders as Regular.
 *
@font-face {
    font-family: 'GT-America';
    src: url('../fonts/GT-America-Medium.woff2') format('woff2'),
         url('../fonts/GT-America-Medium.woff')  format('woff'),
         url('../fonts/GT-America-Medium.ttf')   format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
*/


/* ============================================================
   CSS Custom Properties
   ============================================================ */

:root {
    --color-black:      #000000;
    --color-white:      #ffffff;
    --color-grey:       #888888; /* Secondary / subdued text — check against design references */

    --font-primary:     'GT-America', -apple-system, BlinkMacSystemFont, sans-serif;

    --panel-width:      500px;
    --column-max-width: 560px;

    --transition-panel: 300ms ease-out;
    --transition-card:  600ms ease;
    --transition-arrow: 200ms ease;
}


/* ============================================================
   Reset & Base
   ============================================================ */

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

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-white);
    color: var(--color-black);
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    min-height: 100vh;
    overflow-x: hidden;
}

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

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

button {
    font-family: var(--font-primary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
}


/* ============================================================
   Panel Trigger Button
   Fixed to the left edge of the screen, always on top.
   Arrow direction reflects panel state (toggled via JS).
   ============================================================ */

.panel-trigger {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 400;
    color: var(--color-black);
    padding: 4px;
}

.trigger-arrow {
    display: inline-block;
    transition: transform var(--transition-arrow);
    font-feature-settings: 'ss03' 1;
}

/* Hide the left trigger when panel is open — close button inside panel takes over */
body.panel-open .panel-trigger {
    opacity: 0;
    pointer-events: none;
}


/* ============================================================
   Backdrop — two modes, swap by commenting one in/out
   ============================================================

   MODE A — Frosted glass (ACTIVE)
   backdrop-filter blurs + lightly tints the entire portfolio area.
   To switch to Mode B: comment out the Mode A block, uncomment Mode B.

   MODE B — White wash + filter blur
   Solid white overlay + CSS filter blur on the page wrapper.
   To switch to Mode A: comment out the Mode B block, uncomment Mode A.

   ============================================================ */

/* --- MODE B: White wash + filter blur (ACTIVE) --- */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.75);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-panel);
}

body.panel-open .backdrop {
    opacity: 1;
    pointer-events: all;
}

/*
--- MODE A: Frosted glass ---
.backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.25);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-panel);
}

body.panel-open .backdrop {
    opacity: 1;
    pointer-events: all;
}
*/


/* ============================================================
   Info Panel
   Slides in from the left edge.
   Desktop: var(--panel-width) wide (~300px)
   Mobile:  full viewport width
   ============================================================ */

.info-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--panel-width);
    height: 100vh;
    background-color: transparent;
    border: none;
    box-shadow: none;
    outline: none;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;

    /* Hidden off-screen to the left */
    transform: translateX(-100%);
    transition: transform var(--transition-panel);
}

body.panel-open .info-panel {
    transform: translateX(0);
}

/* -------- Panel Header (close button — uses same arrow as trigger) -------- */

.panel-header {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    padding: 20px 20px 0;
}

.panel-close {
    color: var(--color-black);
    display: inline-block;
    transition: transform var(--transition-arrow);
    font-feature-settings: 'ss03' 1;
}

.panel-close:hover {
    transform: translateX(-4px);
}

/* -------- Panel Body — flex column, fills remaining panel height -------- */

/* -------- Panel Body — flex column, fills remaining panel height -------- */

.panel-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Scrollable content area — unified grid so all rows share the same column widths */
.panel-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 0;
    overscroll-behavior: contain;

    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0 16px;
    align-content: start;
    align-items: start;
}

/* Each row dissolves into the parent grid — spacing handled by children */
.panel-row {
    display: contents;
}

/* -------- Panel label column -------- */

.panel-col-label {
    color: var(--color-black);
    padding-top: 1px;
    padding-bottom: 24px;
    white-space: nowrap;
}

/* -------- Panel content column -------- */

.panel-col-content {
    padding-bottom: 24px;
}

/* -------- Name (top of panel) -------- */

.panel-name {
    display: block;
}

/* -------- Experience -------- */

.panel-experience {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exp-entry {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exp-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.exp-company {
    color: var(--color-black);
}

.exp-dates {
    color: var(--color-grey);
    white-space: nowrap;
    flex-shrink: 0;
}

.exp-role {
    color: var(--color-grey);
}

/* -------- Contact -------- */

.panel-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-contact a {
    color: var(--color-black);
    display: inline-block;
}

.panel-contact a:hover {
    text-decoration: underline;
}

/* -------- More Things To Click — pinned footer outside the scroll area --------
   Always visible at the bottom of the panel on desktop.
   Column width is synced to the scroll grid via JS (syncFooterColumns in main.js).
   Falls back to max-content before JS runs.                                   -------- */

.panel-footer {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0 16px;
    padding: 8px 20px 0;
}

.more-things-list {
    display: flex;
    flex-direction: column;
}

.more-thing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: var(--color-black);
}

.more-thing-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.more-thing-title {
    color: var(--color-black);
}

.more-thing-sub {
    color: var(--color-grey);
}

.more-thing-arrow {
    display: inline-block;
    transition: transform var(--transition-arrow);
    flex-shrink: 0;
    margin-left: 8px;
    color: var(--color-black);
    font-feature-settings: 'ss03' 1;
}

.more-thing:hover .more-thing-arrow {
    transform: translateX(5px);
}


/* ============================================================
   Portfolio Column
   Centered, max-width, vertically scrollable
   ============================================================ */

/* Full-width wrapper receives the blur — avoids the white-halo artifact
   that occurs when blur is applied to a narrow centered column */
.page-blur-wrapper {
    transition: filter var(--transition-panel);
}

/* Mode A: comment the line below out, uncomment Mode A backdrop block above */
/* body.panel-open .page-blur-wrapper { filter: none; } */

/* Mode B: active */
body.panel-open .page-blur-wrapper { filter: blur(4px); }

.portfolio-column {
    max-width: var(--column-max-width);
    margin: 0 auto;
    padding: 48px 24px 80px;
}


/* ============================================================
   Project Card — Default State
   ============================================================ */

.project-card {
    margin-bottom: 36px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.project-card:last-child {
    margin-bottom: 0;
}

/* -------- Cover image -------- */

.card-cover {
    line-height: 0; /* Remove inline spacing below image */
    overflow: hidden;
}

.card-cover img {
    width: 100%;
    height: auto;
    display: block;
}

/* Placeholder shown when no cover image is uploaded */
.card-cover--placeholder .card-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #f0f0f0;
}

/* -------- Card meta (title + subtitle) -------- */

.card-meta {
    padding-top: 8px;
}

/* Title row: title + click-indicator arrow side by side */
.card-title-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.card-title {
    color: var(--color-black);
}

/* Underline title on hover anywhere on the card */
.project-card:hover .card-title {
    text-decoration: underline;
}

/* Hide header meta (title+subtitle) when card is expanded —
   they reappear in the two-column info row inside the card body */
.project-card.expanded .card-header .card-meta {
    display: none;
}

.card-subtitle {
    color: var(--color-grey);
    margin-top: 2px;
}


/* ============================================================
   Project Card — Expanded State
   max-height is set by JavaScript for smooth animation
   ============================================================ */

.card-body {
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--transition-card);
}

/* Gallery images in expanded view */
.card-gallery {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
}

.card-gallery img {
    width: 100%;
    height: auto;
    display: block;
}

/* Portrait pair — two portrait images side by side, same height, cropped to fit */
.card-gallery-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.card-gallery-pair img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center top;
    height: auto;
}

/* Two-column info row: [title + sub] | [description] — description is 2× wider */
.card-info-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0 24px;
    padding-top: 12px;
    padding-bottom: 12px;
    align-items: start;
}

.card-info-left {
    /* title + subtitle */
}

.card-description p {
    color: var(--color-black);
}

.card-description p + p {
    margin-top: 0.75em;
}

/* Mobile: stack the info row */
@media (max-width: 767px) {
    .card-info-row {
        grid-template-columns: 1fr;
        gap: 8px 0;
    }

    /* Always underline titles on mobile — indicates the card is tappable */
    .project-card .card-title {
        text-decoration: underline;
    }
}


/* ============================================================
   Error / utility
   ============================================================ */

.no-projects {
    color: var(--color-grey);
}

.no-projects a {
    text-decoration: underline;
}

.error-page {
    padding-top: 80px;
}

.error-page .card-subtitle {
    margin-top: 12px;
}

.error-page a:hover {
    text-decoration: underline;
}


/* ============================================================
   Desktop breakpoint — 768px+
   ============================================================ */

@media (min-width: 768px) {

    /* Portfolio column: 15% wider than base on desktop */
    .portfolio-column {
        max-width: 644px;
        padding: 60px 40px 100px;
    }

}


/* ============================================================
   Mobile — up to 767px
   ============================================================ */

@media (max-width: 767px) {

    /* Panel fills full screen on mobile */
    .info-panel {
        width: 100%;
    }

    /* On mobile, the column takes full width with smaller side padding */
    .portfolio-column {
        padding: 40px 20px 60px;
    }

    .panel-trigger {
        left: 16px;
        top: 16px;
    }

}
