/* ─── Fonts ──────────────────────────────────────────────────────────────── */
/* Inter Tight (SIL OFL, fonts/OFL-inter-tight.txt): variable 400–700, subset to Latin-1,
   punctuation, arrows and currency. Rebuild from google/fonts ofl/intertight if glyphs are missing. */
@font-face {
  font-family: "Inter Tight";
  src: url("fonts/inter-tight.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Custom properties ──────────────────────────────────────────────────── */
:root {
  --bg:     #0a0a0a;
  --fg:     #fafafa;
  --muted:  #7e7e7e;  /* ≥4.5:1 on --bg and --soft */
  --line:   #1f1f1f;
  --soft:   #141414;
  --tile:   #181818;
  --hover:  #101010;
  --still:  #181818;
  --still-stripe: rgba(255,255,255,0.035);
  --still-label:  rgba(255,255,255,0.42);
  --nav-h:  66px;
  --gutter: 48px;
}
[data-theme="light"] {
  --bg:     #f5f2ec;
  --fg:     #0e0e0e;
  --muted:  #6e6861;  /* ≥4.5:1 on --bg and --soft */
  --line:   #d8d2c5;
  --soft:   #ede8dd;
  --tile:   #e2dccf;
  --hover:  #ede8dd;
  --still:  #e8e3d8;
  --still-stripe: rgba(0,0,0,0.04);
  --still-label:  rgba(0,0,0,0.48);
}

/* ─── Reset + base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.skip-link {
  position: absolute;
  top: 12px;
  left: var(--gutter);
  z-index: 200;
  padding: 8px 12px;
  background: var(--fg);
  color: var(--bg);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
em { font-style: italic; }

/* ─── Reveal animation ───────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .75s cubic-bezier(.2,.7,.2,1), transform .75s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: translateY(0); will-change: auto; }
.reveal-d1 { transition-delay: 80ms; }
.reveal-d2 { transition-delay: 160ms; }
.reveal-d3 { transition-delay: 240ms; }
.reveal-d4 { transition-delay: 320ms; }
.reveal-d5 { transition-delay: 400ms; }

/* ─── Still placeholder ──────────────────────────────────────────────────── */
.still {
  width: 100%;
  background: repeating-linear-gradient(
    135deg,
    var(--still) 0 14px,
    var(--still-stripe) 14px 15px,
    var(--still) 15px 28px
  );
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.still-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--still-label);
  display: flex;
  align-items: center;
  gap: 6px;
}
.still-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--still-label);
  flex-shrink: 0;
}
.still-label {
  padding: 12px;
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--still-label);
  line-height: 1.4;
}
.still-label strong { font-weight: 500; display: block; }

/* ─── Nav ────────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: background .3s, border-color .3s;
}

.nav-name { color: var(--fg); font-weight: 500; }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  transition: color .2s;
}
.nav-links a:hover,
.nav-links a[aria-current="true"] { color: var(--fg); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  border-radius: 2px;
}
.theme-toggle:hover { border-color: var(--fg); color: var(--fg); }

/* ─── Sections ───────────────────────────────────────────────────────────── */
section {
  padding: 56px var(--gutter);
  scroll-margin-top: var(--nav-h);
}

/* Section header */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-bottom: 32px;
}
.section-head-left {
  display: flex;
  gap: 20px;
  align-items: baseline;
}
.section-num {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .1em;
}
.section-title {
  font-size: 40px;
  letter-spacing: -.025em;
  color: var(--fg);
  font-weight: 600;
}
.section-right {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ─── Hero ───────────────────────────────────────────────────────────────── */
#hero {
  padding: 32px var(--gutter) 48px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: stretch;
}
.hero-still {
  border-radius: 2px;
  overflow: hidden;
}
.hero-still .still { aspect-ratio: 16 / 10; }

.hero-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
}
.hero-tag {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.hero-tag .dot { color: var(--fg); }
.hero-name {
  font-size: 96px;
  line-height: .92;
  letter-spacing: -.04em;
  font-weight: 700;
  color: var(--fg);
}
.hero-sub {
  font-size: 20px;
  color: var(--muted);
  margin-top: 20px;
  max-width: 380px;
  line-height: 1.4;
}

/* Stat grid */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}
.stat {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.stat-label {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stat-value {
  font-size: 22px;
  letter-spacing: -.01em;
  color: var(--fg);
  margin-top: 4px;
  line-height: 1.3;
}
.stat-value-small { font-size: 16px; }

/* ─── Work grid ──────────────────────────────────────────────────────────── */
#work { padding-top: 40px; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.tile {
  background: var(--tile);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  cursor: default;
}
.tile.large {
  grid-column: span 2;
  grid-row: span 2;
}
/* ::before is the in-flow sizer — gives rows a height in auto-sized tracks */
.tile::before {
  content: '';
  display: block;
  padding-top: 62.5%; /* 10/16 */
}
.tile.large::before {
  padding-top: 68.75%; /* 11/16 */
}
/* A tile left alone on the last 3-column row becomes a full-width banner */
.tile:not(.large):last-child:nth-child(3n+1) { grid-column: 1 / -1; }
.tile:not(.large):last-child:nth-child(3n+1)::before { padding-top: 37.5%; /* 16/6 */ }
.tile img, .tile .still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.tile img {
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
@media (hover: hover) {
  .tile:hover img { transform: scale(1.03); }
}

.tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.25) 70%, rgba(0,0,0,.7) 100%);
  pointer-events: none;
  transition: opacity .25s;
}
/* Hover deepens the shade by fading in a second, stronger gradient */
.tile-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.35) 100%);
  opacity: 0;
  transition: opacity .25s;
}
@media (hover: hover) {
  .tile:hover .tile-overlay::after { opacity: 1; }
}
.tile-info {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  color: #fafafa;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  text-shadow: 0 1px 12px rgba(0,0,0,.45);
}
/* Key art that already carries the show's logo: keep the title for assistive tech only */
.tile.title-in-art .tile-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.tile.title-in-art .tile-meta { margin-top: 0; }
.tile-title {
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.tile.large .tile-title { font-size: 32px; }
.tile:not(.large) .tile-title { font-size: 22px; }
.tile-meta {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-top: 6px;
  opacity: .85;
}
.tile-years {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .1em;
  opacity: .7;
  white-space: nowrap;
}

/* ─── Credits ────────────────────────────────────────────────────────────── */
#credits { padding-top: 56px; }

.credits-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
}
.layout-btn {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color .2s, color .2s, background .2s;
}
.layout-btn.active, .layout-btn:hover {
  border-color: var(--fg);
  color: var(--fg);
}
.layout-btn.active { background: var(--fg); color: var(--bg); }

/* Credit rows */
.credits-list { margin-top: 24px; }

.credit-row {
  display: grid;
  gap: 20px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
  position: relative;
}
@media (hover: hover) {
  .credit-row:hover { background: var(--hover); }
}

/* Layout: rows (compact text) */
.credits-list.layout-rows .credit-row {
  grid-template-columns: 48px 1.6fr 1fr 0.8fr 0.5fr;
  padding: 12px 0;
}
/* Layout: detailed */
.credits-list.layout-detailed .credit-row {
  grid-template-columns: 48px 1.6fr 1fr 0.8fr 0.5fr;
  padding: 16px 0;
}
/* Layout: visual (thumbnail) */
.credits-list.layout-visual .credit-row {
  grid-template-columns: 120px 1.6fr 1fr 0.8fr 0.5fr;
  padding: 10px 0;
}

.credit-index {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
}
.credit-thumb {
  width: 120px;
  border-radius: 2px;
  overflow: hidden;
}
.credit-thumb .still { aspect-ratio: 16 / 9; }

.credit-title-block {}
.credit-title {
  letter-spacing: -.015em;
  line-height: 1.2;
  font-weight: 500;
  color: var(--fg);
}
.credits-list.layout-rows .credit-title { font-size: 18px; }
.credits-list.layout-detailed .credit-title { font-size: 22px; }
.credits-list.layout-visual .credit-title { font-size: 18px; }

.credit-series {
  color: var(--muted);
  margin-left: 3px; /* plus the word space before it */
  font-weight: 400;
}
.credits-list.layout-rows .credit-series { font-size: 13px; }
.credits-list.layout-detailed .credit-series { font-size: 15px; }
.credits-list.layout-visual .credit-series { font-size: 13px; }

.credit-detail {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: .04em;
  text-transform: uppercase;
  display: none;
}
.credits-list.layout-detailed .credit-detail { display: block; }

.credit-role {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--fg);
  letter-spacing: .04em;
}
.credit-studio {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.credit-network {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--fg);
}
.credit-years {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

/* ─── Awards ─────────────────────────────────────────────────────────────── */
.awards-list { margin-top: 20px; }
.award-row {
  display: grid;
  grid-template-columns: 120px 1.4fr 1.4fr 0.6fr;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.award-badge {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fg);
}
.award-badge span {
  display: inline-block;
  white-space: nowrap;
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 999px;
}
.award-show {
  font-size: 18px;
  letter-spacing: -.01em;
  font-weight: 500;
}
.award-body {
  font-size: 14px;
  color: var(--muted);
}
.award-years {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .06em;
  text-align: right;
}

/* ─── About ──────────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  margin-top: 32px;
}
.about-still {
  border-radius: 2px;
  overflow: hidden;
}
.about-still .still { aspect-ratio: 4 / 5; }
.about-bio {
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: -.005em;
}
.about-bio p { margin-bottom: 22px; }
.about-bio p:last-child { margin-bottom: 0; }

/* ─── Contact ────────────────────────────────────────────────────────────── */
#contact {
  background: var(--soft);
  transition: background .3s;
}
.contact-label {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.contact-email {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.015em;
  line-height: 1.1;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  display: inline-block;
  transition: border-color .2s;
}
.contact-email:hover { border-color: var(--fg); }
.contact-meta {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.9;
  margin-top: 18px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────── */
footer {
  padding: 20px var(--gutter);
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
/* Small laptops and tablets in landscape: same layout, tighter gutter */
@media (max-width: 1024px) {
  :root { --gutter: 32px; }
  .hero-name { font-size: 80px; }
}

/* Tablets in portrait: single-column hero and about, 2-column tiles, card rows */
@media (max-width: 768px) {
  .nav-right > #nav-year { display: none; }

  .hero-grid { grid-template-columns: 1fr; }
  .hero-right { order: -1; padding: 0; }

  .tile-grid { grid-template-columns: repeat(2, 1fr); }
  .tile.large { grid-column: span 2; grid-row: auto; }
  /* An odd tile left over after the lead tile takes the full row */
  .tile:not(.large):last-child:nth-child(even) { grid-column: span 2; }

  /* Visual mode needs thumbnail width; rows/detailed collapse into cards */
  .layout-btn[data-layout="visual"] { display: none; }
  .credits-list.layout-rows .credit-row,
  .credits-list.layout-detailed .credit-row,
  .credits-list.layout-visual .credit-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title years"
      "role  network";
    gap: 6px 16px;
    align-items: baseline;
    padding: 14px 0;
  }
  .credit-index, .credit-thumb { display: none; }
  .credit-title-block { grid-area: title; }
  .credit-role-block  { grid-area: role; }
  .credit-network     { grid-area: network; text-align: right; }
  .credit-years       { grid-area: years; }

  .award-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "badge years"
      "show  show"
      "body  body";
    gap: 6px 16px;
    align-items: center;
    padding: 16px 0;
  }
  .award-badge { grid-area: badge; }
  .award-show  { grid-area: show; }
  .award-body  { grid-area: body; }
  .award-years { grid-area: years; }

  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-still .still { aspect-ratio: 3 / 2; }
  .about-bio { font-size: 20px; }
}

/* Phones */
@media (max-width: 560px) {
  :root { --gutter: 20px; --nav-h: 80px; }

  /* Name and theme toggle on the first row, section links spread across the second */
  .site-nav { flex-wrap: wrap; row-gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .site-nav > nav { order: 1; width: 100%; }
  .nav-links { justify-content: space-between; gap: 12px; }

  section { padding-top: 40px; padding-bottom: 40px; }
  #hero { padding-top: 24px; padding-bottom: 32px; }

  .section-head { flex-wrap: wrap; row-gap: 8px; column-gap: 16px; margin-bottom: 24px; }
  .section-head-left { gap: 14px; }
  .section-title { font-size: 32px; }

  .hero-name { font-size: 64px; }
  .hero-sub { font-size: 18px; }
  /* Stats become label/value rows */
  .stat-grid { grid-template-columns: 1fr; gap: 0; margin-top: 28px; }
  .stat { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; }
  .stat-value { font-size: 18px; margin-top: 0; text-align: right; }
  .stat-value-small { font-size: 15px; }

  .tile-grid { grid-template-columns: 1fr; gap: 12px; }
  .tile.large,
  .tile:not(.large):last-child:nth-child(even),
  .tile:not(.large):last-child:nth-child(3n+1) { grid-column: auto; }
  .tile:not(.large):last-child:nth-child(3n+1)::before { padding-top: 62.5%; }
  .tile-info { left: 14px; right: 14px; bottom: 12px; }
  .tile.large .tile-title { font-size: 26px; }
  .tile:not(.large) .tile-title { font-size: 22px; }

  /* Logo-bearing key art is height-fitted here, so the credit line moves to a strip below it */
  .tile.title-in-art { padding-bottom: 40px; }
  .tile.title-in-art img { height: calc(100% - 40px); }
  .tile.title-in-art .tile-overlay { display: none; }
  .tile.title-in-art .tile-info {
    top: auto;
    bottom: 0;
    height: 40px;
    align-items: center;
    color: var(--fg);
    text-shadow: none;
  }

  .credits-list.layout-detailed .credit-title { font-size: 20px; }

  .about-bio { font-size: 18px; }
  .about-bio p { margin-bottom: 18px; }

  .contact-email { font-size: 22px; }

  footer { flex-direction: column; gap: 6px; }
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tile:hover img { transform: none; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
