/* Shared styles for the unlisted reference pages (hub, QA letters, music letters).
   Palette mirrors the public site (style.css) so the two feel like one property. */
:root {
  --ink: #17251d;
  --muted: #61675e;
  --line: #d8d0be;
  --bg: #e8e1d0;
  --sheet: #fbf9f2;
  --accent-qa: #0d47a1;
  --accent-music: #9e4822;
  --accent: var(--ink);
}
.theme-qa    { --accent: var(--accent-qa); }
.theme-music { --accent: var(--accent-music); }
.theme-tuned {
  --accent: #7d5f16; /* brass, darkened for AA on paper */
  --accent-soft: #f3ead2;
  --espresso: #17150F;
  --bone: #ECE6D6;
  --bone-dim: #A39B86;
  --brass: #C9A24B;
  --intune: #7CC47F;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sheet {
  max-width: 720px;
  margin: 2rem auto;
  background: var(--sheet);
  padding: 2.5rem 3rem;
  box-shadow: 0 10px 40px rgba(23, 37, 29, 0.12);
}
.sheet-wide { max-width: 880px; }

/* ---- in-page section nav (Portfolio · Letters) ---- */
.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
}
.page-nav a {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.page-nav a:hover { border-color: var(--accent); color: var(--accent); }

/* ---- portfolio sections ---- */
.section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  scroll-margin-top: 1rem;
}
.section > h2 {
  font-family: "Playfair Display", serif;
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0 0 0.35rem;
}
.section > .lede {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
  max-width: 44rem;
}
.sub-h {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2rem 0 0.9rem;
}
.sub-h:first-child { margin-top: 0; }

/* facts */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem 1.5rem;
  margin: 0 0 0.5rem;
}
.facts > div {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.facts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts dt {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.3rem;
}
.facts dd { margin: 0; font-size: 0.9rem; line-height: 1.5; }

/* case studies */
.cases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.case {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: #fff;
}
.case h3 { margin: 0; font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
.case .kind {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.case p { margin: 0; font-size: 0.88rem; line-height: 1.55; }
.case p strong { font-weight: 600; }
.case .src {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.76rem;
  color: var(--muted);
}
.case .src a { color: var(--muted); }

/* at-a-glance numbers */
.metrics {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}
.metrics li {
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}
.metrics strong {
  display: block;
  font-family: "Playfair Display", serif;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.case .chips { margin-top: 0.15rem; }
.case .chips li { font-size: 0.7rem; padding: 0.2rem 0.55rem; }
.media-card audio.extra { padding: 0.5rem 0 0; }

/* tag chips (stack / tools) */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-size: 0.76rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(23, 37, 29, 0.06);
  color: var(--ink);
}

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.1rem 1.25rem; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 0.4rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--sheet); border: 2px solid var(--accent);
}
.timeline .when { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.timeline h3 { margin: 0.1rem 0 0.2rem; font-size: 0.98rem; font-weight: 600; }
.timeline p { margin: 0; font-size: 0.86rem; color: var(--muted); }

/* media grid (scoring reel) */
.media-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.media-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.media-card video, .media-card audio { display: block; width: 100%; background: #10241f; }
.media-card video { aspect-ratio: 16 / 9; object-fit: cover; }
.media-card audio { padding: 0.75rem 0.6rem 0.25rem; background: transparent; }
.audio-face {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #10241f;
}
.audio-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.audio-face audio {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.45rem;
  width: calc(100% - 1.1rem);
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}
.media-card .body { padding: 0.85rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.media-card .kind { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.media-card h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.media-card p { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.media-card .year { font-size: 0.76rem; color: var(--muted); }

/* discography */
.disco { list-style: none; margin: 0; padding: 0; }
.disco li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.92rem;
}
.disco a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.disco a:hover { border-bottom-color: var(--ink); }
.disco span { color: var(--muted); font-size: 0.85rem; }

.embed { border: 0; border-radius: 12px; display: block; width: 100%; }

/* two-column lists (performances / collaborators) */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 2rem; }
.cols-mt { margin-top: 1.5rem; }
.plain { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.plain li { margin-bottom: 0.3rem; }

/* CTA band */
.cta-band {
  margin-top: 2.5rem;
  padding: 1.5rem 1.6rem;
  border-radius: 14px;
  background: var(--ink);
  color: var(--sheet);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cta-band h2 { font-family: "Playfair Display", serif; font-size: 1.3rem; margin: 0 0 0.2rem; }
.cta-band p { margin: 0; font-size: 0.88rem; color: rgba(251, 249, 242, 0.75); }
.cta-band .btn { border-color: var(--sheet); color: var(--sheet); }
.cta-band .btn:hover { background: var(--sheet); color: var(--ink); }
.cta-band .btn-primary { background: var(--sheet); color: var(--ink); }
.cta-band a:focus-visible { outline-color: var(--sheet); }

/* Tuned QA — stages & audiences */
.stages { list-style: none; margin: 0; padding: 0; counter-reset: stage; display: grid; gap: 0.9rem; }
.stage {
  counter-increment: stage;
  display: grid;
  grid-template-columns: 2.6rem 1fr;
  gap: 0.25rem 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.stage::before {
  content: counter(stage, decimal-leading-zero);
  grid-row: 1 / span 3;
  font-family: "Playfair Display", serif;
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1;
}
.stage .kind { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stage h3 { margin: 0; font-size: 1.02rem; font-weight: 600; }
.stage p { margin: 0.15rem 0 0; font-size: 0.88rem; color: var(--muted); line-height: 1.55; }
.audience { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; }
.audience li { padding: 1rem 1.1rem; border-radius: 12px; background: var(--accent-soft, rgba(23,37,29,.05)); font-size: 0.88rem; line-height: 1.55; }
.audience li strong { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.74rem; color: var(--accent); margin-bottom: 0.3rem; letter-spacing: 0.02em; }
.quote {
  margin: 1.5rem 0 0;
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.5;
}
.quote cite { display: block; margin-top: 0.4rem; font-family: "DM Sans", system-ui, sans-serif; font-style: normal; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.pullquotes {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}
.pullquotes .quote {
  margin: 0;
  padding: 1rem 1.1rem;
  border-left-width: 4px;
  background: #fff;
  border-radius: 0 12px 12px 0;
  font-size: 0.98rem;
}
.letter .excerpt {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink);
  max-width: 38rem;
  line-height: 1.5;
}

/* ---- Tuned QA brand (espresso / brass / tuner) ---- */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Bricolage Grotesque", "Playfair Display", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.85rem;
}
.brand-mark svg { display: block; }
.brand-mark .qa { color: var(--accent); }
.theme-tuned h1 {
  font-family: "Bricolage Grotesque", "Playfair Display", sans-serif;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.theme-tuned h1 .em { color: var(--accent); }
.tuned-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.5rem;
  align-items: center;
}
.tuner-card {
  margin: 0;
  background: var(--espresso, #17150F);
  border-radius: 10px;
  padding: 1rem 1rem 0.85rem;
  color: var(--bone, #ECE6D6);
  box-shadow: 0 18px 36px -24px rgba(0, 0, 0, 0.7);
}
.tuner-card svg { display: block; width: 100%; height: auto; }
.tuner-card figcaption {
  margin: 0.35rem 0 0;
  text-align: center;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--bone-dim, #A39B86);
}
.tuner-card figcaption b { color: var(--intune, #7CC47F); font-weight: 500; }
.theme-tuned .stage:nth-child(1)::before { content: "E"; }
.theme-tuned .stage:nth-child(2)::before { content: "A"; }
.theme-tuned .stage:nth-child(3)::before { content: "D"; }
.theme-tuned .stage:nth-child(4)::before { content: "G"; }
.theme-tuned .stage::before {
  font-family: "Bricolage Grotesque", "Playfair Display", serif;
}
.receipts {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
.receipts .plain { margin: 0; }
.panel {
  background: var(--espresso, #17150F);
  color: var(--bone-dim, #A39B86);
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.85;
  padding: 1.15rem 1.2rem;
  border-radius: 8px;
}
.panel .ln { display: block; }
.panel .k { color: var(--brass, #C9A24B); }
.panel .v { color: var(--bone, #ECE6D6); }
.panel .ok { color: var(--intune, #7CC47F); }
.theme-tuned .cta-band { background: var(--espresso, #17150F); }
.theme-tuned .cta-band .btn-primary {
  background: var(--brass, #C9A24B);
  border-color: var(--brass, #C9A24B);
  color: var(--espresso, #17150F);
}
.theme-tuned .cta-band .btn-primary:hover { filter: brightness(1.08); }
.theme-tuned .cta-band .btn { border-color: var(--bone, #ECE6D6); color: var(--bone, #ECE6D6); }
.theme-tuned .cta-band .btn:hover { background: var(--bone, #ECE6D6); color: var(--espresso, #17150F); }

/* ---- header ---- */
.crumbs {
  font-size: 0.8rem;
  margin: 0 0 1.25rem;
}
.crumbs a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

h1 {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}
.stats strong { color: var(--ink); }

.intro {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}
.intro a { color: var(--ink); }

/* ---- buttons / pills ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--accent); color: var(--sheet); }
.btn-primary { background: var(--accent); color: var(--sheet); }
.btn-primary:hover { filter: brightness(1.12); }

/* ---- letters ---- */
.letters {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.letter {
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 1rem;
}
/* highlight a deep-linked letter (e.g. …/qa/#yuval-bazilevich) */
.letter:target {
  box-shadow: inset 4px 0 0 var(--accent);
  padding-left: 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-right: 1rem;
}

.letter h2, .letter h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
}
.intro.aside-note { margin: 1.25rem 0 0; }
.intro.tight { margin: 0; }
.cta-band .actions { margin: 0; }
.letter .role {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.45rem;
}
.letter .note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.45rem 0 0;
  max-width: 34rem;
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.badge.signed { background: #e4f1e6; color: #24602c; }
.badge.pending { background: #fff3e0; color: #b34700; }
.badge.onfile { background: #eef2f7; color: #455a64; }
.theme-music .badge.signed { background: #f6e9dd; color: #7a3a19; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.6rem;
  margin-top: 0.9rem;
}
.actions .alt {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin-left: 0.25rem;
  border-bottom: 1px solid transparent;
}
.actions .alt:hover { color: var(--ink); border-bottom-color: currentColor; }

/* ---- bundle callout ---- */
.bundle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(232, 225, 208, 0.35);
  font-size: 0.88rem;
}
.bundle p { margin: 0; }
.bundle strong { font-weight: 600; }
.bundle .meta { color: var(--muted); display: block; font-size: 0.8rem; }

/* ---- footer ---- */
.foot {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.foot a { color: var(--ink); }
.privacy {
  margin: 0.75rem 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---- private hub ---- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin: 2rem 0 2.5rem;
}
.hub-grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.hub-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hub-card {
  display: flex; flex-direction: column; gap: .4rem;
  text-decoration: none; color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.3rem;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.hub-card:hover,
.hub-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(23, 37, 29, .10);
  border-color: var(--muted);
}
.hub-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.hub-tag { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hub-card h2 { margin: .1rem 0 .2rem; font-size: 1.15rem; }
.hub-card p { font-size: .87rem; color: var(--muted); margin: 0; line-height: 1.55; }
.hub-go { margin-top: .5rem; font-size: .8rem; letter-spacing: .04em; color: var(--ink); }
.hub-card[target="_blank"] .hub-go::after { content: " ↗"; }
.foot-note { font-size: .78rem; color: var(--muted); line-height: 1.6; margin-top: 1.5rem; }
.foot-note code {
  font-size: .74rem; padding: .1rem .35rem; border-radius: 4px;
  background: rgba(23, 37, 29, .08);
}

/* ---- responsive ---- */
@media (max-width: 640px) {
  .sheet { padding: 1.5rem; margin: 1rem; }
  h1 { font-size: 1.7rem; }
  .btn { padding: 0.5rem 0.9rem; }
  .cases, .media-grid, .facts, .pullquotes, .receipts, .tuned-hero { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .facts.two { grid-template-columns: 1fr; }
  .hub-grid-4 { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 2rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hub-card, .btn { transition: none; }
  .hub-card:hover { transform: none; }
}

@media print {
  body { background: #fff; }
  .sheet { box-shadow: none; margin: 0; max-width: none; padding: 0; background: #fff; }
  .crumbs, .actions, .bundle, .privacy, .page-nav, .cta-band, .media-card video, .media-card audio, .embed { display: none; }
  .letter, .case, .media-card, .stage, .pullquotes .quote, .tuner-card, .metrics li { break-inside: avoid; }
}
