/* datdoesthings.com: the one stylesheet for every root/ page.
   Heartshot's typefaces (Zodiak, Switzer; linked from Fontshare in each page's <head>), not its look:
   an off-white page, near-black text, one quiet accent. Heartshot's own styles live in site/css/. */

/* ---------------------------------------------------------------------------
   Tokens
   --------------------------------------------------------------------------- */
:root {
  --bg: #f8f7f3;
  --surface: #efede7;
  --ink: #161616;
  --muted: #5f5d58;          /* 6.4:1 on --bg */
  --line: #dedbd3;
  --accent: #2f5d50;         /* the one accent: focus rings and the status dot */

  --serif: "Zodiak", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Switzer", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: clamp(0.84rem, 0.81rem + 0.12vw, 0.92rem);
  --step-0: clamp(1rem, 0.96rem + 0.18vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.45vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.25rem + 1.1vw, 2.25rem);
  --step-3: clamp(2.4rem, 1.5rem + 4.2vw, 5rem);       /* page H1 */
  --step-4: clamp(3rem, 1.4rem + 7.4vw, 7.5rem);       /* home H1: the wordmark, big */

  --gutter: clamp(16px, 4vw, 40px);
  --measure: 38rem;
  --gap: clamp(20px, 3vw, 36px);
  --space: clamp(56px, 9vw, 120px);
  --radius: 4px;
}

/* ---------------------------------------------------------------------------
   Base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.05; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); line-height: 1.2; }
p { margin: 0; }
p + p { margin-top: 1em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

/* Visible focus everywhere, keyboard only */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--radius); text-decoration: none;
}
.skip:focus { top: 12px; }

.container { width: 100%; max-width: calc(1100px + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.section { margin-top: var(--space); }
.section > h2 { margin-bottom: clamp(20px, 3vw, 32px); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* A draft marker (confirm / TBD): wording Dat hasn't signed off yet. Visible on purpose, but quiet. */
.draft { font-family: var(--sans); font-size: 0.7em; color: var(--muted); white-space: nowrap; vertical-align: 0.15em; }

/* ---------------------------------------------------------------------------
   Shell: header and footer (identical markup on every page; tools/check-root.mjs)
   --------------------------------------------------------------------------- */
.site-header-inner {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding-block: clamp(18px, 3vw, 32px);
}
.wordmark { font-family: var(--serif); font-size: var(--step-1); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.site-nav a { text-decoration: none; padding-block: 4px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 1px; }

.site-footer { margin-top: var(--space); border-top: 1px solid var(--line); }
.site-footer .container { padding-block: 28px 40px; color: var(--muted); font-size: var(--step--1); }

/* ---------------------------------------------------------------------------
   Page heads
   --------------------------------------------------------------------------- */
.page-head { padding-top: clamp(32px, 7vw, 96px); }
.page-head h1 { max-width: 16ch; }
.page-head .lede { margin-top: clamp(16px, 2.5vw, 28px); max-width: var(--measure); font-size: var(--step-1); line-height: 1.45; }
.home-head h1 { font-size: var(--step-4); letter-spacing: -0.03em; }
.home-head .tagline { margin-top: 12px; font-size: var(--step-1); color: var(--muted); }
.home-head .lede { margin-top: clamp(28px, 4vw, 48px); }
.prose { max-width: var(--measure); }
.more { display: inline-block; margin-top: clamp(24px, 3vw, 36px); }

/* ---------------------------------------------------------------------------
   Card grid: 3 columns, 2 on tablet, 1 on phone
   --------------------------------------------------------------------------- */
.card-grid { display: grid; gap: var(--gap); grid-template-columns: 1fr; list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; height: 100%; }
.card > img, .card > .placeholder { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; border-radius: var(--radius); margin-bottom: 10px; }
.card h2, .card h3 { font-size: var(--step-1); line-height: 1.2; }
.card p { color: var(--muted); }
.card:hover h2, .card:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.status { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font-size: var(--step--1); color: var(--muted); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------------------------------------------------------------------------
   Placeholder block: stands in for a photo that doesn't exist yet (aria-hidden; the label is visual)
   --------------------------------------------------------------------------- */
.placeholder {
  display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 16px;
  background: var(--surface) repeating-linear-gradient(135deg, transparent 0 14px, rgb(0 0 0 / 0.025) 14px 15px);
  border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: var(--step--1); text-align: center;
}
.hero { margin-top: clamp(28px, 5vw, 56px); }
.hero > img, .hero > picture img, .hero > .placeholder { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); }

/* ---------------------------------------------------------------------------
   Specs table: label column + value; stacks on a phone
   --------------------------------------------------------------------------- */
.specs { width: 100%; max-width: 52rem; border-collapse: collapse; }
.specs th, .specs td { text-align: left; vertical-align: top; padding: 14px 0; border-top: 1px solid var(--line); }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 1px solid var(--line); }
.specs th { width: 12rem; padding-right: 24px; font-weight: 500; color: var(--muted); }
@media (max-width: 600px) {
  .specs, .specs tbody, .specs tr, .specs th, .specs td { display: block; width: auto; }
  .specs th { padding: 14px 0 2px; }
  .specs td { border-top: 0; padding: 0 0 14px; }
  .specs tr:last-child th { border-bottom: 0; }
}

/* ---------------------------------------------------------------------------
   Build log: dated entries, newest first
   --------------------------------------------------------------------------- */
.log { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.log li { padding-block: 20px; border-top: 1px solid var(--line); }
.log li:last-child { border-bottom: 1px solid var(--line); }
.log-date { font-size: var(--step--1); color: var(--muted); margin-bottom: 4px; }
.log h3 { margin-bottom: 6px; }

/* ---------------------------------------------------------------------------
   Photo grid: 2 columns at every width (one column of 4:3 photos runs far too long on a phone)
   --------------------------------------------------------------------------- */
.photo-grid { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .photo-grid { gap: 16px; } }
.photo-grid img, .photo-grid .placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }

.related { list-style: none; margin: 0; padding: 0; }
.related li + li { margin-top: 8px; }
