/* site.css: editorial layer on top of ldcss. Unlayered, so it beats ldcss without !important.
   Fonts are system fonts on purpose: no extra requests, no third-party font host. */

:root {
  --paper: #f6f6f3;
  --ink: #1b1c1e;
  --muted: #5c5f66;
  --rule: #d8d8d2;
  --accent: #2b3dd0;

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
  --page: 68rem;

  /* point ldcss at the same palette so its theme toggle and skip link match */
  --ld-bg: var(--paper);
  --ld-surface: var(--paper);
  --ld-surface-raised: var(--paper);
  --ld-text: var(--ink);
  --ld-text-muted: var(--muted);
  --ld-border: var(--rule);
  --ld-border-soft: var(--rule);
  --ld-accent: var(--accent);
  --ld-font-sans: var(--serif);
  color-scheme: light;
}

:root[data-ld-theme="dark"] {
  --paper: #161719;
  --ink: #e8e7e3;
  --muted: #a0a2a9;
  --rule: #33353a;
  --accent: #98a4ff;
  color-scheme: dark;
}

/* ---------- base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- masthead ---------- */
.site-nav {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem;
  max-width: var(--page); margin: 0 auto; padding: 1.75rem 1.5rem;
  font-family: var(--sans); font-size: .95rem;
}
.site-brand { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; text-decoration: none; color: var(--ink); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; margin: 0 0 0 auto; padding: 0; list-style: none; }
.site-nav ul a { color: var(--muted); text-decoration: none; }
.site-nav ul a:hover, .site-nav ul a[aria-current] { color: var(--ink); }
.site-theme {
  margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--muted); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
}
.site-theme:hover { color: var(--ink); }

/* ---------- home hero ---------- */
.hero { padding: clamp(3.5rem, 11vw, 8rem) 0 clamp(3.5rem, 9vw, 6.5rem); }
.hero h1 {
  max-width: 10em; font-size: clamp(2.75rem, 8.5vw, 6rem);
  line-height: 1; letter-spacing: -.03em; text-wrap: balance;
}
.hero p { max-width: 32em; margin-top: 2rem; font-size: clamp(1.2rem, 2.3vw, 1.5rem); line-height: 1.45; }

/* ---------- sections: label in the margin, content beside it ---------- */
.section {
  display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.25rem 3rem;
  padding: 3rem 0 4.5rem; border-top: 1px solid var(--rule);
}
.section > h2 { font-family: var(--sans); font-size: .95rem; font-weight: 600; line-height: 1.7; }
.meta { font-family: var(--sans); font-size: .875rem; line-height: 1.5; color: var(--muted); }

/* ---------- client work ---------- */
.feature {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 1.5rem 2.5rem; align-items: end; margin: 0 0 3.5rem;
}
.feature:last-child { margin-bottom: 0; }
.feature-img img {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top;
  border: 1px solid var(--rule); background: var(--rule);
}
.feature h3 { margin-top: .35rem; font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.15; letter-spacing: -.01em; }
.feature .desc { max-width: 30em; margin-top: .75rem; }
.feature .tech { margin-top: 1rem; }
.feature .visit { display: inline-block; margin-top: .5rem; }

/* ---------- other projects: an index, not cards ---------- */
.index { margin: 0; padding: 0; list-style: none; }
.index li {
  display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) minmax(0, 9rem);
  gap: .5rem 2rem; padding: 1.35rem 0; border-top: 1px solid var(--rule);
}
.index li:first-child { padding-top: 0; border-top: 0; }
.index h3 { font-size: 1.25rem; line-height: 1.25; }
.index h3 a { text-decoration: none; }
.index .desc { font-size: 1rem; line-height: 1.55; color: var(--muted); }
.index .side { font-family: var(--sans); font-size: .85rem; line-height: 1.5; color: var(--muted); }
.index .side a { display: inline-block; margin-top: .35rem; color: var(--ink); }
.index .side a:hover { color: var(--accent); }
.index li:hover h3 a { color: var(--accent); }

/* ---------- about + facts ---------- */
.prose p { max-width: var(--measure); margin: 0 0 1.15em; line-height: 1.65; }
.prose ul { max-width: var(--measure); margin: 0 0 1.15em; padding-left: 1.25rem; }
.prose li { margin: .35em 0; line-height: 1.55; }
.facts {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .6rem 1.5rem;
  max-width: var(--measure); margin: 2.25rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
.facts dt { padding-top: .2rem; font-family: var(--sans); font-size: .9rem; color: var(--muted); }
.facts dd { margin: 0; line-height: 1.5; }

/* ---------- contact ---------- */
.contact-mail { font-size: clamp(1.5rem, 4vw, 2.5rem); line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.contact-note { margin-top: 1rem; }

/* ---------- project pages ---------- */
.page-head { max-width: 46rem; padding: clamp(2.5rem, 8vw, 5rem) 0 3rem; }
.page-head h1 { margin-top: .5rem; font-size: clamp(2.4rem, 7vw, 4.25rem); line-height: 1.03; letter-spacing: -.025em; text-wrap: balance; }
.page-head .lede { margin-top: 1.5rem; font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.45; }
.page-head .links { margin-top: 1.5rem; font-family: var(--sans); font-size: .95rem; }
.shot { margin: 0; padding: 3rem 0 4.5rem; border-top: 1px solid var(--rule); }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.shot figcaption { margin-top: .75rem; font-family: var(--sans); font-size: .875rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  max-width: var(--page); margin: 0 auto; padding: 2rem 1.5rem 3.5rem;
  font-family: var(--sans); font-size: .85rem; color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--accent); }

/* ---------- small screens ---------- */
@media (max-width: 52rem) {
  .section { grid-template-columns: 1fr; gap: .75rem; padding: 2.25rem 0 3.5rem; }
  .feature { grid-template-columns: 1fr; align-items: start; margin-bottom: 3rem; }
  .index li { grid-template-columns: 1fr; gap: .35rem; }
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dd { margin-bottom: .75rem; }
  .site-nav ul { margin-left: 0; width: 100%; order: 3; }
  .site-theme { margin-left: auto; }
}
