/* HWN Studio — the sliding wall.

   A room that changed state. The comparison is a wall you slide across it: the empty
   room on one side, the working studio on the other. The title spans the wall and obeys
   the rule set in the hero: type that is only drawn is not yet made, solid type is made.
   So the name is an outline over the empty room and solid over the studio, and sliding
   the wall builds it. The photographs are never altered; only the window over them moves. */

.studio-break{
  --studio-ink:#f3f1ea;
  --studio-muted:rgba(243,241,234,.58);
  --studio-line:rgba(243,241,234,.14);
  --studio-bg:#0c0c0b;
  position:relative;
  width:100vw;
  max-width:100vw;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
  box-sizing:border-box;
  margin-top:var(--space-section, 96px);
  background:var(--studio-bg);
  color:var(--studio-ink);
  padding:var(--space-section, 96px) 0;
  overflow:hidden;
  /* The lights go down as the chapter arrives (see motion.css). */
  transition:background-color 1s ease;
}
.studio-break::before{
  content:"";
  position:absolute;inset:0;
  background:
    radial-gradient(ellipse 70% 50% at 70% 20%, rgba(180,120,60,.12), transparent 60%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(40,60,80,.18), transparent 55%);
  pointer-events:none;
  transition:opacity 1.4s ease .15s;
}
.studio-break .marker-num{color:var(--studio-ink)}
.studio-inner{
  position:relative;
  z-index:1;
  /* As wide as a 3:2 window can be while still fitting the screen's height. */
  width:min(1330px, calc(100% - 96px), calc(84svh * 1.5));
  margin:0 auto;
}

/* ---------- What this is: one quiet row above the wall ---------- */
.studio-head{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:16px 48px;
  align-items:start;
  margin-bottom:clamp(28px,4vw,52px);
}
.studio-kicker{
  margin:0 0 10px;
  font-size:var(--type-kicker-size, 11px);
  letter-spacing:var(--type-kicker-track, .1em);
  text-transform:uppercase;
  color:var(--studio-muted);
}
.studio-role{
  margin:0;
  font-size:var(--type-role-size, 12px);
  line-height:var(--type-role-leading, 1.4);
  color:rgba(243,241,234,.72);
}
.studio-desc{
  margin:0;
  max-width:30rem;
  justify-self:end;
  font-size:var(--type-body-size, 14px);
  line-height:var(--type-body-leading, 1.55);
  letter-spacing:var(--type-body-track, -.01em);
  color:rgba(243,241,234,.68);
}

/* ---------- The wall: title, then the room ---------- */
.studio-wall{
  --split:52%;
  --edge:10px;                 /* thickness of the wall's leading edge */
  position:relative;
  container-type:inline-size;
  border-top:1px solid rgba(243,241,234,.3);   /* the rail the wall hangs from */
  user-select:none;
  -webkit-user-select:none;
  touch-action:pan-y;
  cursor:ew-resize;
}
.studio-wall.is-dragging{touch-action:none;cursor:grabbing}
.studio-title{
  position:relative;
  margin:0;
  padding:.1em 0 .13em;
  /* The H's own side-bearing is taken back so its stem meets the wall's end. */
  margin-left:-.078em;
  font-family:var(--font-sans, Arial, Helvetica, sans-serif);
  font-weight:500;
  letter-spacing:-.055em;
  line-height:.82;
  white-space:nowrap;
  /* One line from wall to wall; studio.js trims it to the exact width. */
  font-size:19.6vw;
  font-size:calc(100cqw / 4.92);
  /* Drawn. */
  color:transparent;
  -webkit-text-stroke:max(1px,.005em) rgba(243,241,234,.78);
}
.studio-title-made{
  /* Made: the same letters, solid, on the finished side of the wall. */
  position:absolute;
  inset:0;
  padding:inherit;
  color:var(--studio-ink);
  -webkit-text-stroke:max(1px,.005em) var(--studio-ink);
  clip-path:inset(0 0 0 var(--split));
  pointer-events:none;
}

/* The wall's edge above the room, hung from the rail. */
.studio-edge{
  position:absolute;
  z-index:3;
  top:0;
  left:var(--split);
  width:var(--edge);
  height:100%;
  transform:translateX(-50%);
  pointer-events:none;
  background:linear-gradient(90deg,#070706 0%,#2c2a26 34%,#6b675f 50%,#35332e 62%,#11110f 100%);
  box-shadow:-16px 0 26px -8px rgba(0,0,0,.6),1px 0 0 rgba(243,241,234,.16);
}
.studio-edge::before{
  /* Hanger on the rail. */
  content:"";
  position:absolute;
  left:50%;top:-4px;
  width:26px;height:7px;
  transform:translateX(-50%);
  background:#3b3934;
  box-shadow:inset 0 1px 0 rgba(243,241,234,.22);
}

.studio-compare{
  position:relative;
  width:100%;
  aspect-ratio:3 / 2;
  background:#151514;
  overflow:hidden;
}
.studio-compare:focus-visible{
  outline:2px solid rgba(243,241,234,.55);
  outline-offset:4px;
}
.studio-layer{
  position:absolute;inset:0;
  overflow:hidden;
}
.studio-layer picture,
.studio-tile picture{
  display:block;width:100%;height:100%;
}
.studio-layer img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  pointer-events:none;
  -webkit-user-drag:none;
}
.studio-layer-before{z-index:1}
.studio-layer-before img{object-position:center 45%}
.studio-layer-after{
  z-index:2;
  clip-path:inset(0 0 0 var(--split, 52%));
}
.studio-layer-after img{object-position:center 48%}
.studio-handle{
  position:absolute;
  top:0;bottom:0;
  left:var(--split, 52%);
  z-index:3;
  width:44px;
  transform:translateX(-50%);
  pointer-events:auto;
  cursor:ew-resize;
  /* A swipe up or down that starts on the wall's edge still scrolls the page; only the
     pull itself is held for sliding. */
  touch-action:pan-y;
}
.studio-wall.is-dragging .studio-handle{cursor:grabbing}
.studio-handle::before{
  /* The same edge, continuing down through the room. It throws its shadow on the side
     it has not reached yet. */
  content:"";
  position:absolute;
  top:0;bottom:0;left:50%;
  width:var(--edge);
  transform:translateX(-50%);
  background:linear-gradient(90deg,#070706 0%,#2c2a26 34%,#6b675f 50%,#35332e 62%,#11110f 100%);
  box-shadow:-18px 0 30px -8px rgba(0,0,0,.62),1px 0 0 rgba(243,241,234,.16);
}
.studio-handle-knob{
  /* A pull, set into the edge. */
  position:absolute;
  top:50%;left:50%;
  width:30px;height:68px;
  transform:translate(-50%,-50%);
  border-radius:3px;
  border:1px solid rgba(243,241,234,.34);
  background:linear-gradient(90deg,#141412,#2f2d29 50%,#161614);
  display:grid;
  place-items:center;
  box-shadow:0 10px 26px rgba(0,0,0,.5),inset 0 1px 0 rgba(243,241,234,.14);
  transition:border-color var(--dur-quick,.2s) ease;
  touch-action:none;
}
.studio-wall:hover .studio-handle-knob,
.studio-wall.is-dragging .studio-handle-knob{border-color:rgba(243,241,234,.7)}
.studio-handle-knob svg{
  width:16px;height:16px;
  fill:none;stroke:#f3f1ea;stroke-width:1.6;
}
.studio-badge{
  position:absolute;
  z-index:4;
  top:16px;
  font-size:11px;
  color:rgba(243,241,234,.9);
  background:rgba(0,0,0,.42);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  padding:7px 10px;
  pointer-events:none;
}
.studio-badge-before{left:16px}
.studio-badge-after{right:16px}
.studio-expand{
  position:absolute;
  z-index:5;
  right:16px;bottom:16px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(12,12,11,.55);
  color:#f3f1ea;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  font-size:11px;
  letter-spacing:.02em;
  padding:9px 12px;
  cursor:pointer;
  transition:background .2s, border-color .2s;
}
.studio-expand:hover{
  background:rgba(12,12,11,.78);
  border-color:rgba(255,255,255,.5);
}
.studio-hint{
  margin:12px 0 0;
  font-size:11px;
  color:rgba(243,241,234,.5);
  letter-spacing:.02em;
}

/* ---------- Frames, at their own proportions ----------
   One row, one height: each photograph keeps its shape instead of being cropped to a tile. */
.studio-rail-wrap{
  margin-top:clamp(40px,5vw,64px);
}
.studio-rail-label{
  margin:0 0 14px;
  font-size:11px;
  letter-spacing:var(--type-kicker-track, .1em);
  text-transform:uppercase;
  color:var(--studio-muted);
}
.studio-rail{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.studio-tile{
  margin:0;
  flex:var(--ar,1.5) 1 0%;
  min-width:0;
}
.studio-tile button{
  display:block;width:100%;
  aspect-ratio:var(--ar,1.5);
  padding:0;border:0;background:#161615;
  cursor:zoom-in;position:relative;overflow:hidden;
}
.studio-tile button:focus-visible{outline:2px solid rgba(243,241,234,.55);outline-offset:3px}
.studio-tile img{
  display:block;width:100%;height:100%;
  object-fit:cover;
  transition:transform .7s var(--ease, cubic-bezier(.16,.79,.22,1)), filter .4s;
  filter:saturate(.92) brightness(.96);
}
.studio-tile button:hover img,
.studio-tile button:focus-visible img{
  transform:scale(1.035);
  filter:saturate(1) brightness(1);
}
.studio-tile figcaption{
  margin-top:9px;
  font-size:11px;
  letter-spacing:.01em;
  color:var(--studio-muted);
}

/* Lightbox */
.studio-lightbox{
  position:fixed;inset:0;z-index:90;
  display:none;
  align-items:center;justify-content:center;
  background:rgba(6,6,5,.94);
  padding:clamp(16px,4vw,40px);
}
.studio-lightbox.is-open{display:flex}
.studio-lightbox-frame{
  position:relative;
  max-width:min(1200px,100%);
  max-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
.studio-lightbox img{
  display:block;
  max-width:100%;
  max-height:min(90vh, 1100px);
  width:auto;height:auto;
  object-fit:contain;
  image-rendering:auto;
  box-shadow:0 30px 80px rgba(0,0,0,.5);
}
.studio-lightbox-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  width:min(100%, 720px);
  color:rgba(243,241,234,.7);
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.studio-lightbox-close,
.studio-lightbox-nav{
  position:absolute;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(12,12,11,.45);
  color:#f3f1ea;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  cursor:pointer;
  transition:background .2s, border-color .2s;
}
.studio-lightbox-close{
  top:18px;right:18px;
  width:44px;height:44px;
  border-radius:50%;
  font-size:22px;line-height:1;
}
.studio-lightbox-nav{
  top:50%;
  transform:translateY(-50%);
  width:48px;height:48px;
  border-radius:50%;
  font-size:22px;
  display:grid;place-items:center;
}
.studio-lightbox-prev{left:clamp(8px,2vw,24px)}
.studio-lightbox-next{right:clamp(8px,2vw,24px)}
.studio-lightbox-close:hover,
.studio-lightbox-nav:hover{
  background:rgba(255,255,255,.1);
  border-color:rgba(255,255,255,.5);
}

/* Project video overlay */
.video-lightbox{
  position:fixed;inset:0;z-index:96;
  display:none;
  align-items:center;justify-content:center;
  background:rgba(8,8,7,.72);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  padding:clamp(20px,5vw,56px);
}
.video-lightbox.is-open{display:flex}
.video-lightbox-frame{
  width:min(920px,100%);
  margin:0 auto;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:12px;
}
.video-lightbox video{
  display:block;
  width:100%;
  max-height:min(72vh,780px);
  margin:0 auto;
  object-fit:contain;
  background:#0b0b0a;
  border-radius:8px;
  box-shadow:0 28px 80px rgba(0,0,0,.45);
}
.video-lightbox video[hidden]{display:none}
.video-lightbox-yt{
  display:block;width:100%;aspect-ratio:16/9;max-height:min(72vh,780px);
  border:0;border-radius:8px;background:#0b0b0a;
  box-shadow:0 28px 80px rgba(0,0,0,.45);
}
.video-lightbox-label{
  margin:0;
  color:rgba(243,241,234,.72);
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.video-lightbox-close{
  position:absolute;
  top:18px;right:18px;
  width:44px;height:44px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(12,12,11,.45);
  color:#f3f1ea;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  cursor:pointer;
  font-size:22px;line-height:1;
  transition:background .2s, border-color .2s;
}
.video-lightbox-close:hover{
  background:rgba(255,255,255,.1);
  border-color:rgba(255,255,255,.5);
}
@media(max-width:600px){
  .video-lightbox{
    padding:
      max(16px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(16px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    align-items:center;
    justify-content:center;
  }
  .video-lightbox-frame{width:min(100%,560px)}
  .video-lightbox video{max-height:min(70vh,560px);border-radius:6px}
  .video-lightbox-yt{border-radius:6px}
  .video-lightbox-label{text-align:center}
  .video-lightbox-close{top:max(12px, env(safe-area-inset-top));right:max(12px, env(safe-area-inset-right));width:40px;height:40px}
}

@media(max-width:900px){
  .studio-inner{width:min(calc(100% - 66px), calc(84svh * 1.5))}
  .studio-head{grid-template-columns:1fr;gap:14px}
  .studio-desc{max-width:34rem;justify-self:start}
}
@media(max-width:700px){
  /* All four frames, two to a row, each row at one height; nothing to push sideways. */
  .studio-rail{flex-wrap:wrap;gap:10px}
  .studio-rail::before{content:"";order:2;flex:0 0 100%;height:0;margin-top:-10px}
  .studio-tile:nth-child(-n+2){order:1}
  .studio-tile:nth-child(n+3){order:3}
}
@media(max-width:600px){
  .studio-inner{width:calc(100% - 32px)}
  .studio-wall{--edge:8px}
  /* A taller window on a phone: the room is seen in portrait. */
  .studio-compare{aspect-ratio:3/4;max-height:78svh}
  .studio-badge{top:12px;padding:6px 8px}
  .studio-badge-before{left:12px}
  .studio-badge-after{right:12px}
  .studio-expand{right:12px;bottom:12px;padding:8px 10px}
  .studio-handle-knob{width:28px;height:60px}
  .studio-lightbox-nav{display:none}
}
@media(prefers-reduced-motion:reduce){
  .studio-tile img{transition:none}
}
