/* ── Lenis smooth scroll — outside @layer so it wins over @layer reset ── */

html.lenis,
html.lenis body { height: auto; }

.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }


/* ── Custom cursor — outside @layer for z-index & cursor: none priority ── */

@media (hover: hover) and (pointer: fine) {
  body,
  body a,
  body button,
  body [role="button"],
  body label {
    cursor: none;
  }
}

#cursor {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  #cursor {
    display: block;
    position: fixed;
    top: -18px;
    left: -18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(26, 127, 168, 0.55);
    background: rgba(26, 127, 168, 0.07);
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transition:
      width        0.2s cubic-bezier(0.22, 1, 0.36, 1),
      height       0.2s cubic-bezier(0.22, 1, 0.36, 1),
      background   0.2s ease,
      border-color 0.2s ease;
  }

  #cursor.cursor--active {
    width: 50px;
    height: 50px;
    background: rgba(26, 127, 168, 0.13);
    border-color: rgba(26, 127, 168, 0.8);
  }
}

.cursor-ripple {
  position: fixed;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(26, 127, 168, 0.6);
  pointer-events: none;
  z-index: 9998;
  animation: cursor-ripple-out 0.65s ease-out forwards;
}

@keyframes cursor-ripple-out {
  from { transform: scale(1);   opacity: 0.75; }
  to   { transform: scale(3.8); opacity: 0;    }
}


@layer components {

  /* ── Ocean palette override ──────────────────────────
     tokens.css is Gemini's domain — overrides live here
     until those tokens are promoted upstream.            */
  :root {
    --color-bg:           #FAF8F4;
    --color-surface:      #FFFFFF;
    --color-accent:       #1A7FA8;
    --color-steel:        #9DC4D3;
    --color-steel-subtle: #E6F2F6;
    --color-steel-border: #82AEBF;

    /* hero */
    --c-hero-bg:          #0C3A50;
    --c-hero-text:        #FAF8F4;

    /* motion — flag in ISSUES.md for Gemini to tokenize */
    --dur-fast:   0.15s;
    --dur-mid:    0.35s;
    --dur-slow:   0.6s;
    --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --color-bg:           #111110;
      --color-surface:      #1A1A18;
      --color-accent:       #5ABCD8;
      --color-steel:        #1A3540;
      --color-steel-subtle: #162C36;
      --color-steel-border: #254858;

      --c-hero-bg:          #070F14;
      --c-hero-text:        #F0EFEA;
    }
  }


  /* ════════════════════════════════════════════════════
     KEYFRAMES
     ════════════════════════════════════════════════════ */

  @keyframes wave-drift {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }

  @keyframes sun-glare-pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50%       { opacity: 0.75; transform: scale(1.08); }
  }

  @keyframes sunset-breathe {
    0%, 100% { filter: brightness(1)    saturate(1); }
    50%       { filter: brightness(1.06) saturate(1.1); }
  }

  @keyframes hero-enter {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes scroll-pulse {
    0%, 100% { opacity: 0.22; }
    50%       { opacity: 0.5; }
  }

  @keyframes ring-spin {
    to { transform: rotate(360deg); }
  }

  @keyframes text-shimmer {
    0%, 20%  { background-position: 0% 0; }
    60%, 100% { background-position: 100% 0; }
  }


  /* ── Nav ─────────────────────────────────────────── */

  /* Mobile: logo overflows at ≤480px — hide it (name is in the hero) */
  @media (max-width: 480px) {
    .nav__logo   { display: none; }
    .nav__links  { gap: 18px; }
  }

  .nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-bg);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur-mid) ease;
  }

  .nav.scrolled {
    border-bottom-color: var(--color-border);
  }

  .nav__inner {
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--padding-inline);
    padding-block: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav__logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: var(--text-md);
    color: var(--color-text-primary);
    text-decoration: none;
    white-space: nowrap;
  }

  .nav__logo:hover { text-decoration: none; }

  .nav__links {
    display: flex;
    gap: var(--space-6);
    list-style: none;
  }

  .nav__links a {
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--dur-fast) ease;
  }

  .nav__links a:hover {
    color: var(--color-text-primary);
    text-decoration: none;
  }



  /* ── Hero ────────────────────────────────────────── */

  .hero {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
  }

  /* ── Hero background layer ── */

  .hero__bg {
    position: absolute;
    inset: 0;
    /* Sunset-to-ocean placeholder — replace with video */
    background: linear-gradient(
      160deg,
      #D4622A 0%,
      #B84F2E 12%,
      #7A3B62 30%,
      #1E4D6B 55%,
      #0C3A50 75%,
      #071D28 100%
    );
    animation: sunset-breathe 9s var(--ease-in-out) infinite;
  }

  /* Video fills bg and hides gradient once a src is present */
  .hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
  }

  .hero__video[src]:not([src=""]) {
    opacity: 1;
  }

  /* Animated sun glare — warm radial that breathes */
  .hero__sun-glare {
    position: absolute;
    inset: 0;
    background: radial-gradient(
      ellipse 55% 45% at 55% 25%,
      rgba(255, 185, 80, 0.22) 0%,
      rgba(220, 120, 50, 0.10) 40%,
      transparent 70%
    );
    animation: sun-glare-pulse 7s var(--ease-in-out) infinite;
    pointer-events: none;
  }

  /* Waves */
  .hero__waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: clamp(80px, 12vw, 140px);
    pointer-events: none;
  }

  .wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
  }

  .wave--1 {
    fill: rgba(250, 248, 244, 0.07);
    animation: wave-drift 11s linear infinite;
  }

  .wave--2 {
    fill: rgba(250, 248, 244, 0.05);
    animation: wave-drift 15s linear infinite reverse;
    bottom: 6px;
  }

  .wave--3 {
    fill: rgba(26, 127, 168, 0.12);
    animation: wave-drift 20s linear infinite;
    bottom: -4px;
  }

  /* Gradient overlay — ensures text legibility over any photo/video */
  .hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(7, 29, 40, 0.10) 0%,
      rgba(7, 29, 40, 0.40) 55%,
      rgba(7, 29, 40, 0.82) 100%
    );
    pointer-events: none;
  }

  /* ── Hero text ── */

  .hero__inner {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--padding-inline);
    padding-bottom: var(--space-16);
    will-change: transform;
    transition: transform 0.5s var(--ease-out);
  }

  .hero__eyebrow {
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(250, 248, 244, 0.45);
    margin-bottom: var(--space-6);
    animation: hero-enter 0.8s var(--ease-out) 0.2s both;
  }

  .hero__name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(3rem, 10vw, 6.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    /* gradient-text shimmer — clipped to character shapes, no box artifact */
    background: linear-gradient(
      105deg,
      var(--c-hero-text) 30%,
      rgba(255, 230, 160, 0.65) 50%,
      var(--c-hero-text) 70%
    );
    background-size: 300% 100%;
    background-position: 0% 0;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: 0.18em;
    margin-bottom: var(--space-8);
    animation:
      hero-enter 0.9s var(--ease-out) 0.45s both,
      text-shimmer 10s ease-in-out infinite 2.5s;
  }

  .hero__name-line {
    display: block;
  }

  .hero__tagline {
    font-size: var(--text-lg);
    line-height: 1.65;
    color: rgba(250, 248, 244, 0.6);
    max-width: 32ch;
    animation: hero-enter 0.9s var(--ease-out) 0.75s both;
  }

  .hero__scroll {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    color: rgba(250, 248, 244, 0.22);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    animation: scroll-pulse 2.8s var(--ease-in-out) infinite 1.4s;
  }

  .hero__scroll::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    background: currentColor;
  }


  /* ════════════════════════════════════════════════════
     SCROLL-TRIGGERED ANIMATIONS
     ════════════════════════════════════════════════════ */

  [data-animate] {
    opacity: 0;
    translate: 0 22px;
    transition:
      opacity  var(--dur-slow) var(--ease-out),
      translate var(--dur-slow) var(--ease-out);
  }

  [data-animate].is-visible {
    opacity: 1;
    translate: 0 0;
  }

  [data-animate][data-animate-delay="1"] { transition-delay: 0.08s; }
  [data-animate][data-animate-delay="2"] { transition-delay: 0.18s; }
  [data-animate][data-animate-delay="3"] { transition-delay: 0.28s; }


  /* ── About ───────────────────────────────────────── */

  .about {
    padding-block: var(--space-16);
    background-color: #F7F1E8;
  }

  @media (prefers-color-scheme: dark) {
    .about { background-color: #141210; }
  }

  .about__inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-8);
    align-items: start;
  }

  @media (max-width: 520px) {
    .about__inner { grid-template-columns: 1fr; }
    .headshot     { margin-inline: auto; }
  }

  .headshot {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background-color: var(--color-steel);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    isolation: isolate;
    will-change: transform;
  }

  /* animated ocean-to-amber gradient ring */
  .headshot::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(
      from 0deg,
      #1A7FA8 0%,
      #D4622A 30%,
      #9DC4D3 55%,
      #0C3A50 75%,
      #1A7FA8 100%
    );
    animation: ring-spin 12s linear infinite;
    z-index: -1;
  }

  .headshot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 1;
  }

  .headshot__initials {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-lg);
    color: var(--color-text-muted);
    user-select: none;
  }

  .headshot img ~ .headshot__initials {
    display: none;
  }

  .about__name {
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
  }

  .about__bio {
    color: var(--color-text-muted);
    line-height: 1.75;
    max-width: 52ch;
  }

  .about__bio + .about__bio { margin-top: var(--space-4); }


  /* ── Work — dark "deep water" section ───────────── */

  .work {
    background-color: var(--color-bg);
    background-image: linear-gradient(90deg, transparent 0%, var(--color-steel) 25%, var(--color-accent) 50%, var(--color-steel) 75%, transparent 100%);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: top;
  }

  .work__intro {
    padding-top: var(--space-16);
    padding-bottom: var(--space-12);
  }

  .work .section-label {
    color: #1A7FA8;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.1em;
  }

  .work__headline {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: var(--color-text-primary);
    margin-top: var(--space-4);
  }

  /* ── Work video hero ─────────────────────────── */

  .work__video-hero {
    position: relative;
    padding-block: var(--space-12) var(--space-16);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .work__video-hero video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #070E16;
    object-fit: cover;
  }

  .work__video-text {
    margin-top: var(--space-10);
  }

  .work__video-heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 400;
    letter-spacing: -0.015em;
    line-height: 1.3;
    color: #E8E4DC;
    margin-bottom: var(--space-6);
  }

  .work__video-subheading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-md);
    font-weight: 500;
    color: rgba(232, 228, 220, 0.85);
    margin-top: var(--space-8);
    margin-bottom: var(--space-4);
  }

  .work__video-text p {
    font-size: var(--text-sm);
    color: rgba(232, 228, 220, 0.6);
    line-height: 1.85;
    margin-bottom: var(--space-5);
    max-width: 68ch;
  }

  .work__video-list {
    list-style: none;
    padding: 0;
    margin-top: var(--space-4);
    margin-bottom: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
  }

  .work__video-list li {
    position: relative;
    padding-left: calc(1.2em + var(--space-3));
    font-size: var(--text-sm);
    color: rgba(232, 228, 220, 0.6);
    line-height: 1.7;
    max-width: 68ch;
  }

  .work__video-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    top: 0.1em;
    color: #1A7FA8;
    font-family: 'JetBrains Mono', monospace;
  }

  .work__video-list strong {
    color: rgba(232, 228, 220, 0.85);
    font-weight: 500;
  }


  /* ── Agent showcase (below proj body) ─────────── */

  .proj__showcase {
    padding-bottom: var(--space-16);
  }


  /* ── Project rows ─────────────────────────────── */

  .proj {
    padding-block: var(--space-16);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .proj__inner { position: relative; }

  .proj__num {
    position: absolute;
    top: -0.15em;
    right: 0;
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(5rem, 13vw, 10rem);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.04em;
    color: rgba(255, 255, 255, 0.03);
    pointer-events: none;
    user-select: none;
  }

  .proj__header { margin-bottom: var(--space-10); }

  .proj__meta-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
  }

  .proj__title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.6rem, 3.5vw, var(--text-xl));
    font-weight: 400;
    letter-spacing: -0.02em;
    color: #E8E4DC;
    line-height: 1.15;
  }

  .proj__year {
    font-family: 'JetBrains Mono', monospace;
    font-size: var(--text-xs);
    color: rgba(232, 228, 220, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .proj__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
  }

  .work .tag {
    background-color: rgba(26, 127, 168, 0.10);
    border-color: rgba(26, 127, 168, 0.25);
    color: rgba(232, 228, 220, 0.55);
  }

  .proj__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(var(--space-8), 5vw, var(--space-16));
    align-items: start;
  }

  .proj__body--flip { direction: rtl; }
  .proj__body--flip > * { direction: ltr; }

  @media (max-width: 780px) {
    .proj__body,
    .proj__body--flip { grid-template-columns: 1fr; direction: ltr; }
    .proj__num { font-size: 5rem; }
  }

  .proj__lead {
    font-size: var(--text-md);
    color: #E8E4DC;
    line-height: 1.7;
    margin-bottom: var(--space-6);
  }

  .proj__copy p {
    font-size: var(--text-sm);
    color: rgba(232, 228, 220, 0.6);
    line-height: 1.85;
    margin-bottom: var(--space-5);
  }

  .proj__outcomes {
    list-style: none;
    padding: 0;
    margin-top: var(--space-7);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .proj__outcomes li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: rgba(232, 228, 220, 0.55);
    line-height: 1.6;
  }

  .proj__outcomes li::before {
    content: '→';
    color: #1A7FA8;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 0.05em;
  }

  /* Coming-soon project */
  .proj--dim { opacity: 0.4; transition: opacity 0.4s ease; }
  .proj--dim:hover { opacity: 0.65; }

  .proj__inner--center {
    display: flex;
    align-items: center;
    gap: var(--space-10);
  }

  .proj__wip-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(232, 228, 220, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 4px var(--space-3);
  }

  .proj__wip-badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FFBD2E;
    animation: wip-pulse 2s ease-in-out infinite;
  }

  @keyframes wip-pulse {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1; }
  }

  /* ── Architecture diagram ─────────────────────── */

  .arch-diagram {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .arch-diagram__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.15);
    padding: var(--space-2) var(--space-4) var(--space-3);
  }

  .arch-layer {
    display: grid;
    grid-template-columns: 2em 1fr;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 0.2s ease;
  }

  .arch-layer:hover { background: rgba(255, 255, 255, 0.04); }

  .arch-layer--llm {
    background: rgba(26, 127, 168, 0.12);
    border-color: rgba(26, 127, 168, 0.22);
  }

  .arch-layer--llm:hover { background: rgba(26, 127, 168, 0.18); }

  .arch-layer__num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(26, 127, 168, 0.6);
    text-align: right;
  }

  .arch-layer--llm .arch-layer__num { color: #5ABCD8; }

  .arch-layer__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .arch-layer__content strong {
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(232, 228, 220, 0.85);
  }

  .arch-layer--llm .arch-layer__content strong { color: #5ABCD8; }

  .arch-layer__content span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(232, 228, 220, 0.35);
  }

  .arch-connector {
    display: flex;
    align-items: center;
    padding-left: calc(2em + var(--space-3) + var(--space-4));
    height: 20px;
  }

  .arch-connector::before {
    content: '';
    display: block;
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
  }

  .arch-connector--branch::before {
    background: linear-gradient(to bottom, rgba(26,127,168,0.4), rgba(255,255,255,0.1));
  }

  /* ── Terminal mockup ──────────────────────────── */

  .terminal {
    border-radius: 12px;
    overflow: hidden;
    background: #070E16;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .terminal__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px var(--space-4);
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .terminal__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .terminal__dot--red    { background: #FF5F57; }
  .terminal__dot--yellow { background: #FFBD2E; }
  .terminal__dot--green  { background: #28CA41; }

  .terminal__title {
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(232, 228, 220, 0.25);
  }

  .terminal__body {
    padding: var(--space-5) var(--space-6);
  }

  .terminal__body pre { margin: 0; white-space: pre-wrap; word-break: break-word; }

  .terminal__body code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 2;
    color: rgba(232, 228, 220, 0.8);
  }

  .t-dim    { color: rgba(232, 228, 220, 0.28); }
  .t-green  { color: #28CA41; }
  .t-yellow { color: #FFBD2E; }
  .t-teal   { color: #5ABCD8; }
  .t-white  { color: #E8E4DC; }

  .t-cursor::after {
    content: '▋';
    animation: blink 1.1s step-end infinite;
    color: #1A7FA8;
  }

  @keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
  }

  .tag {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    background-color: var(--color-steel-subtle);
    border: 1px solid var(--color-steel-border);
    border-radius: 20px;
    padding: 2px var(--space-3);
    line-height: 1.4;
  }


  /* ── Play ────────────────────────────────────────── */

  .play {
    padding-block: var(--space-16);
    background-image: linear-gradient(90deg, transparent 0%, var(--color-steel) 25%, var(--color-accent) 50%, var(--color-steel) 75%, transparent 100%);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: top;
  }

  .play__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }

  @media (max-width: 540px) {
    .play__grid { grid-template-columns: 1fr; }
  }

  .media-card {
    --float-y: 0px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background-color: var(--color-surface);
    overflow: hidden;
    will-change: transform;
    transform: translateY(var(--float-y));
    transition:
      border-color var(--dur-fast) ease,
      box-shadow   var(--dur-mid)  var(--ease-out);
  }

  .media-card:hover {
    border-color: color-mix(in srgb, var(--color-border) 40%, var(--color-text-muted));
    box-shadow: 0 8px 28px rgba(12, 58, 80, 0.10);
  }

  .media-card__thumb {
    aspect-ratio: 16 / 9;
    background-color: var(--color-steel-subtle);
    display: grid;
    place-items: center;
    border-bottom: 1px solid var(--color-border);
  }

  .media-card__thumb--photo {
    background-color: color-mix(in srgb, var(--color-steel-subtle) 60%, var(--color-steel));
  }

  .media-card__icon {
    font-size: 1.5rem;
    color: var(--color-steel);
    user-select: none;
  }

  .media-card__meta {
    padding: var(--space-4) var(--space-6) var(--space-6);
  }

  .media-card__title {
    font-size: var(--text-md);
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
  }

  .media-card__desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.65;
  }


  /* ── Section wave dividers ───────────────────────── */

  .section-wave {
    display: block;
    line-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
  }

  .section-wave svg {
    display: block;
    width: 100%;
    height: 60px;
  }

  /* About (cream) → Work (cream) — invisible; sections flow together */
  .section-wave--to-work {
    background: #F7F1E8;
  }
  .section-wave--to-work svg { fill: var(--color-bg); }

  /* Work (cream) → Play (cream) — invisible; sections flow together */
  .section-wave--to-play {
    background: var(--color-bg);
  }
  .section-wave--to-play svg { fill: var(--color-bg); }

  /* Play (cream) → Contact (light steel) */
  .section-wave--to-contact {
    background: var(--color-bg);
  }
  .section-wave--to-contact svg { fill: #EEF6FA; }

  /* Dark mode: section bg colors are too similar — waves are invisible.
     Hide them; the colour shifts between sections still read clearly.  */
  @media (prefers-color-scheme: dark) {
    .section-wave { display: none; }
  }


  /* ── Photo gallery — masonry via CSS columns ──────── */

  .play__video-card {
    max-width: 380px;
    margin-top: var(--space-6);
    margin-bottom: var(--space-8);
  }

  .photo-gallery {
    columns: 3;
    column-gap: 6px;
  }

  /* Figure wrapper injected by JS — owns the masonry break + reveal */
  .photo-gallery__figure {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    break-inside: avoid;
    margin-bottom: 6px;
    /* Wave-wash initial state */
    opacity: 0;
    transform: translateX(-32px);
    transition:
      opacity   0.65s var(--ease-out),
      transform 0.65s var(--ease-out);
  }

  .photo-gallery__figure.wave-in {
    opacity: 1;
    transform: translateX(0);
  }

  .photo-gallery__img {
    width: 100%;
    display: block;
    border-radius: 0;            /* figure handles rounding */
    transition: transform 0.45s var(--ease-out), opacity var(--dur-mid) var(--ease-out);
    cursor: zoom-in;
  }

  .photo-gallery__figure:hover .photo-gallery__img {
    transform: scale(1.06);
    opacity: 1;
  }

  /* Caption overlay — slides up from bottom on hover */
  .photo-gallery__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 22px 12px 10px;
    background: linear-gradient(transparent, rgba(7, 29, 40, 0.72));
    color: rgba(250, 248, 244, 0.9);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    transform: translateY(100%);
    transition: transform 0.38s var(--ease-out);
    pointer-events: none;
  }

  .photo-gallery__figure:hover .photo-gallery__caption {
    transform: translateY(0);
  }

  @media (max-width: 700px) {
    .photo-gallery { columns: 2; }
  }

  @media (max-width: 440px) {
    .photo-gallery { columns: 1; }
  }


  /* ── Lightbox ────────────────────────────────────── */

  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: #070F14;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity    var(--dur-mid) var(--ease-out),
      visibility var(--dur-mid);
  }

  .lightbox.is-open {
    opacity: 1;
    visibility: visible;
  }

  .lightbox__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    width: 100%;
    height: 100%;
    padding: 60px 80px;
    box-sizing: border-box;
    pointer-events: none;
  }

  .lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    transition: opacity var(--dur-mid) var(--ease-out);
  }

  .lightbox__img.is-loading { opacity: 0; }

  .lightbox__close,
  .lightbox__prev,
  .lightbox__next {
    position: absolute;
    border: 1px solid rgba(250, 248, 244, 0.18);
    border-radius: 50%;
    background: rgba(250, 248, 244, 0.06);
    color: rgba(250, 248, 244, 0.75);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
      background var(--dur-fast) ease,
      color      var(--dur-fast) ease;
  }

  .lightbox__close:hover,
  .lightbox__prev:hover,
  .lightbox__next:hover {
    background: rgba(250, 248, 244, 0.14);
    color: #FAF8F4;
  }

  .lightbox__close {
    top: var(--space-6);
    right: var(--space-6);
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .lightbox__prev,
  .lightbox__next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 1.8rem;
    line-height: 1;
  }

  .lightbox__prev { left: var(--space-6); }
  .lightbox__next { right: var(--space-6); }

  @media (max-width: 540px) {
    .lightbox__figure { padding: 56px 52px; }

    .lightbox__prev,
    .lightbox__next {
      width: 40px;
      height: 40px;
      font-size: 1.4rem;
    }

    .lightbox__prev { left: 6px; }
    .lightbox__next { right: 6px; }
  }


  /* ── Contact ─────────────────────────────────────── */

  .contact {
    padding-block: var(--space-16);
    background-image: linear-gradient(90deg, transparent 0%, var(--color-steel) 25%, var(--color-accent) 50%, var(--color-steel) 75%, transparent 100%);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: top;
    background-color: #EEF6FA;
  }

  @media (prefers-color-scheme: dark) {
    .contact { background-color: #0D1E26; }
  }

  .contact__inner { max-width: 48ch; }

  .contact__heading {
    font-family: 'Fraunces', Georgia, serif;
    font-size: var(--text-xl);
    font-weight: 400;
    margin-bottom: var(--space-4);
  }

  .contact__sub {
    font-size: var(--text-md);
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: var(--space-8);
  }

  .contact__link {
    display: inline-block;
    font-size: var(--text-md);
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
    padding-bottom: 2px;
    transition: border-color var(--dur-fast) ease;
  }

  .contact__link:hover {
    border-bottom-color: var(--color-accent);
    text-decoration: none;
  }


  /* ── Footer ──────────────────────────────────────── */

  .footer {
    padding-block: var(--space-12);
    border-top: 1px solid var(--color-border);
  }

  .footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .footer__copy {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
  }

  .footer__links {
    display: flex;
    gap: var(--space-6);
    list-style: none;
  }

  .footer__links a {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--dur-fast) ease;
  }

  .footer__links a:hover {
    color: var(--color-text-primary);
    text-decoration: none;
  }

  .footer__icon {
    flex-shrink: 0;
    transition: transform 0.38s var(--ease-out), color 0.2s ease;
  }

  /* LinkedIn: float up */
  .footer__links a:hover .footer__icon--linkedin {
    transform: translateY(-3px);
    color: #0A66C2;
  }

  /* Instagram: tilt + glow */
  .footer__links a:hover .footer__icon--instagram {
    transform: rotate(12deg) scale(1.18);
    color: #E1306C;
  }

  /* GitHub: full spin */
  .footer__links a:hover .footer__icon--github {
    transform: rotate(360deg);
    transition-duration: 0.65s;
  }

}
