/* s-baum.dev — Technisches Schriftfeld.
   Themes follow the cc-ui pattern: [data-theme] on <html>, CSS variables only.
   Design language: monospace meta-layer (nav, labels, tags) over a sans body,
   section headings as technical labels above dimension-line dividers, faint
   drawing grid in the hero, footer as an engineering title block.
   Zero dependencies, system fonts only. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --fg: #1a1d21;
  --fg-muted: #5c6470;
  --border: #e3e6ea;
  --accent: #0b6bcb;
  --accent-fg: #ffffff;
  --tag-bg: #eef1f4;
  /* Derived per theme via --border, so every theme gets a working value. */
  --grid-line: color-mix(in srgb, var(--border) 55%, transparent);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #101418;
  --bg-soft: #171c22;
  --fg: #e6e9ec;
  --fg-muted: #99a3ad;
  --border: #2a323b;
  --accent: #4da3ff;
  --accent-fg: #0b1016;
  --tag-bg: #1f262e;
  color-scheme: dark;
}

[data-theme="phosphor"] {
  --bg: #0a0f0a;
  --bg-soft: #101710;
  --fg: #d8e8d8;
  --fg-muted: #85a385;
  --border: #223122;
  --accent: #33ff66;
  --accent-fg: #04170a;
  --tag-bg: #162116;
  color-scheme: dark;
}

[data-theme="paper"] {
  --bg: #faf6ef;
  --bg-soft: #f2ecdf;
  --fg: #2b2620;
  --fg-muted: #6f6759;
  --border: #e2d9c8;
  --accent: #b07d10;
  --accent-fg: #ffffff;
  --tag-bg: #ede5d4;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.container {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.25rem;
}

.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--fg);
  margin-right: auto;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-nav a {
  font-family: var(--mono);
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.8rem;
}

.site-nav a:hover {
  color: var(--fg);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lang-switch {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
}

.lang-switch:hover {
  color: var(--fg);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--fg);
}

.theme-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
}

/* Sections */
section {
  padding: 3.75rem 0;
}

h1 {
  font-size: 2.5rem;
  font-weight: 720;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 0.6rem;
}

/* Section headings as technical labels; the content carries the weight. */
h2 {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 1.75rem;
}

/* Dimension-line divider with end ticks. */
h2::before {
  content: "";
  display: block;
  height: 9px;
  margin-bottom: 1.1rem;
  background:
    linear-gradient(var(--fg-muted), var(--fg-muted)) left center / 1px 9px no-repeat,
    linear-gradient(var(--fg-muted), var(--fg-muted)) right center / 1px 9px no-repeat,
    linear-gradient(var(--border), var(--border)) center / 100% 1px no-repeat;
}

/* Hero: faint drawing grid, mono role line. */
.hero {
  padding: 5.5rem 0 4rem;
  background:
    repeating-linear-gradient(0deg, var(--grid-line) 0 1px, transparent 1px 2.5rem),
    repeating-linear-gradient(90deg, var(--grid-line) 0 1px, transparent 1px 2.5rem);
}

.hero .role {
  font-family: var(--mono);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  margin: 0 0 1.25rem;
}

.hero .role::before {
  content: "// ";
  color: var(--fg-muted);
}

.hero p {
  font-size: 1.06rem;
  max-width: 42rem;
  margin: 0.25rem 0;
}

.hero .sub {
  color: var(--fg-muted);
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.88rem;
  border-radius: 3px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  color: var(--fg);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
  border-color: var(--fg-muted);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.btn.primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--fg));
  border-color: color-mix(in srgb, var(--accent) 88%, var(--fg));
}

/* Cards: drawing-sheet precision */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  padding: 1.1rem 1.2rem;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--fg-muted) 55%, var(--border));
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
  font-weight: 660;
}

.card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.tags {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.1rem 0.45rem;
}

.section-note {
  color: var(--fg-muted);
  max-width: 46rem;
  margin: 0 0 1.5rem;
}

/* About */
.about p {
  max-width: 46rem;
  margin: 0 0 0.6rem;
}

.about h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.6rem;
}

/* Contact */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.contact-list li {
  margin: 0.3rem 0;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
}

.contact .fineprint {
  color: var(--fg-muted);
  font-size: 0.88rem;
  max-width: 44rem;
}

/* Footer as engineering title block, bottom-right like on a drawing sheet. */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  font-family: var(--mono);
  color: var(--fg-muted);
  font-size: 0.78rem;
}

.site-footer .container {
  display: flex;
  justify-content: flex-end;
}

.titleblock {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--border);
}

.titleblock > span {
  padding: 0.5rem 0.9rem;
}

.titleblock > span + span {
  border-left: 1px solid var(--border);
}

.site-footer a {
  color: var(--fg-muted);
}

/* Subpages (CV, legal) */
.page {
  padding: 2.5rem 0 3.5rem;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.prose {
  max-width: 46rem;
}

.prose h1 {
  font-size: 1.6rem;
}

.prose h2 {
  margin: 2.25rem 0 1rem;
}

.prose h3 {
  font-size: 1.02rem;
  margin: 1.25rem 0 0.4rem;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.prose th {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.prose a {
  color: var(--accent);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* The h2 dimension line already separates sections; drop a directly preceding hr. */
.prose hr:has(+ h2) {
  display: none;
}

@media (max-width: 640px) {
  .site-nav {
    display: none;
  }

  h1 {
    font-size: 2.05rem;
  }

  .site-footer .container {
    justify-content: stretch;
  }

  .titleblock {
    display: grid;
    grid-auto-flow: row;
    width: 100%;
  }

  .titleblock > span + span {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

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

  .btn,
  .card {
    transition: none;
  }
}

@media print {
  .header-controls {
    display: none;
  }

  .site-header {
    position: static;
    backdrop-filter: none;
  }

  .hero {
    background: none;
  }
}
