/* henrypearce.net: digital résumé. Tokens and rules come from DESIGN.md. */

:root {
  --bg: #0F100D;
  --surface: #181A15;
  --line: #2E3129;
  --text: #EDEBE4;
  --muted: #A3A193;
  --accent: #F4B98A;
  --chip-bg: rgba(15, 16, 13, 0.78);
  --chip-text: #EDEBE4;

  --font-display: 'Bricolage Grotesque', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --max: 1120px;
  --gutter: 32px;
  --section: 96px;
  --radius: 2px;
  color-scheme: dark;
}

/* Optional light "paper" theme: set <html data-theme="light">. */
[data-theme="light"] {
  --bg: #F2EFE7;
  --surface: #E8E4D9;
  --line: #CFCABC;
  --text: #161711;
  --muted: #5B594F;
  --accent: #9E4F1A;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s ease, text-underline-offset .15s ease;
}
a:hover { color: var(--accent); text-underline-offset: 6px; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { border-top: 1px solid var(--line); }
.section > .wrap { padding-top: var(--section); padding-bottom: var(--section); }

/* Type */
.label {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.mono { font-family: var(--font-mono); font-size: 14px; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; font-weight: 800; }
h1 { font-size: clamp(48px, 7vw, 100px); line-height: .94; letter-spacing: -.045em; max-width: 13ch; }
h2 { font-size: 48px; line-height: 1.02; letter-spacing: -.035em; }
h3 { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; }
h3 .org { font-weight: 400; color: var(--muted); }
p { margin: 0; }
.lead { font-size: 22px; line-height: 1.45; max-width: 40ch; }
.prose { max-width: 58ch; }

.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px; flex-wrap: wrap; margin-bottom: 16px;
}

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  min-height: 72px; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.wordmark { display: inline-flex; align-items: center; min-height: 44px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 28px; font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.nav-links { display: flex; gap: 28px; }
.nav .nav-strong { color: var(--text); }

/* Button: the one primary action per screen */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius);
  background: var(--accent); color: var(--bg);
  font-family: var(--font-mono); font-size: 15px; font-weight: 500; letter-spacing: .02em;
  text-decoration: none;
}
.btn:hover { color: var(--bg); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero .wrap { position: relative; padding-top: 88px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; margin-top: 8px; }
.hero-actions .mono { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }
.coords { margin-top: 8px; align-self: flex-end; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.topo-art {
  position: absolute; top: 0; right: -14%; width: 78%; height: 100%;
  color: var(--line); pointer-events: none;
}
.topo { animation: drift 60s ease-in-out infinite alternate; transform-origin: 50% 50%; }
@keyframes drift {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(-40px, 24px) rotate(4deg); }
}

/* Split layouts (About, Creating) */
.split { display: flex; gap: 64px; align-items: flex-start; }
.split.center { align-items: center; }
.split-body { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.portrait {
  flex: 0 1 340px; width: 100%; min-width: 0; height: auto;
  object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}

/* Key/value list ("Currently") */
.facts {
  margin: 8px 0 0; display: grid; grid-template-columns: 120px minmax(0, 1fr);
  font-family: var(--font-mono); font-size: 15px; border-top: 1px solid var(--line);
}
.facts dt, .facts dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }

/* Experience and education entries */
.entry {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px;
  padding: 40px 0; border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry-meta { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.entry-meta .when { color: var(--text); }
.entry-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.points { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 10px; }
.points li::marker { color: var(--muted); }

/* Systems index */
.index-intro { margin: 0 0 32px; max-width: 60ch; color: var(--muted); }
.index-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.5fr) 140px;
  gap: 20px; align-items: baseline; padding: 24px 0; border-top: 1px solid var(--line);
}
.index-row:last-child { border-bottom: 1px solid var(--line); }
.index-head { font-family: var(--font-mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 0 12px; border-top: 0; }
.index-name { font-weight: 800; font-size: 24px; line-height: 1.15; letter-spacing: -.02em; }
.status-live { font-family: var(--font-mono); font-size: 14px; }
.status-wip { font-family: var(--font-mono); font-size: 14px; color: var(--accent); }

/* Skills */
.skill-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 40px; }
.skill-col { border-top: 1px solid var(--text); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.skill-col h3 { font-family: var(--font-mono); font-size: 14px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }

/* Media frame with factual readouts */
.media {
  position: relative; display: block; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-decoration: none;
}
.media.vertical { flex: 0 1 300px; width: 100%; min-width: 0; aspect-ratio: 9 / 16; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chip {
  position: absolute; padding: 6px 10px; border-radius: var(--radius);
  background: var(--chip-bg); color: var(--chip-text);
  font-family: var(--font-mono); font-size: 13px;
}
.chip.tl { left: 12px; top: 12px; letter-spacing: .06em; text-transform: uppercase; }
.chip.bl { left: 12px; bottom: 12px; }

/* Contact */
.contact .wrap { display: flex; flex-direction: column; gap: 28px; }
.big-mail {
  font-weight: 800; font-size: clamp(32px, 6vw, 72px); line-height: 1; letter-spacing: -.04em;
  text-decoration-color: var(--accent); text-decoration-thickness: 3px; overflow-wrap: anywhere;
}
.elsewhere { display: flex; flex-wrap: wrap; gap: 8px 32px; font-family: var(--font-mono); font-size: 15px; color: var(--muted); margin-top: 8px; }
.elsewhere a, .text-link { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-mono); font-size: 15px; }
.text-link { align-self: flex-start; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap {
  padding-top: 28px; padding-bottom: 28px; display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 14px; color: var(--muted);
}
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

/* Phones */
@media (max-width: 760px) {
  :root { --gutter: 20px; --section: 64px; }
  .hero .wrap { padding-top: 72px; }
  h2 { font-size: 38px; }
  h3 { font-size: 26px; }
  .nav-links { display: none; }
  .split { flex-direction: column; gap: 32px; }
  .portrait { flex-basis: auto; max-width: 340px; }
  .media.vertical { flex-basis: auto; max-width: 300px; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .index-row { grid-template-columns: 36px minmax(0, 1fr); row-gap: 6px; }
  .index-row > :nth-child(n+3) { grid-column: 2 / 3; }
  .index-head { display: none; }
  .skill-cols { grid-template-columns: minmax(0, 1fr); }
  .coords { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .topo { animation: none; }
  a, .btn { transition: none; }
}
