@layer reset, tokens, base, components;

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-display: swap; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body, h1, h2, h3, p, ul, ol { margin: 0; }
  ul, ol { padding: 0; }
  img { display: block; max-width: 100%; }
}

@layer tokens {
  :root {
    color-scheme: light dark;
    --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
    --color-bg: #fcfcfb;
    --color-text: #1a1a1a;
    --color-muted: #66665f;
    --color-border: #e2e2dd;
    --color-border-soft: #eeeeea;
    --color-accent: #b4451f;
    --color-focus: #1d5fbf;
    --measure: 42rem;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --color-bg: #151514;
      --color-text: #ececea;
      --color-muted: #a5a59e;
      --color-border: #31312e;
      --color-border-soft: #242422;
      --color-accent: #f08a62;
      --color-focus: #78adff;
    }
  }
}

@layer base {
  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
  }
  a { color: var(--color-accent); text-decoration-thickness: 0.07em; text-underline-offset: 0.2em; }
  a:hover { text-decoration-thickness: 0.14em; }
  :focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
  h1 { font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; }
}

@layer components {
  .wrap { width: min(100% - 2rem, var(--measure)); margin-inline: auto; }
  .muted { color: var(--color-muted); }
  .small { font-size: 0.95rem; }

  .skip-link {
    position: fixed; z-index: 10; top: 0.75rem; left: 0.75rem; padding: 0.5rem 1rem;
    background: var(--color-text); color: var(--color-bg); transform: translateY(-200%);
  }
  .skip-link:focus { transform: none; }

  .site-header { border-bottom: 1px solid var(--color-border); }
  .header-inner { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; }
  .brand { color: var(--color-text); font-family: var(--font-mono); font-size: 0.95rem; font-weight: 500; text-decoration: none; }
  .languages { display: flex; gap: 0.75rem; font-family: var(--font-mono); font-size: 0.8rem; }
  .languages a { color: var(--color-muted); text-decoration: none; }
  .languages a:hover { color: var(--color-text); }
  .languages [aria-current] { color: var(--color-text); font-weight: 500; }

  main { flex: 1; }
  .hero { padding-block: clamp(3rem, 10vw, 5rem) 3.5rem; }
  .avatar { width: 64px; height: 64px; margin-bottom: 1.75rem; border-radius: 50%; }
  .hero h1 { margin-bottom: 1rem; }
  .lede { max-width: 34rem; color: var(--color-muted); font-size: 1.15rem; }

  section { padding-block: 3rem; border-top: 1px solid var(--color-border); }
  section h2 { margin-bottom: 1.5rem; color: var(--color-accent); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; }
  section h2::before { content: "// "; }

  .apps { list-style: none; }
  .apps a { display: grid; grid-template-columns: 56px 1fr auto; gap: 1rem; align-items: center; padding-block: 0.75rem; color: var(--color-text); text-decoration: none; }
  .apps img { width: 56px; height: 56px; }
  .app-text strong { display: block; font-weight: 600; }
  .app-text span { color: var(--color-muted); font-size: 0.95rem; }
  .apps .arrow { color: var(--color-accent); }
  .apps a:hover strong { color: var(--color-accent); }
  .more { display: inline-block; margin-top: 1rem; font-weight: 500; }

  .timeline { list-style: none; margin-bottom: 1.5rem; }
  .timeline li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding-block: 0.6rem; border-bottom: 1px solid var(--color-border-soft); }
  .timeline li:last-child { border-bottom: 0; }
  .timeline .years { padding-top: 0.15rem; color: var(--color-muted); font-family: var(--font-mono); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
  .timeline strong { font-weight: 600; }
  .timeline strong a { color: inherit; text-decoration-color: var(--color-border); }
  .timeline strong a:hover { color: var(--color-accent); text-decoration-color: currentColor; }
  .timeline .muted { display: block; font-size: 0.95rem; }

  .profiles { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1rem; list-style: none; }

  .legal { padding-block: clamp(3rem, 8vw, 4.5rem) 4rem; }
  .legal h1 { margin-bottom: 2rem; }
  .legal h2 { margin: 2rem 0 0.5rem; font-size: 1.1rem; font-weight: 600; }
  .legal p + p { margin-top: 1rem; }

  .site-footer { margin-top: 2rem; padding-block: 2rem 3rem; border-top: 1px solid var(--color-border); color: var(--color-muted); font-size: 0.85rem; }
  .footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
  .footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
  .site-footer a { color: var(--color-muted); }
  .site-footer a:hover { color: var(--color-text); }
  /* Old links to chbeer.de/#impressum land here; make the target easy to spot. */
  #impressum:target { color: var(--color-accent); font-weight: 600; }

  @media (max-width: 520px) {
    .timeline li { grid-template-columns: 1fr; gap: 0; }
  }
}
