/* CSS Variables for Colors and Animation */
:root {
    --bg-color-1: #1e1e1e;
    --bg-color-2: #121212;
    --bg-color-3: #2a2a2a;
    --bg-color-4: #000000;
    --text-color: #ffffff;
    --accent-color: #a0a0a0;
    --nav-bg: rgba(255, 255, 255, 0.1);
    --nav-pill: rgba(255, 255, 255, 0.2);

    /* Sean Halpin spacing system (matched exactly from his css-for-kicks file) */
    --14px: 0.875rem;
    --16px: 1rem;
    --20px: 1.25rem;
    --24px: 1.5rem;
    --42px: 2.652rem;
    --64px: 4rem;
    --spacing-xxs: max(calc(var(--14px) / 2), calc((var(--14px) / 2) + (14 - 7) * ((100vw - 375px) / (1600 - 375))));
    --spacing-xs:  max(var(--14px), calc(var(--14px) + (28 - 14) * ((100vw - 375px) / (1600 - 375))));
    --spacing-s:   max(1.3125rem, calc(1.3125rem + (42 - 21) * ((100vw - 375px) / (1600 - 375))));
    --spacing-m:   max(var(--24px), calc(var(--24px) + (48 - 24) * ((100vw - 375px) / (1600 - 375))));
    --spacing-l:   max(var(--42px), calc(var(--42px) + (84 - 42) * ((100vw - 375px) / (1600 - 375))));
    --spacing-xl:  max(var(--64px), calc(var(--64px) + (128 - 64) * ((100vw - 375px) / (1600 - 375))));

    /* Sean's font sizes */
    --font-h2-display: clamp(1.875rem, 1.301rem + 2.449vw, 3.95rem);
    --font-h2: clamp(1.5rem, 1.0982rem + 1.7143vw, 2.8125rem);
    --font-h3: clamp(1.375rem, 1.1837rem + 0.8163vw, 2rem);
    --font-h4: clamp(1.375rem, 1.1837rem + 0.8163vw, 1.6rem);
    --font-h5: clamp(1rem, 0.9235rem + 0.3265vw, 1.25rem);
    --font-h6: clamp(1rem, 0.9617rem + 0.1633vw, 1.125rem);
    --font-body: clamp(1rem, 0.8852rem + 0.4898vw, 1.375rem);
    --font-link: clamp(0.875rem, 0.7985rem + 0.3265vw, 1.125rem);

    --max-width-sean: 1600px;
}

@font-face {
    font-family: 'PortfolioDisplay';
    src: url('font.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* Animated dark gradient — runs site-wide, on every page */
    background: linear-gradient(-45deg, #1e1e1e, #1a1a1a, #2a2a2a, #0f0f0f);
    background-size: 400% 400%;
    animation: gradient 10s ease infinite;

    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Gradient Animation Keyframes - Matches Reference Flow */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Navigation */
nav {
    z-index: 10;
    position: fixed;
    top: 2rem;
    padding: 0.5rem 0.5rem;
    border-radius: 50px;
    background: transparent;
    display: flex;
    gap: 0.5rem;
    backdrop-filter: blur(5px);
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.2rem;
    /* Increased from 0.9rem */
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    transition: background 0.3s ease;
    opacity: 0.8;
}

nav a:hover,
nav a.active {
    background: var(--nav-pill);
    opacity: 1;
}

nav a.active {
    background: rgba(255, 255, 255, 0.2);
    /* Slightly more opaque for active */
}



/* Main Container */
.container {
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
    margin-top: 2rem;
    /* Push content down safely */
}

/* Hero Section */
.hero {
    min-height: 80vh;
    /* Reduced from 100vh — less empty space before the work tiles */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    width: 100%;
    padding-top: 6vh;
    padding-bottom: 4vh;

    /* Hero lets the body's animated gradient show through */
    background: transparent;
    margin-bottom: 0;
}

.hero::after {
    display: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-family: 'PortfolioDisplay', serif;
    font-size: 8.5rem;
    /* Increased slightly */
    font-weight: 600;
    line-height: 0.95;
    margin-bottom: 2.5rem;
    /* More space below */
    letter-spacing: -0.04em;
    white-space: nowrap;
}

/* Removed h2 as it is now part of h1 for consistent sizing */

.hero-description {
    margin-top: 2rem;
    font-size: 1.20rem;
    /* Increased tagline size */
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    /* Slightly brighter */
    text-wrap: balance;
}

/* Sparkles */
.sparkle {
    position: absolute;
    width: 40px;
    height: 40px;
    color: white;
    animation: sparkleFloat 3s ease-in-out infinite;
}

.sparkle-1 {
    top: -20px;
    right: -40px;
    animation-delay: 0s;
    width: 50px;
    height: 50px;
}

.sparkle-2 {
    bottom: 20px;
    left: -50px;
    animation-delay: 1.5s;
    width: 35px;
    height: 35px;
}

@keyframes sparkleFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 0.8;
    }

    50% {
        transform: translateY(-10px) rotate(10deg) scale(1.1);
        opacity: 1;
    }
}

/* Intro & Timeline Section */
.intro-section {
    margin-top: 5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

.profile-block {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 900px;
    text-align: left;
}

.profile-pic {
    width: 220px;
    height: 220px;
    border-radius: 28px;
    background-color: #1a1a1a;
    background-image: url('2x2%20HD.png');
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* About / Contact page — no hero, content starts under the fixed nav.
   Container widened to match Sean's max-width (1600px) and uses his spacing scale. */
.about-container {
    padding-top: var(--spacing-xl);
    max-width: var(--max-width-sean);
}

/* "I'm Owén." headline — same size as the index.html hero h1 (8.5rem desktop, 4rem mobile) */
.page-hello {
    font-family: 'PortfolioDisplay', serif;
    font-size: 8.5rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 0.95;
    letter-spacing: -0.04em;
    text-align: center;
    margin-bottom: var(--spacing-l);
}

@media (max-width: 768px) {
    .page-hello {
        font-size: 4rem;
    }
}

.page-hello-sub {
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.1rem;
    line-height: 1.65;
    max-width: 680px;
    margin: -1rem auto 4rem;
}

/* About page — photo + bio using Sean's exact 25-column grid placement.
   Photo: cols 4-10 (~24% width). Bio: cols 12-24 (~48% width). */
.about-block {
    display: grid;
    grid-template-columns: repeat(25, 1fr);
    gap: 0;
    align-items: start;
    margin-bottom: var(--spacing-m);
    width: 100%;
    max-width: var(--max-width-sean);
    margin-left: auto;
    margin-right: auto;
}

.about-photo {
    grid-column: 4 / 11;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-image: url('2x2%20HD.png');
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
    margin-top: var(--spacing-xs);
}

.about-content {
    grid-column: 12 / 25;
    margin-top: var(--24px);
    padding-top: 0;
}

.about-content {
    padding-top: 0.5rem;
}

.about-headline {
    font-family: 'PortfolioDisplay', serif;
    font-size: var(--font-h2-display);
    font-weight: 600;
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: var(--spacing-xs) 0 var(--spacing-xs);
}

.about-headline strong {
    font-weight: 600;
    color: #ffffff;
}

.about-bio {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0;
}

.about-bio p {
    font-size: var(--font-body);
    line-height: 1.6;
    margin-bottom: var(--spacing-xs);
}

.about-bio p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .about-block {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 var(--24px);
    }
    .about-photo {
        grid-column: 1;
        max-width: 280px;
        margin: 0 auto;
    }
    .about-content {
        grid-column: 1;
        margin-top: var(--spacing-m);
    }
    .about-headline {
        text-align: center;
    }
}

/* ================================================
   Experience Timeline (Sean Halpin visual pattern)
   25-column grid; padded inside container per Sean's --64px rule on desktop
   ================================================ */
.experience-timeline {
    display: grid;
    grid-template-columns: repeat(25, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: var(--16px) 0.5rem;
    width: 100%;
    max-width: var(--max-width-sean);
    margin: 0 auto var(--spacing-m);
    padding: 0;
}

@media (min-width: 768px) {
    .experience-timeline {
        padding: 0 var(--64px);
    }
}

.timeline-card {
    grid-row: var(--row);
    grid-column: var(--col-start) / var(--col-end);
    border-radius: var(--64px);
    padding: var(--16px) var(--24px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--16px);
    overflow: hidden;
    transition: transform 0.25s ease;
    min-width: 0;
}

.timeline-card:hover {
    transform: translateY(-2px);
}

.timeline-info {
    flex: 1;
    min-width: 0;
}

.timeline-company {
    font-size: var(--font-h5);
    font-weight: 600;
    line-height: 1.2;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.timeline-title {
    font-size: var(--font-h6);
    opacity: 0.65;
    line-height: 1.3;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.timeline-time {
    font-family: 'PortfolioDisplay', serif;
    font-size: var(--font-h4);
    font-weight: 600;
    flex-shrink: 0;
}

/* All timeline cards — solid dark fill, clearly brighter than the body
   gradient's lightest point (#2a2a2a) so they stay visible at every frame. */
.timeline-red,
.timeline-pink,
.timeline-yellow,
.timeline-purple,
.timeline-green {
    background: #3a3a3a;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.timeline-card .timeline-title {
    color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    .experience-timeline {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    .timeline-card {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
}

/* ================================================
   Collaboration headline section — placed at Sean's
   grid cols 8-25 (heading) and 8-19 (body) on desktop
   ================================================ */
.collab-block {
    display: grid;
    grid-template-columns: repeat(25, 1fr);
    width: 100%;
    max-width: var(--max-width-sean);
    margin: var(--spacing-m) auto;
}

.collab-headline {
    grid-column: 3 / 24;
    font-family: 'PortfolioDisplay', serif;
    font-size: var(--font-h2-display);
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-s);
}

.collab-body {
    grid-column: 3 / 24;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-body);
    line-height: 1.65;
}

@media (min-width: 768px) {
    .collab-headline {
        grid-column: 8 / 25;
    }
    .collab-body {
        grid-column: 8 / 19;
    }
}

/* ================================================
   Principles Block — Sean's exact spacing & blur
   Mobile: padding spacing-s top, spacing-l bottom, no rounded
   Desktop: 64px radius, padding spacing-l top, spacing-l + 42px bottom
   ================================================ */
.principles-block {
    width: 100%;
    max-width: var(--max-width-sean);
    margin: var(--spacing-xs) auto var(--spacing-m);
    background: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--spacing-s) 0 var(--spacing-m);
}

@media (min-width: 768px) {
    .principles-block {
        border-radius: var(--64px);
        padding: var(--spacing-m) 0 var(--spacing-l);
        margin: var(--spacing-xs) auto var(--spacing-m);
    }
}

.principles-grid-about {
    display: grid;
    grid-template-columns: repeat(25, 1fr);
    grid-row-gap: var(--spacing-m);
}

/* Sean places principles 1 & 3 in cols 4-13 and 2 & 4 in cols 14-23 */
.principles-grid-about .entry:nth-child(odd) {
    grid-column: 3 / 24;
}

.principles-grid-about .entry:nth-child(even) {
    grid-column: 3 / 24;
}

@media (min-width: 768px) {
    .principles-grid-about .entry:nth-child(odd) {
        grid-column: 4 / 13;
    }
    .principles-grid-about .entry:nth-child(even) {
        grid-column: 14 / 23;
    }
}

.principles-grid-about .entry {
    color: rgba(255, 255, 255, 0.85);
}

.principles-grid-about .count {
    font-family: 'PortfolioDisplay', serif;
    font-size: var(--24px);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: var(--16px);
    line-height: 1;
    opacity: 0.5;
}

@media (min-width: 768px) {
    .principles-grid-about .count {
        font-size: var(--42px);
        margin-bottom: var(--24px);
    }
}

.principles-grid-about h3 {
    font-family: 'PortfolioDisplay', serif;
    font-size: var(--font-h3);
    font-weight: 600;
    color: #fff;
    margin-bottom: var(--16px);
    line-height: 1.2;
}

.principles-grid-about p {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
    font-size: var(--font-body);
}

/* ================================================
   Background paragraphs — Sean places these at cols
   8-19 on desktop, 3-24 on mobile (same as collab body)
   ================================================ */
.background-block {
    display: grid;
    grid-template-columns: repeat(25, 1fr);
    width: 100%;
    max-width: var(--max-width-sean);
    margin: 0 auto var(--spacing-m);
    color: rgba(255, 255, 255, 0.85);
    padding-bottom: 0;
}

.background-block > p {
    grid-column: 3 / 24;
    font-size: var(--font-body);
    line-height: 1.6;
    margin-bottom: var(--16px);
}

.background-block > p:last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .background-block > p {
        grid-column: 8 / 19;
    }
}

.intro-text h3 {
    font-family: 'PortfolioDisplay', serif;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.intro-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

/* Timeline */
.timeline {
    width: 100%;
    max-width: 800px;
    position: relative;
    padding: 2rem 0;
}

.timeline-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: inline-block;
    margin: 1rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
    position: relative;
    /* Simulate the curved path placement roughly with margins */
}

/* Example staggered positioning */
.timeline-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.timeline-pill {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    background: #a3e635;
    /* Mint green from ref */
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 180px;
}

.timeline-pill.purple {
    background: #d8b4fe;
}

.timeline-pill.blue {
    background: #bae6fd;
}

.timeline-pill.green {
    background: #86efac;
}

.year {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-left: 10px;
}


/* Work Cards Section */
.work-section {
    margin-top: 1.5rem;
    width: 100%;
}

.work-heading {
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.work-heading h2 {
    font-family: 'PortfolioDisplay', serif;
    font-size: 4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.work-heading p {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.1rem;
}

a.work-card {
    text-decoration: none;
}

/* Asymmetric grid (Sean Halpin pattern):
   Row 1: narrow + wide   (2 + 3 columns)
   Row 2: wide + narrow   (3 + 2 columns) */
.work-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    width: 100%;
}

.work-grid > *:nth-child(1) { grid-column: span 2; }
.work-grid > *:nth-child(2) { grid-column: span 3; }
.work-grid > *:nth-child(3) { grid-column: span 3; }
.work-grid > *:nth-child(4) { grid-column: span 2; }
.work-grid > *:nth-child(5) { grid-column: span 2; }
.work-grid > *:nth-child(6) { grid-column: span 3; }
.work-grid > *:nth-child(7) { grid-column: span 5; }

@media (max-width: 900px) {
    .work-grid {
        grid-template-columns: 1fr;
    }
    .work-grid > *:nth-child(n) {
        grid-column: 1;
    }
}

.work-card {
    background: var(--card-bg, linear-gradient(160deg, #1a1a1a, #0f0f0f));
    border-radius: 52px;
    height: 400px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--card-text, #1a1a2e);
}

.work-card:hover {
    transform: translateY(-6px);
    filter: saturate(1.15);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

/* Sean-style pastel palette — light card backgrounds with dark text.
   Each pastel is a soft version of the project's actual brand color. */

/* fypsave.com — soft cyan (TikTok cyan, lightened) */
.work-card.purple {
    --card-bg: #b8ecea;
    --card-text: #07393a;
    --accent: #006d68;
    --cta-bg: #07393a;
    --cta-text: #ffffff;
}

/* detectmo.com — soft lavender/violet */
.work-card.mint {
    --card-bg: #d8cdfa;
    --card-text: #2a1c54;
    --accent: #4c1d95;
    --cta-bg: #2a1c54;
    --cta-text: #ffffff;
}

/* UEP Alumni Tracker — soft cream/gold */
.work-card.blue {
    --card-bg: #fbe7a3;
    --card-text: #4a3613;
    --accent: #92400e;
    --cta-bg: #4a3613;
    --cta-text: #ffffff;
}

/* UEP Automator — soft coral (UEP red, lightened) */
.work-card.beige {
    --card-bg: #fac8c0;
    --card-text: #5a1612;
    --accent: #991b1b;
    --cta-bg: #5a1612;
    --cta-text: #ffffff;
}

/* Reddit Digest Bot — soft Reddit orange */
.work-card.orange {
    --card-bg: #fed7aa;
    --card-text: #5a2410;
    --accent: #c2410c;
    --cta-bg: #5a2410;
    --cta-text: #ffffff;
}

/* GoshenFX Trading Bot — slate blue (financial / professional) */
.work-card.navy {
    --card-bg: #b8c5e3;
    --card-text: #1c2547;
    --accent: #1e40af;
    --cta-bg: #1c2547;
    --cta-text: #ffffff;
}

/* Site Snatcher — soft sage (latest project, feature banner) */
.work-card.sage {
    --card-bg: #c2dfcf;
    --card-text: #1a3d2c;
    --accent: #047857;
    --cta-bg: #1a3d2c;
    --cta-text: #ffffff;
}

/* Feature banner card (full-width tile) — slightly different proportions */
.work-card.feature {
    height: auto;
    min-height: 280px;
    padding: 2.5rem 3rem;
}

.work-card.feature .card-header .card-title {
    font-size: 2.6rem;
}

.work-card.feature .card-description {
    font-size: 1.1rem;
    max-width: 760px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card-title {
    font-family: 'PortfolioDisplay', serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--card-text, #fff);
}

.card-subtitle {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent, rgba(255, 255, 255, 0.65));
    font-weight: 700;
}

.card-image-placeholder {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    opacity: 0.5;
}

.card-body {
    flex-grow: 1;
    background: transparent;
    border: none;
    border-radius: 0;
    margin-top: 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.card-description {
    font-size: 1rem;
    line-height: 1.55;
    color: var(--card-text, rgba(0, 0, 0, 0.78));
    font-weight: 500;
    opacity: 0.85;
}

.card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-tag {
    background: rgba(0, 0, 0, 0.1);
    color: var(--card-text, rgba(0, 0, 0, 0.85));
    padding: 0.32rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.card-cta {
    margin-top: 0.8rem;
    align-self: flex-start;
    background: var(--cta-bg, #0d0d0d);
    color: var(--cta-text, #fff);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.work-card:hover .card-cta,
button.work-card:hover .card-cta {
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.work-card.locked {
    position: relative;
}

.work-card.locked .card-body {
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-top: 1.25rem;
}

/* Stack NDA badge above the title so neither wraps on narrow tiles */
.work-card.locked .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.work-card.locked .card-title {
    text-align: left;
    width: 100%;
}

/* NDA Banner — sits inline with the card title at the top of the card */
.nda-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #1a1a1a;
    color: #ffd166;
    padding: 0.55rem 1.1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 209, 102, 0.45);
    align-self: flex-start;
    width: fit-content;
}

/* "Pending approval" subtitle on locked card sits below the header row */
.locked-pending {
    display: block;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.nda-icon {
    font-size: 0.95rem;
    line-height: 1;
}

/* Button-style work-card (for cards that open modals instead of links) */
button.work-card {
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

button.work-card:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}


/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 1.5rem;
    overflow-y: auto;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-window {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    max-width: 900px;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.modal-close:hover {
    background: #000;
    transform: rotate(90deg);
}

.modal-video-wrap {
    width: 100%;
    background: #000;
    aspect-ratio: 16 / 9;
}

.modal-video {
    width: 100%;
    height: 100%;
    display: block;
}

.modal-content {
    padding: 2.5rem;
    color: rgba(255, 255, 255, 0.85);
}

.modal-tag {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.modal-content h3 {
    font-family: 'PortfolioDisplay', serif;
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.modal-content p {
    margin-bottom: 1.1rem;
    line-height: 1.65;
    font-size: 1rem;
}

.modal-content strong {
    color: #fff;
}

.modal-cta-line {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    line-height: 1.6;
}

.modal-cta-line strong {
    display: block;
    margin-bottom: 0.6rem;
}

.modal-cta-link {
    display: inline-block;
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    transition: transform 0.2s ease, text-decoration-color 0.2s ease;
}

.modal-cta-link:hover {
    transform: translateX(4px);
    text-decoration-color: #ffffff;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 1.5rem;
    }
    .modal-content h3 {
        font-size: 1.5rem;
    }
    .nda-banner {
        font-size: 0.75rem;
        padding: 0.45rem 0.9rem;
    }
}

/* Contact Section */
.contact-section {
    margin: 6rem auto 3rem;
    width: 100%;
    scroll-margin-top: 6rem;
}

.contact-card {
    background: linear-gradient(160deg, #1a1a1a, #0f0f0f);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 4rem 2.5rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #a3e635;
    opacity: 0.6;
}

.contact-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a3e635;
    font-weight: 700;
    margin-bottom: 1rem;
}

.contact-card h2 {
    font-family: 'PortfolioDisplay', serif;
    font-size: 3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.contact-lead {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto 2rem;
}

.contact-primary {
    display: inline-block;
    background: #a3e635;
    color: #0d0d0d;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.contact-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(163, 230, 53, 0.3);
}

.contact-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
}

.contact-divider {
    color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .contact-card {
        padding: 2.5rem 1.5rem;
        border-radius: 24px;
    }
    .contact-card h2 {
        font-size: 2rem;
    }
}

/* Contact Page */
.contact-page {
    margin-top: 3rem;
    width: 100%;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.contact-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.contact-info-item {
    background: linear-gradient(160deg, #1a1a1a, #0f0f0f);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    display: grid;
    grid-template-columns: 140px 1fr auto;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s ease;
}

.contact-info-item:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.contact-info-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 700;
}

.contact-info-value {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    user-select: all;
    cursor: text;
    word-break: break-word;
}

.contact-copy-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.contact-copy-btn:hover {
    background: #ffffff;
    color: #0d0d0d;
    border-color: #ffffff;
}

.contact-copy-btn.copied {
    background: #ffffff;
    color: #0d0d0d;
    border-color: #ffffff;
}

.contact-note {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
    max-width: 580px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .contact-info-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .contact-copy-btn {
        justify-self: flex-start;
    }
}

/* ================================================
   About page bottom photo grid (Sean's .pics pattern)
   Mobile: stacked, only the large image
   Desktop: large + small side-by-side, both with rounded corners
   ================================================ */
.about-pics {
    display: flex;
    flex-direction: column;
    gap: var(--16px);
    width: 100%;
    max-width: var(--max-width-sean);
    margin: var(--spacing-m) auto var(--16px);
    padding: 0;
}

/* Row 2 of pics — sit tight under row 1 */
.about-pics-mirror {
    margin-top: 0;
    margin-bottom: var(--spacing-m);
}

.about-pics figure {
    margin: 0;
    overflow: hidden;
    background: #1c1c1c;
}

.about-pics img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Sharpest possible browser-side scaling */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: high-quality;
}

/* PHOTO 2 has letterbox black bars top & bottom — scale up + recenter
   so the dog fills the frame and the black bars get cropped off-screen */
.about-pics .crop-letterbox {
    transform: scale(1.35);
    transform-origin: center center;
    object-position: center 50%;
}

/* PHOTO 4 is portrait but displayed in the landscape (large) slot —
   crop top/bottom so the subject + scenery fill the wide frame */
.about-pics .crop-portrait-wide {
    object-position: center 30%;
}


.pics-large {
    width: 100%;
    overflow: hidden;
}

.pics-large figure {
    aspect-ratio: 4 / 3;
}

.pics-small {
    display: none;
}

@media (min-width: 768px) {
    .about-pics {
        flex-direction: row;
        align-items: stretch;
        justify-content: center;
        padding: 0 var(--64px);
        gap: var(--16px);
    }

    .about-pics figure {
        border-radius: var(--16px);
        height: 100%;
    }

    .pics-large {
        flex: 0 1 844px;
        border-radius: var(--16px);
        overflow: hidden;
    }

    .pics-large figure {
        aspect-ratio: 844 / 542;
    }

    .pics-small {
        display: block;
        flex: 0 1 373px;
        border-radius: var(--16px);
        overflow: hidden;
    }

    .pics-small figure {
        aspect-ratio: 373 / 542;
    }
}

/* About page footer with social links */
.about-footer {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
    padding: var(--spacing-l) 0 var(--spacing-m);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: var(--spacing-l);
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: center;
}

.footer-links-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 700;
    margin-right: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
}

.footer-links a:hover {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    margin: 0;
}

/* Footer & Principles */
.footer {
    margin-top: 5rem;
    padding: 3rem 0;
    text-align: center;
    width: 100%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Section intro — heading + subtitle above the numbered list */
.section-intro {
    width: 100%;
    max-width: 900px;
    margin: 6rem auto 2.5rem;
    text-align: center;
}

.section-title {
    font-family: 'PortfolioDisplay', serif;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 600;
    color: #fff;
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 620px;
    margin: 0 auto;
}

.section-subtitle em {
    color: #ffffff;
    font-style: normal;
    font-weight: 600;
}

/* Numbered list grid (single column — side projects / more automations) */
.principles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin: 0 auto 5rem;
    width: 100%;
    max-width: 760px;
}

/* Tech tags inside numbered list items (dark theme variant) */
.principle-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.principle-tech-tag {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.32rem 0.75rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.principle-item h4 {
    font-size: 4rem;
    opacity: 0.3;
    font-family: 'PortfolioDisplay', serif;
    margin-bottom: 1rem;
}

.principle-item h5 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.principle-item p {
    font-size: 1rem;
    opacity: 0.7;
    line-height: 1.5;
}

/* Animations from previous steps */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll-triggered reveal — sections fade up as they enter the viewport.
   Toggled by JS Intersection Observer via the .is-visible class. */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger variant — children fade in one after another */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
}

.reveal-stagger.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.32s; }

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.is-visible,
    .reveal-stagger > *,
    .reveal-stagger.is-visible > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 4rem;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .work-grid {
        grid-template-columns: 1fr;
    }

    .principles-grid {
        grid-template-columns: 1fr;
    }

    .profile-block {
        flex-direction: column;
        text-align: center;
    }
}


/* =====================================================
   📱  MOBILE FINAL LAYER — comprehensive overrides
   Loaded last so it wins specificity battles. Two
   breakpoints: 768px (phones + small tablets) and
   480px (small phones).
   ===================================================== */

/* Lock down horizontal scroll site-wide */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Make all images / videos behave on small screens */
img, video {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {

    /* ---- Container padding ---- */
    .container {
        padding: 0 1.25rem;
        margin-top: 4rem;
    }
    .about-container {
        padding: 6rem 1.25rem 2rem;
    }

    /* ---- Nav ---- */
    nav {
        top: 1rem;
        padding: 0.3rem;
        gap: 0.15rem;
        max-width: calc(100% - 2rem);
    }
    nav a {
        font-size: 0.85rem;
        padding: 0.45rem 0.75rem;
        white-space: nowrap;
    }

    /* ---- Hero (index.html) ---- */
    .hero {
        min-height: 88vh;
        padding-top: 5vh;
    }
    .hero-content h1 {
        font-size: 3.4rem;
        white-space: normal;
        line-height: 1;
        margin-bottom: 1.5rem;
    }
    .hero-description {
        font-size: 1rem;
        line-height: 1.55;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    .sparkle {
        width: 34px !important;
        height: 34px !important;
        opacity: 0.9;
        z-index: 5;
    }
    .sparkle-1 {
        top: -20px !important;
        right: 8px !important;
    }
    .sparkle-2 {
        bottom: -10px !important;
        left: 8px !important;
    }

    /* ---- Work tiles ---- */
    .work-section {
        margin-top: 1rem;
    }
    .work-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .work-grid > * {
        grid-column: 1 !important;
    }
    .work-card {
        height: auto;
        min-height: 320px;
        padding: 1.5rem;
        border-radius: 28px;
    }
    .work-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .card-title {
        font-size: 1.5rem;
    }
    .card-subtitle {
        font-size: 0.78rem;
    }
    .card-description {
        font-size: 0.95rem;
    }
    .card-cta {
        font-size: 0.78rem;
        padding: 0.5rem 0.95rem;
    }
    .nda-banner {
        font-size: 0.7rem;
        padding: 0.4rem 0.85rem;
    }

    /* ---- "Just for fun" section ---- */
    .section-intro {
        margin: 4rem auto 2rem;
    }
    .section-title {
        font-size: 2rem;
    }
    .section-subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }
    .principles-grid {
        gap: 2rem;
        max-width: 100%;
    }
    .principle-item h4 {
        font-size: 3rem;
    }
    .principle-item h5 {
        font-size: 1.25rem;
    }
    .principle-item p {
        font-size: 0.95rem;
    }

    /* ---- About page ---- */
    .page-hello {
        font-size: 3.4rem !important;
        margin-bottom: 2rem;
    }
    .about-block {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        padding: 0;
    }
    .about-photo {
        grid-column: 1 / -1 !important;
        max-width: 240px;
        margin: 0 auto;
    }
    .about-content {
        grid-column: 1 / -1 !important;
        margin-top: 0;
        text-align: center;
    }
    .about-headline {
        text-align: center !important;
        font-size: 1.5rem !important;
        line-height: 1.2;
    }
    .about-bio {
        text-align: left;
    }
    .about-bio p {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* Experience timeline */
    .experience-timeline {
        grid-template-columns: 1fr !important;
        padding: 0 !important;
        gap: 0.6rem;
    }
    .timeline-card {
        grid-column: 1 !important;
        grid-row: auto !important;
    }
    .timeline-company {
        font-size: 0.95rem;
    }
    .timeline-title {
        font-size: 0.78rem;
    }
    .timeline-time {
        font-size: 1.1rem;
    }

    /* Collab block */
    .collab-block {
        margin: 2rem auto;
    }
    .collab-headline {
        grid-column: 3 / 24 !important;
        font-size: 1.6rem !important;
        line-height: 1.2;
    }
    .collab-body {
        grid-column: 3 / 24 !important;
        font-size: 1rem;
    }

    /* Principles block (about page) */
    .principles-block {
        padding: 1.5rem 1rem !important;
        border-radius: 24px !important;
        margin: 1rem auto;
    }
    .principles-grid-about {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .principles-grid-about .entry:nth-child(odd),
    .principles-grid-about .entry:nth-child(even) {
        grid-column: 3 / 24 !important;
    }
    .principles-grid-about .count {
        font-size: 1.6rem !important;
        margin-bottom: 0.5rem !important;
    }
    .principles-grid-about h3 {
        font-size: 1.2rem;
    }
    .principles-grid-about p {
        font-size: 0.95rem;
    }

    /* Background paragraphs */
    .background-block > p {
        grid-column: 3 / 24 !important;
        font-size: 0.98rem;
        line-height: 1.6;
    }

    /* About-page photo grid — show ALL 4 photos stacked on mobile */
    .about-pics {
        padding: 0 !important;
        gap: 0.6rem;
        flex-direction: column !important;
    }
    .about-pics figure {
        border-radius: 14px !important;
        margin: 0;
    }
    /* Force the small photos visible (was display:none from desktop rule) */
    .pics-small {
        display: block !important;
        flex: 1 1 100%;
        max-width: 100%;
    }
    .pics-large {
        flex: 1 1 100%;
        max-width: 100%;
        border-radius: 14px;
        overflow: hidden;
    }
    .pics-small {
        border-radius: 14px;
        overflow: hidden;
    }
    /* On mobile, simplify aspect ratios — landscape for both rows so heights match */
    .pics-large figure {
        aspect-ratio: 4 / 3 !important;
    }
    .pics-small figure {
        aspect-ratio: 4 / 3 !important;
    }
    /* PHOTO 4 (gf in profile) — on mobile, show more of the upper portion */
    .about-pics .crop-portrait-wide {
        object-position: center 25% !important;
    }

    /* ---- Contact page ---- */
    .page-hello-sub {
        font-size: 1rem;
        max-width: 100%;
        padding: 0 0.25rem;
        margin-top: 0;
    }
    .contact-page {
        margin-top: 2rem;
    }
    .contact-info-item {
        grid-template-columns: 1fr !important;
        padding: 1.25rem;
        gap: 0.5rem;
    }
    .contact-info-value {
        font-size: 1rem;
    }
    .contact-copy-btn {
        align-self: flex-start;
        margin-top: 0.4rem;
    }

    /* ---- Modal (UEP Automator) ---- */
    .modal-overlay {
        padding: 2rem 0.75rem 1rem;
    }
    .modal-window {
        border-radius: 18px;
    }
    .modal-content {
        padding: 1.5rem 1.25rem;
    }
    .modal-content h3 {
        font-size: 1.4rem;
    }
    .modal-content p {
        font-size: 0.95rem;
        line-height: 1.55;
    }
    .modal-cta-line {
        padding: 1rem;
        font-size: 0.95rem;
    }
    .modal-close {
        width: 36px;
        height: 36px;
        top: 0.75rem;
        right: 0.75rem;
    }

    /* ---- Footer ---- */
    .about-footer {
        padding: 2rem 0 1.5rem;
        margin-top: 3rem;
    }
    .footer-links {
        gap: 1rem;
    }
}


@media (max-width: 480px) {

    .hero-content h1 {
        font-size: 2.6rem;
    }
    .hero-description {
        font-size: 0.95rem;
    }

    .page-hello {
        font-size: 2.6rem !important;
    }

    .about-headline {
        font-size: 1.3rem !important;
    }

    .work-card {
        padding: 1.25rem;
        border-radius: 22px;
    }
    .card-title {
        font-size: 1.35rem;
    }

    .section-title {
        font-size: 1.65rem;
    }

    .principle-item h4 {
        font-size: 2.5rem;
    }
    .principle-item h5 {
        font-size: 1.15rem;
    }

    .collab-headline {
        font-size: 1.35rem !important;
    }

    .modal-content {
        padding: 1.25rem 1rem;
    }
    .modal-content h3 {
        font-size: 1.2rem;
    }

    nav a {
        font-size: 0.78rem;
        padding: 0.4rem 0.55rem;
    }

    .timeline-card {
        padding: 0.85rem 1rem;
    }
}


/* =====================================================
   📱  MOBILE — clean final layer
   Goal: desktop-style typography on mobile, tight side
   margin (not edge-to-edge), nothing overflowing.
   The earlier mobile blocks above this in the file are
   superseded where this one sets the same property.
   ===================================================== */

@media (max-width: 768px) {

    /* ---- Comfortable side margin (not edge-to-edge) ---- */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .about-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 6rem !important;
    }

    /* ---- Hero ---- */
    .hero-content h1 {
        font-size: 4.4rem !important;
        line-height: 0.95 !important;
        white-space: normal;
        margin-bottom: 1.5rem !important;
    }
    .hero-description {
        font-size: 1rem !important;
        max-width: 100% !important;
        padding: 0 1rem !important;
        line-height: 1.55;
    }

    /* Sparkles — visible inside hero, not clipped */
    .sparkle {
        width: 36px !important;
        height: 36px !important;
        opacity: 0.9;
    }
    .sparkle-1 {
        top: -10px !important;
        right: 6px !important;
    }
    .sparkle-2 {
        bottom: -10px !important;
        left: 6px !important;
    }

    /* ---- About hero ---- */
    .page-hello {
        font-size: 4.4rem !important;
        margin-bottom: 2rem !important;
        line-height: 0.95;
    }

    /* About-block: photo on top, then bio content (left-aligned for readability) */
    .about-block {
        padding: 0 !important;
        gap: 1.25rem !important;
        grid-template-columns: 1fr !important;
    }
    .about-photo {
        grid-column: 1 / -1 !important;
        max-width: 260px !important;
        margin: 0 auto !important;
    }
    .about-content {
        grid-column: 1 / -1 !important;
        text-align: left !important;
        margin-top: 0 !important;
    }
    .about-headline {
        font-size: 1.85rem !important;
        line-height: 1.2 !important;
        text-align: left !important;
    }
    .about-bio p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    /* ---- Experience timeline — full-width pills, vertical stack ---- */
    .experience-timeline {
        grid-template-columns: 1fr !important;
        padding: 0 !important;
        gap: 0.6rem !important;
    }
    .timeline-card {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    /* ---- Collab block — span full width on mobile (override 25-col grid) ---- */
    .collab-block {
        display: block !important;
        padding: 0 !important;
    }
    .collab-headline {
        grid-column: unset !important;
        font-size: 1.85rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    .collab-body {
        grid-column: unset !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    /* ---- Principles block — fix overflow: span full width, no 25-col gymnastics ---- */
    .principles-block {
        padding: 1.75rem 1.25rem !important;
        border-radius: 24px !important;
    }
    .principles-grid-about {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    .principles-grid-about .entry,
    .principles-grid-about .entry:nth-child(odd),
    .principles-grid-about .entry:nth-child(even) {
        grid-column: 1 / -1 !important;
    }
    .principles-grid-about .count {
        font-size: 2.2rem !important;
        margin-bottom: 0.4rem !important;
    }
    .principles-grid-about h3 {
        font-size: 1.3rem !important;
    }
    .principles-grid-about p {
        font-size: 0.98rem !important;
        line-height: 1.55 !important;
    }

    /* ---- Background paragraphs — full-width ---- */
    .background-block {
        display: block !important;
        padding: 0 !important;
    }
    .background-block > p {
        grid-column: unset !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    /* ---- About photo grid — all 4 visible, natural ratios, no zoom hacks ---- */
    .about-pics {
        flex-direction: column !important;
        padding: 0 !important;
        gap: 0.6rem !important;
    }
    .pics-large,
    .pics-small {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        display: block !important;
        border-radius: 14px;
        overflow: hidden;
    }
    .about-pics figure {
        margin: 0;
        border-radius: 14px;
    }
    .pics-large figure {
        aspect-ratio: 16 / 11;
    }
    .pics-small figure {
        aspect-ratio: 4 / 3;
    }
    /* Drop the desktop crop tricks on mobile so the photos look natural */
    .about-pics .crop-letterbox {
        transform: none !important;
    }
    .about-pics .crop-portrait-wide {
        object-position: center 30% !important;
    }

    /* ---- Work tiles — comfortable padding, big titles ---- */
    .work-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }
    .work-grid > * {
        grid-column: 1 !important;
    }
    .work-card {
        padding: 1.5rem 1.25rem !important;
        min-height: 320px;
    }
    .card-title {
        font-size: 1.65rem !important;
    }
    .card-description {
        font-size: 0.98rem !important;
    }

    /* ---- "Just for fun" section ---- */
    .section-intro {
        padding: 0 !important;
    }
    .section-title {
        font-size: 2.3rem !important;
    }
    .section-subtitle {
        font-size: 1rem !important;
        padding: 0 !important;
    }
    .principles-grid {
        padding: 0 !important;
    }
    .principle-item h4 {
        font-size: 3.5rem !important;
    }
    .principle-item h5 {
        font-size: 1.3rem !important;
    }
    .principle-item p {
        font-size: 0.98rem !important;
    }

    /* ---- Modal ---- */
    .modal-overlay {
        padding: 2rem 1rem 1rem !important;
    }
    .modal-content {
        padding: 1.5rem 1.25rem !important;
    }
    .modal-content h3 {
        font-size: 1.4rem !important;
    }

    /* ---- Contact page ---- */
    .page-hello-sub {
        font-size: 1rem !important;
        padding: 0 !important;
    }
    .contact-info-item {
        padding: 1.25rem 1rem !important;
        grid-template-columns: 1fr !important;
        gap: 0.4rem !important;
    }
    .contact-copy-btn {
        align-self: flex-start;
        margin-top: 0.4rem;
    }

    /* ---- Footer ---- */
    .about-footer {
        padding: 2rem 0 1.5rem !important;
    }
}


@media (max-width: 480px) {
    /* Small phones — slightly smaller fonts only, padding stays at 1rem */

    .hero-content h1 {
        font-size: 3.6rem !important;
    }
    .page-hello {
        font-size: 3.6rem !important;
    }
    .about-headline {
        font-size: 1.55rem !important;
    }
    .section-title {
        font-size: 1.85rem !important;
    }
    .principle-item h4 {
        font-size: 2.8rem !important;
    }
    .collab-headline {
        font-size: 1.55rem !important;
    }
    .card-title {
        font-size: 1.45rem !important;
    }
    .principles-grid-about h3 {
        font-size: 1.2rem !important;
    }
}

