/* Shared on every page: font, skip link, menu button and panel, header links, footer legal row.
   Page styles (tokens, layout) live in their own file and are loaded after this one. */
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage.woff2") format("woff2-variations"), url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
}
/* One page width for every page: the header row and the content share it, so the logo and the
   text start at the same edge everywhere. Pages with long text keep their lines shorter inside it. */
.wrap, .kopf {
  max-width: 64rem; margin-inline: auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
}
/* Big, tall screens (external monitors): everything grows a little, so the full-height areas don't float in empty space.
   In percent, so a larger font size set in the browser still adds on top. */
@media (min-width: 1280px) and (min-height: 1000px) { html { font-size: 112.5%; } }
@media (min-width: 1600px) and (min-height: 1200px) { html { font-size: 125%; } }
/* Header row: shares its vertical centre with the fixed menu button (both 0.85rem down, 2.6rem tall) */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: calc(env(safe-area-inset-top, 0px) + 0.85rem) 0.85rem; }
.mark {
  display: inline-flex; align-items: center; height: 2.6rem;
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; font-stretch: 80%; letter-spacing: -0.01em; line-height: 1;
  color: var(--night-fg); text-decoration: none;
}
.mark span { color: #ff8a7d; }
.mark:focus-visible { outline: 3px solid #ff7a6e; outline-offset: 3px; border-radius: 6px; }
/* one extra link next to the logo (blog: RSS, post: back), so the page links keep their place;
   on phones it sits on the right and keeps clear of the menu button */
.kopf-extra { font-size: 0.9rem; color: var(--night-muted); text-decoration: none; display: inline-flex; gap: 0.4rem; align-items: center; padding-block: 0.3rem; margin-right: 3.4rem; }
.kopf-extra:hover { color: #ffffff; }
@media (min-width: 780px) { .kopf-extra { margin-right: 0; margin-left: 1.25rem; } }

/* Menu: a floating button, the panel slides in from the right */
.menu-btn {
  position: fixed; z-index: 45;
  top: calc(env(safe-area-inset-top, 0px) + 0.85rem);
  right: max(18px, env(safe-area-inset-right, 0px));
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18); cursor: pointer;
  background: rgba(12,14,44,0.6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: grid; place-items: center; padding: 0;
  box-shadow: 0 6px 20px -8px rgba(0,0,0,0.5);
}
.menu-btn span, .menu-btn span::before, .menu-btn span::after {
  display: block; width: 1.05rem; height: 2px; border-radius: 2px; background: #ffffff; position: relative;
}
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; }
.menu-btn span::after { top: 6px; }
.menu-btn:focus-visible { outline: 3px solid #ff7a6e; outline-offset: 3px; }

#menu {
  margin: 0; border: 0; inset: 0 0 0 auto;
  width: min(21rem, 86vw); height: 100%; max-height: none;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) max(22px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 1.5rem) 1.6rem;
  /* page colours, so the panel is light in light mode and dark in dark mode */
  background:
    radial-gradient(20rem 16rem at 100% 0%, color-mix(in srgb, #8a7cff 22%, transparent), transparent 70%),
    radial-gradient(16rem 12rem at 0% 100%, color-mix(in srgb, #f0544f 12%, transparent), transparent 70%),
    var(--bg);
  color: var(--fg);
  display: none; flex-direction: column; gap: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), overlay 0.35s allow-discrete, display 0.35s allow-discrete;
}
#menu:popover-open { display: flex; transform: translateX(0); }
@starting-style { #menu:popover-open { transform: translateX(100%); } }
#menu::backdrop {
  background: rgba(8,9,30,0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0);
  transition: background 0.35s, backdrop-filter 0.35s, overlay 0.35s allow-discrete, display 0.35s allow-discrete;
}
#menu:popover-open::backdrop { background: rgba(8,9,30,0.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@starting-style { #menu:popover-open::backdrop { background: rgba(8,9,30,0); backdrop-filter: blur(0); } }
.menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-close {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; cursor: pointer; padding: 0;
  border: 1px solid var(--line); background: var(--surface, var(--bg)); color: var(--fg);
  font-size: 1.4rem; line-height: 1;
}
#menu .mark { color: var(--fg); }
#menu .mark span { color: var(--hot, #e0574e); }
.menu-close:focus-visible, #menu a:focus-visible { outline: 3px solid #ff7a6e; outline-offset: 3px; }
#menu ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; counter-reset: m; }
#menu li a {
  display: flex; align-items: baseline; gap: 0.8rem; padding-block: 0.45rem;
  font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; font-stretch: 88%;
  color: var(--fg); text-decoration: none;
}
#menu li a:hover, #menu li a[aria-current="page"] { color: var(--accent); }

/* Site nav: text links in the header on wide screens, the menu panel on phones */
.toplinks { display: none; }
#menu .menu-contact { margin-top: auto; display: grid; gap: 0.75rem; }
#menu .menu-contact ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
#menu .menu-contact a {
  display: inline-flex; align-items: center; gap: 0.45rem; height: 2.6rem; padding: 0 0.95rem;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface, var(--bg));
  color: var(--fg); text-decoration: none; font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; font-stretch: 100%;
}
#menu .menu-contact a:hover { border-color: var(--accent); }
.menu-contact svg { width: 1.05rem; height: 1.05rem; flex: none; }
.menu-contact p { margin: 0; font-size: 0.875rem; color: var(--muted); }
@media (min-width: 780px) {
  .toplinks { display: flex; align-items: center; gap: 1.6rem; margin-left: auto; }
  .toplinks a {
    color: var(--night-fg); text-decoration: none; font-weight: 600; font-size: 0.95rem;
    padding-block: 0.3rem; border-bottom: 2px solid transparent;
  }
  .toplinks a:hover, .toplinks a[aria-current="page"] { border-bottom-color: #ff7a6e; }
  .toplinks a:focus-visible { outline: 3px solid #ff7a6e; outline-offset: 3px; border-radius: 4px; }
  /* The header links scroll away; the menu button fades in once they are out of view */
  .menu-btn { right: var(--menu-right, 18px); opacity: 0; visibility: hidden; transform: scale(0.85); transition: opacity 0.25s, transform 0.25s, visibility 0s 0.25s; }
  .past-header .menu-btn { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s, transform 0.25s; }
}
/* Skip link: first stop for keyboard and screen reader users, visible only on focus */
.skip { position: absolute; left: 1rem; top: -10rem; z-index: 100; padding: 0.7rem 1.1rem; border-radius: 10px; background: #ffffff; color: #0c0e2c; font-weight: 700; text-decoration: none; box-shadow: 0 6px 24px -8px rgba(0,0,0,0.5); }
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 0.75rem); outline: 3px solid #ff7a6e; outline-offset: 2px; }
/* Text for screen readers only */
.zusammen { white-space: nowrap; } /* keeps a short phrase on one line */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* Footer: copyright, privacy promise and easter egg each get a line of their own */
.zeile, .egg { flex-basis: 100%; }
.egg { font-style: italic; }
/* Footer on every page except the start page (which has the night contact band, see home.css):
   logo, then the legal row; follows light and dark like the page */
.fuss { border-top: 1px solid var(--line); padding-block: 1.75rem calc(env(safe-area-inset-bottom, 0px) + 2.25rem); font-size: 0.875rem; color: var(--muted); }
.fuss a { color: var(--muted); }
.fuss a[aria-current="page"] { color: var(--fg); }
.fuss .mark { color: var(--fg); }
.fuss .mark span { color: var(--hot, #e0574e); }
/* the logo in a footer is smaller and opens the legal row, on its baseline */
footer .mark { font-size: 1.4rem; height: auto; margin-right: 0.25rem; }
/* Legal row in every footer: plain text and padded links share one baseline */
.legal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.25rem; }
.legal a { display: inline-block; padding-block: 0.25rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
/* Light/dark switch. Header (desktop): round icon button, sun in light mode, moon in dark mode.
   Menu (phones): a row with visible text and a toggle. Both are role="switch", "on" = dark. */
.theme-switch { font: inherit; color: inherit; cursor: pointer; }
.theme-switch[hidden] { display: none; }
.theme-switch svg { width: 1.15rem; height: 1.15rem; }
.theme-switch[aria-checked="true"] svg:first-of-type, .theme-switch[aria-checked="false"] svg:last-of-type { display: none; }
/* the word next to the icon names the active mode, like the icon */
.theme-switch[aria-checked="true"] .ts-light, .theme-switch[aria-checked="false"] .ts-dark { display: none; }
.theme-switch:focus-visible { outline: 3px solid #ff7a6e; outline-offset: 3px; }
.ts-icon {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%;
  color: var(--night-fg); background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
}
.ts-icon:hover { border-color: #ff7a6e; }
#menu .ts-row {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0; background: none; border: 0;
  border-block: 1px solid var(--line); color: var(--fg); font-weight: 600; text-align: left;
}
#menu .ts-row .ts-ic { display: inline-flex; color: var(--accent); }
#menu .ts-row .ts-track { margin-left: auto; }
.ts-track { position: relative; width: 2.6rem; height: 1.45rem; border-radius: 999px; border: 1.5px solid currentColor; flex: none; }
.ts-knob {
  position: absolute; top: 50%; left: 0.2rem; width: 0.95rem; height: 0.95rem; border-radius: 50%;
  background: currentColor; transform: translateY(-50%); transition: left 0.2s ease;
}
.theme-switch[aria-checked="true"] .ts-knob { left: calc(100% - 1.15rem); }
