/* See DESIGN.md for the rules behind these values. */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6b6b6b;
  --line: #ebebeb;
  --tile: #f4f4f3;
  --accent: #e5484d;
  --gutter: 32px;
  --max: 1200px;
  --space: 120px;
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.wrap { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
}
.top__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; letter-spacing: -0.01em; }
.rec { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.nav { display: flex; gap: 28px; font-size: 15px; }
.nav a { color: var(--muted); transition: color 0.15s; }
.nav a:hover { color: var(--text); }

/* Work dropdown: opens on hover or keyboard focus */
.nav__group { position: relative; }
.nav__menu {
  position: absolute; top: 100%; left: -16px;
  display: flex; flex-direction: column;
  min-width: 168px; padding: 18px 0 8px;
  background: transparent;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.nav__menu::before {
  content: ""; position: absolute; inset: 10px 0 0 0; z-index: -1;
  background: var(--bg); border: 1px solid var(--line); border-radius: 4px;
}
.nav__menu a { padding: 7px 16px; font-size: 14px; white-space: nowrap; }
.nav__group:hover .nav__menu,
.nav__group:focus-within .nav__menu { opacity: 1; visibility: visible; transform: none; }

/* Intro */
.intro { padding-top: 112px; padding-bottom: 8px; }
.intro h1 {
  max-width: 24ch;
  font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.18;
  font-weight: 400;
  letter-spacing: -0.022em;
}
.intro__now { margin-top: 24px; color: var(--muted); }

/* Sections */
.section { padding-top: var(--space); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; margin-bottom: 40px; }
.section__head h2 { font-size: 15px; font-weight: 500; }
.section__head p { color: var(--muted); font-size: 15px; }

/* Thumbnails (shared by grid cards and series rows) */
.thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  background: var(--tile);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.25s; }
.thumb--vertical img { object-fit: contain; }
.thumb::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l9 5-9 5z' fill='%23111'/%3E%3C/svg%3E") 55% 50% / 22px no-repeat;
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.2s, transform 0.2s;
}
.play { display: block; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.play:hover .thumb img, .play:focus-visible .thumb img { opacity: 0.82; }
.play:hover .thumb::after, .play:focus-visible .thumb::after { opacity: 1; transform: scale(1); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px 28px; }
.card__title { display: block; margin-top: 14px; font-size: 15px; font-weight: 500; line-height: 1.4; }
.card__meta { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

/* Series rows */
.rows { border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 56px;
  align-items: start;
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.row__title { font-size: 19px; font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; }
.row__tag { margin-top: 4px; font-size: 14px; color: var(--muted); }
.row__roles { margin-top: 20px; font-size: 13px; line-height: 1.6; color: var(--text); }
.row__desc { margin-top: 16px; max-width: 58ch; font-size: 15px; color: var(--muted); }
.row__clip { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* About */
.about__body { display: grid; grid-template-columns: 220px 1fr; gap: 56px; align-items: start; }
.about__photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
.about__text { max-width: 62ch; }
.about__text p + p { margin-top: 18px; }
.about__text p { color: #333; }
.timeline { margin-top: 40px; border-top: 1px solid var(--line); }
.timeline > div { display: grid; grid-template-columns: 120px 1fr; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline dt { color: var(--muted); }

/* Contact */
.contact__line { font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -0.015em; max-width: 30ch; line-height: 1.3; }
.contact__links { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 24px; }
.contact__links a { border-bottom: 1px solid var(--text); padding-bottom: 2px; }
.contact__links a:hover { color: var(--muted); border-color: var(--muted); }
.todo { color: var(--accent); font-size: 14px; }

/* Footer */
.foot {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: var(--space); padding-top: 28px; padding-bottom: 40px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.foot a:hover { color: var(--text); }

/* Player: the only dark surface on the site */
.player {
  /* as wide as possible while the 16:9 frame + close button + caption still fit in the window */
  width: min(92vw, 1280px, calc((100vh - 150px) * 16 / 9));
  max-width: none; max-height: none;
  padding: 0; border: 0;
  background: transparent;
  color: #fff;
  overflow: visible;
}
.player::backdrop { background: rgba(10, 10, 10, 0.94); }
.player[open] { animation: fade 0.2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.player__frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player__frame video, .player__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player--vertical { width: fit-content; --vh: min(calc(100vh - 150px), 900px); }
.player--vertical .player__frame { height: var(--vh); width: calc(var(--vh) * 9 / 16); max-width: 100vw; aspect-ratio: auto; }
.player__caption { margin-top: 14px; font-size: 14px; color: rgba(255, 255, 255, 0.72); }
.player__close {
  position: absolute; right: 0; top: -44px;
  padding: 6px 0; border: 0; background: none;
  font: inherit; font-size: 14px; color: rgba(255, 255, 255, 0.8); cursor: pointer;
}
.player__close:hover { color: #fff; }
.player__close span { font-size: 20px; line-height: 0; vertical-align: -2px; margin-left: 4px; }

/* Tablet */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 44px 20px; }
  .row { grid-template-columns: 1fr; gap: 28px; }
  .row__media { order: -1; }
}

/* Phone */
@media (max-width: 640px) {
  :root { --gutter: 16px; --space: 72px; }
  .top__inner { height: 60px; }
  .nav { gap: 18px; font-size: 14px; }
  .intro { padding-top: 56px; }
  .grid { grid-template-columns: 1fr; gap: 36px; }
  .row { padding: 40px 0; }
  .about__body { grid-template-columns: 1fr; gap: 28px; }
  .about__photo { width: 140px; }
  .timeline > div { grid-template-columns: 1fr; gap: 2px; }
  .player { width: 100vw; }
  .player__close { right: 12px; }
  .player__caption { padding: 0 16px; }
  .player--vertical { width: fit-content; --vh: min(calc(100vh - 140px), calc(100vw * 16 / 9)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
