/* Kyle Marker portfolio. Matches the résumé: navy serif name, small-caps section heads over a rule, one reading column */
:root {
  --page: #ffffff;
  --ink: #1d2329;
  --muted: #59636e;
  --navy: #1f4e79;
  --rule: #1f4e79;
  --hair: #dde3e9;
  --tint: #f3f6f9;
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #12171d; --ink: #e4e9ee; --muted: #a2adb8; --navy: #8fb8de; --rule: #5d86ad; --hair: #2a333d; --tint: #1a2129;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #12171d; --ink: #e4e9ee; --muted: #a2adb8; --navy: #8fb8de; --rule: #5d86ad; --hair: #2a333d; --tint: #1a2129;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
body {
  margin: 0; background: var(--page); color: var(--ink); font-family: var(--serif); font-size: 16px; line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
img { max-width: 100%; }
.wrap { max-width: 960px; margin: 0 auto; padding-block: 56px 64px; display: grid; gap: 44px; }
.wrap.narrow { max-width: 820px; gap: 40px; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: var(--navy); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 2px; }

/* Name block */
header.masthead { display: grid; justify-items: center; text-align: center; gap: 8px; }
.masthead h1 { font-size: clamp(2.3rem, 7vw, 3.4rem); font-weight: 700; letter-spacing: 0.02em; color: var(--navy); line-height: 1.1; }
.headline { font-weight: 700; font-size: clamp(0.82rem, 2.2vw, 0.98rem); letter-spacing: 0.03em; text-wrap: balance; }
.headline .sep { color: var(--muted); padding: 0 0.4em; }
.contact { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; color: var(--muted); font-size: 0.92rem; }
.contact .email { color: var(--ink); user-select: all; }
.copy { font: inherit; font-size: 0.82rem; border: 1px solid var(--hair); background: var(--page); color: var(--ink); border-radius: 4px; padding: 2px 10px; cursor: pointer; }
.copy:hover { border-color: var(--navy); }

/* Section heads */
section { display: grid; gap: 18px; }
section > h2 { font-size: 0.98rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy); border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.summary { max-width: 70ch; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.stat { display: grid; gap: 2px; align-content: start; }
.stat b { font-size: 1.75rem; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums lining-nums; }
.stat span { color: var(--muted); font-size: 0.9rem; line-height: 1.4; }

/* Home: project rows */
.project { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 28px; border-bottom: 1px solid var(--hair); }
.project:last-child { border-bottom: 0; padding-bottom: 0; }
.project img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--tint); }
.project img.diagram, .tool img.diagram { object-fit: contain; background: #ffffff; border: 1px solid var(--hair); }
.project .text { display: grid; gap: 8px; min-width: 0; }
.project h3 { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.figure { color: var(--ink); font-weight: 600; }
.meta { font-style: italic; color: var(--muted); font-size: 0.92rem; }
.project ul { padding-left: 1.1rem; display: grid; gap: 4px; font-size: 0.97rem; }
.read { font-weight: 600; justify-self: start; margin-top: 4px; }

.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.tool { display: grid; gap: 10px; align-content: start; }
.tool img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; background: var(--tint); border: 1px solid var(--hair); }
.tool img.diagram { padding: 6px; }
.tool h3 { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.tool p { font-size: 0.97rem; }

.competencies { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
.competencies li { display: grid; gap: 4px; align-content: start; }
.competencies b { font-size: 0.98rem; }
.competencies span { color: var(--muted); font-size: 0.88rem; line-height: 1.45; }

footer { border-top: 1px solid var(--hair); padding-top: 16px; color: var(--muted); font-size: 0.86rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; }

/* Case study pages */
.topbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; border-bottom: 1px solid var(--hair); padding-bottom: 12px; font-size: 0.92rem; }
.topbar .name { font-weight: 700; letter-spacing: 0.04em; color: var(--navy); text-decoration: none; }
.topbar a.back { text-decoration: none; }
.cs-head { display: grid; gap: 10px; }
.eyebrow { font-size: 0.86rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cs-head h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; color: var(--navy); text-wrap: balance; }
.lede { font-size: 1.08rem; max-width: 68ch; }
.facts { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--hair); }
.facts th { width: 9.5rem; color: var(--muted); font-weight: 600; }
.prose { display: grid; gap: 14px; max-width: 70ch; }
.prose ul, .prose ol { padding-left: 1.2rem; display: grid; gap: 8px; }
.prose li b, .prose p b { color: var(--ink); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
table.data th, table.data td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--hair); }
table.data thead th { color: var(--navy); border-bottom: 1px solid var(--rule); font-size: 0.85rem; letter-spacing: 0.03em; text-transform: uppercase; }
table.data tr.pick td { background: var(--tint); font-weight: 600; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
figure.shot { display: grid; gap: 8px; }
figure.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--hair); background: var(--tint); }
figure.shot img.white { background: #ffffff; }
figcaption { font-size: 0.88rem; color: var(--muted); font-style: italic; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.next { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--hair); padding-top: 16px; font-weight: 600; }

@media (max-width: 820px) {
  .project { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .competencies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .wrap { padding-block: 32px 48px; gap: 32px; }
  .tools, .competencies { grid-template-columns: minmax(0, 1fr); }
  .headline .sep { display: none; }
  .headline .part { display: block; }
  .facts th { width: 7rem; }
}
