/* ===========================================================================
   Andreas Hermann — personal site
   Dark default, light theme via [data-theme="light"]. Inter for UI/body,
   Newsreader for long-form prose. Single-column, content-first.
   =========================================================================== */
:root {
  --bg: #0f1117;
  --bg-elev: #161925;
  --border: #232838;
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #2dd4bf;
  --accent-ink: #06231f;
  --accent-dim: rgba(45, 212, 191, 0.12);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --max: 760px;
  --radius: 14px;
}
[data-theme="light"] {
  --bg: #fbfbfa;
  --bg-elev: #ffffff;
  --border: #e6e6e2;
  --text: #1a1d24;
  --muted: #5d6470;
  --accent: #0d9488;
  --accent-ink: #ffffff;
  --accent-dim: rgba(13, 148, 136, 0.10);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}
a { color: inherit; text-decoration: none; }
.about a, .prose a, .lead a, .pub__title a, .pub__meta a, .more a, .post__foot a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.2s;
}
.about a:hover, .prose a:hover, .lead a:hover, .pub__title a:hover,
.more a:hover, .post__foot a:hover { border-bottom-color: var(--accent); }

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem max(1.5rem, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav__brand { font-weight: 700; letter-spacing: 0.01em; font-size: 1rem; }
.nav__links { display: flex; align-items: center; gap: 1.3rem; }
.nav__links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); }
.nav__links a.is-active { color: var(--accent); }
.nav__toggle {
  display: none;
  background: none; border: none; color: var(--text);
  font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.theme-toggle {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: rotate(20deg); }

/* ---- Layout ---- */
main { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 3.5rem 0; border-top: 1px solid var(--border); }
.section:first-child { border-top: none; }
.section__title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1.6rem;
  font-weight: 600;
}
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}
.page-title { font-size: clamp(2rem, 5vw, 2.7rem); font-weight: 700; line-height: 1.1; }
.lead { color: var(--muted); font-size: 1.1rem; margin-top: 1.1rem; max-width: 44rem; }

/* ---- Hero ---- */
.hero { padding: 4.5rem 0 3rem; }
.hero__eyebrow {
  color: var(--accent); font-weight: 600; letter-spacing: 0.06em;
  font-size: 0.9rem; text-transform: uppercase; margin-bottom: 1rem;
}
.hero__title { font-size: clamp(2.6rem, 8vw, 4rem); font-weight: 700; line-height: 1.04; }
.hero__lead { color: var(--muted); font-size: 1.18rem; max-width: 42rem; margin-top: 1.3rem; }
.hero__lead strong { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; gap: 0.6rem; margin-top: 2rem; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ---- Callout / aside ---- */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.2rem;
  max-width: 44rem;
}
.callout p { color: var(--muted); margin: 0; }
.callout strong { color: var(--text); }
.callout a { color: var(--accent); border-bottom: 1px solid var(--accent-dim); transition: border-color 0.2s; }
.callout a:hover { border-bottom-color: var(--accent); }

/* ---- About / prose blocks ---- */
.about p { color: var(--muted); margin-bottom: 1rem; max-width: 44rem; }
.about strong { color: var(--text); }
.about .thread { color: var(--text); font-size: 1.1rem; margin: 1.8rem 0 0.4rem; }
.about .thread:first-child { margin-top: 0; }
ul.tight { list-style: none; max-width: 44rem; }
ul.tight li { color: var(--muted); padding-left: 1.2rem; position: relative; margin-bottom: 0.55rem; }
ul.tight li::before { content: '–'; position: absolute; left: 0; color: var(--accent); }
ul.tight strong { color: var(--text); }
ul.tight a { color: var(--accent); border-bottom: 1px solid var(--accent-dim); transition: border-color 0.2s; }
ul.tight a:hover { border-bottom-color: var(--accent); }
.more { margin-top: 1.6rem; }
.more a { font-weight: 500; }

/* ---- Cards ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card h3 { font-size: 1rem; margin-bottom: 0.45rem; }
.card p { color: var(--muted); font-size: 0.9rem; }

/* ---- Publication / list rows ---- */
.pub-list { list-style: none; display: flex; flex-direction: column; gap: 1.1rem; }
.pub { display: flex; gap: 1.1rem; align-items: baseline; }
.pub__year {
  color: var(--accent); font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 0.82rem; min-width: 3.6rem; text-transform: uppercase;
}
.pub__title { font-size: 1.02rem; font-weight: 600; line-height: 1.4; }
.pub__meta { color: var(--muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ---- Timeline (CV) ---- */
.timeline { list-style: none; position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 1.8rem; }
.timeline__item::before {
  content: ''; position: absolute; left: -1.5rem; top: 7px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim);
}
.timeline__date { color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.timeline__item h3 { font-size: 1.05rem; margin: 0.25rem 0 0.1rem; }
.timeline__sub { color: var(--text); font-size: 0.92rem; font-weight: 500; margin-bottom: 0.3rem; }
.timeline__item p { color: var(--muted); font-size: 0.92rem; }
.timeline__item p.timeline__sub { color: var(--text); }

/* ---- Long-form post ---- */
.post { max-width: 42rem; }
.post__back { color: var(--muted); font-size: 0.88rem; }
.post__back:hover { color: var(--accent); }
.post__date { color: var(--accent); font-size: 0.85rem; font-weight: 600; margin-top: 1rem; }
.post__title { font-size: clamp(1.8rem, 4.5vw, 2.5rem); font-weight: 700; line-height: 1.12; margin: 0.4rem 0 1.5rem; }
.prose { font-family: 'Newsreader', Georgia, serif; font-size: 1.16rem; line-height: 1.75; color: var(--text); }
.prose h2 { font-family: 'Inter', sans-serif; font-size: 1.35rem; margin: 2.2rem 0 0.8rem; }
.prose h3 { font-family: 'Inter', sans-serif; font-size: 1.1rem; margin: 1.8rem 0 0.6rem; }
.prose p { margin-bottom: 1.2rem; }
.prose ul { margin: 0 0 1.2rem 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { font-weight: 600; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 5px; padding: 0.1em 0.35em;
}
.prose pre {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; overflow-x: auto; margin-bottom: 1.2rem;
}
.prose pre code { border: none; background: none; padding: 0; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.2rem 0 0.2rem 1.2rem; margin: 0 0 1.5rem;
  color: var(--muted); font-style: italic;
}
.prose blockquote strong { color: var(--text); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose em { font-style: italic; }
.post__foot { color: var(--muted); font-size: 0.95rem; }

/* ---- Footer ---- */
.footer {
  max-width: var(--max); margin: 0 auto;
  padding: 2.5rem 1.5rem; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.85rem;
}
.footer__links { display: flex; gap: 1.2rem; margin-bottom: 0.8rem; flex-wrap: wrap; }
.footer__links a { color: var(--muted); transition: color 0.2s; }
.footer__links a:hover { color: var(--accent); }

/* ---- Reveal (only hide when JS is present, so content is visible without JS) ---- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.5rem 1rem; display: none;
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 0.5rem 0; width: 100%; }
  .theme-toggle { margin-top: 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  body { transition: none; }
}
