:root{
    color-scheme: dark;
    --bg: #07070a;
    --bg-soft: #0d0d11;
    --line: rgba(255,255,255,0.09);
    --line-soft: rgba(255,255,255,0.05);
    --text: #f2f2f0;
    --text-dim: #8a8a90;
    --text-faint: #55555c;
    --glow-ui: #8fd3ff;
    --glow-vfx: #ffb067;
    --ease: cubic-bezier(.16,.84,.44,1);
    --spring: cubic-bezier(.34,1.56,.64,1);
  }

  *{ box-sizing: border-box; }
  html{ scroll-behavior: smooth; }
  html,body{ height:100%; }

  body{
    margin:0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  .grain{
    position: fixed; inset:0; pointer-events:none; z-index: 1;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.025) 1px, transparent 0);
    background-size: 3px 3px;
    opacity: 0.5;
  }

  h1,h2,.display{
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    margin: 0;
    letter-spacing: -0.01em;
  }

  a{ color: inherit; text-decoration: none; }
  button{ font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }

  ::selection{ background: rgba(143,211,255,0.25); color: #fff; }

  a:focus-visible, button:focus-visible{
    outline: 2px solid var(--glow-ui);
    outline-offset: 3px;
    border-radius: 4px;
  }

  /* ---------- Ambient background glow ---------- */
  .ambient{
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  .ambient::before, .ambient::after{
    content:"";
    position:absolute;
    width: 60vw; height: 60vw;
    max-width: 700px; max-height: 700px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.14;
  }
  .ambient::before{
    top: -10%; left: -10%;
    background: var(--glow-ui);
  }
  .ambient::after{
    bottom: -15%; right: -10%;
    background: var(--glow-vfx);
    opacity: 0.10;
  }

  /* ---------- Smooth scroll wrapper ---------- */
  #smooth-wrapper{
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 2;
    will-change: transform;
  }
  html.no-smooth #smooth-wrapper{
    position: static;
    transform: none !important;
  }
  #scroll-spacer{ width: 1px; }
  html.no-smooth #scroll-spacer{ display: none; }

  /* ---------- Unified hover fade-in (nav tab / cards / tags) ---------- */
  .hoverable{ position: relative; isolation: isolate; }
  .hoverable::after{
    content:"";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255,255,255,0.07);
    opacity: 0;
    transition: opacity 0.55s var(--ease);
    pointer-events: none;
    z-index: -1;
  }
  .hoverable:hover::after,
  .hoverable:focus-visible::after{ opacity: 1; }

  /* ---------- Topbar ---------- */
  header{
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    display: flex;
    justify-content: center;
    padding: 28px clamp(20px, 5vw, 56px) 0;
  }

  .brand{
    position: fixed;
    top: 28px; left: clamp(20px, 5vw, 56px);
    z-index: 20;
  }
  .brand .name{ font-size: 15px; font-weight: 600; }
  .brand .role{ font-size: 12px; color: var(--text-dim); margin-top: 2px; }

  /* nav.capsule can now hold 3 tabs (Home / Work / Contact). It's given a
     max-width plus a silent horizontal scroll fallback so that on narrow
     viewports the pill scrolls instead of overflowing and getting clipped
     by the viewport edge — that was the cause of the "Work" tab getting
     cut off on mobile. */
  nav.capsule{
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 999px;
    padding: 5px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    max-width: calc(100vw - 40px);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  nav.capsule::-webkit-scrollbar{ display: none; }

  .tab-indicator{
    position: absolute;
    top: 5px; left: 5px;
    height: calc(100% - 10px);
    width: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    transition: transform 0.5s var(--ease), width 0.5s var(--ease);
    z-index: 0;
    pointer-events: none;
  }

  nav.capsule .tab{
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-dim);
    transition: color 0.4s var(--ease);
  }
  nav.capsule .tab[aria-selected="true"]{ color: #fff; }

  nav.capsule.sub-capsule{ padding: 4px; margin-top: 6px; }
  nav.capsule.sub-capsule .tab{ padding: 7px 20px; font-size: 12.5px; }
  nav.capsule.sub-capsule .tab-indicator{ top: 4px; left: 4px; height: calc(100% - 8px); }

  /* ---------- Panels ---------- */
  main, .work, .contact{ position: relative; z-index: 2; }

  .panel{
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  }
  .panel.fade-out{ opacity: 0; transform: translateY(10px); }
  .panel.fade-in-start{ opacity: 0; transform: translateY(10px); }

  .subpanel{
    transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  }
  .subpanel.fade-out{ opacity: 0; transform: translateY(8px); }
  .subpanel.fade-in-start{ opacity: 0; transform: translateY(8px); }

  /* ---------- Hero ---------- */
  .hero{
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 24px 80px;
  }

  .kicker{
    font-size: 14px;
    color: var(--text-dim);
    max-width: 480px;
    line-height: 1.5;
    margin-bottom: 22px;
  }

  .headline{
    font-size: clamp(34px, 6.2vw, 62px);
    line-height: 1.12;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 40px rgba(255,255,255,0.18);
    max-width: 780px;
  }

  .headline .dim{
    color: var(--text-dim);
    font-weight: 500;
  }

  .cards{
    display: flex;
    gap: 18px;
    margin-top: 56px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .card{
    position: relative;
    width: 230px;
    padding: 22px 20px;
    text-align: left;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
    overflow: hidden;
    transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
  }

  .card::before{
    content:"";
    position: absolute;
    width: 140px; height: 140px;
    border-radius: 50%;
    filter: blur(46px);
    top: -50px;
    right: -40px;
    opacity: 0.55;
    transition: opacity 0.5s var(--ease);
  }

  .card.ui::before{ background: var(--glow-ui); }
  .card.vfx::before{ background: var(--glow-vfx); }

  .card:hover{ transform: translateY(-4px); border-color: rgba(255,255,255,0.18); }
  .card:hover::before{ opacity: 0.85; }

  .card .icon{
    width: 30px; height: 30px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
  }
  .card.ui .icon{ color: var(--glow-ui); }
  .card.vfx .icon{ color: var(--glow-vfx); }

  .card .label{
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 600;
    position: relative;
    z-index: 1;
  }
  .card .since{
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 6px;
    position: relative;
    z-index: 1;
  }
  .card .elapsed{
    font-size: 12px;
    color: var(--text-faint);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
    position: relative;
    z-index: 1;
  }

  .scroll-cue{
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-faint);
    font-size: 11px;
  }
  .scroll-cue svg{
    width: 14px; height: 14px;
    animation: bob 2.2s ease-in-out infinite;
  }
  @keyframes bob{
    0%,100%{ transform: translateY(0); opacity: 0.5; }
    50%{ transform: translateY(6px); opacity: 1; }
  }

  /* ---------- Now section ---------- */
  .now{
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px 160px;
    text-align: center;
  }

  .now h2{
    font-size: clamp(22px, 3.4vw, 30px);
    font-weight: 600;
    color: #fff;
    margin-bottom: 18px;
    line-height: 1.3;
  }

  .now p{
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto;
  }

  .tags{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
  }

  .tag{
    font-size: 12.5px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text-dim);
    background: rgba(255,255,255,0.02);
    transition: color 0.55s var(--ease), border-color 0.55s var(--ease);
  }
  .tag:hover{
    color: #fff;
    border-color: rgba(255,255,255,0.22);
  }

  /* ---------- Work tab ---------- */
  .work{
    max-width: 1080px;
    margin: 0 auto;
    padding: 150px 24px 160px;
  }

  .work-head{
    text-align: center;
    margin-bottom: 52px;
  }

  .work-head h1{
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    color: #fff;
  }

  .work-lede{
    font-size: 14px;
    color: var(--text-dim);
    max-width: 460px;
    margin: 12px auto 26px;
    line-height: 1.5;
  }

  .grid{
    display: grid;
    gap: 18px;
  }
  .photos-grid{ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .clips-grid{ grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

  .tile{
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
    border: 1px solid var(--line);
    cursor: pointer;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), border-color 0.5s var(--ease);
  }
  .grid.in .tile{ opacity: 1; transform: translateY(0); }
  .tile:hover{ border-color: rgba(255,255,255,0.16); }

  .tile.photo{ aspect-ratio: var(--ar, 4/5); }
  .tile.clip{ aspect-ratio: 16/9; }

  .tile .placeholder-fill{
    position: absolute; inset: 0;
    background:
      radial-gradient(120% 140% at 20% 15%, rgba(255,255,255,0.07), transparent 60%),
      linear-gradient(160deg, hsla(var(--hue, 210), 60%, 55%, 0.16), transparent 70%);
  }

  .tile img,
  .tile video.tile-thumb{
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transition: transform 0.7s var(--ease);
  }
  .tile:hover img,
  .tile:hover video.tile-thumb{ transform: scale(1.045); }

  .tile video.tile-thumb{
    pointer-events: none;
    background: transparent;
  }

  .tile .scrim{
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(5,5,7,0.12), rgba(5,5,7,0.72));
    opacity: 0;
    transition: opacity 0.45s var(--ease);
  }
  .tile:hover .scrim{ opacity: 1; }

  .tile .tile-label{
    position: absolute;
    left: 14px; bottom: 12px;
    font-size: 12px;
    color: var(--text-dim);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.45s var(--ease) 0.05s, transform 0.45s var(--ease) 0.05s, color 0.45s var(--ease) 0.05s;
    z-index: 1;
  }
  .tile:hover .tile-label{ opacity: 1; transform: translateY(0); color: #fff; }

  .tile-action{
    position: absolute;
    top: 50%; left: 50%;
    width: 56px; height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10,10,12,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.16);
    color: #fff;
    opacity: 0;
    transform: translate(-50%,-50%) scale(0.6) rotate(-8deg);
    transition: opacity 0.5s var(--spring), transform 0.5s var(--spring), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
    transition-delay: 0.06s;
    z-index: 1;
  }
  .tile:hover .tile-action{ opacity: 1; transform: translate(-50%,-50%) scale(1) rotate(0); }

  .tile.photo:hover .tile-action{ box-shadow: 0 0 26px rgba(143,211,255,0.35); border-color: rgba(143,211,255,0.4); }
  .tile.clip:hover .tile-action{ box-shadow: 0 0 26px rgba(255,176,103,0.35); border-color: rgba(255,176,103,0.4); }

  .tile-action svg{ width: 20px; height: 20px; }
  .tile.clip .tile-action svg{ width: 18px; height: 18px; margin-left: 2px; }

  .tile-action::after{
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0;
  }
  .tile.photo:hover .tile-action::after{ animation: ripple 0.9s var(--ease); color: var(--glow-ui); }
  .tile.clip:hover .tile-action::after{ animation: ripple 0.9s var(--ease); color: var(--glow-vfx); }
  @keyframes ripple{
    from{ opacity: 0.55; transform: scale(1); }
    to{ opacity: 0; transform: scale(1.65); }
  }

  /* ---------- Contact tab / Discord widget ---------- */
  .contact{
    max-width: 560px;
    margin: 0 auto;
    padding: 150px 24px 160px;
    text-align: center;
  }

  .contact-head h1{
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 600;
    color: #fff;
  }

  .contact-lede{
    font-size: 14px;
    color: var(--text-dim);
    max-width: 420px;
    margin: 12px auto 36px;
    line-height: 1.5;
  }

  .discord-card{
    position: relative;
    text-align: left;
    border-radius: 20px;
    padding: 26px;
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.015));
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
    overflow: hidden;
  }
  .discord-card::before{
    content:"";
    position: absolute;
    width: 160px; height: 160px;
    border-radius: 50%;
    filter: blur(50px);
    top: -60px; right: -50px;
    background: var(--glow-ui);
    opacity: 0.16;
    pointer-events: none;
  }

  .discord-card-top{
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .discord-avatar-wrap{
    position: relative;
    flex-shrink: 0;
  }
  .discord-avatar{
    width: 64px; height: 64px;
    border-radius: 50%;
    display: block;
    background: var(--bg-soft);
    object-fit: cover;
    border: 1px solid var(--line);
  }
  .discord-status-dot{
    position: absolute;
    right: -2px; bottom: -2px;
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 3px solid var(--bg);
    background: var(--text-faint);
    transition: background 0.3s var(--ease);
  }

  .discord-id-block{ min-width: 0; }
  .discord-name{
    font-family: 'Space Grotesk', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
  }
  .discord-handle{
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 2px;
  }
  .discord-status-text{
    font-size: 12.5px;
    color: var(--text-faint);
    margin-top: 6px;
  }

  .discord-custom-status,
  .discord-activity{
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
  }
  .discord-activity{
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .activity-kind{
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-faint);
  }
  .activity-detail{ color: var(--text-dim); }
  .status-emoji{ width: 16px; height: 16px; }

  .discord-actions{
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
  }
  .discord-btn{
    font-size: 12.5px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text-dim);
    background: rgba(255,255,255,0.02);
    transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
  }
  .discord-btn:hover{ color: #fff; border-color: rgba(255,255,255,0.22); }

  .discord-note{
    position: relative;
    z-index: 1;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-faint);
    margin: 18px 0 0;
  }


  /* ---------- Floating player dock ---------- */
  .player-dock{
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translate(-50%, 0);
    z-index: 30;
    width: min(92vw, 460px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: rgba(10,10,13,0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.06);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s var(--ease), transform 0.45s var(--spring);
  }
  .player-dock.visible{
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
    animation: dock-in 0.5s var(--spring);
  }
  @keyframes dock-in{
    from{ transform: translate(-50%, 16px); opacity: 0; }
    to{ transform: translate(-50%, 0); opacity: 1; }
  }

  .player-viz{
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0.5;
    pointer-events: none;
  }

  .player-inner{
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }

  .player-art-wrap{
    position: relative;
    width: 44px; height: 44px;
    flex-shrink: 0;
  }
  .player-art{
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255,255,255,0.14);
  }

  .player-yt-target{
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
  }
  .player-yt-target iframe{
    position: absolute;
    top: 50%; left: 50%;
    width: 180% !important;
    height: 180% !important;
    transform: translate(-50%, -50%);
  }

  .player-art-wrap{
    animation: spin-disc 6s linear infinite;
    animation-play-state: paused;
  }
  .player-dock.playing .player-art-wrap{ animation-play-state: running; }
  @keyframes spin-disc{ to{ transform: rotate(360deg); } }

  .player-art-glow{
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(143,211,255,0.5), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s var(--ease);
    pointer-events: none;
  }
  .player-dock.playing .player-art-glow{ opacity: 0.7; animation: pulse-glow 1.8s ease-in-out infinite; }
  @keyframes pulse-glow{
    0%,100%{ transform: scale(1); opacity: 0.5; }
    50%{ transform: scale(1.15); opacity: 0.85; }
  }

  .player-meta{ flex: 1; min-width: 0; }
  .player-title{
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .player-artist{
    font-size: 11.5px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
  }

  .player-seek{
    position: relative;
    height: 4px;
    border-radius: 999px;
    background: var(--line);
    margin-top: 8px;
    cursor: pointer;
  }
  .player-seek-fill{
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--glow-ui), var(--glow-vfx));
  }
  .player-seek-handle{
    position: absolute;
    top: 50%; left: 0%;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(143,211,255,0.7);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
  }
  .player-seek:hover .player-seek-handle,
  .player-seek:focus-visible .player-seek-handle{ opacity: 1; }

  .player-times{
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-faint);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
  }

  .player-play-btn{
    width: 38px; height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #07070a;
    background: #fff;
    box-shadow: 0 0 20px rgba(255,255,255,0.25);
    transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease);
  }
  .player-play-btn:hover{ transform: scale(1.06); }
  .player-play-btn svg{ width: 15px; height: 15px; }
  .player-play-btn .icon-play{ margin-left: 1px; }

  .player-close-btn{
    width: 26px; height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    border: 1px solid var(--line);
  }
  .player-close-btn:hover{ color: #fff; }
  .player-close-btn svg{ width: 11px; height: 11px; }

  @media (max-width: 560px){
    .player-dock{ bottom: 14px; }
    .player-meta{ order: 2; }
  }

  /* ---------- Lightbox ---------- */
  .lightbox{
    position: fixed; inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: rgba(3,3,5,0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease);
  }
  .lightbox.open{ opacity: 1; pointer-events: auto; }

  .lightbox-content{
    position: relative;
    max-width: min(90vw, 960px);
    max-height: 85vh;
    transform: scale(0.94);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(.19,1,.22,1), opacity 0.4s var(--ease);
  }
  .lightbox.open .lightbox-content{ transform: scale(1); opacity: 1; }

  .lightbox-content img, .lightbox-content video{
    display: block;
    max-width: 100%;
    max-height: 78vh;
    border-radius: 14px;
    background: var(--bg-soft);
  }

  .lightbox-caption{
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
  }

  .lightbox-close{
    position: absolute;
    top: -46px; right: 0;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.05);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s var(--ease), transform 0.3s var(--ease);
  }
  .lightbox-close:hover{ background: rgba(255,255,255,0.15); transform: rotate(90deg); }
  .lightbox-close svg{ width: 14px; height: 14px; }

  /* ---------- Footer ---------- */
  footer{
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 28px 24px 40px;
    font-size: 12px;
    color: var(--text-faint);
    border-top: 1px solid var(--line-soft);
  }

  /* ---------- Load-in orchestration ---------- */
  [data-reveal]{
    opacity: 0;
    transform: translateY(16px);
  }
  .ready [data-reveal]{
    animation: rise 0.9s var(--ease) forwards;
  }
  .ready [data-reveal="1"]{ animation-delay: 0.05s; }
  .ready [data-reveal="2"]{ animation-delay: 0.15s; }
  .ready [data-reveal="3"]{ animation-delay: 0.32s; }
  .ready [data-reveal="4"]{ animation-delay: 0.48s; }
  .ready [data-reveal="5"]{ animation-delay: 0.6s; }
  .ready [data-reveal="6"]{ animation-delay: 0.68s; }

  @keyframes rise{
    to{ opacity: 1; transform: translateY(0); }
  }

  /* scroll-triggered reveal for the "now" section */
  .now [data-inview]{
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  }
  .now [data-inview].in{
    opacity: 1;
    transform: translateY(0);
  }

  @media (max-width: 560px){
    .brand{ position: static; text-align: center; margin-bottom: 18px; }
    header{ position: static; padding: 24px 20px 0; }
    .hero{ padding-top: 20px; }
    .work{ padding-top: 30px; }
    .contact{ padding-top: 30px; }
    body.ready header, body.ready .brand{ animation: none; opacity: 1; }

    /* tighten tab sizing so Home / Work / Contact fit without relying on
       the scroll fallback on most phones */
    nav.capsule .tab{ padding: 7px 14px; font-size: 12px; }
    nav.capsule.sub-capsule .tab{ padding: 6px 14px; font-size: 11.5px; }
  }

  @media (prefers-reduced-motion: reduce){
    html{ scroll-behavior: auto; }
    [data-reveal], .now [data-inview], .grid .tile{ animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
    .scroll-cue svg{ animation: none; }
    .card, .tile img, .tile-action{ transition: none; }
  }