/* ---------- Fonts (self-hosted: no third-party requests) ---------- */
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #faf8f4;
  --bg-soft: #f3efe7;
  --surface: #ffffff;
  --text: #1d1b18;
  --text-soft: #45413b;
  --muted: #6f685e;
  --line: #e6e0d5;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fdebdc;

  --note-orange: #f7a54a;
  --note-blue: #8fc8f0;
  --note-green: #a9dc9d;
  --note-text: #1d1b18;

  --shadow: 0 1px 2px rgb(29 27 24 / 0.06), 0 8px 24px -8px rgb(29 27 24 / 0.12);
  --shadow-note: 0 1px 1px rgb(0 0 0 / 0.08), 0 6px 14px -4px rgb(0 0 0 / 0.22);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 72rem;
  --measure: 40rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 14px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311;
    --bg-soft: #1b1a17;
    --surface: #1f1d1a;
    --text: #eeeae3;
    --text-soft: #cfc9bf;
    --muted: #a39c91;
    --line: #2f2c27;
    --accent: #ff8f55;
    --accent-hover: #ffb088;
    --accent-soft: #3a2517;
    --note-orange: #e99a45;
    --note-blue: #7fb6dd;
    --note-green: #97c98b;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -8px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311;
  --bg-soft: #1b1a17;
  --surface: #1f1d1a;
  --text: #eeeae3;
  --text-soft: #cfc9bf;
  --muted: #a39c91;
  --line: #2f2c27;
  --accent: #ff8f55;
  --accent-hover: #ffb088;
  --accent-soft: #3a2517;
  --note-orange: #e99a45;
  --note-blue: #7fb6dd;
  --note-green: #97c98b;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -8px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

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

::selection { background: var(--note-orange); color: var(--note-text); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}

p { text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #22a559;
  box-shadow: 0 0 0 4px color-mix(in srgb, #22a559 20%, transparent);
}

.lede {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--text-soft);
  max-width: 36rem;
}

.meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-line linear both;
    animation-timeline: scroll();
    animation-range: 0 80px;
  }
  @keyframes header-line { to { border-bottom-color: var(--line); } }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex: none;
}
.brand:hover { color: var(--text); }
.brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav a,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.site-nav a:hover,
.theme-toggle:hover { background: var(--bg-soft); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--bg-soft); }
.site-nav .icon-link { width: 2.25rem; padding: 0; }

.theme-toggle {
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.button {
  display: inline-flex;
  align-items: center;
  height: 2.9rem;
  padding: 0 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.button:hover { color: var(--text); border-color: var(--muted); transform: translateY(-1px); }
.button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.button.primary:hover { color: var(--bg); background: var(--text-soft); }

/* ---------- Sticky notes (a nod to Event Modeling) ---------- */
.sticky {
  display: inline-block;
  padding: 0.55rem 0.8rem;
  background: var(--note-orange);
  color: var(--note-text);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 3px;
  box-shadow: var(--shadow-note);
}
.sticky-blue { background: var(--note-blue); }
.sticky-green { background: var(--note-green); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) 0; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 4.1rem);
  font-weight: 450;
  line-height: 1.06;
  letter-spacing: -0.025em;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero .lede { margin: 1.5rem 0 0; }
.hero .lede a { color: inherit; text-decoration-color: var(--note-orange); text-decoration-thickness: 2px; }
.hero .lede a:hover { color: var(--accent); }

.portrait {
  position: relative;
  margin: 0;
  max-width: 24rem;
  justify-self: end;
  width: 100%;
}
.portrait picture img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow);
  background: #111;
}
.portrait .sticky { position: absolute; }
.portrait .s1 { top: 9%; left: -12%; transform: rotate(-5deg); }
.portrait .s2 { top: 46%; right: -8%; transform: rotate(4deg); }
.portrait .s3 { bottom: 7%; left: -6%; transform: rotate(-2deg); }

@media (prefers-reduced-motion: no-preference) {
  .portrait .sticky { animation: float 7s ease-in-out infinite; }
  .portrait .s2 { animation-delay: -2.3s; }
  .portrait .s3 { animation-delay: -4.6s; }
  @keyframes float {
    50% { translate: 0 -6px; }
  }
}

/* Timeline strip */
.timeline {
  list-style: none;
  margin: clamp(3rem, 7vw, 5rem) 0 0;
  padding: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  border-top: 1px dashed var(--line);
  position: relative;
}
.timeline li { display: flex; flex-direction: column; gap: 0.8rem; position: relative; }
.timeline .sticky { align-self: flex-start; }
.timeline li:nth-child(odd) .sticky { transform: rotate(-1.5deg); }
.timeline li:nth-child(even) .sticky { transform: rotate(1.5deg); }
.timeline li:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 0.35rem;
  right: 0.25rem;
  color: var(--muted);
  font-family: var(--mono);
}
.timeline small { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

/* ---------- Quote band ---------- */
.quote-band {
  margin-top: clamp(3.5rem, 8vw, 6rem);
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}
.quote-band blockquote {
  margin: 0;
  padding-block: clamp(3rem, 7vw, 5rem);
  text-align: center;
}
.quote-band blockquote p {
  margin: 0 auto;
  max-width: 48rem;
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.quote-band blockquote p::before { content: "“"; color: var(--accent); }
.quote-band blockquote p::after { content: "”"; color: var(--accent); }
.quote-band footer { margin-top: 1.25rem; font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5rem); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.more { font-weight: 500; text-decoration: none; white-space: nowrap; }

/* Featured card (also the fullstack4j offering card) */
.featured,
.offering {
  display: block;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.featured::before,
.offering::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--note-orange);
}
.featured:hover { color: var(--text); transform: translateY(-2px); border-color: var(--muted); }
.featured h3,
.offering h3 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0.8rem 0 0.75rem; }
.featured p:not(.meta),
.offering .pitch {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 48rem;
  margin: 0;
}
.read-more { display: inline-block; margin-top: 1.25rem; color: var(--accent); font-weight: 500; }
.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* Note list */
.note-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}
.note-item a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.4rem 1.5rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 60%, var(--bg));
  color: var(--text);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.note-item a:hover {
  color: var(--text);
  transform: translateY(-2px);
  border-color: var(--muted);
  background: var(--surface);
}
.note-item time,
.note-item .kicker { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.note-item h3 { font-size: 1.45rem; margin: 0.45rem 0 0.5rem; }
.note-item a:hover h3 { color: var(--accent); }
.note-item p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }

/* Projects */
.projects + .section { padding-top: 0; }
.projects .lede { margin: -0.75rem 0 0; }
.project-group { margin: 2rem 0 0; }
.project-group a { color: var(--accent); text-decoration: none; }
.project-group a:hover { text-decoration: underline; }
/* fill the row, so a group of two has no gap */
.project-list { margin-top: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }

/* fullstack4j offering */
.offering-section + .projects { padding-top: 0; }
.offering .stack { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.offering .stack .sticky { transform: rotate(-1.5deg); }
.offering .stack .sticky:nth-child(even) { transform: rotate(1.5deg); }
.offering .actions { margin-top: 1.75rem; }
.offering {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 21rem);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

/* One slice on an Event Modeling board, next to the pitch */
.slice-board { margin: 0; }
.slice-board svg { display: block; width: 100%; height: auto; color: var(--muted); }
.slice-board figcaption { margin-top: 0.6rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-align: center; }
.em-lane { stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 3 4; }
.em-lane-label { font: 500 9px var(--mono); fill: var(--muted); letter-spacing: 0.06em; }
.em-slice { fill: var(--accent-soft); fill-opacity: 0.55; stroke: var(--note-orange); stroke-width: 1.5; stroke-dasharray: 5 4; }
.em-wire { fill: var(--surface); stroke: var(--muted); stroke-width: 1.1; }
.em-wire-title { font: 500 9px var(--mono); fill: var(--text-soft); }
.em-wire-line { fill: var(--line); }
.em-button { fill: var(--text); }
.em-button-text { font: 600 8.5px var(--sans); fill: var(--bg); }
.em-note { filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.12)) drop-shadow(0 4px 6px rgb(0 0 0 / 0.16)); }
.em-cmd { fill: var(--note-blue); }
.em-evt { fill: var(--note-orange); }
.em-view { fill: var(--note-green); }
.em-note-text { font: 500 11px var(--mono); fill: var(--note-text); }
.em-arrow { fill: none; stroke: currentColor; stroke-width: 1.3; }
.em-next { opacity: 0.7; }
.em-tag { font: 9px var(--mono); fill: var(--muted); }
/* after the shared .engagements rules would reset it, hence the extra specificity */
.offering + .offering-steps {
  margin-top: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

/* Notes archive */
.page-intro { padding-bottom: 0; }
.page-intro h1 { font-size: clamp(2.6rem, 6vw, 4rem); }
.page-intro .lede { margin: 1rem 0 0; }
.archive { padding-top: 2.5rem; }
.year-group + .year-group { margin-top: 3.5rem; }
.year {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.year::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Post ---------- */
.post { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-block: clamp(2rem, 6vw, 4rem) 4rem; }
.back-link {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--accent); }
.post-header h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 450;
  letter-spacing: -0.025em;
  margin-top: 0.75rem;
}
.post-header { margin-bottom: 2.25rem; }

.prose {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.4vw, 1.27rem);
  line-height: 1.7;
  color: var(--text-soft);
  overflow-wrap: break-word;
}
.prose p { margin: 0 0 1.35em; }
.prose > p:first-child::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: 0.8;
  padding: 0.08em 0.1em 0 0;
  color: var(--accent);
  font-weight: 500;
}
.prose a { color: var(--text); text-decoration-color: var(--note-orange); text-decoration-thickness: 2px; }
.prose a:hover { color: var(--accent); }
.prose strong { color: var(--text); }
.prose blockquote {
  margin: 1.5em 0;
  padding-left: 1.2em;
  border-left: 3px solid var(--note-orange);
  font-style: italic;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  background: var(--bg-soft);
  border-radius: 4px;
}

.author-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 3rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--muted);
}
.author-card img {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
}
.author-card p { margin: 0; }
.author-card strong { color: var(--text); }

.post-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}
.post-pager a {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.25;
  transition: border-color 0.2s ease;
}
.post-pager a:hover { border-color: var(--muted); color: var(--accent); }
.post-pager span { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.post-pager .older span::before { content: "← "; }
.post-pager .newer { grid-column: 2; text-align: right; }
.post-pager .newer span::after { content: " →"; }

/* ---------- About ---------- */
.about { max-width: 52rem; padding-block: clamp(2rem, 6vw, 4rem) 4rem; }
.about-header {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin-bottom: 3rem;
}
.about-header img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}
.about-header h1 { font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 450; }
.about-header .lede { margin: 0.9rem 0 0; }
.about-header .actions { margin-top: 1.5rem; }
.about .prose { max-width: var(--measure); margin-inline: auto; }

/* ---------- Work with me ---------- */
.work-hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); max-width: 22ch; }
.work-hero h1 em { font-style: italic; color: var(--accent); }
.work-hero .lede { max-width: 44rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stats dt { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3rem); line-height: 1; color: var(--text); }
.stats dd { margin: 0.5rem 0 0; font-size: 0.92rem; line-height: 1.45; color: var(--muted); }
.stats a { color: inherit; text-decoration-color: var(--note-orange); text-decoration-thickness: 2px; }

.services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 1rem;
}
.services li {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.services .sticky { transform: rotate(-2deg); }
.services li:nth-child(even) .sticky { transform: rotate(1.5deg); }
.services h3 { font-size: 1.5rem; margin: 1.1rem 0 0.6rem; }
.services p { margin: 0; color: var(--text-soft); font-size: 0.98rem; }

.tags {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tags li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-soft);
}

.quote-band.flush { margin-top: 0; }
.quote-band .testimonial p { font-size: clamp(1.5rem, 3.2vw, 2.3rem); line-height: 1.25; }

.engagements,
.offering-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 2rem 3rem;
}
.engagements li,
.offering-steps li { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.engagements .meta,
.offering-steps .meta { margin: 0; }
.engagements h3,
.offering-steps h3 { font-size: 1.45rem; margin: 0.4rem 0 0.5rem; }
.engagements p:not(.meta),
.offering-steps p:not(.meta) { margin: 0; color: var(--text-soft); font-size: 0.98rem; }

.certs { padding-top: 0; }
.badges {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1rem;
}
.badges li { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.badges img { width: 6.5rem; height: 6.5rem; object-fit: contain; }
.badges span { font-size: 0.82rem; line-height: 1.35; color: var(--muted); max-width: 12rem; }
.more-certs { margin: 2rem 0 0; font-size: 0.92rem; color: var(--muted); }
.more-certs + .more-certs { margin-top: 0.5rem; }

.cta {
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  text-align: center;
}
.cta h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.cta .lede { margin: 1rem auto 0; }
.cta .actions { justify-content: center; }

/* ---------- Impressum ---------- */
.legal { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.legal h1 { font-size: clamp(2.6rem, 6vw, 4rem); margin-bottom: 2rem; }
.legal h2 { font-family: var(--sans); font-size: 1rem; font-weight: 600; letter-spacing: 0; margin: 2rem 0 0.5rem; }
.legal p { margin: 0; color: var(--text-soft); }
.legal p + p { margin-top: 1rem; }
.legal-updated { font-size: 0.9rem; color: var(--muted) !important; margin-top: 2.5rem !important; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding-block: clamp(4rem, 12vw, 8rem); }
.not-found .sticky { transform: rotate(-3deg); font-size: 1rem; padding: 1rem 1.4rem; }
.not-found h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-top: 2rem; }
.not-found .lede { margin: 1rem auto 0; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem;
}
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .offering { grid-template-columns: 1fr; }
  .slice-board { max-width: 21rem; width: 100%; justify-self: center; }
  .portrait { justify-self: center; max-width: 19rem; order: -1; }
  .portrait .s1 { left: -8%; }
  .portrait .s2 { right: -6%; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; }
  .timeline li:nth-child(2)::after { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.75rem; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .brand span { display: none; }
  .site-nav { gap: 0; }
  .site-nav a:not(.icon-link) { padding-inline: 0.6rem; }
  .site-nav .nav-rss { display: none; } /* still linked in the footer */
  .portrait { max-width: 15rem; }
  .portrait .sticky { font-size: 0.72rem; padding: 0.45rem 0.6rem; }
  .portrait .s1 { left: -10%; }
  .portrait .s2 { right: -10%; }
  .timeline { grid-template-columns: 1fr; gap: 1.25rem; }
  .timeline li { flex-direction: row; align-items: center; gap: 1rem; }
  .timeline li::after { display: none; }
  .timeline .sticky { flex: none; min-width: 7.5rem; text-align: center; }
  .about-header { grid-template-columns: 1fr; }
  .about-header picture { max-width: 11rem; }
  .post-pager { grid-template-columns: 1fr; }
  .post-pager .newer { grid-column: auto; grid-row: 1; }
  .section-head { flex-direction: column; gap: 0.25rem; }
  .stats { grid-template-columns: 1fr; gap: 1.25rem; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .site-nav a:not(.icon-link) { padding-inline: 0.45rem; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
