/* Maddox Mechanic — media kit. Local assets and system fonts only. */
:root {
  color-scheme: light;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --ink: #172725;
  --muted: #586966;
  --line: #d9e0dc;
  --accent: #087669;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, dl, dd { margin: 0; }
.sheet {
  width: min(100%, 66rem);
  margin-inline: auto;
  padding: 1.5rem 1.25rem;
  background: var(--surface);
}
.masthead { border-top: .3rem solid var(--accent); }
.topline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding-top: .875rem;
}
.eyebrow, .edition, .category, .section-tag, .metric-label,
.source-title, .work-subtitle, .footer-note {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 650;
  line-height: 1.5;
  letter-spacing: .035em;
}
.eyebrow, .section-tag, .source-title, .work-subtitle { color: var(--accent); }
.topline-divider { padding-inline: .25rem; }
.edition { color: var(--muted); font-size: .875rem; }
.field { font-variant-numeric: tabular-nums lining-nums; }
.identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--ink);
}
.identity-copy { min-width: 0; }
.category { color: var(--muted); }
h1 {
  margin-block: .5rem .875rem;
  font-size: clamp(2rem, 7.5vw, 4.125rem);
  font-weight: 820;
  line-height: 1.02;
  letter-spacing: -.06em;
  overflow-wrap: anywhere;
}
h1 span { color: var(--accent); }
.hero-description {
  max-width: 72ch;
  color: var(--muted);
  font-size: .9375rem;
  line-height: 1.6;
}
.brand-logo { width: 5rem; max-width: 20%; height: auto; object-fit: contain; }
.section { margin-top: 1.75rem; }
.section-head { display: grid; gap: .5rem; margin-bottom: .875rem; }
.section-tag { margin-bottom: .25rem; }
h2 {
  font-size: 1.375rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.035em;
}
.window {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.stat-grid {
  display: grid;
  gap: 1px;
  padding: 1px;
  background: var(--line);
}
.lifetime-grid { grid-template-columns: minmax(0, 1fr); }
.metric { min-width: 0; padding: 1rem; background: var(--paper); }
.metric-label { color: var(--muted); }
.metric-value, .signal-value {
  margin-top: .5rem;
  font-family: var(--font-mono);
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.metric-value { color: var(--accent); font-size: 1.875rem; }
.lifetime .metric-value { font-size: clamp(2rem, 5.5vw, 2.75rem); }
.lifetime .metric, .reach .metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.lifetime .metric-label, .reach .metric-label { max-width: 15ch; }
.lifetime .metric-value, .reach .metric-value { margin-top: 0; flex-shrink: 0; }
.source-grid, .youtube-metrics, .portfolio-grid { display: grid; gap: .875rem; }
.source-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
}
.source-title { font-size: .875rem; }
.source-head, .signal-head { display: grid; gap: .375rem; }
.source-head { margin-bottom: 1rem; }
.youtube-metrics { margin-top: 1rem; gap: 1rem; }
.signal + .signal { padding-top: 1rem; border-top: 1px solid var(--line); }
.signal-value { font-size: 1.625rem; }
.source-stats { display: grid; gap: 1rem; }
.paired-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.source-stats > div { min-width: 0; }
.work-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-top: .2rem solid var(--accent);
}
.work-card h3 {
  margin-top: .5rem;
  font-size: 1rem;
  font-weight: 720;
  line-height: 1.3;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.work-description { margin-top: .625rem; color: var(--muted); font-size: .875rem; }
.inquiry { padding: 1.25rem; border: 1px solid var(--accent); background: var(--paper); }
.contact {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 2.75rem;
  margin-top: .5rem;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 4.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.035em;
  text-decoration-thickness: .08em;
  text-underline-offset: .2em;
  overflow-wrap: anywhere;
}
.contact .field { min-width: 0; }
.contact:hover { color: var(--ink); }
.contact:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.inquiry-copy { margin-top: .5rem; color: var(--muted); font-size: .875rem; }
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .375rem 1.5rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
}
.footer .section-tag { margin: 0; }
.footer-note { color: var(--muted); }

@media (min-width: 42rem) {
  .sheet { padding: 2rem 2.5rem; }
  .identity { padding-block: 2rem; }
  .section { margin-top: 2rem; }
  .section-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .5rem 1.5rem; }
  .lifetime-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lifetime .metric, .reach .metric { display: block; }
  .lifetime .metric-label, .reach .metric-label { max-width: none; }
  .lifetime .metric-value, .reach .metric-value { margin-top: .5rem; }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .youtube-source { grid-column: 1 / -1; }
  .youtube-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .signal { display: grid; grid-template-rows: 1fr auto; padding-right: 1.25rem; }
  .signal + .signal { padding: 0 0 0 1.25rem; border-top: 0; border-left: 1px solid var(--line); }
  .source-card { padding: 1.25rem; }
  .source-head { min-height: 6rem; }
  .portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 58rem) {
  .sheet { padding: 2.5rem 3.5rem; }
  .metric { padding: 1.25rem; }
}

/* Reflow naturally onto clean sheets; keep related content together. */
@page { size: letter; margin: .45in; }
@media print {
  html, body { margin: 0; padding: 0; background: var(--surface); }
  body { font-size: 10pt; }
  .sheet { width: auto; max-width: none; margin: 0; padding: 0; }
  .sheet, .metric, .inquiry { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .masthead { border-top-width: 3pt; }
  .topline { padding-top: 6pt; gap: 4pt 12pt; }
  .eyebrow, .category, .section-tag, .metric-label, .work-subtitle, .footer-note { font-size: 8.5pt; }
  .edition, .source-title { font-size: 10pt; }
  .identity { padding-block: 14pt; }
  h1 { margin-block: 5pt 7pt; font-size: 36pt; }
  .hero-description { max-width: none; font-size: 10pt; line-height: 1.45; }
  .section { margin-top: 14pt; }
  .section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-bottom: 7pt; gap: 5pt 12pt; }
  h2 { font-size: 15pt; }
  .window { font-size: 10pt; line-height: 1.4; }
  .lifetime-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { padding: 10pt; }
  .metric-value { font-size: 22pt; }
  .lifetime .metric-value { font-size: 28pt; }
  .lifetime .metric, .reach .metric { display: block; }
  .lifetime .metric-label, .reach .metric-label { max-width: none; }
  .lifetime .metric-value, .reach .metric-value { margin-top: 5pt; }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8pt; }
  .youtube-source { grid-column: 1 / -1; }
  .source-card { padding: 10pt; }
  .source-head { min-height: 0; margin-bottom: 8pt; gap: 3pt; }
  .youtube-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 8pt; }
  .signal { display: grid; grid-template-rows: 1fr auto; padding-right: 12pt; }
  .signal + .signal { padding: 0 0 0 12pt; border-top: 0; border-left: 1px solid var(--line); }
  .signal-head { gap: 3pt; }
  .signal-value { margin-top: 5pt; font-size: 19pt; }
  .source-stats { gap: 10pt; }
  .portfolio-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8pt; }
  .work-card { padding: 10pt; border-top-width: 2pt; }
  .work-card h3 { margin-top: 5pt; font-size: 11pt; }
  .work-description { margin-top: 6pt; font-size: 9.5pt; line-height: 1.4; }
  .inquiry { padding: 12pt; }
  .contact { min-height: 0; margin-top: 6pt; font-size: 16pt; }
  .inquiry-copy { margin-top: 6pt; font-size: 10pt; }
  .footer { margin-top: 14pt; padding-top: 8pt; }
  .masthead, .lifetime, .reach, .source-card, .portfolio, .section-head, .work-card, .inquiry, .footer {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .section-head, .source-title, .source-head { break-after: avoid; page-break-after: avoid; }
  p { orphans: 3; widows: 3; }
}

/* Keep the two three-metric groups balanced on phones. */
@media (max-width: 41.999rem) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lifetime .metric, .reach .metric { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: .75rem .5rem; }
  .lifetime .metric-value, .reach .metric-value { margin-top: auto; padding-top: .5rem; font-size: clamp(1.25rem, 5vw, 1.75rem); }
  .metric-label { font-size: .6875rem; }
}
.work-card { display: flex; flex-direction: column; }
.work-description { order: 1; }
.work-link { order: 2; display: flex; align-items: center; min-height: 44px; margin-top: .5rem; color: var(--accent); text-underline-offset: .2em; }
.work-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
@media print {
  .metric { break-inside: avoid; page-break-inside: avoid; }
}
