/* =========================================================
   remo.me – digitales Portfolio
   Eigenständige Website (kein WordPress / Elementor)
   ========================================================= */

:root {
  --bg:        #050505;
  --bg-soft:   #141414;
  --card:      #ffffff;
  --card-text: #1a1a1a;
  --accent:    #fcb424;
  --accent-2:  #ffce5c;
  --text:      #f4f4f4;
  --muted:     #a8a8a8;
  --border:    rgba(255, 255, 255, 0.08);
  --radius:    14px;
  --shadow:    0 10px 30px rgba(0, 0, 0, 0.45);
  --maxw:      980px;
  --font:      "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --ease-settle: cubic-bezier(.22, .61, .36, 1);   /* kommt sauber zum Stehen, ohne langen Auslauf */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; display: block; }

/* ---------- Eleganter Seitenübergang (View Transitions API) ---------- */
/* Cross-Document-Übergang für interne Navigation (Home ↔ Tools ↔ Tool-Seiten).
   Browser ohne Unterstützung navigieren ganz normal – reine Progressive Enhancement. */
@view-transition { navigation: auto; }

::view-transition-old(root) {
  animation: vt-fade-out .38s cubic-bezier(.4, 0, .2, 1) both;
}
::view-transition-new(root) {
  animation: vt-fade-in .46s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes vt-fade-out {
  to   { opacity: 0; transform: translateY(-10px) scale(.992); }
}
@keyframes vt-fade-in {
  from { opacity: 0; transform: translateY(14px) scale(.992); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  padding: 48px 0 32px;   /* Platz fuer die Beschriftung der Profil-Links (Hover) */
  text-align: center;
}
.site-header .container { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* Kopfbereich bleibt beim Runterscrollen zurueck und blendet aus. Direkt an die Scroll-Position
   gekoppelt (scroll-driven animation): Der Browser berechnet das im selben Schritt wie das
   Scrollen, ohne JavaScript, deshalb ohne Stocken. Aeltere Browser: Rueckfall in site.js. */
@keyframes hero-out { from { transform: none; opacity: 1; } to { transform: translateY(120px); opacity: 0; } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .site-header .container {
      animation: hero-out linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 240px;
    }
  }
}
.brand {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: .04em;
  margin: 0;
  line-height: 1.05;
}
.brand a { color: var(--text); }
.brand a:hover { color: var(--accent); }
/* Intro (erster Aufruf pro Besuch): Buchstaben steigen aus einer unsichtbaren Kante auf.
   "intro" setzt ein Mini-Skript im <head>; faellt site.js aus, wird nach 2.5 s trotzdem alles sichtbar. */
.intro:not(.intro-run) .site-header :is(.brand, .tagline, .social) { opacity: 0; }
.brand .ch { display: inline-block; white-space: pre; }
/* Maske statt overflow: veraendert das Layout nicht (keine Verschiebung nach dem Intro) */
.intro-run .brand a { clip-path: inset(-.2em -.2em 0 -.2em); }
.intro-run .brand .ch { animation: ch-rise .8s var(--ease-settle) both; animation-delay: calc(60ms + var(--i) * 42ms); }
.intro-run .tagline { animation: fade-in .8s ease-out .55s both; }
.intro-run .social  { animation: fade-in .8s ease-out .7s both; }
@keyframes ch-rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.tagline {
  font-size: .82rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.social { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
/* Profil-Links als runde Symbol-Knoepfe; der Name erscheint erst beim Hover (oder Tastatur-
   Fokus) als kleine Beschriftung unter dem Symbol. Fuer Screenreader steht er im aria-label. */
.social-link {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  transition: translate .15s ease, border-color .15s ease, background .15s ease;
}
.social-link:hover { translate: 0 -2px; border-color: var(--accent); background: #1c1c1c; color: var(--text); }
.social-link svg { width: 18px; height: 18px; fill: currentColor; }
.social-link svg.ig { fill: none; stroke: currentColor; stroke-width: 2; }
.social-link svg.ig .dot { fill: currentColor; stroke: none; }
.social-link span {
  position: absolute;
  top: calc(100% + 3px);   /* passt in den Abstand bis zur ersten Karte (Kopfbereich liegt unter den Karten) */
  left: 50%;
  translate: -50% -4px;
  padding: 1px 9px;
  border-radius: 8px;
  background: #1c1c1c;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: .72rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, translate .18s ease;
}
.social-link:hover span,
.social-link:focus-visible span { opacity: 1; translate: -50% 0; }
@media (prefers-reduced-motion: reduce) { .social-link:hover { translate: none; } .social-link span { transition: none; } }
@media (max-width: 600px) {
  .social-link { width: 36px; height: 36px; }
  .social-link svg { width: 16px; height: 16px; }
}

/* ---------- Section titles ---------- */
.section-title {
  text-align: center;
  color: var(--text);
  font-size: clamp(1.5rem, 3.6vw, 2.1rem);
  letter-spacing: .01em;
  margin: 26px 0 10px;
}

/* ---------- Cards ---------- */
main { padding-bottom: 60px; }

.card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--card);
  color: var(--card-text);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 12px 34px rgba(0,0,0,.5);
  padding: 22px 26px;
  margin: 0 0 40px;
  /* transform/opacity/filter = Einblenden ("Fokus") · translate = Hover (getrennte Ebenen) */
  transition: translate .22s ease, box-shadow .22s ease;
}
.card:hover {
  translate: 0 -3px;
  box-shadow: 0 0 0 1px rgba(252,180,36,.55), 0 18px 40px rgba(0,0,0,.55);
}
/* Akzentlinie unten: in Ruhe unsichtbar, laeuft beim Hover ueber die ganze Breite */
.card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
}
.card:hover::after { transform: scaleX(1); }
/* ---------- Einblenden "Linie" (assets/js/site.js) ----------
   Eine orange Linie zeichnet die Karte: Sie laeuft vom Logo-Eck aus einmal um die
   abgerundete Karte (SVG, gleichmaessiges Tempo). Dann fuellt sich die Karte weiss, die
   Linie verblasst, der Inhalt blendet gestaffelt ein. Der Inhalt bewegt sich nicht (kein transform), damit Schrift und Logos
   am Ende nicht nachspringen.
   Klasse "reveal" setzt ein Mini-Skript im <head>, damit nichts sichtbar gezeichnet und
   danach versteckt wird. Versteckt wird ohne Uebergang, nur das Einblenden ist animiert. */
.reveal :is(.card, .tool-card):not(.in) {
  transition: none;
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
}
.reveal :is(.card, .tool-card).revealing {
  transition: translate .22s ease,
              background-color .3s ease-out calc(var(--rd, 0ms) + 300ms),
              border-color .3s ease-out calc(var(--rd, 0ms) + 300ms),
              box-shadow .5s ease calc(var(--rd, 0ms) + 300ms);
}
/* Die Linie (SVG wird von site.js eingesetzt und danach wieder entfernt) */
.trace {
  position: absolute;
  inset: 1px;
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  overflow: visible;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 0 4px rgba(252, 180, 36, .4));
}
.trace rect {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.in .trace rect { stroke-dashoffset: 0; transition: stroke-dashoffset .55s cubic-bezier(.65, 0, .35, 1) var(--rd, 0ms); }
.in .trace { opacity: 0; transition: opacity .45s ease calc(var(--rd, 0ms) + 600ms); }

/* Inhalt: nur einblenden, gestaffelt, sobald sich die Karte fuellt */
.reveal :is(.card, .tool-card) > :not(.body):not(.trace),
.reveal .project-card .body > * {
  transition: opacity .3s ease-out;
  transition-delay: calc(var(--rd, 0ms) + var(--sd, 0ms));
}
.reveal :is(.card, .tool-card):not(.in) > :not(.body):not(.trace),
.reveal .project-card:not(.in) .body > * { opacity: 0; transition: none; }
.reveal .card > .media    { --sd: 330ms; }
.reveal .card .kicker     { --sd: 360ms; }
.reveal .card h2,
.reveal .card > .icon-title,
.reveal .tool-card > .tool-body { --sd: 390ms; }
.reveal .card p           { --sd: 420ms; }
.reveal .card .links,
.reveal .card > details   { --sd: 450ms; }
.reveal .tool-card > .thumb { --sd: 330ms; }

@media (prefers-reduced-motion: reduce) {
  .card, .tool-card { transition: box-shadow .2s ease; }
  .card:hover, .tool-card:hover { translate: none; }
  .card::after { transition: none; }
}

/* ---------- Parallax-Hintergrund (assets/js/site.js) ----------
   Dekorative Ebenen hinter dem Inhalt mit eigenem Tempo: Punkteraster (ganz hinten,
   zu den Raendern weich ausgeblendet), zwei Ebenen mit weichen orangen Lichtschimmern und
   vorne kleine Lichtpunkte, die schneller als der Inhalt vorbeiziehen.
   Robust beim schnellen Scrollen:
   - Jede Ebene ist nur Bildschirm + eine Kachel hoch (--tile) und wiederholt sich nahtlos.
     Statt den ganzen Scrollweg zu verschieben, wandert sie immer nur um eine Kachel
     (Endlosschleife); so bleibt der Grafikspeicher klein und nichts blitzt leer auf.
   - Wo moeglich direkt an die Scroll-Position gekoppelt (scroll-driven animation): Die
     Anzahl Kachel-Durchlaeufe (--n) setzt site.js aus Scrollweg x Tempo / Kachel.
   - Keine Filter auf bewegten Ebenen. Maus-Verschiebung separat ueber 'translate'.
   Lichtschimmer laufen innerhalb ihrer Kachel vollstaendig aus (keine Kanten an den
   Kachelgrenzen); ein feines Korn glaettet Farbstufen. */
.parallax { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.parallax::after {
  content: ""; position: absolute; inset: 0; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* 60 px Reserve rundum (Maus-Verschiebung) + eine Kachel fuer die Endlosschleife */
.px-layer {
  position: absolute; left: -60px; right: -60px; top: -60px;
  height: calc(100vh + 120px + var(--tile));
  will-change: transform;
  background-repeat: repeat-y;
}
.px-dots-wrap {
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 20%, transparent 100%);
          mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 20%, transparent 100%);
}
.px-dots {
  --tile: 26px;
  background-image: radial-gradient(rgba(255, 255, 255, .11) 1px, transparent 1.6px);
  background-size: 26px 26px;
  background-repeat: repeat;
}
.px-glow-far {
  --tile: 1200px;
  background-image:
    radial-gradient(420px circle at 6% 330px,  rgba(252, 180, 36, .055) 0%, rgba(252, 180, 36, .02) 40%, transparent 70%),
    radial-gradient(460px circle at 95% 860px, rgba(252, 160, 36, .045) 0%, rgba(252, 160, 36, .017) 40%, transparent 70%);
  background-size: 100% 1200px;
}
.px-glow-near {
  --tile: 1100px;
  background-image:
    radial-gradient(360px circle at 90% 290px, rgba(255, 206, 92, .04) 0%, rgba(255, 206, 92, .015) 40%, transparent 70%),
    radial-gradient(380px circle at 10% 800px, rgba(252, 140, 36, .04) 0%, rgba(252, 140, 36, .015) 40%, transparent 70%);
  background-size: 100% 1100px;
}
/* Vorderste Ebene: kleine Lichtpunkte (weicher Hof im Verlauf statt Filter) */
.px-sparks {
  --tile: 1100px;
  background-image:
    radial-gradient(6px circle at 5% 300px,  rgba(255, 206, 92, .38) 0%, rgba(255, 206, 92, .38) 28%, rgba(252, 180, 36, .08) 45%, transparent 100%),
    radial-gradient(5px circle at 94% 820px, rgba(252, 180, 36, .34) 0%, rgba(252, 180, 36, .34) 28%, rgba(252, 180, 36, .07) 45%, transparent 100%);
  background-size: 100% 1100px;
}
/* Endlosschleife um eine Kachel, an die Scroll-Position gekoppelt (sonst Rueckfall in site.js) */
@keyframes px-loop { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-1 * var(--tile)), 0); } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .px-layer {
      animation: px-loop linear both;
      animation-timeline: scroll(root block);
      animation-iteration-count: var(--n, 1);
    }
  }
}
/* Karten-Drift: Karten liegen unten im Bild leicht zurueck und holen nach oben auf.
   Direkt an die Lage der Karte im Bild gekoppelt (view timeline), stufenlos: Stufen
   (ganze Pixel) wirkten beim Scrollen wie Stocken. Rueckfall: site.js. */
@keyframes card-drift { from { transform: translateY(24px); } to { transform: translateY(-24px); } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .card, .tool-card {
      animation: card-drift linear both;
      animation-timeline: view();
      animation-range: cover;
    }
  }
}
/* Fortschrittsleiste ebenfalls direkt an die Scroll-Position gekoppelt */
@keyframes progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@supports (animation-timeline: scroll()) {
  .scroll-progress { animation: progress-grow linear both; animation-timeline: scroll(root block); }
}
/* Schnelles Scrollen: Karten, die man im Flug ueberholt, sofort zeigen (ohne Linien-Animation) */
.reveal .card.instant, .reveal .card.instant *, .reveal .tool-card.instant, .reveal .tool-card.instant * { transition: none !important; }
.instant .trace { display: none; }

/* Maus: Licht folgt dem Zeiger, Punkteraster leuchtet darunter auf */
.px-lit-wrap, .px-spot { opacity: 0; transition: opacity .6s ease; }
.parallax.mouse-on :is(.px-lit-wrap, .px-spot) { opacity: 1; }
.px-dots-wrap.px-lit-wrap {
  -webkit-mask-image: radial-gradient(230px circle at var(--mx, -999px) var(--my, -999px), #000 0%, rgba(0, 0, 0, .45) 35%, transparent 70%);
          mask-image: radial-gradient(230px circle at var(--mx, -999px) var(--my, -999px), #000 0%, rgba(0, 0, 0, .45) 35%, transparent 70%);
}
.px-dots-lit { background-image: radial-gradient(rgba(252, 180, 36, .6) 1.2px, transparent 1.9px); }
.px-spot {
  position: absolute; inset: 0;
  background: radial-gradient(560px circle at var(--mx, -999px) var(--my, -999px), rgba(252, 180, 36, .035) 0%, rgba(252, 180, 36, .012) 40%, transparent 70%);
}
/* Scroll-Fortschrittsleiste */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 200;
  pointer-events: none;
  will-change: transform;
}

.project-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
/* Einheitliche Logo-Kachel: freie Symbole auf Grau, App-Icons fuellen die Kachel */
.project-card .media {
  width: 88px; height: 88px;
  border-radius: 22px;
  background: #f4f5f7;
  padding: 16px;
  display: grid; place-items: center;
}
.project-card .media img { max-width: 100%; max-height: 100%; width: auto; object-fit: contain; }
.project-card .media.fill { padding: 0; background: none; }
.project-card .media.fill img { width: 88px; height: 88px; max-height: none; border-radius: 22px; }
/* Breiter Schriftzug (Lepori.Schule): breitere Kachel, damit das Logo lesbar bleibt */
.project-card:has(.media.wide) { grid-template-columns: 170px minmax(0, 1fr); }
.project-card .media.wide { width: 170px; padding: 14px 16px; }
.project-card .body { min-width: 0; }
/* Kategorie ueber dem Titel: "Art · Bereich" */
.project-card .kicker,
.tool-card .kicker {
  display: block;
  margin: 4px 0;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #6b6b6b;
}
.project-card h2 {
  margin: 0 0 6px;
  font-size: 1.32rem;
  letter-spacing: .01em;
  color: #111;
}
.project-card h2 a { color: #111; }
.project-card h2 a:hover { color: #111; }
/* Ganze Karte klickbar (Titel-Link ueberspannt die Karte) */
.project-card h2 a::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.project-card h2 a:focus-visible { outline: none; }
.project-card:has(h2 a:focus-visible) { box-shadow: 0 0 0 3px var(--accent), 0 18px 40px rgba(0,0,0,.55); }
.project-card p { margin: 0 0 8px; color: #4a4a4a; font-size: .92rem; line-height: 1.6; }
/* Links im Text und Unterlinks liegen ueber dem Karten-Link */
.project-card .body p a,
.project-card .links a { position: relative; z-index: 2; }
.project-card .body p a { color: var(--accent); font-weight: 600; }
.project-card .body p a:hover { color: var(--accent-2); }
/* Unterlinks als Chips */
.project-card .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.project-card .links a {
  padding: 5px 12px;
  border-radius: 999px;
  background: #f4f5f7;
  border: 1px solid #e6e7ea;
  color: #333;
  font-weight: 600;
  font-size: .8rem;
}
.project-card .links a:hover { background: var(--accent); border-color: var(--accent); color: #111; }

/* ---------- Domains (details) ---------- */
.domains-card { text-align: center; }
.domains-card .icon-title { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 0 8px; }
.domains-card h2 { color: #111; margin: 0; }
.domains-card p { margin: 0 0 8px; }
details.domains { margin-top: 14px; margin-bottom: 8px; }
details.domains > summary {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  user-select: none;
}
details.domains > summary::-webkit-details-marker { display: none; }
details.domains > summary .plus { transition: transform .2s ease; font-weight: 700; }
details.domains[open] > summary .plus { transform: rotate(45deg); }
.domain-list {
  list-style: none;
  padding: 0;
  margin: 18px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  max-width: 640px;
}
.domain-list li { display: flex; }
.domain-list li a {
  background: #f3f3f0;
  border: 1px solid #e3e3df;
  color: #333;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.domain-list li a:hover {
  background: #fff6e6;
  border-color: var(--accent);
  color: #111;
}

/* ---------- Tools grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
/* Tool-Karten: gleiche Sprache wie die Projektkarten der Startseite
   (Rundung, Schatten, Kategorie, orange Linie unten nur beim Hover) */
.tool-card {
  background: var(--card);
  color: var(--card-text);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 12px 34px rgba(0,0,0,.5);
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: translate .22s ease, box-shadow .22s ease;
}
.tool-card:hover {
  translate: 0 -3px;
  box-shadow: 0 0 0 1px rgba(252,180,36,.55), 0 18px 40px rgba(0,0,0,.55);
}
.tool-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
}
.tool-card:hover::after { transform: scaleX(1); }
a.tool-card { text-decoration: none; color: inherit; }
.tool-card .thumb {
  margin: 14px 14px 0;
  padding: 14px;
  background: #f4f5f7;
  border-radius: 14px;
  display: grid;
  place-items: center;
}
.tool-card .thumb img {
  width: 100%;
  height: 170px;
  object-fit: contain;
  border-radius: 6px;
}
.tool-body { padding: 14px 20px 24px; }
.tool-card h2 { margin: 0; font-size: 1.12rem; letter-spacing: .01em; color: #111; }
@media (prefers-reduced-motion: reduce) { .tool-card::after { transition: none; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0 40px;
  text-align: center;
}
.site-footer p { margin: 0; color: var(--muted); font-weight: 600; letter-spacing: .04em; font-size: .9rem; }
.site-footer .nav { margin-bottom: 10px; display: flex; gap: 18px; justify-content: center; }
.site-footer .nav a { color: var(--muted); font-weight: 600; }
.site-footer .nav a:hover { color: var(--accent); }

/* ---------- Tool pages ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 12px;
}
.back-link:hover { color: var(--accent); }
.tool-frame {
  position: relative;
  background: #ffffff;
  color: #1a1a1a;
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 12px 34px rgba(0,0,0,.5);
  padding: 26px;
  margin-bottom: 40px;
  /* Tools mit fixem Layout auf schmalen Schirmen horizontal scrollbar machen,
     statt Inhalt abzuschneiden */
  overflow: auto;
}

/* Breiteres Layout für Vollbild-taugliche Tools */
body.tool-wide .container { max-width: 1320px; }

/* Vollbild-Umschalter (sitzt im Tool-Rahmen, auch im Vollbild sichtbar) */
.fs-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: .82rem;
  cursor: pointer;
  opacity: .85;
  transition: opacity .15s ease, background .15s ease;
}
.fs-btn:hover { opacity: 1; background: #000; }
.fs-btn svg { width: 15px; height: 15px; fill: currentColor; }
.fs-btn .fs-label-off { display: none; }
.tool-frame:fullscreen .fs-btn .fs-label-on { display: none; }
.tool-frame:fullscreen .fs-btn .fs-label-off { display: inline; }

/* Tool-Rahmen im nativen Vollbild */
.tool-frame:fullscreen {
  margin: 0;
  border-radius: 0;
  border-bottom: none;
  background-image: none;
  width: 100vw;
  height: 100vh;
  max-width: none;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(16px, 3vw, 56px);
}
.tool-frame:fullscreen .ipvt-root,
.tool-frame:fullscreen .zahlenstrahl-app {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}
/* Zahlenstrahl im Vollbild auch in der Breite mitwachsen lassen (kein Cap) */
.tool-frame:fullscreen .zahlenstrahl-app,
.tool-frame:-webkit-full-screen .zahlenstrahl-app { max-width: none; }
/* Zahlenstrahl: feste 95vh-Höhe aus dem Original aufheben (erzeugte grossen
   Leerraum unter dem Zahlenstrahl, v. a. im Vollbild). Höhe folgt dem Inhalt,
   sodass das Tool im Vollbild sauber vertikal zentriert wird. */
.tool-frame .zahlenstrahl-app { height: auto; }
/* Rahmen des Zahlenstrahls in derselben grauen Farbe wie das Tool (#f4f5f7),
   damit die Fläche wie im Original durchgehend grau ist (statt weissem Rand). */
.tool-frame:has(.zahlenstrahl-app) { background-color: #f4f5f7; }
/* Im Vollbild oben ausrichten, damit der (per JS mitwachsende) Zahlenstrahl
   die Fläche von oben nach unten füllt und die Höhenmessung stabil bleibt. */
.tool-frame:fullscreen:has(.zahlenstrahl-app),
.tool-frame:-webkit-full-screen:has(.zahlenstrahl-app) { justify-content: flex-start; }
/* Webkit-Präfix für :fullscreen */
.tool-frame:-webkit-full-screen {
  margin: 0; border-radius: 0; border-bottom: none;
  width: 100vw; height: 100vh; max-width: none; overflow: auto;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(16px, 3vw, 56px);
}
.tool-frame :is(input, button, select, textarea) { font-family: inherit; }
.tool-frame--bare {
  background: transparent;
  box-shadow: none;
  border-bottom: none;
  padding: 0;
  display: flex;
  justify-content: center;
}
.tool-intro {
  text-align: center;
  color: var(--muted);
  max-width: 640px;
  margin: -10px auto 26px;
}

/* QR tool (scoped – original used global body rules) */
.qr-tool { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.qr-tool #qrCode { width: auto; display: flex; justify-content: center; align-items: center; }
.qr-tool #qrCode img, .qr-tool #qrCode canvas { max-width: 100%; height: auto; }
.qr-tool #qrInput {
  width: 100%; max-width: 520px; padding: 12px 14px; font-size: 16px;
  color: #333; text-align: center; border: 1px solid #ccc; border-radius: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-header { text-align: center; }
  .site-header .container { align-items: center; }
  /* Logo klein links neben Kategorie + Titel, Text darunter ueber die ganze Breite */
  .project-card { grid-template-columns: 52px minmax(0, 1fr); gap: 4px 14px; padding: 18px; }
  .project-card .body { display: contents; }
  .project-card .media { grid-row: 1 / 3; align-self: center; width: 52px; height: 52px; border-radius: 14px; padding: 10px; }
  .project-card .media.fill { padding: 0; }
  .project-card .media.fill img { width: 52px; height: 52px; border-radius: 14px; }
  .project-card:has(.media.wide) { grid-template-columns: 128px minmax(0, 1fr); }
  .project-card .media.wide { width: 128px; padding: 8px 10px; }
  .project-card .kicker { grid-column: 2; margin: 0; align-self: end; }
  .project-card h2 { grid-column: 2; margin: 0; align-self: start; font-size: 1.15rem; }
  .project-card p,
  .project-card .links { grid-column: 1 / -1; margin-top: 8px; }
  .tools-grid { grid-template-columns: 1fr; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
/* Schriften auf Smartphones kleiner – reduziert die Root-Schriftgrösse,
   wodurch alle rem-/clamp-basierten Schriften proportional mitskalieren. */
@media (max-width: 600px) {
  html { font-size: 15px; }
}
@media (max-width: 400px) {
  html { font-size: 13.5px; }
  /* Breiter Schriftzug: eigene Zeile, sonst reicht der Platz fuer den Titel nicht */
  .project-card:has(.media.wide) { grid-template-columns: minmax(0, 1fr); }
  .project-card .media.wide { grid-row: auto; justify-self: start; margin-bottom: 8px; }
  .project-card:has(.media.wide) :is(.kicker, h2) { grid-column: 1; }
}
