/* SH1FT-W shared design, version 1 (https://sh1ft-w.github.io/theme/v1/theme.css)
 *
 * One stylesheet for the start page and every project page: colour tokens (light and dark),
 * the floating glass navigation, the light/dark button, the DE/EN switch, reveal-on-scroll,
 * focus rings and reduced motion. Load it in <head> BEFORE the page's own <style>, together
 * with theme.js:
 *
 *   <link rel="stylesheet" href="https://sh1ft-w.github.io/theme/v1/theme.css">
 *   <script src="https://sh1ft-w.github.io/theme/v1/theme.js"></script>
 *
 * The path is versioned. A breaking change becomes /theme/v2/ next to this file; v1 stays as it is.
 *
 * WHAT A PAGE SETS (markup):
 *   <html lang="en">                       theme.js switches lang to "de" or "en"
 *   <title data-de="…">…</title>           optional German title, swapped with the language
 *   <span class="en">…</span><span class="de">…</span>   bilingual text, the other language is hidden
 *   <div class="navwrap"><nav class="nav">…</nav></div>  the glass navigation (sticky, one pill)
 *     <a class="brand" href="#top"><img …>Name</a>
 *     <div class="nav-links"><a href="#…">…</a> <a class="opt">…</a></div>   .opt is hidden below 960 px
 *     <button class="iconbtn" id="theme"><svg class="moon"/><svg class="sun"/></button>
 *     <div class="lang"><button data-l="de">DE</button><button data-l="en">EN</button></div>
 *   class="reveal" (+ d1, d2, d3 for a delay)  fades in when scrolled into view; ?still shows everything at once
 *
 * WHAT A PAGE MAY OVERRIDE (CSS custom properties on :root, light and dark):
 *   --accent, --accent-ink, --on-accent    the project colour (links, focus ring, eyebrow dot);
 *                                          set once on :root, the theme does not override it in dark mode
 *                                          (define your own dark value if the colour needs one)
 *   --bg, --bg-2, --card, --card-2         surfaces
 *   --ink, --ink-2, --ink-3                text, from strong to faint
 *   --line, --chip                         hairlines and soft fills
 *   --glass, --glass-line                  the navigation pill
 *   --shadow, --shadow-lg                  card shadows
 *   --radius, --radius-lg, --gutter, --max layout
 *   --font, --font-display, --mono         type (system stack by default, no web fonts)
 *   --nav-top, --nav-h, --nav-gap, --nav-pad   navigation geometry
 * Everything else (hero, cards, sections, buttons) is the page's own.
 */

:root {
  color-scheme: light;
  --bg: #f5f5f7; --bg-2: #ececf0; --card: #ffffff; --card-2: #f5f5f7;
  --ink: #1d1d1f; --ink-2: #6e6e73; --ink-3: #8e8e93;
  --line: rgba(0,0,0,0.08); --chip: rgba(0,0,0,0.05);
  --accent: #0066cc; --accent-ink: #0066cc; --on-accent: #ffffff;
  --glass: rgba(255,255,255,0.66); --glass-line: rgba(255,255,255,0.7);
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -14px rgba(0,0,0,0.14);
  --shadow-lg: 0 2px 6px rgba(0,0,0,0.04), 0 40px 90px -36px rgba(0,0,0,0.28);
  --radius: 26px; --radius-lg: 34px; --gutter: clamp(16px, 5vw, 48px); --max: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --nav-top: 12px; --nav-h: 56px; --nav-gap: 20px; --nav-pad: 0 10px 0 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0b0d; --bg-2: #121214; --card: #1c1c1e; --card-2: #232326;
    --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #6e6e73;
    --line: rgba(255,255,255,0.09); --chip: rgba(255,255,255,0.09);
    --glass: rgba(28,28,30,0.62); --glass-line: rgba(255,255,255,0.08);
    --shadow: 0 14px 34px -16px rgba(0,0,0,0.6); --shadow-lg: 0 40px 90px -36px rgba(0,0,0,0.8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0d; --bg-2: #121214; --card: #1c1c1e; --card-2: #232326;
  --ink: #f5f5f7; --ink-2: #a1a1a6; --ink-3: #6e6e73;
  --line: rgba(255,255,255,0.09); --chip: rgba(255,255,255,0.09);
  --glass: rgba(28,28,30,0.62); --glass-line: rgba(255,255,255,0.08);
  --shadow: 0 14px 34px -16px rgba(0,0,0,0.6); --shadow-lg: 0 40px 90px -36px rgba(0,0,0,0.8);
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Bilingual: static text exists twice, the page language hides the other one */
html[lang="de"] .en, html[lang="en"] .de { display: none !important; }

/* Floating glass navigation */
.navwrap { position: sticky; top: var(--nav-top); z-index: 10; padding: 0 var(--gutter); pointer-events: none; }
.nav { pointer-events: auto; max-width: var(--max); margin: 0 auto; height: var(--nav-h); padding: var(--nav-pad);
  display: flex; align-items: center; gap: var(--nav-gap); border-radius: 999px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  box-shadow: inset 0 0 0 1px var(--glass-line), var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand img.logo { width: auto; height: 26px; border-radius: 0; }
.nav-links { display: flex; gap: 4px; margin-left: auto; font-size: 14px; font-weight: 500; }
.nav-links a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: 999px; transition: background .2s, color .2s; }
.nav-links a:hover { color: var(--ink); background: var(--chip); text-decoration: none; }

/* Light/dark button: moon in light mode, sun in dark mode */
.iconbtn { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center; transition: background .2s, color .2s; }
.iconbtn:hover { background: var(--chip); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn .sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .iconbtn .moon { display: none; } :root:not([data-theme="light"]) .iconbtn .sun { display: block; } }
:root[data-theme="dark"] .iconbtn .moon { display: none; } :root[data-theme="dark"] .iconbtn .sun { display: block; }
:root[data-theme="light"] .iconbtn .moon { display: block; } :root[data-theme="light"] .iconbtn .sun { display: none; }

/* DE/EN switch */
.lang { flex: none; display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button { font: inherit; font-size: 12px; font-weight: 600; border: 0; background: none; color: var(--ink-2); padding: 5px 10px; cursor: pointer; }
.lang button.on { background: var(--ink); color: var(--bg); }

/* Reveal on scroll (?still in the address shows everything at once, e.g. for screenshots) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in, html.still .reveal { opacity: 1; transform: none; }
html.still .reveal { transition: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

@media (max-width: 960px) { .nav-links a.opt { display: none; } }
@media (max-width: 640px) {
  .navwrap { top: 8px; padding: 0 10px; }
  .nav { height: 52px; gap: 8px; }
  .nav-links { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
