/* marc-wilhelm.com v2 — hand-built, no JS required.
   Light/dark via prefers-color-scheme · one accent · self-hosted Fraunces headings. */

/* ---- self-hosted Fraunces (variable, headings only) ---- */
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  --bg: #faf9f6; --surface: #ffffff; --surface-2: #f4f2ec;
  --text: #1a1d23; --text-sec: #4b5563; --text-dim: #9ca3af;
  --accent: #1d4ed8; --accent-soft: rgba(29,78,216,0.08);
  --border: #e5e3de; --hero-bg: #f1efe9;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b; --surface: #1c1f26; --surface-2: #222530;
    --text: #e8e6e1; --text-sec: #b3b0a9; --text-dim: #6e6c66;
    --accent: #8da2fb; --accent-soft: rgba(141,162,251,0.12);
    --border: #2a2d35; --hero-bg: #181b21;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 1.05rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---- header ---- */
header { border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 26px; padding: 22px 0; }
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; color: var(--text); margin-right: auto; letter-spacing: 0.005em; }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav a.item { color: var(--text-sec); font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; }
.nav a.item:hover { color: var(--accent); text-decoration: none; }
.nav a.item.active { color: var(--text); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* ---- hero (D3: oversized fluid display) ---- */
.hero { background: var(--hero-bg); padding: 96px 0 80px; border-bottom: 1px solid var(--border); }
.hero-kicker { color: var(--accent); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 22px; }
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.9rem, 9vw, 5.6rem); line-height: 1.0;
  margin: 0 0 22px; letter-spacing: -0.025em;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: clamp(1.08rem, 2.2vw, 1.35rem); color: var(--text-sec); max-width: 48ch; margin: 0 0 32px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; }
.btn.primary { background: var(--accent); color: var(--bg); }
.btn.primary:hover { text-decoration: none; opacity: 0.92; }
.btn.ghost { border: 1.5px solid var(--accent); color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); text-decoration: none; }

/* ---- studio strip (D1) ---- */
.studio-strip { background: var(--surface); border-bottom: 1px solid var(--border); padding: 22px 0; }
.studio-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 30px; }
.studio-row span {
  color: var(--text-dim); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
}

/* ---- stats strip ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
.stat { background: var(--surface); padding: 28px 20px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-weight: 600; font-size: 2rem; color: var(--accent); line-height: 1; margin-bottom: 6px; }
.stat span { color: var(--text-sec); font-size: 0.85rem; }

/* ---- sections ---- */
section.block { padding: 66px 0; }
h2.sec { font-family: var(--serif); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.2rem); margin: 0 0 10px; letter-spacing: -0.015em; }
p.sec-sub { color: var(--text-sec); margin: 0 0 36px; max-width: 64ch; }

/* ---- timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 26px 28px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--accent);
}
.timeline .when { display: block; font-size: 0.8rem; color: var(--text-dim); letter-spacing: 0.08em; text-transform: uppercase; }
.timeline .what { font-weight: 700; }
.timeline .who { color: var(--text-sec); }

/* ---- project grid (D4: asymmetric featured) ---- */
.work { display: flex; flex-direction: column; gap: 22px; }
.lead-wrap { display: block; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; color: var(--text); transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); text-decoration: none; box-shadow: 0 10px 30px rgba(0,0,0,0.06); }
.card .thumb { aspect-ratio: 16/9; background: var(--surface-2); display: block; width: 100%; object-fit: cover; }
.card .thumb.missing { display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 0.85rem; letter-spacing: 0.04em; }
.card .card-body { padding: 15px 18px 18px; }
.card h3 { margin: 0 0 3px; font-size: 1.08rem; }
.card .role { color: var(--text-sec); font-size: 0.85rem; }

/* featured lead card */
.card.lead .thumb { aspect-ratio: 21/9; }
.card.lead h3 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; letter-spacing: -0.01em; }
.card.lead .lead-blurb { color: var(--text-sec); margin: 10px 0 0; font-size: 0.98rem; max-width: 60ch; }
@media (min-width: 760px) {
  .card.lead { display: grid; grid-template-columns: 1.5fr 1fr; align-items: stretch; }
  .card.lead .thumb { aspect-ratio: auto; height: 100%; min-height: 280px; }
  .card.lead .card-body { padding: 30px 32px; align-self: center; }
}

/* ---- testimonials (D2) ---- */
.tq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 20px; }
figure.tq { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 28px; }
figure.tq blockquote { margin: 0 0 16px; font-family: var(--serif); font-weight: 500; font-size: 1.18rem; line-height: 1.45; color: var(--text); letter-spacing: -0.005em; }
figure.tq figcaption { font-weight: 700; font-size: 0.92rem; color: var(--text); }
figure.tq figcaption span { display: block; font-weight: 400; color: var(--text-sec); font-size: 0.85rem; margin-top: 2px; }
figure.tq.placeholder { border-style: dashed; background: transparent; }
figure.tq.placeholder blockquote { color: var(--text-sec); font-style: italic; }
figure.tq figcaption span.ph { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }

/* ---- article (project / about) ---- */
article.page { padding: 58px 0 76px; max-width: 760px; margin: 0 auto; }
article.page .kicker { color: var(--accent); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700; }
article.page h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.08; margin: 10px 0 6px; letter-spacing: -0.02em; }
article.page .byline { color: var(--text-sec); margin-bottom: 30px; }
article.page p { color: var(--text-sec); }
article.page p strong { color: var(--text); }
article.page ul { color: var(--text-sec); }
.hero-img { width: 100%; border-radius: 12px; margin: 18px 0 8px; display: block; }
.hero-img.missing { aspect-ratio: 16/9; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 0.9rem; }
.portrait { float: right; width: 180px; height: 180px; object-fit: cover; border-radius: 14px; margin: 0 0 16px 24px; }

/* ---- about: first-person lead statement (gray panel, accent edge; opens the page, wraps portrait) ---- */
article.page .lead-statement {
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.6;
  color: var(--text); letter-spacing: -0.005em; margin: 12px 0 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 14px;
  padding: 30px 34px;
}
article.page .lead-statement p { color: var(--text); }
article.page .lead-statement p:first-of-type { margin-top: 0; }
article.page .lead-statement p:last-of-type { margin-bottom: 0; }
.signature { display: block; width: 135px; max-width: 42%; height: auto; margin: 26px 0 2px; }
/* Typical scans are dark ink on transparent/white — lift for the dark theme. */
@media (prefers-color-scheme: dark) {
  .signature { filter: invert(1) hue-rotate(180deg); opacity: 0.9; }
}

/* ---- about: 'Background' heading divides voice (above) from credentials (below) ---- */
article.page h2.bio-head {
  clear: both; font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.4rem, 3vw, 1.8rem); letter-spacing: -0.015em;
  margin: 50px 0 16px; padding-top: 30px; border-top: 1px solid var(--border);
}

/* ---- about: journey image row ---- */
figure.journey { margin: 28px 0 8px; }
figure.journey .gallery { grid-template-columns: repeat(3, 1fr); }
figure.journey figcaption { color: var(--text-dim); font-size: 0.85rem; margin-top: 12px; }
@media (max-width: 560px) { figure.journey .gallery { grid-template-columns: 1fr 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 18px; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.backlink { display: inline-block; margin-top: 34px; font-size: 0.92rem; }

/* ---- contact ---- */
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 38px; text-align: center; max-width: 560px; margin: 24px auto 0; }
.contact-card .big { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 8px; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--border); padding: 34px 0 46px; color: var(--text-dim); font-size: 0.88rem; margin-top: 20px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; }
footer a { color: var(--text-sec); }

@media (max-width: 600px) {
  .portrait { float: none; width: 140px; height: 140px; margin: 0 0 12px; }
  .hero { padding: 64px 0 56px; }
}
