/* ============================================================
   FinanzHub — Editorial base
   Brass accent, dark background, Big Shoulders + Cormorant + Inter
   ============================================================ */

/* Mono Design System — pures Schwarz/Grau, Weiß-Akzent (Vercel/Linear).
   Grün/Rot NUR für Geldbeträge. Eine Schrift: Inter. */
:root {
  --bg:        #060606;
  --bg-2:      #0F0F0F;
  --ink:       #FFFFFF;
  --ink-soft:  #999999;
  --ink-mute:  #555555;
  --ink-dim:   rgba(255,255,255,.22);
  --line:      rgba(255,255,255,.07);
  --line-hi:   rgba(255,255,255,.13);
  --card:      #181818;
  --card-2:    #222222;
  --surface-2: #1C1C1C;
  --surface-3: #222222;

  --accent:    #FFFFFF;        /* Weiß = einziger Akzent */
  --accent-2:  #E5E5E5;
  --accent-soft: rgba(255,255,255,.07);
  --accent-ink: #060606;
  --pos:       #4ADE80;        /* Einnahmen */
  --neg:       #F87171;        /* Ausgaben */

  --font-display: "Inter", system-ui, sans-serif;
  --font-italic:  "Inter", system-ui, sans-serif;
  --font-ui:      "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --radius:     8px;
  --radius-lg:  12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #060606; color: var(--ink); }
html { overflow-x: hidden; }
body {
  font-family: var(--font-ui);
  font-weight: 300;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  /* Force smooth wheel-scroll instead of browser zoom on Ctrl+wheel */
  overscroll-behavior-y: auto;
  /* Lange deutsche Wörter brechen sauber — Trennstriche wo möglich, sonst Wortumbruch */
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  hyphenate-limit-chars: 7 4 3;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}
/* Headlines: Optisch ausgewogene Zeilenumbrüche & sauberer Wortbruch */
h1, h2, h3 {
  text-wrap: balance;
  word-break: normal;
  overflow-wrap: break-word;
}
/* Mono-Zahlen sauber ausrichten (€-Beträge) */
.fmt-num, [class*="-num"], [class*="num-"], code, kbd, samp, pre {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
/* Display-Schrift: bessere Tracking-Anpassung für Großbuchstaben */
[class*="display"], h1, h2, .features-h2, .tools-h2, .feature-title, .tool-title {
  font-feature-settings: "ss01" 1, "kern" 1;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, select, textarea { font: inherit; color: inherit; }

/* ===== Stage: shared background image + grain across views ===== */
.stage {
  position: fixed; inset: 0; z-index: 0;
  background: var(--bg);
  pointer-events: none;
  overflow: hidden;
}
.bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity .9s ease, filter 1.6s ease, transform 1.6s ease;
  will-change: opacity, filter, transform;
}
.bg::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8,8,10,.55) 0%, rgba(8,8,10,.18) 28%, rgba(8,8,10,.20) 60%, rgba(8,8,10,.85) 100%),
    radial-gradient(120% 80% at 80% 60%, rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 100%);
}
/* Dashboard view: dim + slight blur of background image — keeps editorial bridge */
body.view-dashboard .bg,
body.view-transactions .bg,
body.view-budget .bg,
body.view-invest .bg {
  opacity: .22;
  filter: blur(8px) saturate(.8);
  transform: scale(1.04);
}
.grain {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ===== App root sits above stage ===== */
#app-root {
  position: relative; z-index: 2;
  min-height: 100vh;
}

/* ===== Frame + Sheet shells ===== */
.frame {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 36px 48px 36px;
}
.sheet {
  position: relative;
  min-height: 100vh;
  display: grid; grid-template-rows: auto 1fr;
  padding: 36px 48px 36px;
}
@media (max-width: 780px) {
  .frame, .sheet { padding: 24px 22px; }
}

/* ===== Top navigation (mark + actions) ===== */
.nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 24px;
}
.mark {
  display: flex; align-items: center; gap: 14px;
  letter-spacing: .02em;
  cursor: pointer;
}
.mark-glyph {
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center;
}
.mark-glyph svg { width: 18px; height: 18px; color: var(--accent); }
.mark-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px; letter-spacing: .18em;
  text-transform: uppercase;
}
.mark-name em {
  font-family: var(--font-italic);
  font-style: normal; font-weight: 500;
  text-transform: none; letter-spacing: 0;
  color: var(--ink-soft);
  margin-left: 6px;
  font-size: 16px;
}

.nav-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 16px 11px 18px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 13px; font-weight: 500; letter-spacing: .01em;
  transition: transform .2s ease, box-shadow .2s ease;
}
.pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px rgba(255,255,255,.25);
}
.pill .ico {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg); color: var(--ink);
  display: grid; place-items: center;
}
.pill .ico svg { width: 13px; height: 13px; }
.ghost-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px; letter-spacing: .06em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.ghost-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 0 4px rgba(124,252,154,.18);
}

/* Countdown-Pill (arty) — nächster Termin in der Nav */
.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8,8,10,.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--ink-soft);
  position: relative;
  overflow: hidden;
}
.countdown-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  background-size: 220% 100%;
  background-position: 100% 0;
  animation: countdown-shimmer 4.5s linear infinite;
  pointer-events: none;
  opacity: .7;
}
.countdown-pill.is-empty::before { animation: none; opacity: .25; }
@keyframes countdown-shimmer {
  0%   { background-position: 120% 0; }
  100% { background-position: -120% 0; }
}
.countdown-arc {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  background:
    conic-gradient(var(--accent) 0deg, var(--accent) 90deg, transparent 90deg, transparent 360deg);
  -webkit-mask: radial-gradient(circle, transparent 4px, #000 5px);
          mask: radial-gradient(circle, transparent 4px, #000 5px);
  animation: countdown-spin 6s linear infinite;
}
.countdown-pill.is-empty .countdown-arc {
  background: conic-gradient(var(--ink-mute) 0deg, var(--ink-mute) 60deg, transparent 60deg);
  animation-duration: 14s;
  opacity: .55;
}
.countdown-arc-pulse {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
  animation: countdown-pulse 2.4s ease-in-out infinite;
}
.countdown-pill.is-empty .countdown-arc-pulse {
  background: var(--ink-mute);
  box-shadow: 0 0 0 2px rgba(250,250,247,.1);
  animation: none;
}
@keyframes countdown-spin {
  to { transform: rotate(360deg); }
}
@keyframes countdown-pulse {
  0%, 100% { transform: scale(.8); opacity: .55; }
  50%      { transform: scale(1.1); opacity: 1; }
}
.countdown-label {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--ink);
  max-width: 14ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.countdown-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  color: var(--accent);
  text-transform: none;
  border-left: 1px solid var(--line);
  padding-left: 10px;
  margin-left: 2px;
}
.countdown-pill.is-empty .countdown-meta { color: var(--ink-mute); }

/* ===== Menu bar (section cards with label + desc) ===== */
.menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 34px 0 22px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--line);
  position: relative;
}
.menu::before {
  content: "Bereiche";
  position: absolute; left: 0; top: -7px;
  background: var(--bg);
  padding: 0 14px 0 0;
  font-size: 10px; letter-spacing: .32em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.menu-link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px; letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 6px;
  line-height: 1.1;
  transition: all .25s ease;
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 6px;
  background: rgba(8,8,10,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  position: relative; overflow: hidden;
  text-decoration: none;
}
.menu-link::after {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent);
  transform: translateX(-3px);
  transition: transform .25s ease;
}
.menu-link-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .14em;
}
.menu-link-desc {
  font-family: var(--font-italic, 'Inter', sans-serif);
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-mute);
  line-height: 1.3;
}
.menu-link:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
  transform: translateY(-2px);
  background: rgba(8,8,10,.85);
}
.menu-link:hover::after { transform: translateX(0); }
.menu-link:hover .menu-link-desc { color: var(--ink-soft); }
.menu-link.active {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}
.menu-link.active::after { transform: translateX(0); }
.menu-link.active .menu-link-desc { color: rgba(10,11,15,.6); }

/* ===== Mobile: bottom-fixed horizontal scroll bar ===== */
@media (max-width: 720px) {
  /* Body padding so content above doesn't go under fixed nav */
  body { padding-bottom: 92px; }

  .menu {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    margin: 0;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: rgba(8,8,10,.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    z-index: 200;

    /* Horizontal scroll */
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .menu::-webkit-scrollbar { display: none; }
  .menu::before { display: none; }

  .menu-link {
    flex: 0 0 auto;
    min-width: 92px;
    padding: 10px 14px;
    background: rgba(8,8,10,.55);
    text-align: center;
    align-items: center;
    gap: 2px;
  }
  .menu-link-label { font-size: 11px; letter-spacing: .1em; }
  .menu-link-desc {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    max-width: 12ch;
  }
}

/* ===== Eyebrows + section heads ===== */
.eyebrow {
  font-size: 11px; letter-spacing: .32em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 14px;
}
.eyebrow::before {
  content: ""; width: 32px; height: 1px;
  background: var(--ink-mute);
}
.eyebrow.compact { margin-bottom: 16px; letter-spacing: .22em; }
.eyebrow.compact::before { width: 24px; }

.micro {
  font-size: 10.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ===== Numbers helper (Big Shoulders) ===== */
.num {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1;
}
.num .cur {
  color: var(--accent);
  font-size: .68em;
  vertical-align: .18em;
  margin-right: .05em;
  font-weight: 700;
}

/* ===== Focus ring ===== */
*:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== Scrollbar (subtle) ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--line-hi); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ===== Bottom scroll indicator (landing) ===== */
.scroll-ind {
  position: absolute; left: 50%; bottom: 14px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  z-index: 3;
  pointer-events: none;
}
.scroll-ind span {
  font-size: 10px; letter-spacing: .32em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.scroll-line {
  width: 1px; height: 36px;
  background: linear-gradient(180deg, var(--ink-mute), transparent);
  position: relative; overflow: hidden;
}
.scroll-line::after {
  content: ""; position: absolute; left: 0; top: -12px;
  width: 1px; height: 14px;
  background: var(--ink);
  animation: drip 2.4s ease-in-out infinite;
}
@keyframes drip { 0% { top: -14px; } 100% { top: 36px; } }

/* ===== Common stepper buttons ===== */
.stepper { display: flex; gap: 8px; }
.stepper button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-soft);
  transition: all .2s;
}
.stepper button:hover { border-color: var(--ink-soft); color: var(--ink); }
.stepper svg { width: 14px; height: 14px; }

/* ===== Page transition ===== */
@keyframes editorialIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
#app-root > * { animation: editorialIn .55s cubic-bezier(.2,.7,.3,1) both; }
