:root {
    --bg-color: #050505;
    --card-bg: #1a1a1a;
    --accent-purple: #9d4edd;
    --accent-glow: #7b2cbf;
    --text-main: #f3e8ff;
    --text-muted: #c4b5fd;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Space Grotesk', sans-serif;
    --grain-opacity: 0.05;

    /* Fluid spacing tokens */
    --space-xs:  clamp(8px,  1.5vw, 14px);
    --space-sm:  clamp(12px, 2vw,   20px);
    --space-md:  clamp(20px, 3vw,   32px);
    --space-lg:  clamp(32px, 5vw,   60px);
    --space-xl:  clamp(48px, 7vw,   80px);
    --container-pad: clamp(12px, 4vw, 20px);
}

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

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  /* smoother scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", 
               "SF Pro Display", "Segoe UI", Roboto, 
               Helvetica, Arial, sans-serif;
}


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

/* ─── Grain ─── */
.grain-overlay {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: var(--grain-opacity);
}

/* ─── Container ─── */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--container-pad);
}

/* [ HERO ]  */
.hero-section {
    /* Min 100svh (safe-area aware), fallback 100vh */
    min-height: 100svh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 3;
    /* Keep text above tentacle canvases */
    padding: 0 clamp(12px, 4vw, 40px);
}

.main-title {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 12vw, 11rem);
    color: var(--accent-purple);
    line-height: 0.9;
    text-transform: uppercase;
    letter-spacing: clamp(-3px, -0.4vw, -5px);
    z-index: 2;
    text-shadow:
      0 0 8px  rgba(157, 78, 221, 0.7),
      0 0 25px rgba(157, 78, 221, 0.5),
      0 0 50px rgba(157, 78, 221, 0.25);
}

.small-tag {
    display: block;
    font-size: clamp(0.85rem, 2.5vw, 1.2rem);
    color: var(--text-muted);
    letter-spacing: 2px;
}

.top-tag {
    transform: translateX(clamp(-80px, -10vw, -150px));
    margin-bottom: -20px;
}
.bottom-tag {
    transform: translateX(clamp(20px, 5vw, 50px));
    text-align: right;
    margin-top: 10px;
    font-size: clamp(1rem, 3.5vw, 2rem);
    font-weight: 500;
}

/* Floating blob — hide on very small screens */
.placeholder-graphic {
    width: clamp(60px, 8vw, 100px);
    height: clamp(90px, 12vw, 150px);
    background: linear-gradient(180deg, var(--accent-purple), transparent);
    border-radius: 50px;
    position: absolute;
    top: 8%; left: clamp(5%, 10%, 20%);
    opacity: 0.8;
    z-index: 1;
}

/* ── Tentacle Canvases ── */
.tentacle-canvas {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.tentacle-right {
    width:  clamp(200px, 35vw, 420px);
    height: clamp(300px, 50vw, 560px);
    bottom: 0; right: 0;
}

.tentacle-left {
    width:  clamp(180px, 32vw, 380px);
    height: clamp(260px, 45vw, 500px);
    bottom: 0; left: 0;
}

/* [ HORIZONTAL DIVIDER ] */
.horizontal-divider {
    position: relative;
    width: 100%; height: 2px;
    margin: var(--space-lg) 0;
    background: linear-gradient(to right, transparent 0%, var(--accent-purple) 20%, var(--accent-purple) 80%, transparent 100%);
    z-index: 10;
    display: block;
    flex-shrink: 0;
}

.horizontal-divider::before,
.horizontal-divider::after {
    content: '×'; position: absolute;
    color: var(--accent-purple);
    top: 50%; transform: translateY(-50%);
    font-size: 1.2rem;
    background: var(--bg-color);
    padding: 0 4px; line-height: 1;
}
.horizontal-divider::before { left: 0; }
.horizontal-divider::after  { right: 0; }

/* ════════════════════════════════════
   BENTO LAYOUT
   Desktop: left-col (photo+about) | right-block (exp+software / contact)
   Tablet ≤1100: stack vertically, left becomes a row
   Mobile ≤768: everything single column
════════════════════════════════════ */
.bento-outer {
    display: flex;
    gap: var(--space-sm);
    align-items: stretch;
}

.bento-left {
    flex: 0 0 33%;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.bento-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.bento-right-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    flex: 1;
}

/* ── Cards ── */
.bento-card {
    background-color: var(--card-bg);
    border-radius: clamp(12px, 2vw, 20px);
    padding: clamp(16px, 2.5vw, 28px);
    border: 1px solid #2a2a2a;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.bento-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-4px);
}

/* Photo card */
.photo-card {
    flex: 1.8;
    padding: 0;
    min-height: clamp(200px, 35vw, 300px);
}

.image-placeholder {
    width: 100%; height: 100%;
    min-height: clamp(200px, 35vw, 300px);
    background-color: #111;
    border-radius: clamp(12px, 2vw, 20px);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}

.image-placeholder img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center;
    display: block;
    transition: filter 0.5s ease;
}
.image-placeholder:hover img { filter: grayscale(0%) sepia(0%); }

.photo-fallback {
    position: absolute; color: #444;
    font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase;
}

/* About card */
.about-card { flex: 1; }
.about-card h3 {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    color: var(--text-muted); margin-bottom: 12px;
}
.about-card p {
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    line-height: 1.75; color: #aaa; margin-bottom: 10px;
}

.experience-card { height: 100%; }

/* ── Card Headers ── */
.card-header {
    display: flex;
    justify-content: space-between; align-items: flex-start;
    margin-bottom: 22px;
}

.card-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.5vw, 2.5rem);
    font-weight: 700; color: var(--text-main);
    letter-spacing: 0.5px; line-height: 1.3;
}

.card-header h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2vw, 1.65rem);
    font-weight: 700; color: var(--text-main);
    letter-spacing: 0.5px; line-height: 1.3;
}

.dot {
    width: 18px; height: 18px;
    background-color: #000;
    border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}

/* ── Timeline ── */
.timeline-item {
    border-left: 2px solid var(--accent-purple);
    padding-left: 14px; margin-bottom: 18px;
}
.timeline-item h4 {
    font-size: clamp(0.9rem, 1.5vw, 1.4rem);
    font-weight: 600; margin: 5px 0 2px;
}
.timeline-item p {
    font-size: clamp(0.8rem, 1.3vw, 1.2rem);
    color: #888;
}

.year-badge {
    border: 1px solid var(--accent-purple);
    border-radius: 20px; padding: 2px 10px;
    font-size: clamp(0.72rem, 1.2vw, 1rem);
    color: var(--accent-purple);
}

/* ── Software + Skills ── */
.software-skills-card { display: flex; flex-direction: column; }

.software-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(6px, 1vw, 12px);
}

.soft-icon {
    display: flex; align-items: center; justify-content: center;
    padding: clamp(8px, 1.5vw, 14px);
    background: #0d0d0d;
    border: 1px solid #2a2a2a; border-radius: 14px;
    transition: border-color 0.3s ease, transform 0.3s ease;
    aspect-ratio: 1;
}

.soft-icon img {
    /* Fluid icon size: fills the box responsively */
    width: clamp(120px, 8vw, 160px);
    height: clamp(120px, 8vw, 160px);
    object-fit: contain; display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.soft-icon:hover { border-color: var(--accent-purple); transform: translateY(-3px); }
.soft-icon:hover img { filter: drop-shadow(0 0 8px rgba(157,78,221,0.55)); }

.skills-divider {
    width: 100%; height: 1px;
    background: linear-gradient(to right, transparent, #3a3a3a, transparent);
    margin: var(--space-sm) 0;
}

.skills-sub-header { margin-bottom: 14px; }
.skills-sub-header h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2vw, 1.65rem);
    font-weight: 700; color: var(--text-main);
}

.skills-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
    border: 1px solid var(--text-muted); border-radius: 30px;
    padding: clamp(4px, 1vw, 6px) clamp(10px, 2vw, 16px);
    font-size: clamp(0.78rem, 1.3vw, 0.88rem);
    font-weight: 500; white-space: nowrap;
    transition: 0.3s; cursor: default; line-height: 1.4;
}
.pill:hover { background: var(--accent-purple); color: #000; border-color: var(--accent-purple); }

/* ── Contact Card ── */
.contact-card {
    display: flex; justify-content: space-between; align-items: center;
    background-color: var(--accent-purple); color: #000; flex-shrink: 0;
}
.contact-card:hover { transform: none; border-color: transparent; }

.contact-card h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 700; margin-bottom: 12px; color: #000;
}

.contact-links { list-style: none; line-height: 1.9; color: #000; }
.contact-links a {
    color: #000; text-decoration: none;
    font-size: clamp(0.8rem, 1.5vw, 1.2rem);
    /* Allow wrapping on small screens */
    word-break: break-word;
}

.qr-section {
    display: flex; align-items: center; gap: 14px;
    text-align: right; font-weight: bold; font-size: 0.9rem; flex-shrink: 0;
}
.qr-placeholder { width: 80px; height: 80px; background: #000; border-radius: 6px; }

/* [ PROJECT SEGMENTS ] */
.project-segment { margin-top: var(--space-md); padding-bottom: var(--space-md); }

.segment-header {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: var(--space-sm);
    padding: clamp(16px, 3vw, 24px) clamp(50px, 8vw, 100px);
    min-height: 80px;
}

.segment-header-inner {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px; text-align: center;
}

/* Fluid outline title — never overflows its container */
.outline-text {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 5.5vw, 4rem);
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: 2px var(--accent-purple);
    text-stroke: 2px var(--accent-purple);
    letter-spacing: clamp(1px, 0.5vw, 4px);
    white-space: nowrap;
    text-shadow:
        0 0 50px rgba(157, 78, 221, 0.5);
}

.divider-line { width: 60px; height: 1px; background: var(--accent-purple); opacity: 0.6; }
.segment-meta { font-size: 0.82rem; letter-spacing: 3px; text-transform: uppercase; color: var(--text-muted); }

/* ── Side Decorations ── */
.side-decoration {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 2px; height: 0;   /* GSAP animates to 140px */
    background: linear-gradient(to bottom, transparent, var(--accent-purple), transparent);
}
.left-deco  { left: 20px; }
.right-deco { right: 20px; }

.side-decoration::before,
.side-decoration::after {
    content: '×'; position: absolute;
    color: var(--accent-purple); left: -5px;
    font-size: 1rem; line-height: 1;
    opacity: 0; transition: opacity 0.3s ease;
}
.side-decoration::before { top: -18px; }
.side-decoration::after  { bottom: -18px; }
.side-decoration.is-visible::before,
.side-decoration.is-visible::after { opacity: 1; }

/* ── Projects Grid ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 1.5vw, 15px);
    grid-auto-rows: clamp(130px, 18vw, 210px);
}

.project-item {
    position: relative; overflow: hidden;
    border-radius: clamp(8px, 1.5vw, 12px);
    background: #111; cursor: pointer;
}

.project-item img,
.project-item video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;          /* default: crop-to-fill for square cells */
    object-position: center;
    filter: grayscale(100%);
    transition: filter 0.5s ease, transform 0.4s ease;
    display: block;
}
.project-item video { z-index: 2; }
.project-item img   { z-index: 1; }

/* ── Colour / zoom on interaction ── */
.project-item:hover img,
.project-item:hover video,
.project-item:active img,
.project-item:active video {
    filter: grayscale(0%);
    transform: scale(1.04);
}


.item-wide video,
.item-large video,
.item-large-c video,
.item-tall video,
.item-tall-c video {
    object-fit: cover;
    background: #0a0a0a;
}

.item-wide:hover video,
.item-large:hover video,
.item-large-c:hover video,
.item-tall:hover video,
.item-tall-c:hover video,
.item-wide:active video,
.item-large:active video,
.item-large-c:active video,
.item-tall:active video,
.item-tall-c:active video {
    transform: none;
}

.item-wide img,
.item-large img,
.item-large-c img,
.item-tall img,
.item-tall-c img {
    object-fit: cover;
}

.project-overlay {
    position: absolute; inset: 0; z-index: 10;
    display: flex; align-items: flex-end; padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 55%);
    opacity: 0; transition: opacity 0.4s ease;
}
.project-item:hover .project-overlay,
.project-item:focus .project-overlay { opacity: 1; }

.project-overlay span {
    font-size: clamp(0.65rem, 1.5vw, 0.8rem);
    font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--text-main);
}

/* Grid span helpers */
.item-tall    { grid-row: span 2; }
.item-tall-c  { grid-row: span 2; grid-column: span 2; }
.item-wide    { grid-column: span 2; }
.item-large   { grid-column: span 2; grid-row: span 2; }
.item-large-c { grid-column: span 3; grid-row: span 4; }

/* Vertical grid for socials/reels */
.projects-grid.vertical-focus {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: clamp(260px, 40vw, 430px);
}

/* [ THANK YOU ] */
.thank-you-section {
    position: relative;
    min-height: clamp(300px, 50vw, 60vh);
    display: flex; justify-content: center; align-items: center;
    text-align: center;
    padding: clamp(40px, 8vw, 100px) var(--container-pad);
    margin-top: var(--space-lg);
}

.thank-you-title {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 8vw, 8vw);
    color: var(--accent-purple);
    margin-bottom: 30px; letter-spacing: -2px;
    text-shadow:
        0 0 50px rgba(157, 78, 221, 0.5);
}

.cta-pill {
    display: inline-block;
    background-color: var(--accent-purple); color: #000;
    padding: clamp(10px, 2vw, 15px) clamp(24px, 5vw, 40px);
    border-radius: 50px; text-decoration: none;
    font-weight: 700; font-size: clamp(0.95rem, 2vw, 1.2rem);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Prevent text overflow on very small screens */
    white-space: nowrap;
}
.cta-pill:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(157,78,221,0.4); }

 /* [ FOOTER ] */
.site-footer { padding: clamp(32px, 6vw, 60px) var(--container-pad); background-color: #000; text-align: center; }

.footer-links {
    display: flex; justify-content: center;
    flex-wrap: wrap;   /* wraps on narrow screens */
    gap: clamp(16px, 4vw, 40px); margin-bottom: 40px;
}

.social-link {
    display: flex; align-items: center; gap: 8px;
    color: var(--text-muted); text-decoration: none;
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 3vw, 2rem);
    transition: color 0.3s;
}
.social-link .icon { width: clamp(20px, 3vw, 30px); height: clamp(20px, 3vw, 30px); }
.social-link:hover { color: var(--accent-purple); }

.footer-bottom { font-size: clamp(0.78rem, 1.5vw, 0.9rem); color: #555; display: flex; flex-direction: column; gap: 10px; }
.timestamp { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; }

/* [ BREAKPOINTS ] */
/* ── Tablet ≤1100px ── */
@media (max-width: 1100px) {
    .bento-outer    { flex-direction: column; }
    .bento-left     { flex-direction: row; flex: none; }
    .photo-card     { flex: 0 0 220px; min-height: 220px; }
    .bento-right-top { grid-template-columns: 1fr 1fr; }
    .item-large-c   { grid-column: span 2; grid-row: span 2; }
}

/* ── Large Mobile ≤768px ── */
@media (max-width: 768px) {
  .outline-text,
  .thank-you-title{
    text-shadow:
        0 0 50px rgba(157, 78, 221, 0.50);
  }
    /* Bento */
    .bento-left        { flex-direction: column; }
    .photo-card        { flex: none; min-height: 260px; }
    .bento-right-top   { grid-template-columns: 1fr; }

    /* Contact card */
    .contact-card      { flex-direction: column; text-align: center; gap: 20px; align-items: center; }
    .qr-section        { flex-direction: row; justify-content: center; }

    /* Project grids: 2-column */
    .projects-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: clamp(120px, 30vw, 180px); }
    .item-large    { grid-column: span 2; grid-row: span 2; }
    .item-tall-c   { grid-column: span 2; grid-row: span 2; }
    .item-large-c  { grid-column: span 2; grid-row: span 2; }
    .item-wide     { grid-column: span 2; }

    /* Social edits: 2-col portrait */
    .projects-grid.vertical-focus { grid-template-columns: 1fr 1fr; grid-auto-rows: clamp(240px, 55vw, 320px); }

    /* Segment headers */
    .segment-header   { padding: clamp(16px, 4vw, 20px) clamp(44px, 10vw, 56px); }
    .outline-text     { font-size: clamp(1.3rem, 6.5vw, 2.4rem); white-space: nowrap; }
    .side-decoration  { display: none; } /* side lines at small sizes look cramped */

    /* Tentacles — smaller footprint */
    .tentacle-right   { width: 160px; height: 260px; }
    .tentacle-left    { width: 140px; height: 240px; }
}

/* ── Small Mobile ≤480px ── */
@media (max-width: 480px) {
  .outline-text,
  .thank-you-title{
    text-shadow:
        0 0 50px rgba(157, 78, 221, 0.50);
  }
    /* Hero text doesn't overflow */
    .main-title   { font-size: clamp(2.8rem, 15vw, 4.5rem); letter-spacing: -2px; }
    .bottom-tag   { transform: translateX(0); text-align: center; }
    .top-tag      { transform: translateX(0); text-align: center; }

    /* Outline text */
    .outline-text { font-size: clamp(1.1rem, 7.5vw, 2rem); letter-spacing: 1px; }
    .segment-header { padding: 14px 38px; }

    /* Project grids — 1-column on very narrow */
    .projects-grid { grid-template-columns: 1fr; grid-auto-rows: clamp(160px, 55vw, 220px); }
    .item-tall, .item-tall-c, .item-large, .item-large-c, .item-wide { grid-column: span 1; grid-row: span 1; }

    /* Social — single column */
    .projects-grid.vertical-focus { grid-template-columns: 1fr 1fr; grid-auto-rows: clamp(200px, 60vw, 280px); }

    /* Bento right-top stays stacked */
    .bento-right-top { grid-template-columns: 1fr; }

    /* Contact links don't overflow */
    .contact-links a { font-size: 0.82rem; }

    /* Tentacles — minimal on very small */
    .tentacle-right { width: 110px; height: 190px; }
    .tentacle-left  { width: 100px; height: 180px; }
    .placeholder-graphic { display: none; } /* no room */

    /* CTA */
    .cta-pill { font-size: 0.9rem; padding: 10px 22px; white-space: normal; text-align: center; }

    /* Footer */
    .footer-links { gap: 14px; }
    .social-link  { font-size: 1rem; }

    /* Soften card padding */
    .bento-card { padding: 14px; border-radius: 14px; }
}

/* ── Landscape phone ≤768px x ≤500px tall ── */
@media (max-width: 768px) and (max-height: 500px) and (orientation: landscape) {
  .outline-text,
  .thank-you-title{
    text-shadow:
        0 0 50px rgba(157, 78, 221, 0.50);
  }

  .hero-section     { min-height: auto; padding: 40px 0; }
  .tentacle-right,
  .tentacle-left    { display: none; }
  .placeholder-graphic { display: none; }


  .soft-icon img {
    width: clamp(40px, 8vw, 80px);
    height: clamp(40px, 8vw, 80px);
  } 
}

/* ── Touch-active state for mobile project colour reveal ── */
.project-item.touch-active img,
.project-item.touch-active video {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.project-item.touch-active .project-overlay {
    opacity: 1;
}

/* ═══════════════════════════════════════════════
   LIGHTBOX — paste anywhere in style.css
   (double-click to focus on project items)
═══════════════════════════════════════════════ */

/* Hint cursor so users know items are interactive */
.project-segment .project-item {
  cursor: zoom-in;
}

/* ── Backdrop ── */
#lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000; /* sits above grain-overlay (9999) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);

  /* Frosted-glass blur on everything behind */
  backdrop-filter: blur(18px) brightness(0.35);
  -webkit-backdrop-filter: blur(18px) brightness(0.35);
  background: rgba(5, 5, 5, 0.6);

  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

#lb-overlay.lb-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Inner container ── */
#lb-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 1100px);
  max-height: 92vh;

  /* Subtle card lift */
  background: rgba(26, 26, 26, 0.55);
  border: 1px solid rgba(157, 78, 221, 0.25);
  border-radius: 16px;
  padding: clamp(14px, 3vw, 28px);
  box-shadow:
    0 0 40px rgba(157, 78, 221, 0.2),
    0 20px 60px rgba(0, 0, 0, 0.7);

  /* Animate in from slightly below */
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#lb-overlay.lb-visible #lb-inner {
  transform: translateY(0) scale(1);
}

/* ── Media (img & video) ── */
#lb-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: calc(92vh - 100px);
  overflow: hidden;
  border-radius: 10px;
}

#lb-media-wrap img,
#lb-media-wrap video {
  max-width: 100%;
  max-height: calc(92vh - 100px);
  width: auto;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}

/* ── Caption ── */
#lb-caption {
  font-family: var(--font-sans);
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  margin: 0;
}

/* ── Close button ── */
#lb-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(157, 78, 221, 0.4);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  z-index: 1;
}

#lb-close:hover,
#lb-close:focus-visible {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 12px rgba(157, 78, 221, 0.6);
  outline: none;
}

/* ── Mobile tweaks ── */
@media (max-width: 600px) {
  #lb-inner {
    padding: 12px;
    border-radius: 12px;
  }

  #lb-close {
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
}
