/* weedli.ch – globales Stylesheet (Startseite + Tool-Seiten) */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #e8eefc;
  --on-accent: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 4px 14px rgba(17, 24, 39, .05);
  --shadow-hover: 0 2px 4px rgba(17, 24, 39, .06), 0 10px 28px rgba(17, 24, 39, .10);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #f3f4f6;
    --muted: #a3a9b6;
    --line: #262b35;
    --accent: #6d95ff;
    --accent-hover: #8eadff;
    --accent-soft: #1b2440;
    --on-accent: #0b1020;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

/* Topbar */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand__mark { width: 28px; height: 28px; }
.brand__mark rect { fill: var(--accent); stroke: none; }
.brand__mark path { stroke: var(--on-accent); stroke-width: 2.6; }
.brand__tld { color: var(--muted); font-weight: 500; }
.topnav { display: flex; gap: 20px; }
.topnav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.topnav a:hover { color: var(--text); }
.topnav nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.topbar__inner { min-height: 60px; height: auto; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }

/* Hero */
.hero { padding: 56px 0 40px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; max-width: 20ch; }
.hero__lead { margin: 0 0 28px; font-size: 1.15rem; color: var(--muted); max-width: 46ch; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--on-accent);
  padding: 14px 22px; border-radius: 10px;
  font-weight: 600; font-size: 1.05rem; text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }

/* Tools */
.tools { padding: 8px 0 64px; }
.tools__title { margin: 0 0 16px; font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.tile {
  display: flex; align-items: flex-start; gap: 16px; height: 100%;
  padding: 24px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.tile:hover { color: var(--text); border-color: var(--accent); box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.tile__icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.tile__icon svg { width: 28px; height: 28px; }

.tile__body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.tile__title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.tile__text { color: var(--muted); }
.tile__tags { margin-top: 6px; font-size: .875rem; color: var(--accent); font-weight: 500; }

.tile__arrow { flex: none; align-self: center; color: var(--muted); transition: transform .15s ease, color .15s ease; }
.tile:hover .tile__arrow { color: var(--accent); transform: translateX(3px); }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 0; font-size: .95rem; }
.footer__inner { display: flex; flex-wrap: wrap; gap: 24px 56px; }
.footer__head { margin: 0 0 8px; font-weight: 600; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }
.footer__copy { flex-basis: 100%; margin: 8px 0 0; color: var(--muted); font-size: .875rem; }

@media (max-width: 520px) {
  .hero { padding: 36px 0 28px; }
  .btn { width: 100%; justify-content: center; }
  .tile { padding: 18px; }
  .topnav { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Soft Launch: informational cards, no unavailable tool links. */
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: .9rem; font-weight: 650; }
.status { align-self: flex-start; padding: 4px 9px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: .75rem; font-weight: 600; }
.tile--planned:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow); }
.tile--planned .tile__title, .tile--planned .tile__text, .tile--planned .tile__tags { margin: 0; }
.tile--planned .tile__title { overflow-wrap: anywhere; }
.tile--planned .tile__tags { margin-top: 8px; }
.tools__note { max-width: 65ch; margin: 24px 0 0; color: var(--muted); font-size: .95rem; }
.calculator { padding-bottom: 40px; }
.calculator fieldset { margin: 0 0 24px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.calculator legend { padding: 0 8px; font-weight: 700; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.field-grid label { display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
.field-grid input { width: 100%; min-height: 48px; border: 1px solid var(--muted); border-radius: 8px; padding: 10px; font: inherit; background: var(--surface); color: var(--text); }
.field-grid input[aria-invalid="true"] { outline: 2px solid #c2410c; }
.help { color: var(--muted); font-size: .9rem; }
.calculator details { margin-bottom: 24px; }
.calculator summary { cursor: pointer; font-weight: 600; padding: 12px 0; }
.calculator button { border: 0; cursor: pointer; font-family: inherit; }
.notice { padding: 16px; border-left: 4px solid var(--accent); background: var(--accent-soft); }
[hidden] { display: none !important; }
#mortgage-result { margin-top: 32px; }
.result-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; }
.result-list dd { margin: 0; text-align: right; font-weight: 650; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.calculator table { width: 100%; border-collapse: collapse; }
.calculator caption { text-align: left; color: var(--muted); margin-bottom: 12px; }
.calculator th, .calculator td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
.explanation { padding-bottom: 56px; }
.explanation summary { cursor: pointer; padding: 12px 0; }
.explanation summary h2 { display: inline; }
.explanation p { max-width: 75ch; }
.section-nav { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 24px; }
.section-nav a { padding: 8px 0; }
.formula-list { max-width: 75ch; overflow-wrap: anywhere; }
.formula-list dt { font-weight: 700; margin-top: 16px; }
.formula-list dd { margin: 6px 0 0; }
/* Tool-only, in-flow slots. Reserve space before any future ad request. */
.ad-placement { margin-top: 24px; margin-bottom: 64px; }
.ad-placement__label { margin: 0 auto 8px; max-width: 728px; color: var(--muted); font-size: .75rem; text-align: center; }
.ad-placeholder { display: grid; place-items: center; width: 100%; max-width: 728px; min-height: 250px; margin: 0 auto; padding: 16px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); text-align: center; font-size: .875rem; }
.tool-layout { width: 100%; max-width: 960px; margin: 0 auto; }
.ad-placement--entry { padding: 0 16px; margin: 0 0 48px; }
.ad-placement--entry .ad-placeholder { max-width: 728px; min-height: 100px; }
@media (min-width: 1200px) {
  .tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 48px; max-width: 1280px; padding: 0 24px; align-items: start; }
  .tool-layout > .calculator { grid-column: 1; grid-row: 1; min-width: 0; padding-left: 0; padding-right: 0; }
  .ad-placement--entry { grid-column: 2; grid-row: 1; margin: 0; padding: 0; }
  .ad-placement--entry .ad-placeholder { min-height: 250px; }
}
@media (min-width: 800px) {
  .ad-placeholder { min-height: 90px; }
}
@media print {
  .ad-placement { display: none; }
  .tool-layout { display: block; }
}
[id] { scroll-margin-top: 80px; }
@media (max-width: 520px) {
  .result-list { grid-template-columns: 1fr; gap: 4px; }
  .result-list dd { text-align: left; margin-bottom: 16px; }
  .calculator th, .calculator td { padding: 10px 5px; font-size: .85rem; overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .topbar__inner { height: auto; min-height: 60px; flex-wrap: wrap; gap: 8px; padding-top: 12px; padding-bottom: 12px; }
  .tile--planned { flex-direction: column; }
}
/* Sleep calculator: reuses the shared advertising layout. */
.field-grid select { width: 100%; min-height: 48px; border: 1px solid var(--muted); border-radius: 8px; padding: 10px; font: inherit; background: var(--surface); color: var(--text); }
.sleep-hero h1 { max-width: 27ch; }
.sleep-options { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sleep-option { padding: 20px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.sleep-option h3 { margin: 0; font-size: 1rem; }
.sleep-option .sleep-option__time { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 750; letter-spacing: -.04em; color: var(--accent); margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.sleep-table { overflow-x: auto; }
.sleep-table table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.sleep-table caption { text-align: left; font-weight: 600; margin-bottom: 12px; }
.sleep-table th, .sleep-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
@media (max-width: 520px) { .sleep-options { grid-template-columns: 1fr; } .sleep-table th, .sleep-table td { padding: 10px 5px; font-size: .85rem; } }

/* VAT calculator */
.vat-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.vat-remove { margin-top: 16px; padding: 12px; border-radius: 6px; background: var(--surface); color: var(--text); text-decoration: underline; }
.calculator button:disabled { opacity: .5; cursor: default; }
#vat-result { margin-top: 32px; }
#vat-result table { min-width: 520px; }

.savings-figure { margin: 24px 0; }
#savings-chart { width: 100%; height: auto; display: block; }
.savings-figure figcaption { color: var(--muted); font-size: .9rem; }
#savings-result table { min-width: 560px; }

.etf-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.etf-cards p { overflow-wrap: anywhere; }
#etf-result table { min-width: 560px; }

#pillar-result table { min-width: 560px; }

#salary-result table { min-width: 560px; }

#rent-letter { display:block; width:100%; margin:12px 0; padding:16px; background:var(--surface); color:var(--text); border:1px solid var(--muted); border-radius:8px; font:inherit; resize:vertical; }

/* Homepage: topic navigation and consistent calculator cards. */
.home-hero { background: linear-gradient(120deg, var(--accent-soft), var(--bg) 80%); padding: 64px 0 42px; }
.home-hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); max-width: 22ch; }
.home-hero .hero__lead { max-width: 58ch; margin-top: 20px; }
.home-benefits { display: flex; flex-wrap: wrap; gap: 12px 24px; list-style: none; padding: 0; margin: 24px 0 0; color: var(--muted); font-size: .9rem; }
.home-benefits li::before { content: "✓"; color: var(--accent); margin-right: 8px; }
.home-page .tools { padding-top: 40px; }
.home-page h2 { font-size: clamp(1.6rem, 3vw, 2rem); line-height: 1.25; margin: 0 0 12px; letter-spacing: -.02em; }
.home-intro { color: var(--muted); margin: 0 0 20px; }
.home-topics { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 36px; }
.home-topics a { padding: 10px 16px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); text-decoration: none; font-weight: 600; }
.home-topics a:hover { border-color: var(--accent); background: var(--accent-soft); }
.home-group { margin-bottom: 36px; scroll-margin-top: 24px; }
.home-group > h3 { font-size: 1.25rem; margin: 0 0 6px; }
.home-card .tile__body { height: 100%; gap: 12px; }
.home-card .tile__icon { width: 42px; height: 42px; }
.home-card .tile__icon svg { width: 24px; height: 24px; }
.home-card .tile__title, .home-card .tile__text, .home-card .tile__tags { margin: 0; }
.home-card .tile__title { overflow-wrap: anywhere; font-size: 1.15rem; }
.home-card .tile__tags { font-size: .8rem; }
.home-card .tile__body > a { margin-top: auto; padding-top: 8px; font-weight: 600; text-underline-offset: 4px; }

.home-about { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-bottom: 64px; }
.home-about p { color: var(--muted); }
.home-faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.home-faq summary { cursor: pointer; font-weight: 600; }
.home-faq p { margin-bottom: 0; }
@media (max-width: 600px) { .home-hero { padding: 36px 0; } .home-about { grid-template-columns: 1fr; gap: 12px; } .home-page .tiles { grid-template-columns: 1fr; } .home-page #alltag .tiles { max-width: none; } }
