/* ═══════════════════════════════════════════════════════════════════════════════
   Let's Fib! — Common Styles (shared by article.css + blog.css)
   Fonts, CSS Variables, Reset, Header, Hamburger Menu, Language Switch, Footer
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Inter – self-hosted variable font (wght 400–800) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/inter-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/inter-greek.woff2') format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/inter-greek-ext.woff2') format('woff2');
  unicode-range: U+1F00-1FFF;
}

:root {
  --bg: #ede5dd;
  --bg-card: #fdf9f5;
  --bg-highlight: linear-gradient(135deg, #fdf9f5 0%, #fff4ec 100%);
  --border: #d4cabc;
  --border-highlight: #F97316;
  --text: #2a1a14;
  --text-muted: #7b6a60;
  --link: #DC6B20;
  --link-hover: #b85410;
  --logo-accent: #F97316;
  --tag-default-bg: #e8ecf1; --tag-default-fg: #374151;
  --tag-free-bg: #dff9f0; --tag-free-fg: #0d7351;
  --tag-paid-bg: #fef3cd; --tag-paid-fg: #8a6d12;
  --tag-browser-bg: #e0f2fe; --tag-browser-fg: #0369a1;
  --tag-app-bg: #f3e8ff; --tag-app-fg: #7c3aed;
  --tag-recommended-bg: linear-gradient(135deg, #fff8e1, #ffecb3); --tag-recommended-fg: #b45309; --tag-recommended-border: #fbbf24;
  --tag-chill-bg: #e0f2fe; --tag-chill-fg: #0c4a6e;
  --tag-action-bg: #fef0c7; --tag-action-fg: #92400e;
  --tag-cozy-bg: #ede9fe; --tag-cozy-fg: #5b21b6;
  --cta-bg: linear-gradient(135deg, #fdf9f5 0%, #fff4ec 100%);
  --cta-btn: linear-gradient(135deg, #F97316, #DC6B20);
  --cta-btn-text: #fff;
  --cta-btn-shadow: rgba(249, 115, 22, 0.3);
  --highlight-shadow: 0 2px 12px rgba(249, 115, 22, 0.15);
  --accent-rgb: 249, 115, 22;
  --sticky-cta-clearance: 96px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181d;
    --bg-card: #262a31;
    --bg-highlight: linear-gradient(135deg, #262a31 0%, #2e2118 100%);
    --border: #2d323a;
    --border-highlight: #FB923C;
    --text: #ececef;
    --text-muted: #9ca3af;
    --link: #FB923C;
    --link-hover: #FDBA74;
    --logo-accent: #FB923C;
    --tag-default-bg: #374151; --tag-default-fg: #e5e7eb;
    --tag-free-bg: #0d3b2a; --tag-free-fg: #6ee7b7;
    --tag-paid-bg: #3b2e0f; --tag-paid-fg: #fcd34d;
    --tag-browser-bg: #172554; --tag-browser-fg: #a5b4fc;
    --tag-app-bg: #2e1065; --tag-app-fg: #d8b4fe;
    --tag-recommended-bg: linear-gradient(135deg, #422a08, #5a3a0e); --tag-recommended-fg: #fbbf24; --tag-recommended-border: #92400e;
    --tag-chill-bg: #0c4a6e; --tag-chill-fg: #bae6fd;
    --tag-action-bg: #78350f; --tag-action-fg: #fde68a;
    --tag-cozy-bg: #3b0764; --tag-cozy-fg: #ddd6fe;
    --cta-bg: linear-gradient(135deg, #262a31 0%, #2e2118 100%);
    --cta-btn: linear-gradient(135deg, #FB923C, #DC6B20);
    --cta-btn-text: #15181d;
    --cta-btn-shadow: rgba(251, 146, 60, 0.25);
    --highlight-shadow: 0 2px 12px rgba(251, 146, 60, 0.1);
    --accent-rgb: 251, 146, 60;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Base
   ═══════════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

strong { color: var(--text); }

/* ═══════════════════════════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════════════════════════ */

.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0.85em;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; color: var(--text); }
.logo span { color: var(--logo-accent); }
.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
  border-radius: 50%;
}
.back-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); text-decoration: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.header-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.header-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}
.header-btn-primary {
  background: var(--cta-btn);
  color: var(--cta-btn-text);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.header-btn-primary:hover {
  box-shadow: 0 4px 12px var(--cta-btn-shadow);
  color: var(--cta-btn-text);
}

/* Hamburger button */
.hamburger-btn {
  background: none;
  border: none;
  padding: 0.35rem 0.2rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}
.hamburger-btn:hover {
  color: var(--text);
}

.lang-geo-icon {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.25rem 0.3rem 0.25rem 0.35rem;
  margin-right: 0.2rem;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.lang-geo-icon img {
  display: block;
  width: 28px;
  height: 21px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.lang-geo-icon-chev {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  transition: transform 0.2s, color 0.2s;
}
.lang-geo-icon:hover {
  text-decoration: none;
  background-color: rgba(var(--accent-rgb), 0.08);
}
.lang-geo-icon:hover .lang-geo-icon-chev {
  color: var(--accent);
  transform: translateX(2px);
}
.lang-geo-icon:hover img {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
@keyframes lang-geo-pulse {
  0%, 100% { transform: translateY(0); }
  35%      { transform: translateY(-3px); }
  70%      { transform: translateY(0); }
}

/* Dropdown menu */
.header-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.35rem;
  z-index: 20;
  min-width: 240px;
  animation: menuFadeIn 0.15s ease-out;
}
/* Arrow pointing up to hamburger button */
.header-menu::before {
  content: '';
  position: absolute;
  top: -7px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.header-menu[hidden] {
  display: none;
}
.header-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}
.header-menu-item:hover {
  background: var(--border);
  text-decoration: none;
}
.menu-icon {
  flex-shrink: 0;
  opacity: 0.6;
}
.header-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.3rem 0.5rem;
}
.lang-switch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.3rem 0.4rem;
}
.lang-switch-item {
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.lang-switch-item:hover {
  background: var(--border);
  color: var(--text);
  text-decoration: none;
}
.lang-switch-active,
.lang-switch-active:hover {
  background: var(--logo-accent);
  color: #fff;
  cursor: default;
}

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════════
   Sticky CTA bar (permanent; layout toggled via body.has-sticky-cta from JS)
   ═══════════════════════════════════════════════════════════════════════════════ */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom);
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem;
  pointer-events: none; /* Padding-Bereich klickt durch */
  transform: translateY(120%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sticky-cta.is-visible {
  transform: translateY(0);
}

.sticky-cta-pill {
  position: relative;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 280px;
  padding: 0.3rem 1.8rem 0.3rem 0.3rem;
  border-radius: 999px;
  background: var(--cta-btn);
  color: var(--cta-btn-text);
  text-decoration: none;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.18),
    0 2px 6px rgba(0, 0, 0, 0.08),
    0 0 32px rgba(var(--accent-rgb), 0.4);
  transition: box-shadow 0.2s, transform 0.15s;
}
.sticky-cta-pill:hover {
  text-decoration: none;
  color: var(--cta-btn-text);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    0 2px 6px rgba(0, 0, 0, 0.1),
    0 0 40px rgba(var(--accent-rgb), 0.55);
  transform: translateY(-2px);
}
.sticky-cta-pill:active {
  transform: translateY(1px);
  box-shadow:
    0 3px 10px rgba(0, 0, 0, 0.15),
    0 0 22px rgba(var(--accent-rgb), 0.3);
}

@keyframes sticky-cta-bob {
  0%, 100% { transform: translateY(0); }
  50%     { transform: translateY(-3px); }
}
.sticky-cta-mascot-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 1px 3px rgba(0, 0, 0, 0.15);
  animation: sticky-cta-bob 2.4s ease-in-out infinite;
  will-change: transform;
}
.sticky-cta-mascot {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 50%;
}
.sticky-cta-pill:hover .sticky-cta-mascot {
  transform: rotate(-6deg) scale(1.06);
  transition: transform 0.2s ease-out;
}
.sticky-cta-sparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 12px;
  height: 12px;
  pointer-events: none;
  background: var(--logo-accent);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
  filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.55));
}
.sticky-cta.is-visible .sticky-cta-sparkle {
  animation: sticky-cta-sparkle 0.8s ease-out var(--d, 0s) forwards;
}
@keyframes sticky-cta-sparkle {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1.3) rotate(60deg); }
  70%  { opacity: 1; transform: translate(-50%, -50%) scale(0.9) rotate(140deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(220deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sticky-cta-mascot-wrap { animation: none; will-change: auto; }
  .sticky-cta-sparkle { display: none; }
}

.sticky-cta-label {
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}

/* Sticky-Pill aktiv: header un-sticky + slimmer + ohne CTA-Button.
   Die Sticky-Pill übernimmt die Conversion-Rolle, der Header scrollt mit weg.
   Footer braucht Bottom-Padding, damit er nicht hinter der Pill verschwindet. */
body.has-sticky-cta {
  padding-bottom: calc(var(--sticky-cta-clearance) + env(safe-area-inset-bottom));
}
body.has-sticky-cta .site-header {
  position: static;
  padding: 0.55rem 0.85em;
}
body.has-sticky-cta .header-btn-primary {
  display: none;
}
body.has-sticky-cta .lang-geo-icon.is-ready {
  display: inline-flex;
  animation: lang-geo-pulse 0.9s ease-out 1.2s 2;
}
