/* ============================================================
   WirStartenKI — Brand SHELL (chrome only, site-wide)
   Tokens · topographic background · header · language dropdown ·
   footer · mobile menu. Buttons are scoped to the chrome so inner
   app content keeps its own styling. The two fully-redesigned pages
   (landing, dashboard) additionally load the complete brand.css.
   ============================================================ */

:root {
  --bg-deep: #03131F;
  --bg-primary: #051C2C;
  --bg-raised: #07273C;
  --bg-card: rgba(255,255,255,0.025);
  --bg-card-hover: rgba(255,255,255,0.05);

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255,255,255,0.72);
  --text-muted: rgba(255,255,255,0.46);
  --text-faint: rgba(255,255,255,0.28);

  --accent-rgb: 0,212,255;
  --accent: #00D4FF;
  --accent-hover: #5BE4FF;
  --accent-deep: #0090B8;
  --accent-glow: rgba(var(--accent-rgb),0.28);
  --accent-wash: rgba(var(--accent-rgb),0.07);
  --accent-bd: rgba(var(--accent-rgb),0.24);
  --accent-bd-strong: rgba(var(--accent-rgb),0.30);
  --accent-ink: #03131F;

  --glass-bg: rgba(255,255,255,0.08);
  --glass-bd: rgba(255,255,255,0.18);
  --glass-blur: blur(22px) saturate(165%);
  --shadow-card: 0 30px 70px -38px rgba(0,0,0,0.72);
  --shadow-float: 0 24px 60px -22px rgba(0,0,0,0.78);

  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --hairline: rgba(255,255,255,0.06);

  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --t-kicker: 12.5px;

  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 18px;
  --radius-sm: 11px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --motion: 1;
}

/* ---- Focus rings for chrome controls ---- */
.header .nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.langdd-btn:focus-visible, .langdd-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 11px; }

/* ============================================================
   BACKGROUND — topographic / summit motif
   ============================================================ */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-grad {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(var(--accent-rgb),0.10) 0%, transparent 45%),
    radial-gradient(90% 60% at 88% 8%, rgba(var(--accent-rgb),0.06) 0%, transparent 50%),
    radial-gradient(70% 55% at 6% 92%, rgba(var(--accent-rgb),0.05) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-primary) 22%, var(--bg-primary) 100%);
}
.bg-topo { position: absolute; inset: -12% -12% -12% -12%; opacity: 0.46; will-change: transform; }
.bg-topo svg { width: 100%; height: 100%; overflow: visible; display: block; }
.bg-topo path { fill: none; stroke: var(--accent); stroke-width: 0.85; }
.bg-orb { position: absolute; border-radius: 50%; filter: blur(66px); mix-blend-mode: screen; pointer-events: none; will-change: transform; }
.bg-orb.o1 { width: 48vw; height: 48vw; left: -13vw; top: -12vw; background: radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb),0.17), transparent 62%); animation: orb1 calc(36s / var(--motion)) ease-in-out infinite; }
.bg-orb.o2 { width: 44vw; height: 44vw; right: -15vw; bottom: -12vw; background: radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb),0.11), transparent 62%); animation: orb2 calc(50s / var(--motion)) ease-in-out infinite; }
@keyframes orb1 { 0%,100% { transform: translate3d(0,0,0); } 33% { transform: translate3d(7vw,5vw,0); } 66% { transform: translate3d(2vw,-5vw,0); } }
@keyframes orb2 { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(-6vw,-6vw,0); } }
.bg-grain {
  position: absolute; inset: 0; opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(calc(-2.2% * var(--motion)), calc(1.8% * var(--motion)), 0) rotate(calc(0.8deg * var(--motion))) scale(1.05); }
  100% { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
}
.bg-topo.animate { animation: drift calc(42s / var(--motion)) ease-in-out infinite; }

/* ---- shared layout primitive ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); position: relative; z-index: 1; }
/* Keep page content above the fixed topographic background */
body > main, main { position: relative; z-index: 1; }

/* ============================================================
   BUTTONS — scoped to chrome so inner content is untouched
   ============================================================ */
.header .btn, .mobile-menu .btn, .footer .btn {
  --pad-y: 14px; --pad-x: 26px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .3s var(--ease), background .25s var(--ease-out),
              border-color .25s var(--ease-out), box-shadow .35s var(--ease), color .2s;
}
.header .btn svg, .mobile-menu .btn svg, .footer .btn svg { width: 17px; height: 17px; transition: transform .3s var(--ease); }
.header .btn-primary, .mobile-menu .btn-primary, .footer .btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 24px -6px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.35);
}
.header .btn-primary:hover, .mobile-menu .btn-primary:hover, .footer .btn-primary:hover {
  background: var(--accent-hover); transform: translateY(-2px);
  box-shadow: 0 14px 40px -8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.45);
}
.header .btn-primary:hover svg, .mobile-menu .btn-primary:hover svg { transform: translateX(3px); }
.header .btn-lg, .mobile-menu .btn-lg, .footer .btn-lg { --pad-y: 17px; --pad-x: 34px; font-size: 16px; }
.header .btn-block, .mobile-menu .btn-block, .footer .btn-block { width: 100%; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky; top: 0; z-index: 1000;
  transition: background .3s var(--ease-out), border-color .3s, padding .3s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: rgba(5,28,44,0.66);
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border-bottom-color: var(--border);
  box-shadow: 0 12px 40px -28px rgba(0,0,0,0.9);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; transition: height .3s var(--ease-out); }
.header.scrolled .header-inner { height: 64px; }

.header .brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-primary); }
.brand-name { font-size: 18.5px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); }
.brand-name b { font-weight: 700; }
.brand-logo { height: 48px; width: auto; display: block; transition: height .3s var(--ease-out); }
.header.scrolled .brand-logo { height: 42px; }
@media (max-width: 600px) { .brand-logo { height: 38px; } }

.header .nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 2.2vw, 32px); }
.header .nav-link { color: var(--text-secondary); text-decoration: none; font-size: 14.5px; font-weight: 500; position: relative; transition: color .2s; }
.header .nav-link::after { content:""; position:absolute; left:0; right:100%; bottom:-5px; height:1px; background: var(--accent); transition: right .3s var(--ease); }
.header .nav-link:hover { color: var(--text-primary); }
.header .nav-link:hover::after { right: 0; }
.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; cursor: pointer; width: 40px; height: 40px; }

/* ---- language dropdown ---- */
.langdd { position: relative; }
.langdd-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-strong); border-radius: 11px; color: var(--text-secondary); cursor: pointer; font-family: var(--font-sans); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: all .2s; }
.langdd-btn:hover { color: var(--text-primary); border-color: var(--accent-bd-strong); background: rgba(255,255,255,0.08); }
.langdd-flag { font-size: 15px; line-height: 1; margin-right: 1px; filter: saturate(1.05); }
.langdd-btn > svg:last-child { width: 13px; height: 13px; transition: transform .28s var(--ease); opacity: 0.7; }
.langdd.open .langdd-btn { color: var(--text-primary); border-color: var(--accent-bd-strong); }
.langdd.open .langdd-btn > svg:last-child { transform: rotate(180deg); }
.langdd-menu {
  position: absolute; top: calc(100% + 10px); right: 0; width: 188px; max-height: 420px; overflow-y: auto;
  padding: 7px;
  background: linear-gradient(180deg, rgba(10,38,58,0.86), rgba(5,24,38,0.92));
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.16); border-radius: 16px;
  box-shadow: 0 30px 70px -26px rgba(0,0,0,0.85), inset 0 1px 0 rgba(255,255,255,0.16);
  opacity: 0; transform: translateY(-8px) scale(0.98); transform-origin: top right; pointer-events: none;
  transition: opacity .24s var(--ease), transform .24s var(--ease);
  margin: 0;
}
.langdd-menu::-webkit-scrollbar { width: 6px; }
.langdd-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 100px; }
.langdd.open .langdd-menu { opacity: 1; transform: none; pointer-events: auto; }
.langdd-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  background: transparent; border: 1px solid transparent; border-radius: 11px;
  color: var(--text-secondary); font-family: var(--font-sans); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: background .16s, color .16s, border-color .16s;
}
.langdd-menu .lc {
  flex: none; display: inline-grid; place-items: center; width: 34px; height: 26px; border-radius: 7px;
  font-size: 17px; line-height: 1; letter-spacing: 0;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text-muted);
  transition: all .16s;
}
.langdd-menu .ln { flex: 1; text-align: left; }
.langdd-menu button:hover { background: rgba(255,255,255,0.07); color: var(--text-primary); }
.langdd-menu button:hover .lc { color: var(--text-secondary); border-color: var(--border-strong); }
.langdd-menu button.active {
  background: linear-gradient(180deg, rgba(var(--accent-rgb),0.16), rgba(var(--accent-rgb),0.07));
  border-color: var(--accent-bd-strong); color: var(--text-primary);
}
.langdd-menu button.active .lc { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.langdd-menu button .ck { width: 16px; height: 16px; color: var(--accent); opacity: 0; flex: none; }
.langdd-menu button.active .ck { opacity: 1; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--border); padding-block: clamp(56px, 7vw, 88px) 32px; position: relative; z-index: 1; background: transparent; }
.footer .wrap { position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: clamp(28px, 4vw, 56px); margin-bottom: clamp(40px, 5vw, 64px); }
.footer-brand .brand { display: inline-flex; align-items: center; margin-bottom: 18px; text-decoration: none; }
.footer-brand .brand-logo { height: 56px; }
.footer-brand p { font-size: 14.5px; color: var(--text-muted); max-width: 32ch; line-height: 1.6; }
.footer-col h4 { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 18px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; }
.footer-col a { color: var(--text-secondary); text-decoration: none; font-size: 14.5px; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 28px; border-top: 1px solid var(--hairline); flex-wrap: wrap; }
.footer-legal { display: flex; gap: 24px; list-style: none; flex-wrap: wrap; margin: 0; padding: 0; }
.footer-legal a { color: var(--text-muted); text-decoration: none; font-size: 13px; transition: color .2s; }
.footer-legal a:hover { color: var(--text-primary); }
.footer-copy { font-size: 13px; color: var(--text-faint); }

/* ============================================================
   MOBILE MENU
   ============================================================ */
.mobile-menu { position: fixed; inset: 0; z-index: 1100; background: rgba(3,19,31,0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); display: flex; flex-direction: column; padding: 24px var(--gutter); opacity: 0; pointer-events: none; transition: opacity .3s; }
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu-top { display:flex; align-items:center; justify-content: space-between; height: 52px; margin-bottom: 24px; }
.mobile-menu nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu nav a { font-family: var(--font-serif); font-size: 30px; font-weight: 600; color: var(--text-primary); text-decoration: none; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.mobile-menu .btn { margin-top: 28px; }

/* ============================================================
   RESPONSIVE — chrome only
   ============================================================ */
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .header .nav-right .btn-primary { display: none; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-topo.animate, .bg-orb { animation: none; }
}
