/* ============================================================
   Stop Motion Dispatch — Müller-Brockmann / International
   Typographic Style. One source of truth: grid params in :root.
   White paper, near-black ink, ONE accent (Swiss red).
   No blue/purple. Grotesque (Inter) + mono (Space Mono).
   ============================================================ */
:root {
  --cols: 12;
  --bl: 8px;            /* baseline unit */
  --lh: 24px;          /* leading = 3 x baseline */
  --gutter: 24px;
  --margin: 72px;
  --pad: 64px;         /* spread top/bottom pad (x baseline) */
  --maxw: 1296px;

  --paper: #ffffff;
  --ink: #111315;
  --ink-soft: #5b6066;
  --faint: #8b9097;
  --line: #111315;
  --hair: #d7d9dc;
  --accent: #e4002b;
  --accent-ink: #c2001f;

  --g-col: rgba(228, 0, 43, 0.075);
  --g-edge: rgba(228, 0, 43, 0.40);

  --mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: var(--lh);
  font-feature-settings: "ss01", "cv05";
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus {
  outline: none;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ---------- Mono kicker / label primitive ---------- */
.kicker,
.filter-heading,
.section-block h3,
.meta-grid small,
.audit-stats small,
.news-date,
.sort-control,
.queue-table thead th,
.detail-hero p:first-child {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: var(--bl);
}

/* ============================================================
   Grid overlay (press G) — fixed + centered so its columns
   match the centered editorial content box at any width.
   ============================================================ */
.guides {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.26s ease;
}

body.grid-on .guides {
  opacity: 1;
}

.guides-wrap {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
}

.guides .cols {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--margin);
  right: var(--margin);
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
}

.guides .col {
  position: relative;
  background: var(--g-col);
  box-shadow: inset 1px 0 0 var(--g-edge), inset -1px 0 0 var(--g-edge);
}

.guides .col span {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  color: var(--accent);
}

.guides .mline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--g-edge);
}

.guides .mline.l { left: var(--margin); }
.guides .mline.r { right: var(--margin); }

/* ---------- Grid toggle (hidden; press G to reveal if ever needed) ---------- */
.toggle {
  display: none;
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: none;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toggle .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b6066;
}

body.grid-on .toggle { background: var(--accent); }
body.grid-on .toggle .dot { background: #fff; }

/* ============================================================
   Masthead
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  padding: 16px var(--margin) 0;
}

.masthead-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  position: relative;
  width: 40px;
  height: 40px;
  background: var(--accent);
  flex: none;
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 9px 6px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, transparent 0 4px, #fff 4px 6px);
  box-shadow: -6px 0 0 -4px #fff, 6px 0 0 -4px #fff;
}

.brand-text {
  display: block;
}

.kicker {
  display: block;
  color: var(--accent);
  margin-bottom: 2px;
}

.masthead {
  display: block;
  font-family: var(--sans);
  font-size: 34px;
  font-weight: 800;
  line-height: 32px;
  letter-spacing: -0.025em;
  text-transform: none;
}

.search-shell {
  position: relative;
  display: block;
  flex: 0 1 320px;
  margin-bottom: 6px;
}

.search-shell input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.search-shell input::placeholder {
  color: var(--faint);
}

.search-shell input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.topnav a {
  position: relative;
  padding: 10px 16px 12px 0;
  margin-right: 16px;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.topnav a:hover {
  color: var(--ink);
}

.topnav a.active {
  color: var(--ink);
}

.topnav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 16px;
  bottom: -2px;
  height: 2px;
  background: var(--accent);
}

/* ============================================================
   App shell + centered editorial wrap
   ============================================================ */
.app-shell {
  display: block;
  min-height: 60vh;
}

.app-shell.atlas-layout {
  display: grid;
  grid-template-columns: 264px minmax(440px, 1fr) minmax(360px, 33vw);
  align-items: start;
}

/* Generic centered editorial page (news, works, people, articles…) */
.page {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad) var(--margin) 96px;
}

.page > h1,
.directory h1 {
  font-size: 40px;
  font-weight: 800;
  line-height: 40px;
  letter-spacing: -0.03em;
  max-width: 22ch;
}

.page > p {
  margin: 16px 0 0;
  max-width: 64ch;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: var(--lh);
}

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
}

/* ============================================================
   Directory (3-pane functional spread)
   ============================================================ */
.filters {
  padding: var(--lh) 24px 48px;
  border-right: 1px solid var(--hair);
}

.filter-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-top: 24px;
  color: var(--accent);
}

.filter-heading button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filter-heading button:hover {
  color: var(--accent);
}

.filters > label,
.filters fieldset {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0 0 24px;
  border: 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
}

.filters > label,
.filters legend {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.filters legend {
  margin-bottom: 12px;
  padding: 0;
}

.filters fieldset label {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  cursor: pointer;
}

.filters select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 12px;
}

.filters select:focus,
.sort-control select:focus {
  outline: none;
  border-color: var(--accent);
}

.filters input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.directory {
  padding: var(--lh) 32px 64px;
  min-width: 0;
}

.directory-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin: 24px 0 8px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--line);
}

.directory h1 {
  font-size: 32px;
  line-height: 32px;
}

.directory-head p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.sort-control {
  display: flex;
  gap: 10px;
  align-items: center;
  flex: none;
  color: var(--ink-soft);
}

.sort-control select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.studio-list {
  display: block;
  border-top: 1px solid var(--hair);
}

.studio-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(110px, 0.9fr) minmax(120px, 1fr) 96px 16px;
  gap: 20px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--hair);
  color: inherit;
  background: transparent;
}

.studio-row:hover,
.studio-row.active {
  background: #faf3f4;
  box-shadow: -16px 0 0 #faf3f4, 16px 0 0 #faf3f4;
}

.studio-title strong {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: var(--lh);
}

.studio-title small {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.studio-cell {
  color: var(--ink-soft);
  font-size: 14px;
}

.confidence {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.confidence .dot {
  width: 7px;
  height: 7px;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--faint);
}

.confidence .dot.filled {
  background: var(--accent);
  box-shadow: none;
}

.arrow {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 15px;
  text-align: right;
}

.studio-row:hover .arrow {
  font-weight: 700;
}

/* ============================================================
   Detail / preview
   ============================================================ */
.preview-pane {
  border-left: 1px solid var(--hair);
  background: var(--paper);
  position: sticky;
  top: 132px;
  align-self: start;
  max-height: calc(100vh - 132px);
  overflow-y: auto;
}

.studio-page {
  max-width: var(--maxw);
  margin: 0 auto;
}

.detail-hero {
  padding: 40px var(--margin) 32px;
  background: var(--ink);
  color: #fff;
  border-bottom: 2px solid var(--accent);
}

.detail-hero--media {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  column-gap: var(--gutter);
  align-items: end;
}

.detail-hero--media > p,
.detail-hero--media > h2 {
  grid-column: 1;
}

.detail-media {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: stretch;
  margin: 0;
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #1d1f21;
}

.detail-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 340px;
  object-fit: cover;
}

.detail-media figcaption {
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-pane .detail-hero {
  padding: 32px 28px 24px;
}

.detail-hero p:first-child {
  margin: 0;
  color: var(--accent);
}

.detail-hero h2 {
  margin: 12px 0 0;
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.preview-pane .detail-hero h2 {
  font-size: clamp(26px, 3vw, 34px);
}

.detail-hero h2 + p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.detail-body {
  padding: 32px var(--margin) 64px;
}

.preview-pane .detail-body {
  padding: 24px 28px 48px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  margin: 0 -1px -1px 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button.secondary {
  background: var(--paper);
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--ink);
  color: #fff;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 8px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--hair);
}

.preview-pane .meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-grid div {
  min-height: 88px;
  padding: 12px 14px 16px;
  border-right: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  font-size: 15px;
  color: var(--ink);
}

.meta-grid small {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
}

.section-block {
  display: grid;
  gap: 12px;
  padding: 24px 0;
  border-top: 1px solid var(--hair);
}

.section-block h3 {
  color: var(--accent);
}

.section-block p,
.section-block li {
  color: var(--ink);
  font-size: 16px;
  line-height: var(--lh);
}

.section-block ul {
  margin: 0;
  padding-left: 18px;
}

.section-block li {
  margin-bottom: 4px;
}

.section-block a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ============================================================
   Tables (works / people / network / queue / film audit)
   ============================================================ */
.queue-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 32px;
  border-top: 2px solid var(--line);
}

.queue-table th,
.queue-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--hair);
  text-align: left;
  font-size: 14px;
  line-height: var(--lh);
  vertical-align: baseline;
}

.queue-table thead th {
  color: var(--ink-soft);
  vertical-align: bottom;
  padding-bottom: 10px;
}

.queue-table tbody tr:hover {
  background: #faf3f4;
}

.queue-table td a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.queue-table td a:hover {
  color: var(--accent);
}

.work-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.thumb {
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f4f0ec;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb--table {
  width: 72px;
  height: 48px;
}

.thumb--empty {
  background:
    linear-gradient(135deg, rgba(228, 0, 43, 0.12), transparent 52%),
    repeating-linear-gradient(0deg, #f7f3ee 0 7px, #efe7df 7px 8px);
}

.compact-table {
  margin-top: 4px;
  border-top: 1px solid var(--hair);
}

/* ============================================================
   News — the index / dispatch feed (editorial front page)
   ============================================================ */
.news-page {
  padding-top: 32px;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  row-gap: 0;
  margin-top: 24px;
  border-top: 2px solid var(--line);
}

.news-item {
  grid-column: span 4;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 0 28px;
  color: inherit;
  border-bottom: 1px solid var(--hair);
}

.news-item:hover strong {
  color: var(--accent);
}

/* Lead story: first item spans the full measure, large display headline */
.news-item:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--gutter);
  padding: 32px 0 36px;
  border-bottom: 2px solid var(--line);
}

.news-item:first-child .news-date {
  grid-column: 1 / -1;
}

.news-item:first-child strong {
  grid-column: 1 / 9;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.0;
  letter-spacing: -0.035em;
}

.news-item:first-child span {
  grid-column: 9 / 13;
}

.news-item:first-child em {
  grid-column: 1 / -1;
}

.news-date {
  color: var(--accent);
}

.news-item strong {
  font-size: 21px;
  font-weight: 700;
  line-height: var(--lh);
  letter-spacing: -0.02em;
}

.news-item span {
  color: var(--ink);
  font-size: 15px;
  line-height: var(--lh);
}

.news-item em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================================================
   Stats — big numerals (a signature move)
   ============================================================ */
.audit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--hair);
}

.audit-stats div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 20px 8px 0;
  margin-right: 20px;
  border: 0;
}

.audit-stats small {
  margin: 0;
  color: var(--ink-soft);
}

.audit-stats strong {
  font-size: 18px;
  font-weight: 700;
  line-height: var(--lh);
  letter-spacing: -0.01em;
  font-feature-settings: "tnum";
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1180px) {
  :root { --margin: 40px; }

  .app-shell.atlas-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .preview-pane {
    display: none;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  :root { --margin: 20px; --pad: 40px; }

  .topbar {
    position: static;
  }

  .masthead { font-size: 26px; }

  .topnav {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .app-shell.atlas-layout {
    grid-template-columns: 1fr;
  }

  .filters {
    border-right: 0;
    border-bottom: 1px solid var(--hair);
  }

  .directory { padding: 16px 20px 48px; }

  .studio-row {
    grid-template-columns: 1fr auto;
    gap: 4px 16px;
  }

  .studio-cell { grid-column: 1 / -1; }
  .arrow { display: none; }

  .meta-grid,
  .audit-stats { grid-template-columns: 1fr; }

  .detail-hero--media {
    grid-template-columns: 1fr;
  }

  .detail-hero--media > p,
  .detail-hero--media > h2,
  .detail-media {
    grid-column: 1;
  }

  .detail-media {
    grid-row: auto;
    min-height: 180px;
    margin-bottom: 24px;
  }

  .work-link {
    min-width: 0;
  }

  .news-item,
  .news-item:first-child strong,
  .news-item:first-child span,
  .news-item:first-child em { grid-column: 1 / -1; }

  .detail-hero,
  .detail-body { padding-left: 20px; padding-right: 20px; }
}
