/* Brief Board: production-sheet look. Tracing-paper light, graphite dark. Red pen = review, blue pencil = checked. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #e9edee;        /* tracing paper */
  --sheet: #f7f8f6;        /* the sheet you write on */
  --ink: #1b2230;
  --ink-soft: #55606e;
  --rule: #c6cdd0;
  --rule-soft: #dbe0e2;
  --red: #c92f2b;          /* correction pencil */
  --blue: #2a56bf;         /* check pencil */
  --blue-soft: #d9e3f8;
  --amber: #b87a00;
  --amber-soft: #f6e6bf;
  --ok: #1d7a4a;
  --focus: #2a56bf;
  --radius: 3px;
  --wide: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1c1f; --sheet: #212428; --ink: #e8ebee; --ink-soft: #9aa3ad; --rule: #3a3f45; --rule-soft: #2c3035;
    --red: #ef5a54; --blue: #7ea2f4; --blue-soft: #25324f; --amber: #e0a22c; --amber-soft: #3c3220; --ok: #5cc48a;
    --focus: #7ea2f4; color-scheme: dark;
  }
}
:root[data-theme="dark"], [data-room="dark"] {
  --paper: #1a1c1f; --sheet: #212428; --ink: #e8ebee; --ink-soft: #9aa3ad; --rule: #3a3f45; --rule-soft: #2c3035;
  --red: #ef5a54; --blue: #7ea2f4; --blue-soft: #25324f; --amber: #e0a22c; --amber-soft: #3c3220; --ok: #5cc48a;
  --focus: #7ea2f4; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h2 { font-size: 1.45rem; margin: 2.2rem 0 .7rem; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 .5rem; }
p { margin: .5rem 0; max-width: 68ch; }
small, .soft { color: var(--ink-soft); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar ---- */
.top { border-bottom: 1px solid var(--rule); background: var(--sheet); }
.top-in { max-width: var(--wide); margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 22px; min-height: 52px; flex-wrap: wrap; }
.brand { font-weight: 600; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: .01em; display: flex; align-items: center; gap: 9px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--ink-soft); text-decoration: none; padding: 14px 10px 12px; border-bottom: 2px solid transparent; font-weight: 500; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--red); }
.who { color: var(--ink-soft); font-size: .9rem; display: flex; gap: 10px; align-items: center; }
.who img { width: 24px; height: 24px; border-radius: 50%; }

main { max-width: var(--wide); margin: 0 auto; padding: 26px 16px 70px; }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 8px; }
.head p { margin: .3rem 0 0; color: var(--ink-soft); }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- a stat strip: plain numbers between rules ---- */
.strip { display: flex; flex-wrap: wrap; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 18px 0 8px; }
.strip > div { padding: 12px 22px 12px 0; margin-right: 22px; border-right: 1px solid var(--rule-soft); min-width: 120px; }
.strip > div:last-child { border-right: 0; }
.strip b { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.strip span { color: var(--ink-soft); font-size: .9rem; }

.meter { height: 6px; background: var(--rule-soft); border-radius: 3px; overflow: hidden; min-width: 90px; }
.meter > i { display: block; height: 100%; background: var(--blue); }
.meter.over > i { background: var(--red); }

/* ---- sheets (tables) ---- */
.sheet { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); font-size: .95rem; }
.sheet th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: 8px 12px; border-bottom: 1px solid var(--rule); background: var(--paper); white-space: nowrap; }
.sheet th.num { text-align: right; }
.sheet td { padding: 8px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.sheet tr:last-child td { border-bottom: 0; }
.sheet tbody tr:hover td { background: color-mix(in srgb, var(--blue-soft) 45%, transparent); }
.sheet .code { font-weight: 600; white-space: nowrap; }
.scroll { overflow-x: auto; }
.seqrow td { background: var(--paper); font-weight: 700; font-size: 1rem; padding-top: 12px; }

/* ---- the status grid: one cell per task, in pipeline order ---- */
.cells { display: flex; gap: 5px; flex-wrap: nowrap; }
.cell { width: 30px; height: 24px; border: 1.5px solid var(--ink-soft); border-radius: var(--radius); font-size: .66rem; font-weight: 700; display: grid; place-items: center; color: var(--ink-soft); position: relative; text-decoration: none; background: transparent; line-height: 1; }
.cell:hover { outline: 2px solid var(--focus); outline-offset: 1px; color: var(--ink); }
.cell[data-s="planned"] { border-style: dashed; border-color: var(--rule); }
.cell[data-s="open"] { border-color: var(--ink); color: var(--ink); }
.cell[data-s="pending"] { border-color: var(--amber); color: var(--amber); background: repeating-linear-gradient(45deg, transparent 0 4px, var(--amber-soft) 4px 6px); }
.cell[data-s="in_progress"] { border-color: var(--blue); color: var(--blue); background: repeating-linear-gradient(-45deg, var(--blue-soft) 0 4px, transparent 4px 8px); }
.cell[data-s="submitted"] { border-color: var(--amber); background: var(--amber-soft); color: var(--ink); }
.cell[data-s="approved"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.cell[data-s="approved"]::after { content: "✓"; position: absolute; right: -1px; top: -2px; font-size: .7rem; }
.cell[data-hidden="1"] { opacity: .45; border-style: dotted; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-soft); font-size: .88rem; margin: 10px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 18px; height: 14px; }

.chip { display: inline-block; padding: 1px 8px; border: 1px solid var(--rule); border-radius: 99px; font-size: .82rem; color: var(--ink-soft); background: var(--sheet); }
.chip.red { border-color: var(--red); color: var(--red); }
.chip.blue { border-color: var(--blue); color: var(--blue); }
.chip.amber { border-color: var(--amber); color: var(--amber); }

/* ---- forms and buttons ---- */
button, .btn { font: inherit; font-weight: 600; padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--ink); background: var(--ink); color: var(--sheet); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { filter: brightness(1.15); color: var(--sheet); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
button.ghost:hover, .btn.ghost:hover { border-color: var(--ink); color: var(--ink); }
button.red, .btn.red { background: var(--red); border-color: var(--red); color: #fff; }
button.blue, .btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 9px; }
textarea { width: 100%; min-height: 70px; resize: vertical; }
label { font-weight: 500; }
select { max-width: 100%; }

.note { border-left: 3px solid var(--blue); background: var(--sheet); padding: 10px 14px; margin: 14px 0; max-width: 72ch; }
.note.warn { border-color: var(--amber); }
.note.bad { border-color: var(--red); }

.pick { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.pick a { padding: 4px 12px; border: 1px solid var(--rule); border-radius: 99px; text-decoration: none; color: var(--ink-soft); background: var(--sheet); }
.pick a[aria-current="true"] { border-color: var(--ink); color: var(--ink); font-weight: 600; }

/* ---- calendar ---- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--rule); background: var(--sheet); }
.cal .dow { padding: 6px 8px; background: var(--paper); color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--rule); font-size: .88rem; }
.cal .day { min-height: 92px; padding: 5px 6px; border-right: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); font-size: .8rem; overflow: hidden; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out { background: var(--paper); color: var(--ink-soft); }
.cal .day.today { box-shadow: inset 0 0 0 2px var(--red); }
.cal .day b { font-weight: 600; display: block; margin-bottom: 2px; }
.cal .due { display: block; padding: 1px 4px; margin: 2px 0; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .due.late { border-color: var(--red); background: color-mix(in srgb, var(--red) 15%, transparent); }

/* ---- sign-in / landing ---- */
.landing { max-width: 640px; margin: 8vh auto 0; }
.landing h1 { font-size: clamp(2.4rem, 7vw, 4rem); }

/* ---- review room ---- */
body.room { background: #111214; }
.room .top { background: #17181a; border-color: #2b2e33; }
.stage-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: calc(100vh - 53px); }
@media (max-width: 900px) { .stage-wrap { grid-template-columns: 1fr; } }
.stage { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.canvas-box { position: relative; background: #000 repeating-conic-gradient(#16171a 0 25%, #1c1d20 0 50%) 0 0 / 22px 22px; display: grid; place-items: center; border: 1px solid #2b2e33; min-height: 240px; overflow: hidden; }
.canvas-box video, .canvas-box img { max-width: 100%; max-height: 72vh; display: block; }
.canvas-box canvas.pen { position: absolute; left: 0; top: 0; touch-action: none; cursor: crosshair; }
.canvas-box canvas.pen.off { pointer-events: none; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--ink); }
.bar .sep { width: 1px; align-self: stretch; background: #2b2e33; margin: 0 4px; }
.bar button { padding: 5px 10px; }
.bar .tc { font-variant-numeric: tabular-nums; min-width: 9ch; font-weight: 600; }
.scrub { flex: 1; min-width: 160px; accent-color: var(--red); }
.side { border-left: 1px solid #2b2e33; background: #17181a; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 900px) { .side { border-left: 0; border-top: 1px solid #2b2e33; } }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notes li { border: 1px solid #2b2e33; background: #1d1f22; border-radius: var(--radius); padding: 8px; display: grid; grid-template-columns: 72px 1fr; gap: 4px 10px; }
.notes li img { width: 72px; height: 48px; object-fit: cover; border-radius: 2px; background: #000; grid-row: span 2; }
.notes li .meta { font-size: .82rem; color: var(--ink-soft); }
.notes li.done { opacity: .55; }
.notes li.done .text { text-decoration: line-through; }
.notes li .acts { display: flex; gap: 8px; align-items: center; }
.pen-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #17181a; box-shadow: 0 0 0 1px #3a3f45; cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.cmp-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.wipe { position: relative; overflow: hidden; background: #000; display: grid; place-items: center; }
.wipe .top-layer { position: absolute; inset: 0; display: grid; place-items: center; }
.wipe .handle { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); pointer-events: none; }

/* ---- showcase gallery and wall ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px 16px; }
.tile { display: block; text-decoration: none; color: var(--ink); }
.tile .thumb { aspect-ratio: 16 / 9; background: #0c0d0e; border: 1px solid var(--rule); display: grid; place-items: center; overflow: hidden; }
.tile .thumb img, .tile .thumb video { width: 100%; height: 100%; object-fit: cover; }
.tile b { display: block; margin-top: 6px; font-size: 1.05rem; }
.tile span { color: var(--ink-soft); font-size: .9rem; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px 1px 6px; border: 1px solid var(--rule); border-radius: 99px; background: var(--sheet); font-size: .84rem; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.person { border: 1px solid var(--rule); background: var(--sheet); padding: 12px 14px; }
.person h3 { margin: 0 0 4px; font-size: 1.25rem; }
.person .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---- credits roll ---- */
body.roll-page { background: #050506; color: #f1f1ee; overflow: hidden; }
.roll-wrap { height: 100vh; overflow: hidden; position: relative; }
.roll { position: absolute; left: 0; right: 0; text-align: center; padding: 100vh 16px 60vh; animation: roll var(--roll-time, 90s) linear forwards; }
.roll.paused { animation-play-state: paused; }
@keyframes roll { from { transform: translateY(0); } to { transform: translateY(-100%); } }
.roll h1 { font-size: clamp(2.8rem, 9vw, 6rem); font-weight: 800; letter-spacing: .02em; margin-bottom: .3em; }
.roll .sub { color: #a9adb3; margin-bottom: 4.5rem; }
.roll section { margin: 0 0 3.6rem; }
.roll h2 { margin: 0 0 .9rem; font-size: 1.5rem; color: #e9d6a0; font-weight: 600; }
.roll h2 small { display: block; color: #8a8f96; font-size: .95rem; font-weight: 400; letter-spacing: .08em; }
.roll p { margin: .25rem auto; max-width: none; font-size: 1.25rem; }
.roll p small { color: #8a8f96; font-size: .85rem; margin-left: .5rem; }
.roll .thanks { margin-top: 5rem; }
.roll-ctl { position: fixed; right: 14px; bottom: 14px; display: flex; gap: 8px; z-index: 3; opacity: .35; transition: opacity .2s; }
.roll-ctl:hover, .roll-ctl:focus-within { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .roll { animation: none; position: static; padding-top: 12vh; } body.roll-page { overflow: auto; } .roll-wrap { height: auto; overflow: visible; } }

@media (max-width: 640px) {
  .strip > div { min-width: 44%; border-right: 0; margin-right: 0; }
    .nav a { padding: 10px 8px; }
  .cal .day { min-height: 60px; font-size: .7rem; }
}

.send { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #2b2e33; padding-top: 12px; }
.send textarea, .send input { width: 100%; box-sizing: border-box; }

[hidden] { display: none !important; }
