/* =========================================================
   STUDIO SHUMO — SITE STYLESHEET
   The values below are documented in /style-guide:
   01-colour.md · 02-typography.md · 03-spacing-and-layout.md ·
   04-accessibility.md. Change a token here and every page follows.

   1.  Design tokens
   2.  Base
   3.  Typography
   4.  Layout & grid
   5.  Navigation & header
   6.  Components
   7.  Pages
   8.  Petal case study
   9.  Utilities
   10. Responsive overrides
========================================================= */


/* =========================================================
   1. DESIGN TOKENS
========================================================= */

:root {
    /* --- Colour: core palette (see 01-colour.md) --- */
    --color-ink: #040707;           /* primary text, dark surfaces */
    --color-paper: #F9F9F9;         /* page background, text on dark */
    --color-graphite: #676767;      /* secondary text, hover, active */
    --color-concrete: #CCCCCC;      /* borders, image placeholders */
    --color-white: #FFFFFF;         /* text blended over media */
    --color-mist: #EBEBEB;          /* light pill background (workflow steps) */

    /* --- Colour: transparent variants --- */
    --color-ink-66: rgba(4, 7, 7, 0.66);         /* project card overlay */
    --color-ink-75: rgba(4, 7, 7, 0.75);         /* mobile text-on-image panel */
    --color-ink-15: rgba(4, 7, 7, 0.15);         /* hairline divider */
    --color-paper-90: rgba(249, 249, 249, 0.9);  /* frosted mobile sub-nav */
    --color-paper-70: rgba(249, 249, 249, 0.7);  /* photo credits on images */
    --color-scrim: rgba(0, 0, 0, 0.85);          /* Petal nav spotlight */

    /* --- Colour: semantic roles --- */
    --color-text: var(--color-ink);
    --color-text-muted: var(--color-graphite);
    --color-text-inverse: var(--color-paper);
    --color-bg: var(--color-paper);
    --color-bg-inverse: var(--color-ink);
    --color-surface-muted: var(--color-concrete);
    --color-border: var(--color-concrete);
    --color-border-strong: var(--color-ink);
    --color-hover: var(--color-graphite);

    /* --- Typography (see 02-typography.md) --- */
    --font-sans: "Montserrat", sans-serif;
    --font-alt: "Montserrat Alternates", sans-serif;

    --fw-extralight: 200;
    --fw-light: 300;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 900;

    --fs-display-xl: 12rem;      /* 144pt · 192px */
    --fs-display-l: 10rem;       /* 120pt · 160px */
    --fs-display-m: 4rem;        /* 48pt  · 64px  */
    --fs-headline: 3.3333rem;    /* 40pt  · 53.33px */
    --fs-title: 2rem;            /* 24pt  · 32px  */
    --fs-nav: 1.8333rem;         /* 22pt  · 29.33px */
    --fs-subtitle: 1.5rem;       /* 18pt  · 24px  */
    --fs-label: 1.1667rem;       /* 14pt  · 18.67px */
    --fs-body: 1rem;             /* 12pt  · 16px  */
    --fs-small: 0.9167rem;       /* 11pt  · 14.67px */
    --fs-xs: 0.75rem;            /* 9pt   · 12px  */
    --fs-micro: 0.6667rem;       /* 8pt   · 10.67px */

    --lh-solid: 1;
    --lh-tight: 1.1;
    --lh-heading: 1.2;
    --lh-relaxed: 1.5;
    --lh-body: 1.6;

    --ls-caps: 0.05em;           /* tracking for uppercase labels */

    /* --- Spacing: 8px base unit (see 03-spacing-and-layout.md) --- */
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
    --space-40: 40px;
    --space-48: 48px;
    --space-56: 56px;
    --space-64: 64px;
    --space-80: 80px;
    --space-120: 120px;
    --space-160: 160px;

    /* --- Grid (desktop; tablet & mobile values in section 10) --- */
    --grid-rows: 8px;            /* base unit for vertical rhythm */
    --grid-row-gutter: 8px;
    --grid-columns: 15;
    --grid-margin: 80px;
    --grid-col-gutter: 32px;
    --page-top: calc(var(--grid-rows) * 7 + var(--grid-row-gutter));   /* 64px */

    /* --- Shape & elevation --- */
    --radius-xs: 2px;
    --radius-s: 4px;
    --radius-m: 12px;
    --radius-pill: 999px;
    --radius-round: 50%;
    --shadow-float: 0 4px 20px rgba(0, 0, 0, 0.08);

    /* --- Sizing --- */
    --size-logo: 60px;           /* logo and circular controls */
    --size-icon: 32px;

    /* --- Motion --- */
    --duration-fast: 0.2s;
    --duration-base: 0.3s;
    --duration-slow: 0.6s;
    --duration-slower: 0.9s;
    --ease-out: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out: cubic-bezier(0.7, 0, 0.3, 1);
    --ease-spotlight: cubic-bezier(0.25, 1, 0.2, 1);

    /* --- Layers --- */
    --z-nav: 300;
    --z-logo: 301;
    --z-subnav: 500;
    --z-float: 999;
    --z-overlay: 1000;
}


/* =========================================================
   2. BASE
========================================================= */

/* <body> is the scroll container; html never scrolls. */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--color-bg);
}

body.scrollable-page {
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
}

::selection {
    color: var(--color-paper);
    background: var(--color-graphite);
}

/* Keyboard focus: an ink ring on a paper halo stays visible on light,
   dark and photographic backgrounds (see 04-accessibility.md). */
:focus-visible {
    outline: 2px solid var(--color-ink);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--color-paper);
}

/* Elements focused by script (skip-link target) need no ring */
[tabindex="-1"]:focus {
    outline: none;
    box-shadow: none;
}

/* Hidden visually, still read by screen readers */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* First focusable element on every page; slides in when focused */
.skip-link {
    position: fixed;
    top: var(--space-16);
    left: var(--space-16);
    z-index: calc(var(--z-overlay) + 1);
    padding: var(--space-12) var(--space-24);
    background: var(--color-bg-inverse);
    color: var(--color-text-inverse);
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    font-size: var(--fs-body);
    border-radius: var(--radius-s);
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

/* Media fade-in on load */
img, video {
    opacity: 0;
    animation: imageFadeIn var(--duration-slow) ease-out forwards;
}

.standalone-logo,
.mobile-logo,
.search-icon,
.close-btn svg,
.mobile-menu-icon svg {
    opacity: 1;
    animation: none !important;
}

@keyframes imageFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}


/* =========================================================
   3. TYPOGRAPHY
========================================================= */

/* Page titles: ABOUT, PROJECTS, project names.
   192px on wide screens, scaling down so the widest title word
   (BLOOMING ≈ 5.95 × font size) never runs off the screen. */
.title-text {
    font-family: var(--font-sans);
    font-weight: var(--fw-black);
    font-size: min(var(--fs-display-xl), 13.4vw - 16px);
    line-height: var(--lh-solid);
    margin: 0;
    text-transform: uppercase;
    color: var(--color-text);
}

.download-link {
    font-family: var(--font-sans);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    text-decoration: underline;
    transition: opacity var(--duration-base) ease;
}

/* Project page text styles */
.proj-headline {
    font-family: var(--font-sans);
    font-weight: var(--fw-light);
    font-size: var(--fs-headline);
    line-height: var(--lh-tight);
    color: var(--color-text);
    margin: 0;
}

.proj-h2 {
    font-family: var(--font-sans);
    font-weight: var(--fw-black);
    font-size: var(--fs-title);
    margin: 0 0 var(--space-16) 0;
    color: var(--color-text);
    line-height: var(--lh-heading);
}

.proj-h3 {
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    font-size: var(--fs-subtitle);
    margin: 0 0 var(--space-24) 0;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: var(--ls-caps);
}

.proj-p {
    font-family: var(--font-sans);
    font-weight: var(--fw-regular);
    font-size: var(--fs-body);
    margin: 0;
    color: var(--color-text);
    line-height: var(--lh-body);
}

.proj-caption {
    font-family: var(--font-sans);
    font-weight: var(--fw-medium);
    font-size: var(--fs-body);
    color: var(--color-text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: var(--ls-caps);
    text-align: right;
}

/* CV-style list (date left, description right) */
.list-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-24);
    margin-bottom: calc(var(--grid-rows) * 2);
    align-items: baseline;
}

.list-date,
.list-desc {
    font-family: var(--font-sans);
    font-weight: var(--fw-regular);
    font-size: var(--fs-body);
    line-height: var(--lh-relaxed);
    color: var(--color-text);
    margin: 0;
}

.list-date {
    width: 280px;
    flex-shrink: 0;
    text-align: left;
    font-weight: var(--fw-semibold);
}

.list-desc {
    flex-grow: 1;
    text-align: right;
}


/* =========================================================
   4. LAYOUT & GRID
   15 columns on desktop and tablet, 5 on mobile.
   .col-{start}-{end} spans columns start…end inclusive.
========================================================= */

.page-grid-container {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    padding: var(--page-top) var(--grid-margin) calc(var(--grid-margin) * 4);
}

/* Start column 1 */
.col-1-1    { grid-column: 1 / 2; }
.col-1-2    { grid-column: 1 / 3; }
.col-1-3    { grid-column: 1 / 4; }
.col-1-4    { grid-column: 1 / 5; }
.col-1-5    { grid-column: 1 / 6; }
.col-1-6    { grid-column: 1 / 7; }
.col-1-7    { grid-column: 1 / 8; }
.col-1-8    { grid-column: 1 / 9; }
.col-1-9    { grid-column: 1 / 10; }
.col-1-10   { grid-column: 1 / 11; }
.col-1-11   { grid-column: 1 / 12; }
.col-1-12   { grid-column: 1 / 13; }
.col-1-13   { grid-column: 1 / 14; }
.col-1-14   { grid-column: 1 / 15; }
.col-1-15   { grid-column: 1 / -1; }

/* Start column 2 */
.col-2-2    { grid-column: 2 / 3; }
.col-2-3    { grid-column: 2 / 4; }
.col-2-4    { grid-column: 2 / 5; }
.col-2-5    { grid-column: 2 / 6; }
.col-2-6    { grid-column: 2 / 7; }
.col-2-7    { grid-column: 2 / 8; }
.col-2-8    { grid-column: 2 / 9; }
.col-2-9    { grid-column: 2 / 10; }
.col-2-10   { grid-column: 2 / 11; }
.col-2-11   { grid-column: 2 / 12; }
.col-2-12   { grid-column: 2 / 13; }
.col-2-13   { grid-column: 2 / 14; }
.col-2-14   { grid-column: 2 / 15; }
.col-2-15   { grid-column: 2 / -1; }

/* Start column 3 */
.col-3-3    { grid-column: 3 / 4; }
.col-3-4    { grid-column: 3 / 5; }
.col-3-5    { grid-column: 3 / 6; }
.col-3-6    { grid-column: 3 / 7; }
.col-3-7    { grid-column: 3 / 8; }
.col-3-8    { grid-column: 3 / 9; }
.col-3-9    { grid-column: 3 / 10; }
.col-3-10   { grid-column: 3 / 11; }
.col-3-11   { grid-column: 3 / 12; }
.col-3-12   { grid-column: 3 / 13; }
.col-3-13   { grid-column: 3 / 14; }
.col-3-14   { grid-column: 3 / 15; }
.col-3-15   { grid-column: 3 / -1; }

/* Start column 4 */
.col-4-4    { grid-column: 4 / 5; }
.col-4-5    { grid-column: 4 / 6; }
.col-4-6    { grid-column: 4 / 7; }
.col-4-7    { grid-column: 4 / 8; }
.col-4-8    { grid-column: 4 / 9; }
.col-4-9    { grid-column: 4 / 10; }
.col-4-10   { grid-column: 4 / 11; }
.col-4-11   { grid-column: 4 / 12; }
.col-4-12   { grid-column: 4 / 13; }
.col-4-13   { grid-column: 4 / 14; }
.col-4-14   { grid-column: 4 / 15; }
.col-4-15   { grid-column: 4 / -1; }

/* Start column 5 */
.col-5-5    { grid-column: 5 / 6; }
.col-5-6    { grid-column: 5 / 7; }
.col-5-7    { grid-column: 5 / 8; }
.col-5-8    { grid-column: 5 / 9; }
.col-5-9    { grid-column: 5 / 10; }
.col-5-10   { grid-column: 5 / 11; }
.col-5-11   { grid-column: 5 / 12; }
.col-5-12   { grid-column: 5 / 13; }
.col-5-13   { grid-column: 5 / 14; }
.col-5-14   { grid-column: 5 / 15; }
.col-5-15   { grid-column: 5 / -1; }

/* Start column 6 */
.col-6-6    { grid-column: 6 / 7; }
.col-6-7    { grid-column: 6 / 8; }
.col-6-8    { grid-column: 6 / 9; }
.col-6-9    { grid-column: 6 / 10; }
.col-6-10   { grid-column: 6 / 11; }
.col-6-11   { grid-column: 6 / 12; }
.col-6-12   { grid-column: 6 / 13; }
.col-6-13   { grid-column: 6 / 14; }
.col-6-14   { grid-column: 6 / 15; }
.col-6-15   { grid-column: 6 / -1; }

/* Start column 7 */
.col-7-7    { grid-column: 7 / 8; }
.col-7-8    { grid-column: 7 / 9; }
.col-7-9    { grid-column: 7 / 10; }
.col-7-10   { grid-column: 7 / 11; }
.col-7-11   { grid-column: 7 / 12; }
.col-7-12   { grid-column: 7 / 13; }
.col-7-13   { grid-column: 7 / 14; }
.col-7-14   { grid-column: 7 / 15; }
.col-7-15   { grid-column: 7 / -1; }

/* Start column 8 */
.col-8-8    { grid-column: 8 / 9; }
.col-8-9    { grid-column: 8 / 10; }
.col-8-10   { grid-column: 8 / 11; }
.col-8-11   { grid-column: 8 / 12; }
.col-8-12   { grid-column: 8 / 13; }
.col-8-13   { grid-column: 8 / 14; }
.col-8-14   { grid-column: 8 / 15; }
.col-8-15   { grid-column: 8 / -1; }

/* Start column 9 */
.col-9-9    { grid-column: 9 / 10; }
.col-9-10   { grid-column: 9 / 11; }
.col-9-11   { grid-column: 9 / 12; }
.col-9-12   { grid-column: 9 / 13; }
.col-9-13   { grid-column: 9 / 14; }
.col-9-14   { grid-column: 9 / 15; }
.col-9-15   { grid-column: 9 / -1; }

/* Start column 10 */
.col-10-10  { grid-column: 10 / 11; }
.col-10-11  { grid-column: 10 / 12; }
.col-10-12  { grid-column: 10 / 13; }
.col-10-13  { grid-column: 10 / 14; }
.col-10-14  { grid-column: 10 / 15; }
.col-10-15  { grid-column: 10 / -1; }

/* Start column 11 */
.col-11-11  { grid-column: 11 / 12; }
.col-11-12  { grid-column: 11 / 13; }
.col-11-13  { grid-column: 11 / 14; }
.col-11-14  { grid-column: 11 / 15; }
.col-11-15  { grid-column: 11 / -1; }

/* Start column 12 */
.col-12-12  { grid-column: 12 / 13; }
.col-12-13  { grid-column: 12 / 14; }
.col-12-14  { grid-column: 12 / 15; }
.col-12-15  { grid-column: 12 / -1; }

/* Start column 13 */
.col-13-13  { grid-column: 13 / 14; }
.col-13-14  { grid-column: 13 / 15; }
.col-13-15  { grid-column: 13 / -1; }

/* Start column 14 */
.col-14-14  { grid-column: 14 / 15; }
.col-14-15  { grid-column: 14 / -1; }

/* Start column 15 */
.col-15-15  { grid-column: 15 / -1; }

/* Single-column helpers used by the gallery arrows */
.col-3  { grid-column: 3 / 4; }
.col-13 { grid-column: 13 / 14; }

/* Image aspect ratios */
.locked-ratio {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.locked-ratio-vert {
    width: auto;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.locked-ratio-16-9 {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.locked-ratio-1-1 {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}


/* =========================================================
   5. NAVIGATION & HEADER
========================================================= */

.standalone-logo {
    position: fixed;
    top: var(--page-top);
    left: var(--grid-margin);
    width: var(--size-logo);
    height: var(--size-logo);
    object-fit: contain;
    z-index: var(--z-logo);
}

/* Desktop & tablet navigation (left rail) */
.top-nav {
    position: fixed;
    top: calc(var(--grid-rows) * 27 + var(--grid-row-gutter));   /* 224px */
    left: var(--grid-margin);
    z-index: var(--z-nav);
    display: flex;
    flex-direction: column;
    gap: calc(var(--grid-rows) * 2);
    mix-blend-mode: difference;
}

.top-nav a {
    text-decoration: none;
    color: var(--color-white);
    font-family: var(--font-sans);
    font-weight: var(--fw-extralight);
    font-size: var(--fs-nav);
    transition: opacity var(--duration-base) ease;
    width: max-content;
}

.top-nav a:hover,
.top-nav a[aria-current] {
    color: var(--color-hover);
}

.top-nav :focus-visible {
    outline-color: var(--color-white);
    box-shadow: none;
}

/* Search */
.search-container {
    display: flex;
    align-items: center;
    border: 1px solid var(--color-white);
    border-radius: var(--radius-pill);
    padding: 2px var(--space-8);
    margin-top: calc(var(--grid-rows));
    width: 140px;
    justify-content: space-between;
}

.search-container input {
    font-family: var(--font-sans);
    background: transparent;
    border: none;
    color: var(--color-white);
    outline: none;
    width: 80%;
    font-size: 1rem;
}

.search-container .search-icon {
    width: 14px;
    height: 14px;
    stroke: var(--color-white);
}

.search-container:focus-within {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

/* Mobile navigation */
.mobile-menu-icon,
.close-btn {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
}

/* Top-left corner, above the page title, so it never covers text */
.mobile-menu-icon {
    display: none;
    position: fixed;
    top: var(--grid-margin);
    left: var(--grid-margin);
    width: var(--size-logo);
    height: 38px;
    z-index: var(--z-nav);
    cursor: pointer;
    color: var(--color-white);
    mix-blend-mode: difference;
}

.mobile-nav-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--color-bg-inverse);
    z-index: var(--z-overlay);
    display: none;
    padding: var(--page-top) var(--grid-margin);
}

.mobile-nav-overlay.open {
    display: block;
}

.mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    row-gap: calc(var(--grid-rows) * 4);
    align-content: start;
}

.mobile-logo-wrapper {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: calc(var(--grid-rows) * 2);
    display: flex;
    justify-content: flex-start;
}

.mobile-logo {
    width: var(--size-logo);
    height: var(--size-logo);
    object-fit: contain;
}

/* Sits exactly where the menu button was, so open and close share a spot */
.close-btn {
    position: absolute;
    top: var(--grid-margin);
    left: var(--grid-margin);
    width: var(--size-logo);
    height: 38px;
    cursor: pointer;
    color: var(--color-paper);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-overlay :focus-visible {
    outline-color: var(--color-paper);
    box-shadow: none;
}

.mobile-search-wrapper {
    grid-column: 2 / -1;
    grid-row: 2;
    background-color: var(--color-paper);
    border-radius: var(--radius-pill);
    padding: 0 var(--space-12);
    height: 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.mobile-search-wrapper input {
    border: none;
    background: transparent;
    outline: none;
    width: 80%;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--color-text);
}

.mobile-search-wrapper svg {
    color: var(--color-ink);
}

.mobile-search-wrapper:focus-within {
    outline: 2px solid var(--color-paper);
    outline-offset: 2px;
}

.mobile-links-container {
    grid-column: 2 / -1;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: calc(var(--grid-rows) * 4);
    margin-top: calc(var(--grid-rows) * 3);
}

.mobile-links-container a {
    color: var(--color-text-inverse);
    font-family: var(--font-sans);
    font-weight: var(--fw-light);
    font-size: var(--fs-title) !important;
    text-decoration: none;
    letter-spacing: 1px;
    line-height: var(--lh-tight);
}

.mobile-links-container a[aria-current] {
    color: var(--color-text-muted);
}


/* =========================================================
   6. COMPONENTS
========================================================= */

/* --- Back to top button --- */
.back-to-top {
    position: fixed;
    bottom: var(--space-48);
    left: var(--grid-margin);
    z-index: var(--z-float);
    width: var(--size-logo);
    height: var(--size-logo);
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    color: var(--color-text);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity var(--duration-base), visibility var(--duration-base),
                transform var(--duration-base) ease, color var(--duration-base) ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.back-to-top:hover {
    color: var(--color-hover);
    transform: translateY(-5px);
}

.back-to-top svg {
    width: var(--size-icon);
    height: var(--size-icon);
    display: block;
}

/* --- Gallery slider --- */
.gallery-view-port {
    grid-column: 4 / 13;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.slider-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    display: block !important;
    pointer-events: none;
    transition: transform var(--duration-slower) var(--ease-in-out),
                opacity var(--duration-slower) ease;
    z-index: 1;
}

.slider-img.active {
    opacity: 1;
    transform: translateX(0) scale(1);
    z-index: 10;
    pointer-events: auto;
}

.slider-img.exit {
    opacity: 0;
    transform: scale(0.85);
    z-index: 5;
}

.slider-img.slide-right { transform: translateX(100%); }
.slider-img.slide-left  { transform: translateX(-100%); }

.slider-nav-petal {
    width: var(--size-logo);
    height: var(--size-logo);
    border-radius: var(--radius-round);
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-base) ease;
    padding: 0;
    position: relative;
    z-index: 50;
}

.slider-nav-petal:hover {
    background: var(--color-bg-inverse);
    color: var(--color-text-inverse);
    border-color: var(--color-border-strong);
}

.slider-nav-petal svg {
    width: var(--size-icon);
    height: var(--size-icon);
    position: relative;
    top: 1px;
}

#prevBtn svg { left: -1px; }
#nextBtn svg { right: -1px; }

/* One chevron (arrow-up) rotated to point each way */
.slider-nav-petal .icon-prev { transform: rotate(-90deg); }
.slider-nav-petal .icon-next { transform: rotate(90deg); }

#galleryCounter {
    grid-column: 4 / 13;
    text-align: center;
    margin-top: var(--space-24);
    position: relative;
    z-index: 50;
}

/* --- Buttons --- */
.download-btn {
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    font-size: var(--fs-body);
    color: var(--color-text-inverse);
    background-color: var(--color-bg-inverse);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: var(--radius-s);
    transition: background-color var(--duration-base) ease, transform var(--duration-fast) ease;
}

.download-btn:hover {
    background-color: var(--color-hover);
    transform: translateY(-2px);
}

/* About page button rows: primary (filled) downloads, secondary
   (outlined) contact links */
.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
    margin-top: var(--space-48);
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
}

.about-actions .download-btn,
.about-actions .download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--duration-base) var(--ease-out);
    box-sizing: border-box;
}

.about-actions .download-btn {
    padding: var(--space-12) var(--space-24);
    transition: all var(--duration-base) ease;
}

.about-actions .download-link {
    border: 1px solid var(--color-border-strong);
    padding: 10px 20px;
    border-radius: var(--radius-s);
    font-weight: var(--fw-bold);
    font-size: var(--fs-small);
    min-width: 100px;
}

/* Small file-type tag inside a button: RESUME PDF */
.btn-tag {
    font-size: var(--fs-xs);
    font-weight: var(--fw-light);
    opacity: 0.8;
    margin-left: var(--space-4);
}

.about-actions .download-btn:hover {
    background-color: var(--color-hover) !important;
    border-color: var(--color-hover) !important;
    transform: none !important;
}

.about-actions .download-link:hover {
    background-color: var(--color-hover) !important;
    border-color: var(--color-hover) !important;
    color: var(--color-text-inverse) !important;
    transform: none !important;
}

/* --- Project card (Projects hub) --- */
.project-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    text-decoration: none;
    background-color: var(--color-surface-muted);
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-ink-66);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--duration-base) ease-in-out;
    padding: 20px;
    box-sizing: border-box;
    text-align: center;
}

.project-item:hover .project-overlay,
.project-item:focus-visible .project-overlay {
    opacity: 1;
}

.project-overlay h2 {
    font-family: var(--font-sans);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-title);
    color: var(--color-text-inverse);
    margin: 0 0 var(--space-8) 0;
    text-transform: uppercase;
}

.project-overlay p {
    font-family: var(--font-sans);
    font-weight: var(--fw-light);
    font-size: var(--fs-body);
    color: var(--color-text-inverse);
    margin: 0;
}

/* --- Analysis table with score bars --- */
.analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans);
    color: var(--color-text);
}

.analysis-table th {
    text-align: left;
    padding: var(--space-16) 0;
    border-bottom: 2px solid var(--color-border-strong);
    font-weight: var(--fw-bold);
    font-size: var(--fs-label);
    text-transform: uppercase;
}

.analysis-table td {
    padding: var(--space-24) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--fs-body);
}

/* Keep a gap between columns when the table is narrow */
.analysis-table th:not(:last-child),
.analysis-table td:not(:last-child) {
    padding-right: var(--space-16);
}

.bar-cell {
    padding-right: var(--space-40) !important;
    padding-left: 0 !important;
}

.score-bar {
    height: 18px;
    background-color: var(--color-graphite);
    border-radius: var(--radius-xs);
    transition: width 1s var(--ease-out);
}

tr:has(.text-bold) .score-bar {
    background-color: var(--color-ink);
}


/* =========================================================
   7. PAGES
========================================================= */

/* --- Home --- */
.image-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.video-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.video-link.previous {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    transition: none;
}

.video-link.active {
    opacity: 1;
    visibility: visible;
    z-index: 3;
}

.video-link video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-graphic {
    position: absolute;
    bottom: 10%;
    right: 40px;
    width: 600px;
    height: auto;
    z-index: 10;
    pointer-events: none;
    mix-blend-mode: difference;
}

/* --- Page header (About, Projects, Artwork, Contact) --- */
.about-header {
    grid-column: 4 / -1;
    margin-top: 0;
}

/* --- Projects hub & 404 --- */
.projects-container {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    padding: var(--page-top) var(--grid-margin) var(--space-56);
}

.projects-header {
    grid-column: 4 / -1;
    margin-bottom: var(--space-56);
}

.projects-grid-wrapper {
    grid-column: 4 / -1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--grid-col-gutter);
    row-gap: var(--space-56);
}

/* --- Project detail page --- */
.hero-section {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.hero-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* border-box keeps the overlay's columns aligned with the page grid below */
.hero-grid-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    box-sizing: border-box;
    z-index: 2;
    background: transparent;
    pointer-events: none;
    mix-blend-mode: difference;
}

.hero-grid-overlay .about-header {
    grid-column: 4 / -1;
}

.hero-grid-overlay .title-text {
    color: var(--color-white) !important;
    mix-blend-mode: normal;
}

.project-content-grid {
    padding-top: calc(var(--grid-rows) * 12);
    padding-bottom: var(--space-120);
    row-gap: var(--space-56);
    align-items: start;
}

.proj-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin-bottom: var(--space-56);
}

.proj-text-box {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-56);
}

.proj-image-group {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-56);
}

.proj-image-group .proj-img {
    margin-bottom: var(--space-16);
}

.gallery-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    row-gap: var(--grid-col-gutter);
}

.gallery-grid .proj-img {
    margin-bottom: 0;
}

/* Four-up thumbnail grid (Undull user testing) */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-col-gutter);
}

ul.proj-p { padding-left: 20px; }

/* Artwork page: two stacked columns of works */
.artwork-column {
    display: flex;
    flex-direction: column;
}

/* Full-bleed image section */
.full-screen-section {
    width: 100vw;
    height: 100vh;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    position: relative;
    overflow: hidden;
    background: var(--color-bg);
}

.full-screen-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Full-screen "Final Renders" gallery */
.final-renders-hero-section {
    height: 100vh;
    width: 100vw;
    padding: var(--space-48) var(--grid-margin) var(--space-48) var(--grid-margin) !important;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    overflow: hidden;
}

.final-renders-hero-section .proj-headline {
    grid-row: 1;
    align-self: end;
    margin-bottom: var(--space-48) !important;
    margin-top: 0 !important;
    grid-column: 4 / -1;
}

.final-renders-hero-section .gallery-view-port,
.final-renders-hero-section .col-3,
.final-renders-hero-section .col-13 {
    grid-row: 2;
    align-self: center;
}

.final-renders-hero-section #galleryCounter {
    grid-row: 3;
    align-self: start;
    margin-top: var(--space-24) !important;
}

/* Scroll-to-play image sequence (Flora) */
.scroll-sequence-container {
    position: relative;
    width: 100%;
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
}

#scroll-video-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.canvas-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), 1fr);
    column-gap: var(--grid-col-gutter);
    padding: 0 var(--grid-margin);
    align-items: flex-start;
    padding-top: var(--space-80);
    box-sizing: border-box;
    pointer-events: none;
}

/* Text panel over the full-bleed exploded render (Flora) */
.exploded-text-overlay {
    position: absolute;
    top: 50%;
    right: var(--grid-margin);
    transform: translateY(-50%);
    max-width: 450px;
    text-align: right;
    pointer-events: none;
    z-index: 10;
}

.scroll-trigger {
    height: 300vh;
}

/* --- Contact --- */
.contact-wrapper {
    grid-column: 4 / -1;
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    margin-top: calc(var(--grid-rows) * 8);
}

.contact-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    text-decoration: none;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--space-24);
    padding-top: var(--space-24);
    transition: border-color var(--duration-base) ease;
}

.contact-link:hover {
    border-color: var(--color-border-strong);
}
.contact-link:hover .contact-label {
    color: var(--color-text);
}
.contact-link:hover .contact-value {
    color: var(--color-text-muted);
}

.contact-label {
    font-family: var(--font-sans);
    font-weight: var(--fw-light);
    font-size: var(--fs-title);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: var(--ls-caps);
    transition: color var(--duration-base) ease;
}

.contact-value {
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    font-size: var(--fs-title);
    color: var(--color-text);
    text-align: right;
    transition: color var(--duration-base) ease;
}

.resume-section {
    cursor: default;
    border-color: var(--color-border-strong);
}

.resume-actions {
    display: flex;
    align-items: center;
    gap: var(--space-16);
}

/* --- 404 --- */
.error-project-link {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: var(--grid-col-gutter);
    text-decoration: none;
    align-items: center;
}

.error-image-col {
    grid-column: 1 / 7;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background-color: var(--color-surface-muted);
}

.error-image-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.error-text-col {
    grid-column: 7 / -1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 0;
}

.continue-text {
    font-family: var(--font-sans);
    font-weight: var(--fw-light);
    font-size: var(--fs-subtitle);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-16) 0;
    text-transform: uppercase;
    letter-spacing: var(--ls-caps);
}

.error-project-title {
    font-family: var(--font-sans);
    font-weight: var(--fw-black);
    font-size: var(--fs-display-m);
    color: var(--color-text);
    margin: 0 0 var(--space-16) 0;
    text-transform: uppercase;
    line-height: var(--lh-solid);
    transition: color var(--duration-base) ease;
}

.error-project-desc {
    font-family: var(--font-sans);
    font-weight: var(--fw-regular);
    font-size: var(--fs-subtitle);
    color: var(--color-text);
    margin: 0;
    line-height: var(--lh-relaxed);
}

.error-project-link:hover .error-project-title {
    color: var(--color-hover);
}
.error-project-link:hover .error-image-col img {
    opacity: 0.85;
}


/* =========================================================
   8. PETAL CASE STUDY
   petal.html, petal-concept.html, petal-refinement.html,
   petal-final.html
========================================================= */

/* Landing page (no scroll, video background) */
.petal-landing-body {
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background-color: transparent;
}

.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.landing-click-area {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    text-decoration: none;
    z-index: 10;
    cursor: pointer;
}

.landing-click-area .title-text {
    color: var(--color-text);
}

/* Full-height grid that sits the PETAL title on the bottom margin */
.landing-title-grid {
    height: 100vh;
    box-sizing: border-box;
    align-items: flex-end;
    padding-bottom: var(--page-top);
}

.logo-scrollable {
    position: absolute;
    top: var(--page-top);
    left: var(--grid-margin);
    width: var(--size-logo);
    z-index: var(--z-logo);
}

.hero-text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    align-items: flex-end;
    padding-bottom: var(--page-top);
    z-index: 2;
    pointer-events: none;
}

/* Sub-navigation (right side, MTA line icons) */
.petal-sub-nav {
    position: fixed;
    top: calc(var(--grid-rows) * 24 + var(--grid-row-gutter));   /* 200px */
    right: var(--grid-margin);
    width: 280px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0px;
    z-index: var(--z-subnav);
}

.petal-nav-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-16);
    text-decoration: none;
    transition: opacity var(--duration-base) ease;
    position: relative;
    z-index: 10;
    padding: var(--space-16) 0 var(--space-16) 60px;
    width: 100%;
    box-sizing: border-box;
}

.petal-nav-text {
    font-family: var(--font-sans);
    font-weight: var(--fw-regular);
    font-size: var(--fs-subtitle);
    text-transform: uppercase;
    white-space: nowrap;
    text-align: right;
}

.mta-icon {
    width: var(--size-icon);
    height: var(--size-icon);
    object-fit: contain;
    transition: filter var(--duration-base) ease;
}

.nav-active .petal-nav-text { color: var(--color-text); }
.nav-inactive .petal-nav-text { color: var(--color-text-muted); }
.nav-inactive .mta-icon { filter: grayscale(100%) contrast(200%); }

.petal-nav-item:hover .petal-nav-text {
    color: var(--color-white) !important;
}

.petal-nav-item:hover .mta-icon {
    filter: none !important;
}

/* Sliding spotlight behind the sub-nav (element created by JS) */
.nav-spotlight {
    position: absolute;
    width: 2000px;
    height: 2000px;
    right: -984px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: var(--radius-round);
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0);
    z-index: -1;
    pointer-events: none;
    transition: top 0.4s var(--ease-out),
                width var(--duration-slow) var(--ease-spotlight),
                height var(--duration-slow) var(--ease-spotlight),
                right var(--duration-slow) var(--ease-spotlight),
                box-shadow var(--duration-slow) var(--ease-spotlight);
}

.petal-sub-nav.is-hovered .nav-spotlight {
    width: 50px;
    height: 50px;
    right: -9px;
    box-shadow: 0 0 0 4000px var(--color-scrim);
}

/* Floating action pill (back / back-to-top) */
.floating-action-pill {
    position: fixed;
    bottom: var(--space-48);
    right: var(--grid-margin);
    z-index: var(--z-float);
    height: var(--size-logo);
    width: var(--size-logo);
    background-color: rgba(4, 7, 7, 0);
    border-radius: var(--radius-pill);
    overflow: hidden;
    transition: all 0.4s var(--ease-out);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.floating-action-pill.scrolled:hover {
    width: 120px;
    background-color: var(--color-bg-inverse);
}

.pill-prev-btn {
    position: absolute;
    right: 60px;
    top: 0;
    width: var(--size-logo);
    height: var(--size-logo);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-base) ease, visibility var(--duration-base);
}

.floating-action-pill.scrolled .pill-prev-btn {
    visibility: visible;
    opacity: 1;
}

.pill-prev-btn img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    position: relative;
    right: 2px;
    transform: rotate(180deg);
    filter: brightness(0) invert(1);
}

.pill-dynamic-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: var(--size-logo);
    height: var(--size-logo);
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.pill-dynamic-btn img {
    width: var(--size-icon);
    height: var(--size-icon);
    display: block;
    position: relative;
    bottom: 1px;
    transform: rotate(180deg);
    transition: transform 0.5s var(--ease-out);
}

.floating-action-pill.scrolled .pill-dynamic-btn img {
    transform: rotate(270deg);
}

.floating-action-pill.scrolled:hover .pill-dynamic-btn img {
    filter: brightness(0) invert(1);
}

/* The circle that slides between the two pill buttons */
.pill-hover-bg {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 52px;
    height: 52px;
    background-color: var(--color-graphite);
    border-radius: var(--radius-round);
    z-index: 1;
    opacity: 0;
    transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) ease;
}

.floating-action-pill.scrolled:hover .pill-hover-bg {
    opacity: 1;
}

.pill-prev-btn:hover ~ .pill-hover-bg {
    transform: translateX(-60px);
}

/* Petal typography */
/* 160px on wide screens; scales so REFINEMENT (≈ 6.97 × font size)
   always fits the full-width column */
.petal-title-text {
    font-family: var(--font-sans);
    font-weight: var(--fw-black);
    font-size: min(var(--fs-display-l), 14.3vw - 17px);
    line-height: var(--lh-solid);
    margin: 0;
    text-transform: uppercase;
}

.petal-text-box {
    display: flex;
    flex-direction: column;
    margin-bottom: var(--space-80);
}

.petal-h2 {
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    font-size: var(--fs-title);
    margin: 0;
    color: var(--color-text);
    line-height: var(--lh-heading);
}

.petal-body {
    font-family: var(--font-sans);
    font-weight: var(--fw-regular);
    font-size: var(--fs-body);
    margin: 0;
    color: var(--color-text);
    line-height: var(--lh-body);
}

.petal-body-bold {
    font-family: var(--font-sans);
    font-weight: var(--fw-bold);
    font-size: var(--fs-body);
    margin: 0;
    color: var(--color-text);
    line-height: var(--lh-body);
}

ul.petal-body { padding-left: 20px; }

/* "Continue Reading" link — inherits .petal-body-bold type */
.petal-action-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

.petal-action-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

/* Petal imagery */
.petal-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin-bottom: var(--space-80);
}

.petal-ratio-landscape {        /* 16:10 */
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.petal-ratio-longlandscape {    /* 16:9 */
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.petal-ratio-portrait {         /* 3:4 */
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.petal-ratio-wide {             /* 2.2:1 panorama */
    aspect-ratio: 2.2 / 1;
    object-fit: cover;
}

.gray-banner {
    width: 100vw;
    background-color: var(--color-surface-muted);
    padding: 260px 0;
    margin: var(--space-40) 0;
}

/* Photo credit, bottom-right of an image */
.credit-label {
    position: absolute;
    bottom: var(--space-16);
    right: 20px;
    color: var(--color-paper-70);
    font-family: var(--font-sans);
    font-size: var(--fs-micro);
    font-weight: var(--fw-regular);
    pointer-events: none;
    z-index: 5;
    text-align: right;
}

/* Image annotations (positioned with inline top/left/right) */
.annotation-wrapper {
    position: relative;
    width: 100%;
}

.sketch-annotation {
    position: absolute;
    max-width: 220px;
    z-index: 10;
}

.sketch-annotation .petal-body-bold {
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

.sketch-annotation .petal-body {
    color: var(--color-text-muted);
    font-size: var(--fs-body);
}

.mobile-petal-logo,
.mobile-back-btn {
    display: none !important;
}


/* =========================================================
   9. UTILITIES
   Single-purpose classes. Spacing utilities use !important
   so they always win over component margins.
========================================================= */

/* Margin bottom */
.mb-0   { margin-bottom: 0 !important; }
.mb-24  { margin-bottom: var(--space-24) !important; }
.mb-48  { margin-bottom: var(--space-48) !important; }
.mb-80  { margin-bottom: var(--space-80) !important; }
.mb-120 { margin-bottom: var(--space-120) !important; }
.mb-160 { margin-bottom: var(--space-160) !important; }

/* Pulls the next grid row 24px closer (paired thumbnail rows) */
.mb-n24 { margin-bottom: calc(var(--space-24) * -1) !important; }

/* Margin top */
.mt-24 { margin-top: var(--space-24) !important; }

/* Padding */
.pt-0   { padding-top: 0 !important; }
.pt-80  { padding-top: var(--space-80) !important; }
.pt-120 { padding-top: var(--space-120) !important; }
.pb-0   { padding-bottom: 0 !important; }
.pb-120 { padding-bottom: var(--space-120) !important; }

.spacer-120 { height: var(--space-120); width: 100%; }

/* Grid & media */
.row-span-2  { grid-row: span 2; }
.object-top  { object-position: top; }
.no-blend    { mix-blend-mode: normal !important; }

/* Alignment */
.align-center { align-self: center !important; }
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }
.text-left    { text-align: left !important; }

/* Text */
.text-italic  { font-style: italic; }
.text-bold    { font-weight: var(--fw-bold); }
.text-regular { font-weight: var(--fw-regular); }

.text-white { color: var(--color-paper); }
.text-gray  { color: var(--color-text-muted); }
.text-black { color: var(--color-text); }

/* Montserrat Alternates letter inside a word: P<span class="alt-glyph">E</span>TAL */
.alt-glyph { font-family: var(--font-alt); }


/* =========================================================
   10. RESPONSIVE OVERRIDES
   Tablet  ≤ 1024px
   Mobile  ≤ 767px
========================================================= */

/* Tablet keeps the 15-column grid (every .col-* class is written for
   15 columns) and tightens margins and gutters. */
@media (max-width: 1024px) {
    :root {
        --grid-margin: 32px;
        --grid-col-gutter: 16px;
    }

    .title-text {
        font-size: min(var(--fs-display-xl), 13.4vw - 6px);
    }

    .petal-title-text {
        font-size: min(var(--fs-display-l), 14.3vw - 7px);
    }

    .overlay-graphic {
        right: var(--grid-margin);
    }
}

@media (max-width: 767px) {
    :root {
        --grid-columns: 5;
        --grid-margin: 16px;
        --grid-col-gutter: 16px;
    }

    /* Navigation */
    .desktop-nav {
        display: none !important;
    }

    .mobile-menu-icon {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    /* The logo link goes too, not just its image, so no empty link
       stays in the tab order (the menu carries the home link) */
    .site-logo,
    .standalone-logo,
    .logo-scrollable {
        display: none !important;
    }

    .overlay-graphic {
        width: 70vw;
        right: var(--grid-margin);
        bottom: 5%;
    }

    /* Every column span becomes full width, including the page-level
       wrappers that are placed without a .col-* class */
    [class*="col-"],
    .about-header,
    .hero-grid-overlay .about-header,
    .projects-header,
    .projects-grid-wrapper,
    .contact-wrapper,
    .error-image-col,
    .error-text-col {
        grid-column: 1 / -1 !important;
    }

    .error-image-col {
        margin-bottom: var(--space-24);
    }

    /* Contact rows stack: label above value */
    .contact-link {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-8);
    }

    .contact-label,
    .contact-value {
        font-size: var(--fs-subtitle);
        text-align: left;
        overflow-wrap: anywhere;
    }

    /* Type scale: titles stay at 40pt unless the word would overflow */
    .title-text {
        line-height: var(--lh-tight);
        font-size: min(var(--fs-headline), 16.8vw - 4px) !important;
    }
    .petal-title-text {
        font-size: min(var(--fs-headline), 14.3vw - 3px) !important;
    }
    .proj-headline, .petal-h2, .error-project-title {
        font-size: var(--fs-title) !important;
    }

    /* Spacing scale compresses to 48px */
    .mb-160, .mb-120, .mb-80 {
        margin-bottom: var(--space-48) !important;
    }

    .pt-120, .pt-80 {
        padding-top: var(--space-48) !important;
        height: auto !important;
    }

    .spacer-120 {
        padding-top: 0 !important;
        height: var(--space-48) !important;
    }

    /* Final renders gallery stacks: image, arrows, counter */
    .final-renders-hero-section {
        display: flex !important;
        flex-wrap: wrap;
        padding: var(--space-48) var(--space-16) !important;
        height: auto !important;
    }
    .final-renders-hero-section .gallery-view-port {
        width: 100% !important;
        order: 1;
        margin-bottom: var(--space-24);
    }
    .final-renders-hero-section .col-3 {
        width: 50% !important;
        order: 2;
        text-align: right !important;
        padding-right: var(--space-12);
    }
    .final-renders-hero-section .col-13 {
        width: 50% !important;
        order: 3;
        text-align: left !important;
        padding-left: var(--space-12);
    }
    .final-renders-hero-section #galleryCounter {
        width: 100% !important;
        order: 4;
        margin-top: var(--space-24) !important;
    }

    .canvas-text-overlay {
        padding-top: var(--space-48) !important;
    }
    /* Flora: the text becomes a panel across the bottom of the render.
       (In normal flow it fell below the 100vh section and was cut off.) */
    .exploded-text-overlay {
        top: auto !important;
        bottom: 0;
        left: 0;
        right: 0 !important;
        max-width: none;
        transform: none !important;
        padding: var(--space-24) var(--space-16) !important;
        background: var(--color-ink-75);
        text-align: left !important;
    }

    /* Undull score table: body-size headers so it fits a 320px screen */
    .analysis-table th {
        font-size: var(--fs-body);
    }

    /* Petal: sub-nav becomes a frosted bar across the top */
    .mobile-petal-logo,
    .mobile-back-btn {
        display: flex !important;
    }

    .mobile-petal-logo {
        align-items: center;
        justify-content: center;
        padding-left: var(--space-8) !important;
        padding-right: var(--space-12) !important;
        margin-right: var(--space-4);
        border-right: 1px solid var(--color-ink-15);
    }

    .mobile-petal-logo img {
        width: 28px !important;
        height: 28px !important;
        object-fit: contain;
    }

    .petal-sub-nav {
        top: var(--space-24) !important;
        bottom: auto !important;
        left: var(--space-16) !important;
        right: var(--space-16) !important;
        width: auto !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        background-color: var(--color-paper-90);
        backdrop-filter: blur(10px);
        border-radius: var(--radius-m);
        padding: var(--space-8) !important;
        box-shadow: var(--shadow-float);
    }

    .petal-nav-item {
        padding: 2px !important;
        flex-direction: column-reverse !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 2px !important;
        flex: 1;
    }

    .petal-nav-text {
        font-size: var(--fs-micro) !important;
        text-align: center !important;
        white-space: normal !important;
        line-height: var(--lh-tight);
    }

    /* "Final Design" is shortened to fit the bar */
    a[href="petal-final.html"] .petal-nav-text {
        font-size: 0 !important;
    }

    a[href="petal-final.html"] .petal-nav-text::after {
        content: "Final Dsg." !important;
        font-size: var(--fs-micro) !important;
    }

    .mta-icon {
        width: 20px !important;
        height: 20px !important;
    }

    .nav-spotlight {
        display: none !important;
    }

    .petal-landing-body .floating-action-pill,
    .petal-sub-nav ~ .floating-action-pill {
        display: none !important;
    }

    /* Petal: text and layout */
    .petal-text-box br,
    .petal-h2 br,
    .petal-body br {
        display: none !important;
    }

    .petal-text-box,
    .petal-h2,
    .petal-body {
        text-align: left !important;
    }

    .petal-landing-body .title-text {
        font-size: 3.75rem !important;   /* 45pt */
    }

    .landing-click-area .page-grid-container {
        padding-bottom: 30vh !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }

    .hero-text-overlay {
        padding-bottom: 30vh !important;
        align-items: flex-end !important;
        justify-content: center !important;
    }

    .gray-banner {
        padding: var(--space-64) 0 !important;
        margin: var(--space-24) 0 !important;
    }

    .petal-text-box { margin-bottom: var(--space-40) !important; }
    .petal-img { margin-bottom: var(--space-24) !important; }

    .gray-banner [class*="col-"],
    .petal-text-box,
    .annotation-wrapper,
    .petal-action-link,
    .petal-img.petal-ratio-portrait {
        grid-column: 1 / -1 !important;
    }

    .sketch-annotation {
        position: relative;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        text-align: left !important;
        margin-top: var(--space-24);
        max-width: 100%;
    }

    /* Petal refinement page: reorder the grid into one column */
    .refinement-main {
        display: flex !important;
        flex-direction: column !important;
    }

    .refinement-main .mobile-reset-img {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .m-order-1 { order: 1; }
    .m-order-2 { order: 2; }
    .m-order-3 { order: 3; }
    .m-order-4 { order: 4; }
    .m-order-5 { order: 5; }
    .m-order-6 { order: 6; }
    .m-order-7 { order: 7; }
    .m-order-8 { order: 8; }
    .m-order-9 { order: 9; }
    .m-order-10 { order: 10; }
    .m-order-11 { order: 11; }
    .m-order-12 { order: 12; }
    .m-order-13 { order: 13; }

    .m-order-hide { display: none !important; }
}

/* Visitors who ask their system for less motion get instant state
   changes; js/main.js also stops autoplaying video for them. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   BLOOMING
========================================================= */

/* The small ink-and-red drawing used as a recurring mark */
.motif {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin: 0 auto;
}

/* Two-column word list */
.word-columns {
    columns: 2;
    column-gap: var(--grid-col-gutter);
    list-style: none;
    padding-left: 0;
}

/* Four square images in a row; two per row on phones */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-col-gutter);
}

@media (max-width: 767px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =========================================================
   CASE STUDY (first used on Fulcrum; reusable on any project page)
========================================================= */

.mb-8        { margin-bottom: var(--space-8) !important; }
.mb-32       { margin-bottom: var(--space-32) !important; }
.text-medium { font-weight: var(--fw-medium); }
.align-end   { align-self: end !important; }

.text-link {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

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

/* Intro: headline, grey lead, then the project facts */
.case-intro {
    padding-top: var(--space-120);
    padding-bottom: var(--space-80);
    align-items: start;
}

.case-intro .proj-headline {
    margin-bottom: var(--space-24);
}

.case-lead {
    font-family: var(--font-sans);
    font-size: var(--fs-subtitle);
    font-weight: var(--fw-regular);
    line-height: var(--lh-relaxed);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-64);
}

/* Year · Duration · Team · Tools: one hairline, label over value */
.case-facts {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 2fr;
    column-gap: var(--grid-col-gutter);
    row-gap: var(--space-24);
    margin: 0;
    padding-top: var(--space-24);
    border-top: 1px solid var(--color-ink-15);
}

.case-facts dd {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: var(--lh-relaxed);
    color: var(--color-text);
}

.tool-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-12);
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: 0;
}

.tool-logos img {
    display: block;
    width: auto;
    height: 28px;
}

.case-facts dt,
.facts-label {
    display: block;
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-8);
}

/* Chapter navigation: the dark pill from the Petal back button, with the
   same 4px inner gap and a 52px Graphite highlight on the current chapter */
.chapter-nav {
    /* Pill is --size-logo tall (52px + 4px gap each side); pinning it half
       its height above the logo's top puts its middle on the logo's top edge */
    --chapter-top: calc(var(--page-top) - var(--size-logo) / 2);
    position: sticky;
    top: var(--chapter-top);
    z-index: var(--z-subnav);
    padding-top: 0;
    padding-bottom: 0;
    pointer-events: none;      /* only the pill itself takes clicks */
}

.chapter-nav > * {
    grid-row: 1;
}

/* Content scrolling up under the pill fades out instead of meeting it in a
   hard line. Covers the content columns only, so the left rail is untouched. */
.chapter-fade {
    align-self: stretch;
    margin: calc(-1 * var(--chapter-top)) calc(-1 * var(--grid-margin)) calc(-1 * var(--space-48)) calc(-1 * var(--grid-col-gutter));
    background: linear-gradient(to bottom,
        var(--color-bg) 0,
        var(--color-bg) calc(var(--chapter-top) + var(--size-logo) / 2),
        rgba(249, 249, 249, 0) 100%);
    pointer-events: none;
}

.chapter-pill,
.step-pill {
    justify-self: start;
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    list-style: none;
    margin: 0;
    padding: var(--space-4);
    background-color: var(--color-bg-inverse);
    border-radius: var(--radius-pill);
    pointer-events: auto;
}

.chapter-pill::-webkit-scrollbar,
.step-pill::-webkit-scrollbar {
    display: none;
}

.chapter-pill a,
.step-pill button {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    height: 52px;
    padding: 0 var(--space-24);
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-caps);
    text-transform: uppercase;
    white-space: nowrap;
    text-decoration: none;
    color: var(--color-text-inverse);
    transition: background-color var(--duration-base) ease;
}

.chapter-pill .chapter-num,
.step-pill .chapter-num {
    color: var(--color-concrete);
}

.chapter-pill a:hover,
.step-pill button:hover {
    background-color: rgba(249, 249, 249, 0.12);
}

.chapter-pill a[aria-current="true"],
.step-pill button[aria-pressed="true"] {
    background-color: var(--color-graphite);
}

.chapter-pill a[aria-current="true"] .chapter-num,
.step-pill button[aria-pressed="true"] .chapter-num {
    color: var(--color-paper);
}

.chapter-pill a:focus-visible,
.step-pill button:focus-visible {
    outline: 2px solid var(--color-paper);
    outline-offset: -4px;
}

/* Workflow players: one clip per step, switched by the step pill */
.step-pill button {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.step-pill {
    width: max-content;
    margin-top: var(--space-24);
}

/* Light version of the pill: Mist ground, Ink on the current step */
.step-pill {
    background-color: var(--color-mist);
}

.step-pill button,
.step-pill .chapter-num {
    color: var(--color-text-muted);
    font-weight: var(--fw-medium);
}

.step-pill .chapter-num {
    font-weight: var(--fw-semibold);
}

.step-pill button:hover {
    background-color: rgba(4, 7, 7, 0.06);
}

.step-pill button[aria-pressed="true"] {
    background-color: var(--color-bg-inverse);
    color: var(--color-text-inverse);
    font-weight: var(--fw-bold);
}

.step-pill button[aria-pressed="true"] .chapter-num {
    color: var(--color-text-inverse);
    font-weight: var(--fw-regular);
}

.step-pill button:focus-visible {
    outline: 2px solid var(--color-ink);
    outline-offset: -4px;
}

.workflow-lead {
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: var(--color-text-muted);
    max-width: 46em;
    margin-top: 0;
}

.workflow-player {
    position: relative;
    background-color: var(--color-surface-muted);
}

.workflow-video,
.workflow-still {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.workflow-video[hidden],
.workflow-still[hidden] {
    display: none;
}

/* The same 60px circle as the Petal back pill */
.workflow-toggle {
    position: absolute;
    left: var(--space-24);
    bottom: var(--space-24);
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--size-logo);
    height: var(--size-logo);
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background-color: var(--color-bg-inverse);
    color: var(--color-text-inverse);
    cursor: pointer;
}

.workflow-toggle svg {
    width: 24px;
    height: 24px;
}

.workflow-toggle .icon-pause,
.workflow-toggle.is-playing .icon-play {
    display: none;
}

.workflow-toggle.is-playing .icon-pause {
    display: block;
}

.workflow-toggle:focus-visible {
    outline: 2px solid var(--color-ink);
    outline-offset: 4px;
}

/* One segment per step; finished steps are full, the current one fills */
.workflow-progress {
    position: absolute;
    left: calc(var(--space-24) * 2 + var(--size-logo));
    right: var(--space-24);
    bottom: calc(var(--space-24) + var(--size-logo) / 2 - 1.5px);
    display: flex;
    gap: 6px;
}

.workflow-segment {
    flex: 1;
    height: 3px;
    background-color: var(--color-ink-15);
    overflow: hidden;
}

.workflow-fill {
    display: block;
    height: 100%;
    background-color: var(--color-ink);
    transform: scaleX(0);
    transform-origin: left;
}

/* Chapters */
.case-chapter {
    padding-top: var(--space-160);
    padding-bottom: 0;
    scroll-margin-top: var(--space-24);
}

.chapter-label {
    display: flex;
    align-items: center;
    gap: var(--space-16);
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text);
    margin: 0;
}

.chapter-label .chapter-num {
    color: var(--color-text-muted);
}

.chapter-rule {
    width: 48px;
    height: 1px;
    background-color: var(--color-ink);
}

.case-statement {
    font-family: var(--font-sans);
    font-size: var(--fs-headline);
    font-weight: var(--fw-light);
    line-height: var(--lh-tight);
    color: var(--color-text);
    margin: 0;
}

.case-statement-s {
    font-size: var(--fs-title);
    line-height: var(--lh-heading);
}

.stat-xl,
.stat-l {
    font-family: var(--font-sans);
    font-weight: var(--fw-black);
    line-height: var(--lh-solid);
    color: var(--color-text);
    margin: 0;
}

.stat-xl { font-size: min(7.5rem, 22vw); }
.stat-l  { font-size: var(--fs-headline); }

.proj-source {
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

/* Causes listed down the left, the cost figures stacked on the right */
.cause-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-40);
    list-style: none;
    margin: 0;
    padding: 0;
}

.cause-list li {
    display: flex;
    align-items: center;
    gap: var(--space-24);
}

.cause-icon-box {
    flex: 0 0 128px;
    display: flex;
    justify-content: center;
}

.cause-icon {
    display: block;
    width: auto;
    max-width: 128px;
    height: 88px;
}

.case-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-64);
    padding-top: calc(var(--fs-subtitle) * 1.2 + var(--space-48));   /* line up with the first cause */
}

.img-round {
    border-radius: 50%;
}

/* Numbered steps and impact points: a 2px rule over each item */
.step-row,
.impact-row {
    display: grid;
    grid-template-columns: repeat(var(--steps, 3), 1fr);
    list-style: none;
    margin: 0;
    padding: 0;
}

.impact-row {
    column-gap: var(--grid-col-gutter);
}

.step-row li,
.impact-row li {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    padding: var(--space-16) var(--space-16) 0 0;
    border-top: 2px solid var(--color-ink);
}

.step-num {
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--color-text-muted);
}

.step-name {
    font-family: var(--font-sans);
    font-size: var(--fs-subtitle);
    font-weight: var(--fw-bold);
    line-height: var(--lh-heading);
    text-transform: uppercase;
    color: var(--color-text);
}

/* Credits and next project */
.case-ending {
    padding-top: var(--space-160);
    padding-bottom: var(--space-160);
    row-gap: var(--space-80);
}

.case-credit {
    padding-top: var(--space-24);
    border-top: 1px solid var(--color-ink-15);
}

.next-project {
    display: flex;
    flex-direction: column;
    color: var(--color-text);
    text-decoration: none;
}

.next-project .proj-img {
    transition: opacity var(--duration-base) ease;
}

.next-project:hover .proj-img {
    opacity: 0.85;
}

.next-project-name {
    font-family: var(--font-sans);
    font-size: var(--fs-display-m);
    font-weight: var(--fw-black);
    line-height: var(--lh-solid);
    text-transform: uppercase;
    margin: var(--space-8) 0;
}

.back-link {
    font-family: var(--font-sans);
    font-size: var(--fs-label);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--ls-caps);
    text-transform: uppercase;
}

@media (max-width: 1024px) {
    .case-facts {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .case-intro {
        padding-top: var(--space-48);
        padding-bottom: var(--space-48);
    }

    .case-lead {
        font-size: var(--fs-body);
        margin-bottom: var(--space-40);
    }

    /* On phones the pill scrolls with the page, clear of the menu button */
    .chapter-nav {
        position: static;
    }

    .chapter-fade {
        display: none;
    }

    .case-chapter {
        padding-top: var(--space-80);
    }

    .case-statement {
        font-size: var(--fs-title);
    }

    .step-row {
        grid-template-columns: 1fr 1fr;
        row-gap: var(--space-24);
    }

    .step-pill {
        width: auto;
    }

    .workflow-toggle {
        left: var(--space-12);
        bottom: var(--space-12);
        width: 44px;
        height: 44px;
    }

    .workflow-progress {
        left: calc(var(--space-12) * 2 + 44px);
        right: var(--space-12);
        bottom: calc(var(--space-12) + 22px - 1.5px);
    }

    .case-stats {
        padding-top: 0;
        gap: var(--space-40);
    }

    .cause-icon-box {
        flex-basis: 88px;
    }

    .cause-icon {
        height: 60px;
    }

    .impact-row {
        grid-template-columns: 1fr;
        row-gap: var(--space-32);
    }

    .case-ending {
        padding-top: var(--space-80);
        padding-bottom: var(--space-80);
        row-gap: var(--space-48);
    }
}
