/* Gemeinsames Chrome (Header, Footer, Buttons, Theme) für die Unterseiten unter /tools.
   Die beiden index-Dateien bleiben bewusst eigenständig mit eigenem inline-CSS. */

/* Inter (variable, self-hosted) - Lizenz: fonts/LICENSE-OFL.txt */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(./fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
}

:root {
  --accent: #E91E63;
  --accent-hover: #d4145a;
  --accent-soft: rgba(233, 30, 99, 0.09);
  --bg: #ffffff;
  --bg-raised: #f6f7f9;
  --ink: #191c23;
  --ink-soft: #4b5262;
  --ink-faint: #8a90a0;
  --line: #e4e6ec;
  --card: #ffffff;
  --card-shadow: 0 1px 2px rgba(20, 22, 30, .05), 0 8px 24px -12px rgba(20, 22, 30, .12);
  --hex: url(./what-the-hex.webp);
  --header-bg: rgba(255, 255, 255, .82);
  --ok: #17a673;
}
html[data-theme="dark"] {
  --bg: #171a22;
  --bg-raised: #1e222d;
  --ink: #e9ebf2;
  --ink-soft: #aab0c0;
  --ink-faint: #767d8f;
  --line: #2b3040;
  --card: #222733;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px -12px rgba(0, 0, 0, .5);
  --hex: url(./what-the-hex-dark.webp);
  --header-bg: rgba(23, 26, 34, .82);
  --ok: #2ecc9a;
}

* { box-sizing: border-box; }
/* Ohne !important gewinnt jedes eigene display: (z. B. .badge) gegen das
   [hidden] des Browsers - das Attribut bliebe dann wirkungslos. */
[hidden] { display: none !important; }
html, body { padding: 0; margin: 0; }
body {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  transition: background-color .25s ease, color .25s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
::selection { background: var(--accent); color: #fff; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; width: 100%; }
main { flex: 1 0 auto; }

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  /* Etwas weiter als der 1060er-Inhalt darunter: die volle Nav (Apps + Tools +
     Links) passt sonst nicht kollisionsfrei neben Wortmarke und Aktionen. */
  max-width: 1160px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.brand-name { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name b { font-weight: 700; font-size: .95rem; white-space: nowrap; }
.brand-name span { font-weight: 400; font-size: .78rem; color: var(--ink-soft); white-space: nowrap; }
nav { display: flex; align-items: center; gap: 2px; }
nav a.nav-link, nav .nav-toggle {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  padding: 8px 9px;
  border-radius: 8px;
  transition: color .15s ease, background-color .15s ease;
}
nav a.nav-link:hover, nav .nav-toggle:hover { color: var(--ink); background: var(--accent-soft); }
nav a.nav-link.active, nav .nav-toggle.active { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* Burger nur auf Mobile sichtbar; auf Desktop verhält sich .header-collapse
   dank display:contents so, als wären nav + Aktionen direkte Header-Kinder. */
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-burger:hover { color: var(--accent); border-color: var(--accent); }
.nav-burger svg { width: 22px; height: 22px; }
.nav-burger .burger-close { display: none; }
header[data-menu="open"] .nav-burger .burger-open { display: none; }
header[data-menu="open"] .nav-burger .burger-close { display: inline; }
.header-collapse { display: contents; }

/* ---------- Nav-Dropdown ---------- */
.nav-dropdown { position: relative; }
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle .caret { width: 13px; height: 13px; transition: transform .2s ease; }
.nav-dropdown[data-open="true"] .nav-toggle .caret { transform: rotate(180deg); }
.nav-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 226px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
/* unsichtbare Brücke, damit der Hover über der 8px-Lücke nicht abreißt */
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav-dropdown:hover .nav-menu,
.nav-dropdown:focus-within .nav-menu,
.nav-dropdown[data-open="true"] .nav-menu { opacity: 1; visibility: visible; transform: none; }
.nav-menu a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .92rem;
  font-weight: 500;
  white-space: nowrap;
}
.nav-menu a:hover { background: var(--accent-soft); color: var(--accent); }
.nav-menu a[aria-current="page"] { color: var(--accent); }
.nav-menu a svg { width: 17px; height: 17px; flex-shrink: 0; }
/* Echte App-Icons (Apps-Dropdown): kleine gerundete Kacheln statt Glyphen */
.nav-menu a img { width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(120, 120, 120, .18); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px -4px rgba(233, 30, 99, .5); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 13px; font-size: .87rem; border-radius: 9px; }
.btn-sm svg { width: 16px; height: 16px; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 19px; height: 19px; }
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  font-size: .82rem;
  font-weight: 600;
}
.lang-switch a, .lang-switch .lang-active {
  padding: 5px 9px;
  border-radius: 7px;
  text-decoration: none;
}
.lang-switch .lang-active { background: var(--accent-soft); color: var(--accent); }
.lang-switch a { color: var(--ink-soft); }
.lang-switch a:hover { color: var(--accent); }
html[data-theme="dark"] .icon-moon { display: none; }
html:not([data-theme="dark"]) .icon-sun { display: none; }

/* ---------- Seitenkopf der Unterseiten ---------- */
.page-head {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image: var(--hex);
}
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 72% 15%, var(--accent-soft), transparent 70%),
    linear-gradient(to bottom, transparent, var(--bg) 97%);
  pointer-events: none;
}
.page-head-inner {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
  padding: 54px 24px 46px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.crumbs { font-size: .84rem; color: var(--ink-faint); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.page-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.8rem); font-weight: 800; }
.page-head h1 em { font-style: normal; color: var(--accent); }
.page-head p { margin: 0; max-width: 640px; color: var(--ink-soft); font-size: 1.02rem; }

/* ---------- Karten ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px;
  box-shadow: var(--card-shadow);
}
.card h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.card .hint { margin: 0 0 20px; font-size: .9rem; color: var(--ink-soft); }

/* ---------- Gemeinsame Bausteine der Tool-Seiten ----------
   chmod- und Emoji-Seite deklarieren einen Teil davon noch inline; das ist
   nur eine Wiederholung derselben Werte und überschreibt hier nichts Fremdes. */
.tool-section { padding: 40px 0 72px; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0 20px; }
.field-label {
  display: block;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
.text-input, .text-area {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--ink);
  font-family: inherit;
  font-size: .95rem;
}
.text-area { line-height: 1.55; resize: vertical; min-height: 190px; }
.text-input:focus, .text-area:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.text-input.invalid, .text-area.invalid { border-color: #e5484d; }
.opt-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-soft); }
.opt-row input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.count { font-size: .8rem; color: var(--ink-faint); }
.status { font-size: .88rem; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.status svg { width: 16px; height: 16px; }
.status.ok { color: var(--ok); }
.status.bad { color: #e5484d; }
.error-msg {
  font-size: .88rem;
  color: #e5484d;
  background: rgba(229, 72, 77, .09);
  border: 1px solid rgba(229, 72, 77, .3);
  border-radius: 10px;
  padding: 9px 12px;
  margin: 12px 0 0;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--bg);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 60;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 9px;
}
.toast svg { width: 17px; height: 17px; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- Footer ---------- */
footer {
  background: var(--bg-raised);
  border-top: 1px solid var(--line);
  font-size: .84rem;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.footer-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 24px 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 36px;
}
footer h3 { font-size: .95rem; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
footer p { margin: 0; line-height: 1.8; }
footer a { color: inherit; }
footer a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 24px;
  text-align: center;
  font-size: .8rem;
  color: var(--ink-faint);
}

/* ---------- Responsive ---------- */
/* Ab ~940px passen Brand + Nav + Aktionen nicht mehr kollisionsfrei nebeneinander
   (~1056px nötig): Nav + Aktionen wandern ins Burger-Panel. Im Band 941-1080px wird
   zuerst nur der Wortmarken-Text weggelassen, damit die volle Nav auf kleinen Laptops
   erhalten bleibt. */
@media only screen and (max-width: 960px) {
  .nav-burger { display: inline-flex; }
  .header-collapse {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 28px -16px rgba(0, 0, 0, .4);
    padding: 12px 24px 20px;
  }
  header[data-menu="open"] .header-collapse { display: flex; }
  nav { flex-direction: column; align-items: stretch; gap: 2px; }
  nav a.nav-link, nav .nav-toggle { padding: 11px 12px; font-size: 1rem; }
  .nav-dropdown { width: 100%; }
  .nav-toggle { width: 100%; justify-content: space-between; }
  .nav-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--line);
    border-radius: 0;
    margin: 2px 0 4px 12px;
    padding: 2px 0;
    min-width: 0;
  }
  .nav-menu::before { display: none; }
  .nav-dropdown[data-open="true"] .nav-menu { display: flex; }
  .header-actions {
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
  .header-actions .btn-primary { flex: 1 1 100%; justify-content: center; }
  header[data-menu="open"] .header-cta-label { display: inline; }
}
@media only screen and (min-width: 961px) and (max-width: 1139px) {
  .brand-name { display: none; }
}
@media only screen and (max-width: 560px) {
  .header-inner { padding: 12px 16px; }
  .header-collapse { padding-left: 16px; padding-right: 16px; }
  .brand-name { display: none; }
  .header-cta-label { display: none; }
  .page-head-inner { padding: 40px 20px 36px; }
}
