/* ─────────────────────────────────────────────────────────────
   Corvus Library
   Reading surface for shooting briefs, read on a phone mid-setup.
   Reference is a call sheet, not a document: mono for anything
   measurable (durations, take numbers), sans for anything readable.
   ───────────────────────────────────────────────────────────── */

:root {
  --paper:      #ffffff;
  --ink:        #14151a;
  --ink-soft:   #565a66;
  --ink-faint:  #8b909e;
  --rule:       #e7e8ec;
  --wash:       #f7f8fa;

  /* Corvus iridescent — used once, deliberately */
  --iris-a:     #7b5cff;
  --iris-b:     #00c2d1;
  --iris-c:     #ff4fa3;

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --measure: 34rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ── header ─────────────────────────────────────────────── */

.sheet-head {
  padding: 2.5rem 0 0;
  border-bottom: 1px solid var(--rule);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .875rem;
}

.mark {
  width: 1.25rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--iris-a), var(--iris-b) 55%, var(--iris-c));
}

.eyebrow-text {
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sheet-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.15;
}

/* language switcher — the control that replaces Notion's toggles */
.langbar {
  display: flex;
  gap: .5rem;
  padding-bottom: 1.125rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.langbar::-webkit-scrollbar { display: none; }

.langchip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .8rem;
  border: 1px solid var(--rule);
  border-radius: 100px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}

.langchip:hover { border-color: var(--ink-faint); color: var(--ink); }

.langchip.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.langchip .flag { font-size: 1rem; line-height: 1; }

/* ── body ───────────────────────────────────────────────── */

.sheet-body { padding: 2rem 1.25rem 4rem; }

.sheet-body h2 {
  margin: 2.5rem 0 .75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.sheet-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.sheet-body h3 {
  margin: 2rem 0 .5rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* take headings carry numbers + durations — set them in mono so they
   read as data, which is what they are */
.sheet-body h4 {
  margin: 1.75rem 0 .5rem;
  font-family: var(--mono);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.sheet-body p { margin: 0 0 1rem; }

.sheet-body ul,
.sheet-body ol { margin: 0 0 1.25rem; padding-left: 1.25rem; }

.sheet-body li { margin-bottom: .4rem; }
.sheet-body li::marker { color: var(--ink-faint); }

.sheet-body strong { font-weight: 600; }

.sheet-body blockquote {
  margin: 0 0 1.75rem;
  padding: 1rem 1.125rem;
  background: var(--wash);
  border-radius: .625rem;
  border-left: 3px solid transparent;
  border-image: linear-gradient(180deg, var(--iris-a), var(--iris-c)) 1;
  font-size: .96875rem;
  color: var(--ink-soft);
}
.sheet-body blockquote p:last-child { margin-bottom: 0; }

.sheet-body hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.sheet-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

.sheet-body img { max-width: 100%; height: auto; border-radius: .5rem; }

.sheet-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
  margin-bottom: 1.5rem;
}
.sheet-body th, .sheet-body td {
  padding: .5rem .625rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}
.sheet-body th { font-family: var(--mono); font-size: .8125rem; font-weight: 500; }

/* ── footer ─────────────────────────────────────────────── */

.sheet-foot {
  padding: 1.75rem 0 3rem;
  border-top: 1px solid var(--rule);
}
.sheet-foot p {
  margin: 0;
  font-size: .875rem;
  color: var(--ink-faint);
}

/* ── link gone ──────────────────────────────────────────── */

.gone {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 2rem;
}
.gone h1 { font-size: 1.375rem; font-weight: 600; margin: 0 0 .5rem; }
.gone p  { color: var(--ink-soft); margin: 0; max-width: 26rem; }
.gone .mark { margin: 0 auto 1.5rem; width: 2rem; }

/* ── admin ──────────────────────────────────────────────── */

body.admin { background: var(--wash); }

.admin-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
}
.admin-bar .wrap {
  max-width: 62rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: 3.5rem;
}
.admin-bar .brand {
  font-family: var(--mono);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.admin-bar nav { margin-left: auto; display: flex; gap: 1.25rem; }
.admin-bar nav a {
  font-size: .9375rem; color: var(--ink-soft); text-decoration: none;
}
.admin-bar nav a:hover { color: var(--ink); }

.admin-main { max-width: 62rem; margin-inline: auto; padding: 2rem 1.25rem 5rem; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: .75rem;
  margin-bottom: 2rem;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: .625rem;
  padding: .875rem 1rem;
}
.stat .n {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
}
.stat .k {
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: .25rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: .75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2 { margin: 0 0 .875rem; font-size: 1.0625rem; font-weight: 600; }

.page-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
}
.page-row:last-child { border-bottom: 0; }
.page-row:hover .page-title { text-decoration: underline; }
.page-title { font-weight: 500; }
.page-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.pill {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 100px;
  font-family: var(--mono);
  font-size: .6875rem;
  font-weight: 500;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
}
.pill.warn   { border-color: #f0c36d; color: #8a6100; background: #fff9ec; }
.pill.live   { border-color: #7fd3a5; color: #15693f; background: #f0fbf5; }
.pill.dead   { border-color: var(--rule); color: var(--ink-faint); }

textarea.editor {
  width: 100%;
  min-height: 26rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: .5rem;
  font-family: var(--mono);
  font-size: .875rem;
  line-height: 1.6;
  resize: vertical;
}

input[type=text], select {
  padding: .5rem .625rem;
  border: 1px solid var(--rule);
  border-radius: .375rem;
  font-family: var(--sans);
  font-size: .9375rem;
  background: var(--paper);
}

.btn {
  display: inline-block;
  padding: .5rem .95rem;
  border: 1px solid var(--ink);
  border-radius: .375rem;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.small { padding: .3rem .6rem; font-size: .8125rem; }

.linkline {
  display: flex; align-items: center; gap: .625rem; flex-wrap: wrap;
  padding: .75rem 0; border-bottom: 1px solid var(--rule);
}
.linkline:last-child { border-bottom: 0; }
.linkline code {
  font-family: var(--mono); font-size: .8125rem;
  background: var(--wash); padding: .2rem .4rem; border-radius: .25rem;
}

.empty { color: var(--ink-faint); font-size: .9375rem; padding: .5rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

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