/*
 * Shared stylesheet for bitcoindigital.de.
 * Mobile-first, system font stack, no external assets (ADR-0001).
 * Comments and identifiers are English; user-facing text lives in the HTML
 * and is German (ADR-0002).
 */

:root {
  color-scheme: light dark;

  --accent: #f7931a;          /* Bitcoin orange */
  --accent-ink: #7a4300;

  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f0f1f3;
  --text: #1b1d21;
  --muted: #5c626c;
  --border: #e2e4e8;

  --ok-bg: #e7f6ec;
  --ok-ink: #1c7a3e;
  --ok-border: #b6e3c4;

  --warn-bg: #fdf2e2;
  --warn-ink: #9a5b00;
  --warn-border: #f4d8ab;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 22, 28, .06), 0 6px 24px rgba(20, 22, 28, .06);
  --maxw: 720px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f25;
    --surface-2: #242830;
    --text: #eceef2;
    --muted: #a2a9b4;
    --border: #2c313a;

    --ok-bg: #16301f;
    --ok-ink: #67d693;
    --ok-border: #235233;

    --warn-bg: #33260f;
    --warn-ink: #f0b45f;
    --warn-border: #5a4318;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-block: .9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  font-size: 1.05rem;
}

.brand .mark {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

/* ---------- Layout ---------- */

main { padding-block: 2rem 3rem; }

h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  line-height: 1.2;
  margin: 0 0 .5rem;
  letter-spacing: -.01em;
}

h2 {
  font-size: clamp(1.15rem, 1.05rem + 0.6vw, 1.3rem);
  margin: 2.25rem 0 .6rem;
  letter-spacing: -.01em;
}

h3 { font-size: 1.08rem; margin: 1.4rem 0 .3rem; }

.lead {
  font-size: clamp(1.02rem, 0.95rem + 0.6vw, 1.15rem);
  color: var(--muted);
  margin: 0 0 1.5rem;
}

a { color: var(--accent-ink); }
@media (prefers-color-scheme: dark) { a { color: var(--accent); } }

/* ---------- Breadcrumb ---------- */

.breadcrumb { margin: 0 0 1.25rem; }

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  font-size: .85rem;
  color: var(--muted);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  min-width: 0;
}

.breadcrumb li:first-child { flex: none; }

/* Separator drawn via CSS, not markup, so it stays out of the accessible name. */
.breadcrumb li + li::before {
  content: "\203A"; /* › */
  color: var(--muted);
  padding: 0 .5rem;
  flex: none;
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px; /* comfortable tap target */
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

/* Current page never wraps; truncates with an ellipsis when space is tight. */
.breadcrumb [aria-current="page"] {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Calculator card ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
}

.field .hint {
  display: block;
  font-size: .9rem;
  color: var(--muted);
  margin-top: .35rem;
}

input[type="date"],
input[type="number"],
input[type="text"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem .8rem;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button.primary {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: .75rem 1.1rem;
}

button.primary:hover { filter: brightness(.96); }

/* Full-width primary button on small screens for easier tapping. */
@media (max-width: 480px) {
  button.primary { width: 100%; }
}

/* ---------- Result ---------- */

.result {
  margin-top: 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 1.25rem;
  background: var(--surface-2);
}

.result[hidden] { display: none; }

.badge {
  display: inline-block;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: .25rem .6rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-border); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-border); }

.result .headline {
  font-size: clamp(1.25rem, 1.05rem + 1.2vw, 1.5rem);
  font-weight: 700;
  margin: .6rem 0 .2rem;
  letter-spacing: -.01em;
}

.result .detail { color: var(--muted); margin: .2rem 0 0; }

.result.is-error {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

/* ---------- Price box (Satoshi-Rechner) ---------- */

.price-box {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
}

.price-box p { margin: .3rem 0; }
.price-box .price-meta { color: var(--muted); }
.price-box .field { margin: .6rem 0 .3rem; }

.link-btn {
  font: inherit;
  color: var(--accent-ink);
  background: none;
  border: none;
  padding: .1rem .15rem;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--text); }

@media (prefers-color-scheme: dark) { .link-btn { color: var(--accent); } }

/* ---------- Result stats (Sparplan-Rechner) ---------- */

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 1.1rem;
  margin: 1.25rem 0 0;
}

@media (min-width: 520px) {
  .stats { grid-template-columns: 1fr 1fr; }
}

.stats > div {
  padding: .6rem 0;
  border-bottom: 1px solid var(--border);
}

.stats dt { margin: 0; font-size: .85rem; color: var(--muted); }
.stats dd { margin: .1rem 0 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }

.value-pos { color: var(--ok-ink); }
.value-neg { color: #c0392b; }
@media (prefers-color-scheme: dark) { .value-neg { color: #ff6f61; } }

/* ---------- Inline SVG chart ---------- */

.chart-figure { margin: 1.5rem 0 0; }

.chart {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.chart-line { fill: none; stroke-width: 2; }
.chart-invested { stroke: var(--muted); }
.chart-value { stroke: var(--accent); }
.chart-axis { fill: var(--muted); font-size: 11px; }
.chart-baseline { stroke: var(--border); stroke-width: 1; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: .5rem 0 0;
  font-size: .9rem;
  color: var(--muted);
}

.chart-legend .k {
  display: inline-block;
  width: .8rem;
  height: .8rem;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: .35rem;
}
.chart-legend .k-invested { background: var(--muted); }
.chart-legend .k-value { background: var(--accent); }

.chart-figure figcaption { margin-top: .5rem; font-size: .9rem; color: var(--muted); }

/* ---------- Info notes ---------- */

.note {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem;
  margin: 1rem 0;
  font-size: .96rem;
}

.note strong { color: var(--text); }

/* ---------- Tool grid (hub) ---------- */

.tools {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 620px) {
  .tools { grid-template-columns: 1fr 1fr; }
}

.tool {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
}

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

.tool h2 { margin: 0 0 .3rem; font-size: 1.15rem; }
.tool p { margin: 0; color: var(--muted); font-size: .96rem; }

.tool.soon { opacity: .7; }

.tool .tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .1rem .5rem;
  margin-top: .6rem;
}

/* ---------- FAQ ---------- */

details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .35rem 1rem;
  margin: .6rem 0;
  background: var(--surface);
}

details summary {
  font-weight: 600;
  cursor: pointer;
  padding: .55rem 0;
}

details[open] summary { margin-bottom: .3rem; }

/* ---------- Legal / prose ---------- */

.prose p, .prose li { color: var(--text); }
.prose address { font-style: normal; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .9rem;
  padding-block: 1.5rem 2rem;
}

.site-footer .disclaimer { margin: 0 0 .8rem; }

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.1rem;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

.site-footer .copyright { margin: .9rem 0 0; }

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--surface);
  padding: .5rem .8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
