/* Asher Pfeifer — portfolio stylesheet
   One system for the home page and the project pages. Colors are tokens on
   :root; each project page may set --accent to its own color. */

:root {
  --paper: #f7f5f0;
  --panel: #fffdf9;
  --panel-2: #efece5;
  --ink: #16181d;
  --ink-2: #3d424b;
  --muted: #6b7079;
  --rule: #e1ddd5;
  --rule-strong: #c9c4ba;
  --accent: #16181d;
  --accent-ink: #f7f5f0;
  --accent-soft: #e9e6df;
  --teal: #1d7a68;
  --teal-soft: #dcefe9;
  --camel: #a8884f;
  --camel-soft: #f1e9d8;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --measure: 66ch;
  --wrap: 1040px;
  --read: 720px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121417;
    --panel: #1a1d22;
    --panel-2: #20242b;
    --ink: #ebe9e4;
    --ink-2: #c4c2bb;
    --muted: #9aa0a8;
    --rule: #2a2e35;
    --rule-strong: #3b404a;
    --accent: #ebe9e4;
    --accent-ink: #121417;
    --accent-soft: #23272e;
    --teal: #58c6ab;
    --teal-soft: #163a35;
    --camel: #d6be95;
    --camel-soft: #2d2719;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #121417;
  --panel: #1a1d22;
  --panel-2: #20242b;
  --ink: #ebe9e4;
  --ink-2: #c4c2bb;
  --muted: #9aa0a8;
  --rule: #2a2e35;
  --rule-strong: #3b404a;
  --accent: #ebe9e4;
  --accent-ink: #121417;
  --accent-soft: #23272e;
  --teal: #58c6ab;
  --teal-soft: #163a35;
  --camel: #d6be95;
  --camel-soft: #2d2719;
  color-scheme: dark;
}

/* Project accents */
.page-ap { --accent: var(--teal); --accent-soft: var(--teal-soft); --accent-ink: #fff; }
.page-vale { --accent: var(--camel); --accent-soft: var(--camel-soft); --accent-ink: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-ap { --accent-ink: #0f1a17; }
  :root:not([data-theme="light"]) .page-vale { --accent-ink: #1c1a14; }
}
:root[data-theme="dark"] .page-ap { --accent-ink: #0f1a17; }
:root[data-theme="dark"] .page-vale { --accent-ink: #1c1a14; }

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
@media (min-width: 640px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
}

.read { max-width: var(--read); }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule-strong); }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 30;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
}
.skip:focus { left: 8px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); font-weight: 400; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); }
li { margin-bottom: 0.35em; }
strong { font-weight: 600; }
em { font-style: italic; }
code, .mono { font-family: var(--font-mono); font-size: 0.9em; }
code { background: var(--panel-2); padding: 0.1em 0.35em; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow b { color: var(--accent); font-weight: 500; }

.lede {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34em;
}

.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

/* Top nav */
.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.topnav ul {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topnav ul li { margin: 0; }
.topnav ul a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-2);
}
.topnav ul a:hover, .topnav ul a[aria-current="page"] { color: var(--ink); }
.topnav .back { font-size: 0.92rem; text-decoration: none; color: var(--ink-2); }
.topnav .back:hover { color: var(--ink); }
@media (max-width: 480px) {
  .topnav ul { gap: 16px; }
  .topnav ul a { font-size: 0.88rem; }
}

/* Buttons */
.button {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
}
.button:hover { filter: brightness(1.08); }
.button.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.button.ghost:hover { background: var(--panel-2); filter: none; }

/* Home hero */
.hero { padding: 72px 0 48px; }
@media (min-width: 900px) { .hero { padding: 104px 0 64px; } }
.hero h1 { max-width: 16ch; }
.hero .lede { margin-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* Sections */
section.block { padding: 48px 0 8px; }
@media (min-width: 900px) { section.block { padding: 64px 0 16px; } }
.section-head { margin-bottom: 28px; }
.section-head p { margin-top: 10px; color: var(--muted); }

/* Project cards (home) */
.projects {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.projects { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .projects { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; } }
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 24px 24px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 16px;
  margin: 0;
}
.pcard::before {
  content: "";
  position: absolute;
  left: 24px; right: 24px; top: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}
.pcard .eyebrow { margin-bottom: 4px; }
.pcard h3 { font-size: 1.75rem; font-weight: 400; }
.pcard .what { color: var(--ink-2); margin: 0; }
.pcard .facts {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}
.pcard .facts li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}
.pcard .facts span:first-child { color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; padding-top: 3px; }
.pcard .more { margin-top: auto; padding-top: 10px; font-weight: 600; text-decoration: none; color: var(--accent); }
.pcard .more:hover { text-decoration: underline; }

/* Smaller work list */
.worklist { margin: 0; padding: 0; list-style: none; }
.worklist li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 20px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.worklist li:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 720px) { .worklist li { grid-template-columns: 220px minmax(0, 1fr); } }
.worklist h3 { font-size: 1.15rem; }
.worklist .when { color: var(--muted); font-size: 0.9rem; font-family: var(--font-mono); }
.worklist p { margin: 0; }

/* Record strip */
.record {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.record li {
  margin: 0;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.record .n {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 8px;
}
.record .l { display: block; font-size: 0.9rem; color: var(--ink-2); line-height: 1.4; }

/* About split */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
}
.about > * { min-width: 0; }
@media (min-width: 860px) { .about { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; } }
.about aside { font-size: 0.95rem; }
.about aside dl { margin: 0; }
.about aside dt { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin-top: 14px; }
.about aside dd { margin: 4px 0 0; }

/* Project page header */
.phead { padding: 56px 0 24px; border-bottom: 1px solid var(--rule); }
@media (min-width: 900px) { .phead { padding: 80px 0 32px; } }
.phead h1 { max-width: 18ch; }
.phead .lede { margin-top: 20px; }
.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 14px 24px;
  margin: 36px 0 0;
  padding: 0;
  font-size: 0.95rem;
}
.meta div { border-top: 1px solid var(--rule); padding-top: 10px; }
.meta dt { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 4px 0 0; }

/* Project page body */
.pbody { padding: 16px 0 48px; }
.pbody section { padding: 40px 0 0; }
.pbody section > h2 { margin-bottom: 18px; }
.pbody section > h3 { margin: 28px 0 10px; }
.pbody .kicker { color: var(--accent); font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }

.summary {
  padding: 22px 24px;
  margin: 0 0 8px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
}
.summary p:last-child { margin-bottom: 0; }

.callout {
  padding: 18px 22px;
  margin: 22px 0;
  background: var(--accent-soft);
  border-radius: 12px;
}
.callout p:last-child { margin-bottom: 0; }
.callout .t { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* Numbers row */
.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}
.numbers li { margin: 0; padding: 16px 16px 14px; background: var(--panel); }
.numbers .n { display: block; font-family: var(--font-display); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.numbers .n small { font-family: var(--font-body); font-size: 0.8rem; color: var(--muted); margin-left: 4px; }
.numbers .l { display: block; margin-top: 8px; font-size: 0.86rem; color: var(--ink-2); line-height: 1.4; }

/* Definition rows (label / text) */
.rows { margin: 10px 0 0; max-width: none; }
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 20px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.row:last-child { border-bottom: 1px solid var(--rule); }
@media (min-width: 680px) { .row { grid-template-columns: 200px 1fr; } }
.row dt { font-weight: 600; }
.row dd { margin: 0; color: var(--ink-2); max-width: var(--measure); }
.row dd b { color: var(--ink); font-weight: 500; }

/* Tables */
.tbl-scroll { overflow-x: auto; margin: 18px 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; min-width: 480px; }
th, td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.g { color: var(--muted); }

/* Figures */
figure { margin: 24px 0; }
figure .scroll { overflow-x: auto; padding-bottom: 4px; }
figure svg { display: block; width: 100%; height: auto; }
figcaption { margin-top: 10px; font-size: 0.92rem; color: var(--muted); max-width: var(--measure); }
.fig-panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px;
}

/* Steps */
.steps { counter-reset: step; margin: 10px 0 0; padding: 0; list-style: none; max-width: var(--measure); }
.steps li {
  position: relative;
  padding: 10px 0 10px 44px;
  margin: 0;
  border-top: 1px solid var(--rule);
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0; top: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: grid;
  place-items: center;
}
.steps b { display: block; font-weight: 600; }

/* Status list */
.status { margin: 10px 0 0; padding: 0; list-style: none; }
.status li {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.status li:last-child { border-bottom: 1px solid var(--rule); }
.dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 9px; }
.dot.live { background: var(--teal); }
.dot.wait { background: var(--camel); }
.dot.held { background: transparent; border: 1px solid var(--muted); }
.status b { font-weight: 600; }
.status span { display: block; color: var(--ink-2); font-size: 0.95rem; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.tags li { margin: 0; padding: 3px 10px; font-size: 0.8rem; font-weight: 500; color: var(--accent); background: var(--accent-soft); border-radius: 999px; }

/* Next-project footer on project pages */
.next {
  margin-top: 56px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.next p { margin: 0; }
.next .eyebrow { margin-bottom: 4px; }

/* Contact */
.contact { padding-bottom: 24px; }

footer.site {
  margin-top: 40px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}
footer.site p { margin: 0; }
footer.site .links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
