:root{
    --ink:#111111;
    --paper:#ffffff;
    --muted:#8a8a8a;
    --hair:#e4e4e4;
    --serif: "Georgia", "Iowan Old Style", "Times New Roman", serif;
    --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --ink:#111111;
      --paper:#ffffff;
      --muted:#8a8a8a;
      --hair:#e4e4e4;
    }
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:var(--paper);
    color:var(--ink);
    font-family:var(--sans);
    height:100vh;
    overflow:hidden;
    -webkit-font-smoothing:antialiased;
    cursor:pointer;
  }

  /* ---------- Page: top margin band / stage / bottom margin band ---------- */
  .page{
    height:100vh;
    width:100vw;
    display:flex;
    flex-direction:column;
  }

  /* Header sits vertically centered within the whole top margin band,
     the same way the caption sits centered within the bottom band —
     neither one is pinned to the viewport edge. */
  .band{
    min-height:0;
    display:flex;
    align-items:center;
  }
  .band-top, .band-bottom{
    flex:0 0 125px;
    height:125px;
  }
  .band-top{
    justify-content:space-between;
    padding:0 40px;
  }
  .band-bottom{
    justify-content:center;
    padding:0 40px;
  }

  .id-block{
    font-size:15px;
    line-height:1.3;
    letter-spacing:0.02em;
  }
  .id-name{font-weight:700; cursor:pointer;}
  .id-title{font-weight:400; color:var(--ink);}
  nav.top-nav{
    display:flex;
    gap:22px;
    font-size:14px;
  }
  nav.top-nav button{
    background:none;
    border:none;
    font-family:var(--sans);
    font-size:14px;
    color:var(--ink);
    cursor:pointer;
    padding:2px 0;
    letter-spacing:0.01em;
    text-transform:uppercase;
    position:relative;
  }
  nav.top-nav button::after{
    content:"";
    position:absolute;
    left:0; right:0; bottom:-3px;
    height:1px;
    background:var(--ink);
    transform:scaleX(0);
    transform-origin:left;
  }
  nav.top-nav button:hover::after,
  nav.top-nav button[aria-pressed="true"]::after{
    transform:scaleX(1);
  }

  /* ---------- Stage (fills the space between the fixed-height bands) ---------- */
  .stage-row{
    flex:1 1 auto;
    width:100%;
    display:flex;
    align-items:stretch;
    justify-content:center;
    padding:0 60px;
    min-height:0;
  }
  #stageVideo{ width:100%; height:100%; object-fit:cover; display:block; }
  #muteBtn{
    position:absolute; right:14px; bottom:14px; z-index:5;
    width:34px; height:34px; border-radius:50%;
    background:rgba(0,0,0,0.55); border:none; color:#fff;
    display:none; align-items:center; justify-content:center;
    cursor:pointer; transition:background 0.15s;
  }
  #muteBtn:hover{ background:rgba(0,0,0,0.75); }
  .frame-wrap{
    position:relative;
    display:flex;
    align-items:stretch;
    justify-content:center;
    max-width:82vw;
    height:100%;
  }
  .frame{
    position:relative;
    height:100%;
    cursor:pointer;
    background:#f2f2f2;
    overflow:hidden;
  }
  .frame img{
    height:100%;
    width:100%;
    object-fit:cover;
    display:block;
    user-select:none;
    -webkit-user-drag:none;
    transition:opacity 0.15s ease;
  }
  .frame.video::before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
  }

  .caption{
    text-align:center;
    font-size:14px;
    line-height:1.4;
    max-width:600px;
  }
  .caption .proj{font-weight:700;}
  .caption .kind{font-weight:400;}
  .caption .credit{color:var(--ink);}

  .counter{
    position:fixed;
    bottom:26px;
    right:40px;
    font-size:12px;
    letter-spacing:.03em;
    color:var(--muted);
    z-index:30;
    font-variant-numeric:tabular-nums;
  }

  /* ---------- Thumbnails overlay ---------- */
  .overlay{
    position:fixed;
    top:125px; left:0; right:0; bottom:0;
    background:var(--paper);
    z-index:60;
    overflow-y:auto;
    opacity:0;
    pointer-events:none;
    transition:opacity .25s ease;
  }
  .overlay.open{opacity:1; pointer-events:auto;}
  .thumb-grid{
    display:grid;
    grid-template-columns:repeat(8,1fr);
    gap:25px;
    grid-auto-rows:var(--thumb-row-h, 110px);
    padding-top:0;
    padding-bottom:60px;
    padding-left:40px;
    padding-right:calc(40px - var(--thumb-sb-comp, 0px));
  }
  @media (max-width:900px){
    .thumb-grid{
      grid-template-columns:repeat(4,1fr);
      gap:14px;
      padding-left:16px;
      padding-right:calc(16px - var(--thumb-sb-comp, 0px));
      padding-bottom:40px;
    }
  }
  .thumb{
    position:relative;
    overflow:hidden;
    cursor:pointer;
    background:var(--paper);
  }
  .thumb.wide{
    grid-column:span 2;
  }
  .thumb img,
  .thumb video{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
  }

  /* ---------- Info overlay ---------- */
  .info-panel{
    position:fixed;
    top:125px; left:0; right:0; bottom:0;
    background:var(--paper);
    z-index:60;
    opacity:0;
    pointer-events:none;
    transition:opacity .25s ease;
    overflow-y:auto;
    cursor:default;
  }
  .info-panel.open{opacity:1; pointer-events:auto;}
  .info-grid{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:40px;
    padding:40px 40px 60px;
    font-size:15px;
    line-height:1.7;
  }
  @media (max-width:900px){
    .info-grid{grid-template-columns:1fr; padding:32px 16px 40px;}
  }
  .info-inner p{margin:0 0 20px;}
  .info-inner a{color:var(--ink);}
  .info-past-work .info-heading{
    font-weight:400;
    margin-bottom:6px;
  }
  .info-past-work ul{
    list-style:none;
    margin:0; padding:0;
  }
  .info-past-work li{margin-bottom:2px;}

  @media (prefers-reduced-motion: reduce){
    *{transition:none !important;}
  }

  @media (max-width:780px){
    .band-top, .band-bottom{padding:0 22px;}
    .id-block{font-size:13px;}
    nav.top-nav{gap:16px; font-size:13px;}
    .stage-row{padding:0 20px;}
    .thumb-grid{padding-left:16px; padding-right:calc(16px - var(--thumb-sb-comp, 0px)); padding-bottom:40px;}
  }
