/* Kiersten Roth — portfolio
   Warm off-white editorial system. Self-contained: system font stacks only.
   One muted blue accent; structure via hairlines, not shadow. */

:root {
  --canvas: #f7f4ee;
  --surface: #fcfbf8;
  --ink: #21252c;
  --body: #2f343d;
  --muted: #5b616e;
  --accent: #3a5a8a;
  --accent-strong: #2b466f;
  --hairline: rgba(33, 37, 44, 0.12);
  --hairline-soft: rgba(33, 37, 44, 0.08);
  --dark: #20242c;
  --on-dark: #f2efe8;
  --on-dark-muted: #b8bcc4;

  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 52px; --s9: 80px; --s10: 112px;

  --r-entry: 10px;
  --r-tile: 6px;
  --measure: 68ch;
  --reading-rail: 840px;
  --page: 1060px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 var(--s4);
}
h1 { font-size: clamp(2.3rem, 1.6rem + 3vw, 3.05rem); letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; letter-spacing: -0.005em; }
h3 { font-size: 1.16rem; }
p { margin: 0 0 var(--s4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-color: rgba(58, 90, 138, 0.4); text-underline-offset: 2px; transition: color 150ms ease, text-decoration-color 150ms ease; }
a:hover { color: var(--accent-strong); text-decoration-color: var(--accent-strong); }
main a:not(.btn):not(.arrow-link) { padding-block: 4px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.measure { max-width: var(--measure); }
.lede { font-size: 1.2rem; line-height: 1.6; color: var(--body); }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---- Skip link ---- */
.skip {
  position: absolute; left: var(--s4); top: -3rem;
  background: var(--ink); color: #fff; padding: var(--s2) var(--s4);
  border-radius: var(--r-tile); z-index: 100; transition: top 150ms ease;
}
.skip:focus { top: var(--s4); }

/* ---- Layout shell ---- */
.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--s5); }

/* ---- Header / nav ---- */
.site-header {
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.1) blur(6px);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); min-height: 64px; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 1.12rem; color: var(--ink);
  text-decoration: none; font-weight: 600; letter-spacing: -0.01em;
  padding: var(--s2) 0;
}
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: var(--s2); list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s3);
  color: var(--body); text-decoration: none; text-underline-offset: 5px; text-decoration-thickness: 1.5px; font-size: 1rem; border-radius: var(--r-tile);
}
.nav-links a:hover { color: var(--accent-strong); background: var(--hairline-soft); }
.nav-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.nav-sep { width: 1px; height: 22px; background: var(--hairline); margin-inline: var(--s1); }
.nav-icon { width: 18px; height: 18px; display: block; }

/* ---- Sections ---- */
main { display: block; }
.section { padding-block: var(--s8); border-top: 1px solid var(--hairline); }
.section:first-of-type { border-top: 0; }
.section-head { margin-bottom: var(--s6); }
.section-head > h1, .section-head > h2 { text-align: center; }
.page-title { font-size: 1.5rem; letter-spacing: -0.005em; }
.section-head .eyebrow { display: block; font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); }
.section-head p { color: var(--muted); max-width: var(--reading-rail); margin-inline: auto; text-align: left; font-size: 1.0625rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hero-grid, .entry, .events li, .skill-groups { grid-template-columns: 1fr; }

/* ---- Hero ---- */
.hero { padding-block: clamp(var(--s7), 5vw, var(--s9)); }
.hero-grid { display: grid; gap: var(--s7); align-items: start; }
@media (min-width: 820px) { .hero-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--s8); } }
.hero h1 { margin-bottom: var(--s4); }
.hero .lede { max-width: 54ch; margin-bottom: var(--s4); }
.hero .sub { color: var(--muted); max-width: 54ch; }
.hero-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-top: var(--s6); padding: 0; list-style: none; }
.hero-links a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-size: 1rem;
  text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--hairline);
  padding-bottom: 2px;
}
.hero-links a:hover { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }
.hero-links svg { width: 16px; height: 16px; color: var(--accent); }

.portrait {
  width: 100%; max-width: 320px; height: auto; display: block; border-radius: var(--r-entry);
  outline: 1px solid rgba(0,0,0,0.1); outline-offset: -1px;
  justify-self: start;
}
@media (min-width: 820px) { .portrait { justify-self: end; max-width: 300px; } }

/* ---- Entry ledger (experience / work) ---- */
.entries { display: flex; flex-direction: column; gap: var(--s5); }
.entry {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-entry);
  padding: var(--s5) var(--s6);
  display: grid; gap: var(--s4);
}
@media (min-width: 720px) {
  .entry { grid-template-columns: 184px minmax(0, 1fr); gap: var(--s6); align-items: start; }
}
.entry-meta { display: flex; flex-direction: column; gap: var(--s3); }
.mark-tile {
  width: 112px; height: 62px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--hairline-soft); border-radius: var(--r-tile);
  padding: 6px 8px;
}
.mark-tile img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.entry-dates { font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-tools { font-size: 0.88rem; color: var(--muted); }
.entry-tools b { color: var(--body); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.03em; text-transform: uppercase; display: block; margin-bottom: 2px; }
.entry-body h3 { margin-bottom: 2px; }
.entry-org { color: var(--muted); font-size: 0.98rem; margin: 0 0 var(--s3); }
.entry-org a { color: var(--accent); }
.entry-body p { font-size: 1.0625rem; }
.contrib { margin: var(--s3) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s2); }
.contrib li { position: relative; padding-left: var(--s4); font-size: 1.0625rem; }
.contrib li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.tag-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.tag { font-size: 0.8rem; color: var(--muted); border: 1px solid var(--hairline); border-radius: var(--r-tile); padding: 2px 8px; }

.label-line { margin-top: var(--s4); }
.label-line .lbl { display: block; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }

/* ---- Inline arrow link ---- */
.arrow-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--hairline); padding-bottom: 1px; }
.arrow-link:hover { border-bottom-color: var(--accent-strong); }
.arrow-link svg { width: 15px; height: 15px; transition: transform 150ms ease; }
.arrow-link:hover svg { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) { .arrow-link:hover svg { transform: none; } }

/* ---- Selected-project summaries on home ---- */
.proj-list { display: flex; flex-direction: column; gap: var(--s5); max-width: var(--reading-rail); margin-inline: auto; }
.proj-item { border-top: 1px solid var(--hairline); padding-top: var(--s5); }
.proj-item:first-child { border-top: 0; padding-top: 0; }
.proj-item h3 { margin-bottom: var(--s2); }
.proj-item .kind { font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); }
.proj-item p { font-size: 1rem; max-width: var(--measure); }
.proj-links { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s3); }

/* ---- Compact role list (home) ---- */
.role-list { list-style: none; margin: 0 auto; padding: 0; max-width: var(--reading-rail); }
.proj-list + p, .role-list + p { max-width: var(--reading-rail); margin-inline: auto; }
.role-list li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--hairline-soft); }
.role-list li:first-child { border-top: 0; }
.role-list .r-name { color: var(--ink); font-weight: 500; }
.role-list .r-org { color: var(--muted); }
.role-list .r-date { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Events list ---- */
.events { list-style: none; margin: 0 auto; padding: 0; max-width: var(--reading-rail); }
.events li { display: grid; gap: 2px; padding: var(--s3) 0; border-top: 1px solid var(--hairline-soft); }
@media (min-width: 560px) { .events li { grid-template-columns: 140px 1fr; gap: var(--s4); } }
.events li:first-child { border-top: 0; }
.events .ev-date { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* ---- Skills ---- */
.skill-groups { display: grid; gap: var(--s5); max-width: var(--reading-rail); margin-inline: auto; }
@media (min-width: 640px) { .skill-groups { grid-template-columns: 1fr 1fr; } }
.skill-group h3 { font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); }
.skill-group p { font-size: 1rem; color: var(--body); }

/* ---- Project page ---- */
.breadcrumb { font-size: 0.9rem; color: var(--muted); max-width: var(--reading-rail); margin: 0 auto var(--s5); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-strong); }
.project-head { margin-bottom: var(--s6); }
.project-head h1 { text-align: center; }
.project-head .kind { font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s3); display: inline-flex; align-items: center; gap: var(--s3); }
.project-head .proj-links { max-width: var(--reading-rail); margin-inline: auto; }
.project-head .status { color: var(--accent); }
.prose { max-width: var(--reading-rail); margin-inline: auto; }
.section .measure { max-width: var(--reading-rail); margin-inline: auto; }
.prose + p { max-width: var(--reading-rail); margin-inline: auto; }
.section .measure p { font-size: 1.0625rem; }
.prose h2 { margin-top: var(--s7); text-align: center; }
.prose h2:first-of-type { margin-top: 0; }
.callout { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-entry); padding: var(--s5); margin: var(--s5) 0; }
.callout .lbl { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2); display: block; }

/* ---- Buttons / contact band ---- */
.contact-band { background: var(--dark); color: var(--on-dark); margin-top: var(--s9); }
.contact-band .wrap { padding-block: var(--s8); }
.contact-band h2 { color: var(--on-dark); text-align: center; }
.contact-band p { color: var(--on-dark-muted); max-width: var(--reading-rail); margin-inline: auto; }
.contact-actions { display: flex; flex-wrap: wrap; gap: var(--s3); max-width: var(--reading-rail); margin: var(--s5) auto 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 var(--s5);
  border-radius: var(--r-tile); text-decoration: none; font-size: 0.98rem; font-weight: 500;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--on-dark); color: var(--dark); }
.btn-primary:hover { background: #fff; color: var(--dark); }
.btn-ghost { border: 1px solid rgba(242,239,232,0.3); color: var(--on-dark); }
.btn-ghost:hover { border-color: var(--on-dark); color: var(--on-dark); background: rgba(242,239,232,0.06); }
.btn:active { transform: scale(0.96); }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }

@media (max-width: 719px) {
  .entry { padding: var(--s4); }
  .mark-tile { width: 104px; height: 58px; }
  .section { padding-block: var(--s7); }
}

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--hairline); padding-block: var(--s6); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4); align-items: center; }
.footer-row p { color: var(--muted); font-size: 0.9rem; margin: 0; }
.footer-links { display: flex; gap: var(--s4); list-style: none; margin: 0; padding: 0; }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--body); text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover { color: var(--accent-strong); }
.footer-links svg { width: 16px; height: 16px; color: var(--muted); }

/* Content remains visible at every scroll position. */
.reveal { opacity: 1; transform: none; }

/* ---- Utility ---- */
.stack-sm > * + * { margin-top: var(--s4); }
.pagetop { padding-top: var(--s7); }
hr.rule { border: 0; border-top: 1px solid var(--hairline); margin-block: var(--s7); }
