/* ==========================================================
   matthewmcnamara.com · "Spec Sheet"
   One neutral base + one accent. Change colors here only.
   ========================================================== */

:root {
  --bg: #F2F0EB;
  --card: #FAF9F6;
  --ink: #161514;
  --muted: #5C5A55;
  --line: #D6D2C9;
  --inv-muted: #B9B5AC;
  --accent: #E0461A;
  --on-accent: #161514;

  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --gutter: clamp(20px, 4.5vw, 64px);
  --max: 1440px;
  --section: clamp(72px, 9vw, 136px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413; --card: #1C1B19; --ink: #EDEAE3; --muted: #A19D94;
    --line: #34322E; --inv-muted: #55524C; --accent: #FF6A3D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141413; --card: #1C1B19; --ink: #EDEAE3; --muted: #A19D94;
  --line: #34322E; --inv-muted: #55524C; --accent: #FF6A3D;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--ink); color: var(--bg); padding: 12px 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- display type ---------- */
.display { font-stretch: 115%; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.h1 { font-size: clamp(46px, 7.4vw, 108px); line-height: 0.96; letter-spacing: -0.035em; text-wrap: balance; }
.h2 { font-size: clamp(36px, 5vw, 72px); }
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px 24px; flex-wrap: wrap; padding-block: 16px;
}
.wordmark {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  text-decoration: none; color: var(--ink);
  font-stretch: 125%; font-weight: 800; font-size: 22px; letter-spacing: -0.01em;
}
.wordmark::before { content: ""; width: 12px; height: 12px; background: var(--accent); }
.wordmark:hover { color: var(--ink); }
.nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.nav a { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; padding: 12px 0; }
.nav a[aria-current="page"] { color: var(--accent); }
.icons { display: flex; align-items: center; border-left: 1px solid var(--line); padding-left: 12px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
.theme-toggle span { display: contents; }

@media (max-width: 640px) {
  .site-header .wrap { padding-block: 10px 2px; }
  .wordmark { font-size: 19px; }
  .nav { order: 3; width: 100%; gap: 24px; }
  .nav a { font-size: 12px; }
  .icons { border-left: 0; padding-left: 0; margin-right: -10px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; border: 1px solid var(--ink); cursor: pointer;
}
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-line { color: var(--ink); background: transparent; }
.btn-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); min-height: 52px; padding: 0 28px; font-size: 14px; font-weight: 500; }
.btn-accent:hover { color: var(--on-accent); filter: brightness(1.08); }
.btn svg { width: 16px; height: 16px; }

/* ---------- hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 104px) 56px; display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); }
.hero-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.hero-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 32px; align-items: end; }
.hero-sub { font-size: clamp(21px, 2.2vw, 30px); font-weight: 500; letter-spacing: -0.01em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.portrait { display: flex; align-items: center; gap: 20px; justify-self: end; }
.portrait figcaption { display: flex; flex-direction: column; gap: 4px; text-align: right; color: var(--muted); }
.portrait img {
  width: 148px; height: 148px; border-radius: 50%; object-fit: cover;
  background: #000; box-shadow: 8px 8px 0 var(--accent);
}
@media (max-width: 640px) {
  .portrait { justify-self: start; order: -1; }
  .portrait figcaption { display: none; }
  .portrait img { width: 104px; height: 104px; box-shadow: 6px 6px 0 var(--accent); }
}

/* ---------- numbers strip ---------- */
.numbers { border-block: 1px solid var(--line); }
.numbers .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 28px 24px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.stat:first-child { padding-left: 0; }
.stat:last-child { border-right: 0; }
.stat-key { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.stat-num { font-stretch: 115%; font-weight: 800; font-size: clamp(38px, 3.9vw, 56px); line-height: 1; letter-spacing: -0.03em; }
.stat-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
a.stat .stat-num { color: var(--accent); }
.stat-label svg { width: 13px; height: 13px; flex: none; }
a.stat:hover .stat-label { color: var(--ink); }
@media (max-width: 860px) {
  .numbers .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 18px 12px; border-bottom: 1px solid var(--line); }
  .stat:nth-child(odd) { padding-left: 0; }
  .stat:nth-child(even) { border-right: 0; }
  .stat:nth-child(n+3) { border-bottom: 0; }
}

/* ---------- sections ---------- */
.section { padding-block: var(--section); }
#about { padding-bottom: 0; }
.section-head { display: flex; flex-direction: column; gap: 20px; }
.section-head-row { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }

/* about */
.about-title { white-space: nowrap; font-size: clamp(30px, 5vw, 72px); }
.about-grid { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 40px 80px; align-items: start; }
.about-copy { display: flex; flex-direction: column; gap: 24px; font-size: clamp(18px, 1.6vw, 23px); line-height: 1.5; max-width: 680px; }
.log { font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; border-top: 1px solid var(--line); }
.log li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.log li > :first-child { color: var(--muted); }
@media (max-width: 860px) { .about-grid .log { order: 2; } }

/* projects */
.projects { display: flex; flex-direction: column; gap: 56px; margin-top: 48px; }
.group { display: flex; flex-direction: column; gap: 24px; }
.group-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1.5px solid var(--ink); font-family: var(--mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; }
.cards { display: grid; column-gap: 24px; row-gap: 0; grid-template-columns: repeat(auto-fit, minmax(min(var(--card-min, 380px), 100%), 1fr)); }
.cards--wide { --card-min: 540px; }
.card {
  display: grid; grid-template-rows: subgrid; grid-row: span 6; row-gap: 0;
  margin-bottom: 24px; background: var(--card); border: 1px solid var(--line);
}
.card-media { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--media-bg, var(--card)); }
.cards--wide .card-media { aspect-ratio: 16 / 9; }
.card-media img { width: 100%; height: 100%; object-fit: var(--fit, cover); object-position: var(--pos, center); }
.card-kicker { padding: 28px 28px 12px; color: var(--muted); }
.card-title { padding: 0 28px 12px; font-stretch: 110%; font-weight: 750; font-size: clamp(26px, 2.3vw, 32px); line-height: 1.05; letter-spacing: -0.02em; }
.card-title a { text-decoration: none; }
.card-desc { padding: 0 28px 20px; color: var(--muted); }
.specs { display: grid; grid-template-columns: 104px 1fr; align-self: start; font-family: var(--mono); font-size: 13px; border-top: 1px solid var(--line); }
.card .specs { margin: 0 28px; }
.specs dt, .specs dd { padding: 10px 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.card-links { padding: 16px 28px 24px; display: flex; gap: 0 24px; flex-wrap: wrap; align-items: center; align-self: end; }
.link-strong { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 650; text-decoration: none; }
.link-quiet { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--muted); font-family: var(--mono); font-size: 13px; text-decoration: none; }
.link-strong svg { width: 16px; height: 16px; }
.link-quiet svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .card-kicker { padding: 22px 22px 10px; font-size: 11px; }
  .card-title, .card-desc { padding-inline: 22px; }
  .card .specs { margin: 0 22px; }
  .card-links { padding: 12px 22px 18px; }
}

/* get help */
.help { background: var(--ink); color: var(--bg); }
.help .wrap { padding-block: var(--section); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 56px 96px; }
.help a:hover { color: var(--accent); }
.help-intro { margin-top: 20px; max-width: 520px; color: var(--inv-muted); font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; }
.help-list { margin-top: 32px; border-top: 1px solid var(--inv-muted); }
.help-list li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 20px 0; border-bottom: 1px solid var(--inv-muted); }
.help-list .n { font-family: var(--mono); font-size: 13px; color: var(--accent); padding-top: 4px; }
.help-list strong { display: block; font-size: 20px; font-weight: 600; }
.help-list span.sub { display: block; color: var(--inv-muted); margin-top: 4px; }
.form { display: flex; flex-direction: column; gap: 28px; align-self: start; padding-top: 44px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 28px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--inv-muted); }
.field input, .field textarea {
  font: inherit; font-size: 17px; color: inherit; background: transparent;
  border: 1px solid var(--inv-muted); border-radius: 0; padding: 14px 16px;
}
.field input { height: 52px; padding-block: 0; }
.field textarea { resize: vertical; min-height: 180px; }
.field input::placeholder, .field textarea::placeholder { color: var(--inv-muted); opacity: 0.8; }
.form .btn-accent { border: 0; }
.form .btn-accent:disabled { opacity: 0.6; cursor: progress; }
.form-foot { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.form-status { font-family: var(--mono); font-size: 13px; color: var(--inv-muted); }
.form-status[data-state="ok"] { color: var(--bg); }
.form-status[data-state="error"] { color: var(--accent); }
.hp { display: none; }
@media (max-width: 640px) { .form { padding-top: 8px; } .form .btn-accent { width: 100%; justify-content: center; } }

/* footer */
.site-footer .wrap { padding-block: 40px; display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; }
.site-footer .wordmark { font-size: 18px; }
.foot-links { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.foot-links a { text-decoration: none; padding: 12px 0; }

/* ---------- project page ---------- */
.crumbs { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 32px; }
.crumbs a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; }
.crumbs svg { width: 16px; height: 16px; }
.p-hero { display: flex; flex-direction: column; gap: 24px; padding-top: 48px; }
.p-title { font-size: clamp(50px, 9vw, 136px); line-height: 0.92; letter-spacing: -0.04em; overflow-wrap: anywhere; }
.p-intro { display: flex; flex-wrap: wrap; gap: 40px 80px; align-items: start; margin-top: 32px; }
.p-lede { flex: 999 1 520px; min-width: 0; max-width: 760px; font-size: clamp(21px, 2.1vw, 30px); line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; }
.p-intro .specs { flex: 1 1 340px; grid-template-columns: 112px 1fr; border-top: 1.5px solid var(--ink); }
.p-intro .specs dt, .p-intro .specs dd { padding: 12px 0; }
.p-intro .specs a { text-decoration: underline; text-underline-offset: 3px; }
.fig { display: flex; flex-direction: column; gap: 12px; }
.fig-media { border: 1px solid var(--line); background: var(--media-bg, var(--card)); overflow: hidden; }
.fig-media img { width: 100%; height: 100%; object-fit: var(--fit, cover); object-position: var(--pos, center); }
.fig figcaption { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
.p-hero-fig { margin-top: 56px; }
.p-hero-fig .fig-media { aspect-ratio: 21 / 9; }
@media (max-width: 640px) { .p-hero-fig .fig-media { aspect-ratio: 4 / 3; } }

.p-section { padding-top: 96px; }
.p-section-inner { display: flex; flex-wrap: wrap; gap: 20px 80px; border-top: 1px solid var(--line); padding-top: 28px; }
.p-section-head { flex: 1 1 280px; display: flex; flex-direction: column; gap: 8px; }
.p-section-head h2 { font-stretch: 112%; font-weight: 800; font-size: clamp(28px, 2.6vw, 34px); line-height: 1.05; letter-spacing: -0.02em; }
.p-section-body { flex: 999 1 560px; min-width: 0; max-width: 760px; display: flex; flex-direction: column; gap: 24px; font-size: clamp(18px, 1.5vw, 20px); line-height: 1.6; }
.p-section-body p + p { margin-top: 0; }
.p-section-body .prose { display: flex; flex-direction: column; gap: 20px; }
.p-section-body .prose a { text-decoration: underline; text-underline-offset: 3px; }
.p-section-body .fig-media { aspect-ratio: 4 / 3; }
.release-log { font-family: var(--mono); font-size: 14px; border-top: 1.5px solid var(--ink); }
.release-log li { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.release-log li > :first-child { color: var(--accent); }
.release-log li > :last-child { color: var(--muted); }
.gallery { padding-top: 96px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); gap: 24px; }
.gallery .fig-media { aspect-ratio: 4 / 3; }

.pager { padding-block: 112px 96px; }
.pager-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); border-top: 1.5px solid var(--ink); border-bottom: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; gap: 8px; padding: 28px 28px 28px 0; text-decoration: none; }
.pager a + a, .pager .next { align-items: flex-end; text-align: right; padding: 28px 0 28px 28px; }
.pager .prev { border-right: 1px solid var(--line); }
.pager .label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.pager .label svg { width: 14px; height: 14px; }
.pager .name { font-stretch: 112%; font-weight: 800; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -0.02em; }
@media (max-width: 760px) {
  .pager .prev { border-right: 0; border-bottom: 1px solid var(--line); }
  .pager a, .pager a + a, .pager .next { padding: 18px 0; }
}

.cta-band { background: var(--ink); color: var(--bg); }
.cta-band .wrap { padding-block: 80px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 32px; }
.cta-band h2 { font-size: clamp(32px, 4vw, 56px); margin-top: 16px; }
@media (max-width: 640px) { .cta-band .btn-accent { width: 100%; justify-content: center; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
