/* Work page: one project per section, magazine style */
.mag { padding: 0 var(--pad); }
.mag-item {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(40px, 6vw, 104px) 0;
  border-top: 1.5px solid var(--ink);
}
.mag-num { font-size: 14px; font-weight: 600; color: var(--ink-3); margin: 0 0 clamp(16px, 2vw, 28px); }

/* The visual: the scroll video with a phone still over one corner */
.mag-visual { position: relative; margin: 0 0 clamp(28px, 3.4vw, 56px); }
.mag-shot {
  display: block; width: 100%; padding: 0; border: 1px solid rgba(10, 10, 10, 0.08);
  border-radius: clamp(16px, 2vw, 28px); overflow: hidden; background: #f2f2f2;
  box-shadow: 0 40px 80px -48px rgba(10, 10, 10, 0.55);
  cursor: zoom-in; transition: transform 0.25s ease;
}
.mag-shot:hover { transform: translateY(-3px); }
.mag-shot:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; }
.mag-shot video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.mag-phone {
  position: absolute; right: clamp(-12px, -1vw, 0px); bottom: clamp(-40px, -4vw, -20px);
  width: clamp(110px, 13vw, 240px); height: auto; pointer-events: none;
  filter: drop-shadow(0 24px 30px rgba(10, 10, 10, 0.28)) drop-shadow(0 2px 4px rgba(10, 10, 10, 0.14));
}
.mag-item.flip .mag-phone { right: auto; left: clamp(-12px, -1vw, 0px); }
@media (max-width: 640px) { .mag-phone { display: none; } }

/* Copy under the visual */
.mag-copy { display: grid; gap: clamp(20px, 2.4vw, 32px); }
@media (min-width: 900px) {
  .mag-copy { grid-template-columns: 1.3fr 1fr; align-items: end; column-gap: clamp(32px, 5vw, 96px); }
}
.mag-copy h2 { font-size: clamp(44px, 7vw, 120px); }
.mag-line { margin: clamp(14px, 1.6vw, 22px) 0 0; color: var(--ink-2); font-size: clamp(18px, 1.5vw, 24px); line-height: 1.4; max-width: 40ch; }
.mag-facts { display: flex; flex-wrap: wrap; gap: clamp(20px, 3vw, 48px); margin: 0; }
.mag-facts div { display: grid; gap: 4px; }
.mag-facts dt {
  font-weight: 800; font-variation-settings: "opsz" 96, "wdth" 112, "wght" 800;
  font-size: clamp(30px, 3.4vw, 56px); line-height: 1; letter-spacing: -0.03em;
}
.mag-facts dt.word { font-size: clamp(20px, 1.8vw, 28px); letter-spacing: -0.02em; line-height: 1.1; }
.mag-facts dd { margin: 0; font-size: 15px; color: var(--ink-3); }
.mag-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: clamp(20px, 2.4vw, 32px); }
.mag-links a { font-weight: 600; font-size: 17px; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.mag-links a:hover { text-decoration-thickness: 2.5px; }

/* Closing call to action */
.mag-end { border-top: 1.5px solid var(--ink); padding: clamp(56px, 9vw, 160px) var(--pad); text-align: center; }
.mag-end h2 { max-width: 14ch; margin: 0 auto; text-wrap: balance; }
.mag-end .btn { margin-top: clamp(28px, 3.4vw, 48px); font-size: clamp(17px, 1.4vw, 22px); padding: 18px 34px; }

/* Lightbox: the video, larger */
.work-lb { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; overscroll-behavior: contain; background: rgba(10, 10, 10, 0.95); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.work-lb::backdrop { background: transparent; }
.work-lb[open] { display: grid; place-items: center; }
.work-lb figure { margin: 0; display: grid; justify-items: center; gap: 14px; padding: 72px clamp(12px, 5vw, 96px) 24px; width: 100%; box-sizing: border-box; }
.work-lb video { display: block; width: min(100%, calc((100dvh - 150px) * 1.6)); height: auto; aspect-ratio: 16 / 10; border-radius: 12px; background: #000; }
.work-lb figcaption { font-size: 15px; font-weight: 600; text-align: center; }
.work-lb-close { position: absolute; right: clamp(8px, 2vw, 32px); top: 12px; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer; }
.work-lb-close:hover { background: rgba(255, 255, 255, 0.24); }
.work-lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.work-lb-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Side projects: three screenshot tiles */
.side { border-top: 1.5px solid var(--ink); padding: clamp(48px, 7vw, 120px) var(--pad); }
.side-inner { max-width: var(--max); margin: 0 auto; }
.side-sub { margin: clamp(14px, 1.6vw, 22px) 0 0; color: var(--ink-2); font-size: clamp(17px, 1.35vw, 22px); max-width: 44ch; }
.side-grid { list-style: none; margin: clamp(32px, 4vw, 64px) 0 0; padding: 0; display: grid; gap: clamp(36px, 3vw, 48px) clamp(20px, 2.4vw, 36px); }
@media (min-width: 900px) { .side-grid { grid-template-columns: repeat(3, 1fr); } }
.side-tile { display: block; color: inherit; text-decoration: none; }
.side-tile img, .side-tile video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  border: 1px solid rgba(10, 10, 10, 0.08); border-radius: clamp(12px, 1.4vw, 20px); background: #f2f2f2;
  box-shadow: 0 30px 60px -40px rgba(10, 10, 10, 0.5);
  transition: transform 0.25s ease;
}
.side-tile:hover img, .side-tile:hover video { transform: translateY(-3px); }
.side-tile:focus-visible { outline: none; }
.side-tile:focus-visible img, .side-tile:focus-visible video { outline: 3px solid var(--ink); outline-offset: 6px; }
.side-tile h3 { margin: clamp(16px, 1.6vw, 22px) 0 0; font-size: clamp(22px, 1.9vw, 30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.side-tile p { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .mag-shot, .side-tile img, .side-tile video { transition: none; }
  .mag-shot:hover, .side-tile:hover img, .side-tile:hover video { transform: none; }
}
