/* peterstieg.com · Admiring complexity. Loving simplicity. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #F7F6F3;
  --ink: #1A1C1E;
  --muted: #565B60;
  --line: #DCDAD4;
  --accent: #7A1A2C;
  --accent-soft: #E8C3CA;
  --bar: #C4C6C9;
  --bar-lit: #6E7378;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #181A1C;
    --ink: #F5F4F2;
    --muted: #A3A8AD;
    --line: #2F3337;
    --accent: #C98593;
    --accent-soft: #4E0E1B;
    --bar: #3A3F44;
    --bar-lit: #8E949A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #181A1C;
  --ink: #F5F4F2;
  --muted: #A3A8AD;
  --line: #2F3337;
  --accent: #C98593;
  --accent-soft: #4E0E1B;
  --bar: #3A3F44;
  --bar-lit: #8E949A;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  font-kerning: normal;
}

::selection { background: var(--accent-soft); color: var(--ink); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}
a:hover { text-decoration-color: var(--accent); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.75rem; z-index: 10; text-decoration: none;
}
.skip:focus { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- frame ---------- */

.wrap {
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 48rem) { .wrap { padding-inline: 2.5rem; } }
@media (min-width: 74rem) { .wrap { padding-right: 8rem; } }

.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
}
.top.scrolled { border-bottom-color: var(--line); }
.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 3.5rem;
}
.home {
  font-weight: 700; text-decoration: none; white-space: nowrap;
  font-size: 1rem;
}
.home .caret { display: inline-block; color: var(--accent); margin-right: 0.45em; }
.home .name { display: inline-block; text-transform: uppercase; letter-spacing: 0.055em; }
.nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.95rem; }
@media (max-width: 47.99rem) { .nav { gap: 0.5rem; } .top .wrap { gap: 0.75rem; } }

/* docking: the hero name and its prompt become the header logo (see site.js) */
.js .top.dock .home { visibility: hidden; }
.js .top.dock.docked .home { visibility: visible; }
.hero h1, .hero .prompt .caret { transform-origin: 0 0; }
.hero.flying h1, .hero.flying .prompt .caret { position: relative; z-index: 6; will-change: transform; }
.hero.docked h1, .hero.docked .prompt .caret { opacity: 0; pointer-events: none; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.langs {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.1rem 0.3rem;
}
.langs > * { padding: 0 0.35rem; line-height: 1.6; }
.nav .langs a { color: var(--muted); }
.nav .langs a:hover { color: var(--ink); }
.langs [aria-current] { color: var(--ink); font-weight: 700; }

/* theme switch: same pill as the languages */
.themes {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 0.1rem 0.2rem;
}
.themes button {
  display: inline-grid; place-items: center;
  width: 1.7rem; height: 1.5rem; padding: 0; margin: 0;
  border: 0; border-radius: 999px; background: none;
  color: var(--muted); cursor: pointer;
}
.themes button:hover { color: var(--ink); }
.themes button[aria-pressed="true"] { color: var(--ink); }
.themes svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.themes button[aria-pressed="true"] svg { stroke-width: 2; }
html:not(.js) .themes { display: none; }
@media (max-width: 47.99rem) { .nav .sect { display: none; } }

/* ---------- hero ---------- */

.hero { padding-block: clamp(3.5rem, 13vh, 8.5rem) clamp(3rem, 9vh, 6rem); }
.hero h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(2.6rem, 9.2vw, 5.75rem);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.tagline {
  margin: 0 0 0.35rem;
  font-size: clamp(1.3rem, 3.3vw, 2rem);
  line-height: 1.25;
}
.claim {
  margin: 0 0 1.6rem;
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  line-height: 1.3;
  color: var(--muted);
}
.prompt {
  margin: 0;
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  min-height: 1.6em;
}
.prompt .caret { display: inline-block; color: var(--accent); font-weight: 700; margin-right: 0.45em; }
.cursor {
  display: inline-block; width: 0.55em; height: 1.05em;
  margin-left: 0.12em; vertical-align: -0.16em;
  background: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .typed .cursor { animation: blink 1.1s steps(2, start) 4; }
}
@keyframes blink { to { visibility: hidden; } }

/* ---------- sections ---------- */

.sec {
  display: grid;
  gap: 0.75rem 2.5rem;
  padding-block: 3rem;
  border-top: 1px solid var(--line);
}
@media (min-width: 48rem) {
  .sec { grid-template-columns: 11rem minmax(0, 1fr); padding-block: 3.75rem; }
  .sec > h2 { position: sticky; top: 5rem; align-self: start; }
}
.sec > h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
  font-weight: 700;
}
.body { max-width: 42rem; }
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
:where(.body) p { margin: 0 0 1em; }

h3 { margin: 0 0 0.3rem; font-size: 1.125rem; line-height: 1.35; font-weight: 700; }

.muted { color: var(--muted); }

/* ledger of results */
.ledger { margin: 2rem 0 0; padding: 0; }
.ledger div {
  display: grid; gap: 0.15rem 1.5rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--line);
}
.ledger div:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 36rem) {
  .ledger { display: grid; grid-template-columns: max-content 1fr; column-gap: 1.5rem; }
  .ledger div { grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; }
  @supports not (grid-template-columns: subgrid) { .ledger div { grid-template-columns: 15.5rem 1fr; } }
}
.ledger dt {
  font-size: 1.5rem; font-weight: 700; line-height: 1.2;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ledger dd { margin: 0; color: var(--muted); }

/* fields of work */
.fields { display: grid; gap: 1.75rem 2.5rem; }
@media (min-width: 40rem) { .fields { grid-template-columns: 1fr 1fr; } }
.fields p { margin: 0; color: var(--muted); }

/* experience timeline */
.roles { list-style: none; margin: 0; padding: 0; }
.role { display: grid; gap: 0.2rem 1.5rem; padding-bottom: 2rem; }
.role + .role { padding-top: 2rem; border-top: 1px solid var(--line); }
.role:last-child { padding-bottom: 0; }
@media (min-width: 36rem) { .role { grid-template-columns: 9.5rem 1fr; } }
.when {
  margin: 0; color: var(--muted); font-size: 0.95rem;
  font-variant-numeric: tabular-nums; padding-top: 0.15rem; white-space: nowrap;
}
.role h3 { margin-bottom: 0.1rem; }
.org { margin: 0 0 0.5rem; }
.org .place { color: var(--muted); }
.ctx { margin: 0 0 0.6rem; color: var(--muted); font-size: 1rem; }

/* projects */
.group + .group { margin-top: 2.5rem; }
.group > h3 { color: var(--muted); font-weight: 400; font-size: 1rem; margin-bottom: 1rem; }
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }
.projects h4 { margin: 0 0 0.15rem; font-size: 1.125rem; font-weight: 700; }
.projects p { margin: 0; }
.projects .stack { color: var(--muted); font-size: 0.95rem; margin-top: 0.2rem; }

/* approach */
.principles { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.4rem; }
.principles p { margin: 0; }
.principles strong { font-weight: 700; }

/* education */
.facts { margin: 0; }
.facts div { display: grid; gap: 0.1rem 1.5rem; padding-block: 0.75rem; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 36rem) { .facts div { grid-template-columns: 9.5rem 1fr; } }
.facts dt { color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.facts dd { margin: 0; }

/* contact */
.hello {
  margin: 0 0 1rem;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
}
.mail { font-size: 1.25rem; font-weight: 700; }

/* dictionary entry: the word on GitHub, defined like Merriam-Webster, Duden or Treccani would */
.entry { margin: 0 0 1.75rem; }
.hw { margin: 0 0 0.4rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.8rem; }
.hw dfn { font-style: normal; font-weight: 700; font-size: clamp(1.7rem, 4.4vw, 2.3rem); line-height: 1.15; }
.hw .syl { color: var(--muted); font-weight: 400; margin: 0 0.03em; }
.pos { font-style: italic; color: var(--muted); }
.ety { color: var(--muted); font-size: 1rem; }
.def { margin: 0; font-size: 1.25rem; line-height: 1.5; }
.ety i { font-style: italic; }

/* P⁴ */
.sec > h2 sup { font-size: 0.62em; line-height: 0; vertical-align: 0.55em; margin-left: 0.04em; }
.intro { margin: 0 0 1.5rem; color: var(--muted); }
.intro strong { color: var(--ink); }
.fields h3 { font-size: 1.375rem; margin-bottom: 0.25rem; }

/* #JobAlert tree: ├── and └── drawn with borders, so they align in any font */
.tree { list-style: none; margin: 0.35rem 0 0; padding: 0; }
.tree li { position: relative; padding-left: 1.7em; margin: 0; padding-bottom: 0.2rem; }
.tree li::before {
  content: ""; position: absolute; left: 0.3em; top: 0; bottom: 0;
  border-left: 1px solid var(--muted);
}
.tree li:last-child::before { bottom: auto; height: 0.8em; }
.tree li::after {
  content: ""; position: absolute; left: 0.3em; top: 0.8em; width: 0.95em;
  border-top: 1px solid var(--muted);
}
.tree .k { font-weight: 700; }
.tree .k::after { content: ":"; }

/* drawn arrow: → is not part of Atkinson Hyperlegible */
.arr { display: inline-block; width: 0.95em; height: 0.62em; margin: 0 0.12em; vertical-align: 0.06em; }
.arr svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.ledger dt .arr svg { stroke-width: 2.1; }

/* footnotes */
.fnref { font-size: 0.68em; line-height: 0; vertical-align: 0.6em; margin-left: 0.08em; }
.fnref a { text-decoration: none; color: var(--accent); font-weight: 700; padding: 0 0.1em; }
.fnref a:hover { text-decoration: underline; }
.notes { margin: 0; padding-left: 1.4em; color: var(--muted); font-size: 0.95rem; display: grid; gap: 0.5rem; }
.notes li::marker { color: var(--ink); font-weight: 700; }
.notes .back { text-decoration: none; color: var(--accent); font-weight: 700; margin-right: 0.15em; }
.notes li:target { color: var(--ink); }

/* contact: Work online | Live offline */
.reach { margin: 0; display: grid; gap: 0.5rem; }
.reach div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0 1rem; align-items: baseline; }
.reach dt { color: var(--muted); font-size: 0.95rem; }
.reach dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* 404 */
.lost { padding-block: clamp(3.5rem, 13vh, 8.5rem) clamp(3rem, 9vh, 6rem); }
.lost .code { margin: 0; font-size: clamp(3rem, 10vw, 6rem); line-height: 1; font-weight: 700; letter-spacing: 0.04em; }
.lost h1 { margin: 0.6rem 0 0.35rem; font-size: clamp(1.3rem, 3.3vw, 2rem); line-height: 1.25; font-weight: 400; }
.dki { font-family: inherit; font-size: inherit; color: var(--accent); }

/* back to top: appears once the name has docked; on wide screens it sits under the minimap */
.to-top {
  position: fixed; z-index: 5;
  right: max(1rem, calc(env(safe-area-inset-right, 0px) + 1rem));
  bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center;
  text-decoration: none; color: var(--ink);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(0.5rem);
  transition: opacity 0.2s, transform 0.2s, visibility 0s linear 0.2s;
}
.top.docked ~ .to-top { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s, transform 0.2s; }
html:not(.js) .to-top { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top:focus-visible { border-radius: 50%; }
.to-top svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .to-top, .top.docked ~ .to-top { transition: none; } }
@media (min-width: 74rem) and (min-height: 30rem) {
  .to-top { right: calc(1.75rem + (4.25rem - 2.75rem) / 2); bottom: 1.75rem; }
}

/* footer */
.foot { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; color: var(--muted); font-size: 0.95rem; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.foot a { color: inherit; }

/* legal pages */
.legal { padding-block: 3rem 4rem; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.15; margin: 0 0 2rem; }
.legal h2 { font-size: 1.25rem; margin: 2.25rem 0 0.5rem; }
.legal .body { max-width: 40rem; }
.legal address { font-style: normal; }
.legal ul { padding-left: 1.2em; }

/* ---------- minimap ---------- */

.minimap { display: none; }
@media (min-width: 74rem) and (min-height: 30rem) {
  .minimap {
    display: block;
    position: fixed;
    right: 1.75rem;
    top: 5rem;
    bottom: 5.25rem;
    width: 4.25rem;
    cursor: pointer;
    touch-action: none;
    z-index: 4;
  }
}
.mm-measure .sec > h2 { position: static; }
.mm-bar {
  position: absolute; left: 0; height: 2px; border-radius: 1px;
  background: var(--bar);
}
.mm-bar.h { background: var(--bar-lit); }
.mm-bar.lit { background: var(--bar-lit); }
.mm-bar.h.lit { background: var(--ink); }
.mm-view {
  position: absolute; left: -0.5rem; right: -0.5rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border: 1px solid var(--line);
  pointer-events: none;
}

@media print {
  .top, .minimap, .skip, .to-top { display: none; }
  .hero h1, .hero .prompt .caret { transform: none !important; opacity: 1 !important; }
  .hero .prompt .cmd, .hero .prompt .cursor { opacity: 1 !important; }
  .sec > h2 { position: static; }
  body { font-size: 11pt; }
}
