/* Nodz marketing site. Brand tokens from docs/images/Nodz look.png */

/* The hidden attribute must win over component display rules. */
[hidden] { display: none !important; }

@font-face {
  font-family: "Satoshi";
  src: url("/assets/fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #0b0f1a;          /* Deep Navy: backgrounds */
  --midnight: #1e2638;      /* Midnight: surfaces */
  --warm: #ffb86b;          /* Warm Light: primary */
  --accent: #ff8a45;        /* Accent: highlights */
  --soft: #fff7e6;          /* Soft Light: text on dark, light mode */

  --text: var(--soft);
  --muted: rgb(255 247 230 / 0.68);
  --faint: rgb(255 247 230 / 0.45);
  --line: rgb(255 247 230 / 0.1);
  --surface: rgb(30 38 56 / 0.55);
  --glow: 0 0 0 1px rgb(255 184 107 / 0.25), 0 10px 40px -10px rgb(255 138 69 / 0.45);

  --radius: 18px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page, var(--navy));
  color: var(--text);
  font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--soft); color: var(--navy);
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  background: linear-gradient(to bottom, rgb(11 15 26 / 0.85), rgb(11 15 26 / 0));
}
.nav { display: flex; align-items: center; gap: 24px; height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 32px; margin-left: auto; font-size: 0.95rem; }
.nav { gap: 16px; }
.nav-links { margin-right: 8px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav > *, .nav-links a, .nav .btn { flex-shrink: 0; white-space: nowrap; }
/* Narrower screens: the text links move to the footer only; then Donate becomes a heart. */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .nav .lang-menu { margin-left: auto; }
}
@media (max-width: 860px) {
  .nav .btn-donate { width: 40px; padding: 0; }
  .nav .btn-donate span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
.nav-links a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.92rem; }
.btn-primary { background: var(--warm); color: var(--navy); box-shadow: var(--glow); }
.btn-primary:hover { background: #ffc386; }
.btn-light { background: var(--soft); color: var(--navy); }
.btn-ghost { color: var(--text); box-shadow: inset 0 0 0 1px rgb(255 247 230 / 0.28); background: rgb(11 15 26 / 0.35); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px rgb(255 247 230 / 0.6); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(100svh, 920px);
  display: flex; align-items: center;
  padding: 120px 0 96px;
}
.hero-bg, .closing-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(11 15 26 / 0.92) 0%, rgb(11 15 26 / 0.7) 34%, rgb(11 15 26 / 0) 62%),
    linear-gradient(0deg, var(--navy) 0%, rgb(11 15 26 / 0) 28%);
}
.hero-content { max-width: var(--wrap); }
@media (min-width: 721px) {
  /* Push the archway right so the headline sits on the dark wall. */
  .hero-bg { left: 10%; width: 112%; }
}
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); max-width: 12ch; }
.lede { margin-top: 22px; max-width: 34rem; color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.2rem); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }

.status {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px;
  padding: 6px 14px; border-radius: 999px;
  background: rgb(30 38 56 / 0.6); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.85rem; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warm); box-shadow: 0 0 12px var(--accent); }
/* Server status (homepage): grey while checking, then green / orange / red. */
.status[data-state] .dot { position: relative; flex: none; transition: background .3s, box-shadow .3s; }
.status[data-state="checking"] .dot { background: #8a93a6; box-shadow: none; }
.status[data-state="ok"] .dot { background: #6fd39a; box-shadow: 0 0 10px rgb(111 211 154 / 0.7); }
.status[data-state="ok"] .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #6fd39a;
  animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.status[data-state="degraded"] .dot { background: #f5b84a; box-shadow: 0 0 10px rgb(245 184 74 / 0.7); }
.status[data-state="down"] .dot { background: #e5484d; box-shadow: 0 0 10px rgb(229 72 77 / 0.7); }
@media (prefers-reduced-motion: reduce) { .status[data-state="ok"] .dot::after { animation: none; } }

.user-count {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; padding: 8px 16px 8px 12px;
  border-radius: 999px; background: rgb(11 15 26 / 0.55); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted); font-size: 0.95rem; animation: fade-up .6s ease both;
}
.user-count strong { color: var(--text); font-variant-numeric: tabular-nums; }
.user-count .pulse { position: relative; width: 10px; height: 10px; border-radius: 50%; background: #6fd39a; }
.user-count .pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: #6fd39a;
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .user-count, .user-count .pulse::after { animation: none; } }

/* ---------- Pillars ---------- */
.pillars { border-block: 1px solid var(--line); background: linear-gradient(180deg, var(--navy), #0e1322); }
.pillar-list { display: grid; grid-template-columns: repeat(5, 1fr); }
.pillar-list li {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 36px 12px; text-align: center; font-size: 1rem; line-height: 1.35;
}
.pillar-list li + li { border-left: 1px solid rgb(255 184 107 / 0.22); }
.pillar-list svg { width: 40px; height: 40px; fill: none; stroke: var(--warm); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pillar-list em { font-style: normal; color: var(--warm); font-weight: 600; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(72px, 10vw, 128px); }
.eyebrow { color: var(--warm); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.78rem; font-weight: 600; margin-bottom: 14px; }
.section h2 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 22ch; }
.section-lede { margin-top: 18px; color: var(--muted); max-width: 40rem; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; counter-reset: step; }
.steps li, .card {
  position: relative; padding: 30px; border-radius: var(--radius);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.step-n {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 22px;
  border-radius: 12px; background: rgb(255 184 107 / 0.12); color: var(--warm); font-weight: 700;
}
.steps h3, .card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.steps p, .card p { color: var(--muted); }

.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 48px; }
.ticks li, .dots li { position: relative; padding-left: 30px; color: var(--muted); }
.ticks li + li, .dots li + li { margin-top: 12px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 0.45em; width: 14px; height: 8px;
  border-left: 2px solid var(--warm); border-bottom: 2px solid var(--warm); transform: rotate(-45deg);
}
.dots li::before {
  content: ""; position: absolute; left: 5px; top: 0.6em; width: 8px; height: 8px; border-radius: 50%;
  background: transparent; box-shadow: inset 0 0 0 2px var(--faint);
}
.fineprint { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.recovery { margin-top: 20px; }
.card-warm { background: linear-gradient(120deg, rgb(255 138 69 / 0.14), rgb(30 38 56 / 0.55) 55%); box-shadow: inset 0 0 0 1px rgb(255 184 107 / 0.22); }

.platforms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 44px; }
.platforms li {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 12px; border-radius: var(--radius);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-align: center;
}
.platforms img { border-radius: 10px; background: var(--navy); }
.platforms span { font-weight: 600; }
.platforms small { font-size: 0.8rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.12em; }
.platforms li:first-child { box-shadow: var(--glow); padding: 0; }
.platform-link {
  display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; padding: 26px 12px;
  border-radius: var(--radius); text-decoration: none; transition: background-color .15s;
}
.platform-link:hover { background: rgb(255 184 107 / 0.08); }
.nav-signin { color: var(--text); }
.platforms li:first-child small { color: var(--warm); }

/* ---------- Closing ---------- */
.closing {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 520px; display: flex; align-items: flex-end; padding-bottom: 72px;
}
.closing::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--navy) 0%, rgb(11 15 26 / 0.1) 35%, rgb(11 15 26 / 0.2) 70%, var(--navy) 100%);
}
.closing-content { text-align: center; }
.closing h2 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
.closing p { margin-top: 10px; color: var(--muted); font-size: 1.15rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-slogan { color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-left: auto; font-size: 0.95rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.copyright { flex-basis: 100%; color: var(--faint); font-size: 0.85rem; }

/* ---------- Document pages (privacy, 404) ---------- */
.doc { padding-top: 140px; padding-bottom: 96px; max-width: 760px; }
.doc h1 { font-size: clamp(1.6rem, 7vw, 3.2rem); margin-bottom: 18px; }
/* Long Dutch and German words ("Gebruiksvoorwaarden") and long addresses must not push
   the page wider than a phone: hyphenate (in the page's language) or break them. */
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }
.doc, .legal { overflow-wrap: break-word; }
.doc h2 { font-size: 1.4rem; margin: 40px 0 12px; }
.doc p, .doc li { color: var(--muted); }
.doc p + p { margin-top: 12px; }
.doc ul { list-style: disc; padding-left: 22px; }
.doc li + li { margin-top: 6px; }
.doc .notice { padding: 16px 20px; border-radius: 12px; background: rgb(255 138 69 / 0.12); box-shadow: inset 0 0 0 1px rgb(255 184 107 / 0.3); color: var(--soft); }
.doc .btn { margin-top: 28px; }

/* ---------- Language menu (native <details> dropdown) ---------- */
.lang-menu { position: relative; }
.lang-menu summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; cursor: pointer; list-style: none; user-select: none;
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted);
  box-shadow: inset 0 0 0 1px rgb(255 247 230 / 0.18); transition: color .15s, box-shadow .15s;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { color: var(--text); box-shadow: inset 0 0 0 1px rgb(255 247 230 / 0.45); }
.lang-menu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lang-menu .chevron { width: 14px; height: 14px; transition: transform .15s; }
.lang-menu[open] .chevron { transform: rotate(180deg); }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 190px; padding: 6px;
  border-radius: 14px; background: #121827; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgb(0 0 0 / 0.7);
}
.lang-menu li a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
}
.lang-menu li a:hover { background: rgb(255 247 230 / 0.06); color: var(--text); }
.lang-menu li a[aria-current] { color: var(--warm); }
.lang-menu li a[aria-current]::after { content: "✓"; margin-left: auto; }
.lang-menu .code { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; width: 22px; color: var(--faint); }
.footer-langs { flex-basis: 100%; }
.footer-langs .lang-menu ul { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; }

/* ---------- Donate button ---------- */
.btn-donate {
  color: #2a1204; font-weight: 700;
  background: linear-gradient(135deg, #ffc98a 0%, var(--warm) 40%, var(--accent) 100%);
  box-shadow: 0 0 0 1px rgb(255 184 107 / 0.5), 0 8px 28px -8px rgb(255 138 69 / 0.75);
}
.btn-donate:hover { box-shadow: 0 0 0 1px rgb(255 200 140 / 0.8), 0 10px 34px -6px rgb(255 138 69 / 0.95); }
.btn .heart { width: 18px; height: 18px; fill: #c2410c; stroke: none; animation: beat 2.4s ease-in-out infinite; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 1.08rem; }
.btn-lg .heart { width: 22px; height: 22px; }
@keyframes beat { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.18); } 90% { transform: scale(0.96); } }
@media (prefers-reduced-motion: reduce) { .btn .heart { animation: none; } }

/* ---------- Homepage support section ---------- */
.support { padding-top: 0; }
.support-panel {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
  padding: clamp(28px, 5vw, 56px); border-radius: 28px; position: relative; overflow: hidden;
  background:
    radial-gradient(40rem 22rem at 100% 0%, rgb(255 138 69 / 0.28), transparent 60%),
    radial-gradient(30rem 20rem at 0% 100%, rgb(255 184 107 / 0.12), transparent 60%),
    linear-gradient(135deg, #1a1420, #141a2a);
  box-shadow: inset 0 0 0 1px rgb(255 184 107 / 0.28), 0 30px 80px -40px rgb(255 138 69 / 0.5);
}
.support-icon {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px; border-radius: 18px;
  background: rgb(255 138 69 / 0.15); box-shadow: inset 0 0 0 1px rgb(255 138 69 / 0.4);
}
.support-icon .heart { width: 28px; height: 28px; fill: var(--accent); }
.support-copy h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: 18ch; margin-bottom: 14px; }
.support-copy > p { color: var(--muted); max-width: 34rem; }
.support-points { margin-top: 18px; display: grid; gap: 8px; color: var(--muted); }
.support-points li { position: relative; padding-left: 26px; }
.support-points li::before {
  content: ""; position: absolute; left: 2px; top: 0.5em; width: 12px; height: 7px;
  border-left: 2px solid var(--warm); border-bottom: 2px solid var(--warm); transform: rotate(-45deg);
}
.support-action {
  display: grid; gap: 14px; padding: 26px; border-radius: 20px;
  background: rgb(11 15 26 / 0.55); box-shadow: inset 0 0 0 1px var(--line);
}
.support-action .btn { width: 100%; }
.support-more { color: var(--warm); font-weight: 600; text-decoration: none; font-size: 0.95rem; }
.support-more:hover { text-decoration: underline; }
.support-action .fineprint { margin: 0; padding: 0; border: 0; font-size: 0.85rem; color: var(--faint); }

/* ---------- Legal and document pages ---------- */
.doc .eyebrow { margin-bottom: 8px; }
.doc .muted { color: var(--faint); font-size: 0.95rem; margin-bottom: 18px; }
.doc .notice { margin-bottom: 8px; }
.legal h2 { font-size: 1.3rem; margin: 36px 0 10px; }
.legal a { color: var(--warm); }
.legal strong { color: var(--text); }
.table-wrap { overflow-x: auto; margin: 14px 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 640px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.legal th { color: var(--text); background: rgb(30 38 56 / 0.6); font-weight: 600; }
.legal tr:last-child td { border-bottom: 0; }

/* ---------- Help ---------- */
.help-category { margin-top: 40px; }
.help-category h2 { font-size: 1.25rem; margin: 0 0 12px; }
.doc .help-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.doc .help-list li { list-style: none; padding: 0; margin: 0; }
.doc .help-list li::before { content: none; }
.help-list a {
  display: grid; gap: 4px; padding: 16px 18px; border-radius: 14px; text-decoration: none;
  background: rgb(30 38 56 / 0.45); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .15s, background .15s;
}
.help-list a:hover, .help-list a:focus-visible { box-shadow: inset 0 0 0 1px rgb(255 184 107 / 0.55); background: rgb(30 38 56 / 0.7); }
.help-list strong { color: var(--text); font-size: 1.02rem; }
.help-list span { color: var(--muted); font-size: 0.93rem; }
.help-contact { margin-top: 40px; }
.help-contact h2 { margin-top: 0; }
.breadcrumbs { font-size: 0.9rem; color: var(--faint); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); }
.help-body { margin-top: 28px; }
.help-body > * + * { margin-top: 14px; }
.help-body > h2 { margin-top: 34px; }
.help-body ol, .help-body ul { padding-left: 1.4em; display: grid; gap: 6px; }
.help-body ol { list-style: decimal; }
.help-body ul { list-style: disc; }
.help-body strong { color: var(--text); }
.help-body .tip { padding: 12px 16px; border-radius: 12px; background: var(--notice-bg, rgb(255 184 107 / 0.08)); box-shadow: inset 0 0 0 1px var(--line); }
.help-more { margin-top: 40px; }
.help-more h2 { margin-top: 0; font-size: 1.1rem; }
.help-related { padding-left: 1.2em; list-style: disc; display: grid; gap: 6px; margin-bottom: 16px; }

/* ---------- Download ---------- */
.download .card { margin-top: 20px; }
.download .card > h2:first-child { margin-top: 0; }
.download h3 { font-size: 1.05rem; margin: 22px 0 8px; }
.download pre { margin: 6px 0 14px; padding: 12px 14px; border-radius: 10px; overflow-x: auto; background: rgb(255 255 255 / 0.05); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.88rem; }
.download-links:empty { display: none; }
.download-links { display: grid; gap: 14px; margin-top: 16px; }
.download-file { display: grid; gap: 4px; justify-items: start; }
.download-file .muted { font-size: 0.9rem; }
.download-file .hash { font-size: 0.78rem; color: var(--faint); overflow-wrap: anywhere; }
.install-steps { list-style: decimal; padding-left: 1.4em; display: grid; gap: 6px; color: var(--muted); }
.install-steps li { padding-left: 4px; }
.install-steps strong { color: var(--text); }

/* ---------- Donate ---------- */
.donate-mark { margin-bottom: 18px; }
.donate .lede { color: var(--muted); font-size: 1.1rem; margin-bottom: 28px; }
.donate-box { display: grid; gap: 16px; }
.donate-box .btn { width: 100%; }
.donate-box .notice { margin: 0; }
.donate-box .fineprint { border: 0; margin: 0; padding: 0; color: var(--faint); font-size: 0.9rem; }
.donate-why { margin-top: 20px; }
.doc ul.ticks { list-style: none; padding-left: 0; }
.donate-why h2 { font-size: 1.2rem; margin: 0 0 12px; }

.more-link { margin-top: 28px; }
.more-link a { color: var(--warm); font-weight: 600; text-decoration: none; }
.more-link a:hover { text-decoration: underline; }

/* ---------- How it works ---------- */
.how { padding-top: 120px; }
.how-hero { padding-bottom: 32px; text-align: center; }
.how-hero h1 { font-size: clamp(2.2rem, 5.4vw, 4rem); max-width: 18ch; margin: 0 auto; }
.how-hero .lede { margin: 18px auto 0; max-width: 40rem; color: var(--muted); font-size: 1.15rem; }
.how-toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 32px; }
.how-toc a {
  padding: 7px 14px; border-radius: 999px; font-size: 0.9rem; text-decoration: none; color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line); transition: color .15s, box-shadow .15s;
}
.how-toc a:hover { color: var(--warm); box-shadow: inset 0 0 0 1px rgb(255 184 107 / 0.5); }

.how-step {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(28px, 6vw, 80px);
  padding-block: clamp(48px, 8vw, 96px); scroll-margin-top: 90px;
}
.how-step--wide { grid-template-columns: 1fr; }
.how-step h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 10px 0 14px; max-width: 20ch; }
.how-step p { color: var(--muted); font-size: 1.08rem; max-width: 34rem; }
.step-num { font-weight: 700; color: var(--warm); letter-spacing: 0.1em; font-size: 0.9rem; }
.how-art { display: grid; place-items: center; min-height: 240px; }
.how-art svg { width: min(100%, 360px); height: auto; }
section[id] { scroll-margin-top: 90px; }

/* 1: key appears on the device and a public card flies to the server */
.art-keys .device { fill: #141a28; stroke: rgb(255 247 230 / 0.25); stroke-width: 2; }
.art-keys .screen { fill: #0b0f1a; }
.art-keys .glow { fill: rgb(255 138 69 / 0.25); animation: glow 3s ease-in-out infinite; transform-origin: 160px 108px; }
.art-keys .key-head, .art-keys .key-shaft { fill: none; stroke: var(--warm); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.art-keys .key-hole { fill: var(--warm); }
.art-keys .key { animation: key-in 3s ease-in-out infinite; transform-origin: 160px 108px; }
.art-keys .beam { stroke: rgb(255 184 107 / 0.6); stroke-width: 2; stroke-dasharray: 4 6; animation: dash 1.2s linear infinite; }
.art-keys .pub-card { fill: #1e2638; stroke: var(--warm); stroke-width: 1.5; }
.art-keys .pub-line { stroke: var(--soft); stroke-width: 3; stroke-linecap: round; }
.art-keys .pub { animation: pub 3s ease-in-out infinite; }
@keyframes glow { 0%, 100% { transform: scale(0.85); opacity: 0.5; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes key-in { 0% { transform: scale(0.3) rotate(-30deg); opacity: 0; } 25%, 100% { transform: none; opacity: 1; } }
@keyframes dash { to { stroke-dashoffset: -20; } }
@keyframes pub { 0%, 35% { opacity: 0; transform: translate(-30px, 14px); } 55%, 100% { opacity: 1; transform: none; } }

/* 2: sealed envelope travels device → server → device */
.flow {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start;
  padding: 36px 24px 72px; border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.node { display: grid; justify-items: center; gap: 8px; text-align: center; font-weight: 600; position: relative; z-index: 1; }
.node small { color: var(--warm); font-weight: 500; font-size: 0.82rem; }
.node-icon {
  width: 64px; height: 64px; padding: 14px; border-radius: 20px; background: #0e1322;
  fill: none; stroke: var(--soft); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  box-shadow: inset 0 0 0 1px rgb(255 247 230 / 0.15);
}
.node-server .node-icon { stroke: var(--warm); box-shadow: inset 0 0 0 1px rgb(255 184 107 / 0.45), 0 0 30px -6px rgb(255 138 69 / 0.6); }
.track { position: absolute; left: 16.6%; right: 16.6%; top: 68px; height: 2px; background: repeating-linear-gradient(90deg, rgb(255 184 107 / 0.5) 0 6px, transparent 6px 12px); }
.envelope {
  position: absolute; top: -20px; left: 0; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; background: var(--warm); box-shadow: 0 6px 20px -4px rgb(255 138 69 / 0.8);
  animation: travel 4.5s cubic-bezier(.6, 0, .4, 1) infinite;
}
.envelope svg { width: 24px; height: 24px; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.envelope .lock { position: absolute; right: -8px; bottom: -8px; width: 20px; height: 20px; padding: 2px; border-radius: 50%; background: var(--navy); stroke: var(--warm); }
@keyframes travel {
  0% { left: 0; transform: translateX(-50%) scale(0.8); opacity: 0; }
  8% { opacity: 1; transform: translateX(-50%) scale(1); }
  40%, 55% { left: 50%; transform: translateX(-50%) scale(1); }
  92% { left: 100%; transform: translateX(-50%) scale(1); opacity: 1; }
  100% { left: 100%; transform: translateX(-50%) scale(0.8); opacity: 0; }
}

/* 3: rotating keys around a protected core */
.art-ratchet .ring { fill: none; stroke: rgb(255 247 230 / 0.15); stroke-width: 2; stroke-dasharray: 3 7; }
.art-ratchet .orbit { animation: spin 12s linear infinite; transform-origin: 160px 120px; }
.art-ratchet .k { fill: #1e2638; stroke: var(--warm); stroke-width: 2; }
.art-ratchet .k1 { animation: rekey 4s ease-in-out infinite; }
.art-ratchet .k2 { animation: rekey 4s ease-in-out 1s infinite; }
.art-ratchet .k3 { animation: rekey 4s ease-in-out 2s infinite; }
.art-ratchet .k4 { animation: rekey 4s ease-in-out 3s infinite; }
.art-ratchet .core { fill: rgb(111 211 154 / 0.15); stroke: #6fd39a; stroke-width: 2; }
.art-ratchet .check { fill: none; stroke: #6fd39a; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rekey { 0%, 70%, 100% { fill: #1e2638; } 80% { fill: var(--accent); } }

/* 4: phone number and email swap for a username */
.swap { position: relative; min-height: 200px; }
.id-card {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 18px 24px; border-radius: 18px;
  font-size: 1.25rem; font-weight: 600; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); background: var(--surface);
}
.id-card > span:first-child { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #0e1322; color: var(--warm); }
.id-old { flex-direction: row; color: var(--faint); animation: id-out 6s ease-in-out infinite; }
.id-old-mail { display: none; }
.id-new { color: var(--text); box-shadow: inset 0 0 0 2px var(--warm), 0 12px 40px -12px rgb(255 138 69 / 0.6); animation: id-in 6s ease-in-out infinite; }
@keyframes id-out { 0%, 35% { opacity: 1; transform: none; text-decoration: none; } 45% { text-decoration: line-through; } 55%, 100% { opacity: 0; transform: translateY(-24px) scale(0.92); } }
@keyframes id-in { 0%, 45% { opacity: 0; transform: translateY(24px) scale(0.92); } 60%, 92% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* 5: recovery code chips appear one by one */
.code-art { grid-template-columns: repeat(3, auto); gap: 12px; justify-content: center; }
.code-art span {
  padding: 14px 18px; border-radius: 12px; font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 1.2rem; letter-spacing: 0.08em; background: #0e1322; box-shadow: inset 0 0 0 1px rgb(255 184 107 / 0.35);
  animation: chip 6s ease-in-out infinite both;
}
.code-art span:nth-child(2) { animation-delay: .3s; } .code-art span:nth-child(3) { animation-delay: .6s; }
.code-art span:nth-child(4) { animation-delay: .9s; } .code-art span:nth-child(5) { animation-delay: 1.2s; } .code-art span:nth-child(6) { animation-delay: 1.5s; }
@keyframes chip { 0% { opacity: 0; transform: translateY(10px); } 10%, 85% { opacity: 1; transform: none; color: var(--soft); } 50% { color: var(--warm); } 100% { opacity: 0; } }

/* comparison table and FAQ */
.compare { margin-top: 28px; }
.compare table { width: 100%; border-collapse: collapse; min-width: 560px; }
.compare th, .compare td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.compare thead th { color: var(--text); background: rgb(30 38 56 / 0.6); }
.compare tbody th { color: var(--text); font-weight: 600; }
.compare .col-nodz { color: var(--warm); font-weight: 600; background: rgb(255 184 107 / 0.05); }
.compare + .fineprint { border: 0; padding: 0; margin-top: 10px; color: var(--faint); font-size: 0.85rem; }
.faq { display: grid; gap: 10px; margin-top: 24px; max-width: 820px; }
.faq details { border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.faq summary { cursor: pointer; padding: 18px 22px; font-weight: 600; list-style: none; position: relative; padding-right: 52px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: var(--warm); font-size: 1.4rem; transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 22px 20px; color: var(--muted); }
.how-cta { grid-template-columns: 1.2fr 1fr; }
.how-cta-actions { display: grid; gap: 12px; }

/* scroll reveal (only when JavaScript marks the page; content is visible without it) */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .how *, .how *::before, .how *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .id-old { display: none; } .id-new { opacity: 1; }
  .envelope { left: 50%; transform: translateX(-50%); }
}

@media (max-width: 860px) {
  .how-step, .how-cta { grid-template-columns: 1fr; }
  .how-step .how-art { order: -1; }
  .flow { padding: 28px 12px 64px; }
  .node-icon { width: 52px; height: 52px; padding: 11px; }
  .node { font-size: 0.85rem; }
  .track { top: 56px; }
  .id-card { font-size: 1.05rem; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .pillar-list { grid-template-columns: repeat(3, 1fr); }
  .pillar-list li:nth-child(4) { border-left: 0; }
  .pillar-list li:nth-child(n + 4) { border-top: 1px solid rgb(255 184 107 / 0.22); }
  .steps, .ledger { grid-template-columns: 1fr; }
  .platforms { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .nav { height: 64px; }
  .nav { gap: 10px; }
  .nav-links { display: none; }
  .nav .lang-menu { margin-left: auto; }
  .nav .nav-get { display: none; }
  .support-panel { grid-template-columns: 1fr; gap: 28px; }
  .br-wide { display: none; }
  .hero { padding-top: 104px; align-items: flex-end; min-height: 92svh; }
  .hero-bg { object-position: 70% 50%; }
  .hero::before {
    background: linear-gradient(0deg, var(--navy) 8%, rgb(11 15 26 / 0.78) 48%, rgb(11 15 26 / 0.15) 100%);
  }
  .actions .btn { flex: 1 1 auto; }
  .pillar-list { grid-template-columns: 1fr 1fr; }
  .pillar-list li { padding: 26px 8px; font-size: 0.95rem; }
  .pillar-list li + li { border-left: 0; }
  .pillar-list li:nth-child(even) { border-left: 1px solid rgb(255 184 107 / 0.22); }
  .pillar-list li:nth-child(n + 3) { border-top: 1px solid rgb(255 184 107 / 0.22); }
  .pillar-list li:last-child { grid-column: 1 / -1; }
  .steps li, .card { padding: 24px; }
  .platforms { grid-template-columns: 1fr 1fr; }
  .platforms li:first-child { grid-column: 1 / -1; }
  .footer-links { margin-left: 0; }

  /* Phone header: logo, language, theme, the Donate heart and one account button. */
  .nav .btn-sm { padding: 0 14px; }
  .nav .btn-donate { padding: 0; }
}

@media (max-width: 400px) {
  .nav { gap: 6px; padding-inline: 12px; }
  .nav .brand span { display: none; } /* the logo alone; the link keeps its "home" label */
  .nav .lang-menu summary { padding: 0 10px; gap: 4px; }
  .nav .lang-menu .globe { display: none; }
  .nav .btn-sm { padding: 0 12px; font-size: 0.86rem; }
}

/* ---------- Theme toggle (header) ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 1rem; background: transparent; box-shadow: inset 0 0 0 1px rgb(255 247 230 / 0.18); transition: box-shadow .15s;
}
.theme-toggle:hover { box-shadow: inset 0 0 0 1px rgb(255 247 230 / 0.45); }

/* ---------- Light theme ----------
   Chosen in the header (or in the app), or following the device when no choice was made.
   The photographic hero and closing banner stay dark: their copy sits on the night-time archway. */
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f6f1e8;
  --text: #1d2433;
  --muted: rgb(29 36 51 / 0.72);
  --faint: rgb(29 36 51 / 0.52);
  --line: rgb(29 36 51 / 0.12);
  --surface: rgb(255 255 255 / 0.86);
  --glow: 0 0 0 1px rgb(214 120 40 / 0.25), 0 10px 30px -14px rgb(255 138 69 / 0.55);
  --link: #b45309;
  --menu: #fff;
  --head: rgb(246 241 232 / 0.88);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: #f6f1e8;
    --text: #1d2433;
    --muted: rgb(29 36 51 / 0.72);
    --faint: rgb(29 36 51 / 0.52);
    --line: rgb(29 36 51 / 0.12);
    --surface: rgb(255 255 255 / 0.86);
    --glow: 0 0 0 1px rgb(214 120 40 / 0.25), 0 10px 30px -14px rgb(255 138 69 / 0.55);
    --link: #b45309;
    --menu: #fff;
    --head: rgb(246 241 232 / 0.88);
  }
}

/* The dark photographic sections keep their own dark tokens in every theme. */
.hero, .closing {
  --text: var(--soft); --muted: rgb(255 247 230 / 0.68); --faint: rgb(255 247 230 / 0.45);
  --line: rgb(255 247 230 / 0.1); --surface: rgb(30 38 56 / 0.55);
  color: var(--soft);
}
.hero, .closing { background-color: var(--navy); }
/* Specific enough to win over the light-theme button rules: the hero stays dark. */
.hero .actions .btn-ghost.btn-ghost { color: var(--soft); box-shadow: inset 0 0 0 1px rgb(255 247 230 / 0.28); background: rgb(11 15 26 / 0.35); }
.hero .actions .btn-light.btn-light { background: var(--soft); color: var(--navy); }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .site-header { background: var(--head); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
  :root:not([data-theme="dark"]) .btn-ghost { color: var(--text); background: rgb(255 255 255 / 0.7); box-shadow: inset 0 0 0 1px rgb(29 36 51 / 0.22); }
  :root:not([data-theme="dark"]) .btn-light { background: #1d2433; color: #fff; }
  :root:not([data-theme="dark"]) .theme-toggle, :root:not([data-theme="dark"]) .lang-menu summary { box-shadow: inset 0 0 0 1px rgb(29 36 51 / 0.2); color: var(--text); }
  :root:not([data-theme="dark"]) .lang-menu ul { background: var(--menu); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -16px rgb(29 36 51 / 0.35); }
  :root:not([data-theme="dark"]) .lang-menu li a:hover { background: rgb(29 36 51 / 0.05); }
  :root:not([data-theme="dark"]) .pillars { background: linear-gradient(180deg, #fffaf1, var(--page)); }
  :root:not([data-theme="dark"]) .pillar-list svg, :root:not([data-theme="dark"]) .pillar-list em,
  :root:not([data-theme="dark"]) .eyebrow, :root:not([data-theme="dark"]) .step-num, :root:not([data-theme="dark"]) .legal a,
  :root:not([data-theme="dark"]) .more-link a, :root:not([data-theme="dark"]) .support-more, :root:not([data-theme="dark"]) .node small,
  :root:not([data-theme="dark"]) .compare .col-nodz, :root:not([data-theme="dark"]) .platforms li:first-child small { color: var(--link); stroke: var(--link); }
  :root:not([data-theme="dark"]) .card-warm { background: linear-gradient(120deg, rgb(255 138 69 / 0.14), var(--surface) 55%); }
  :root:not([data-theme="dark"]) .support-panel {
    background: radial-gradient(40rem 22rem at 100% 0%, rgb(255 138 69 / 0.22), transparent 60%), linear-gradient(135deg, #fff6ea, #fdeedd);
    box-shadow: inset 0 0 0 1px rgb(214 120 40 / 0.28), 0 30px 80px -50px rgb(255 138 69 / 0.6);
  }
  :root:not([data-theme="dark"]) .support-action { background: rgb(255 255 255 / 0.75); }
  :root:not([data-theme="dark"]) .legal th, :root:not([data-theme="dark"]) .compare thead th { background: rgb(29 36 51 / 0.05); }
  :root:not([data-theme="dark"]) .doc .notice { color: var(--text); background: #fff1df; }
  :root:not([data-theme="dark"]) .step-n { color: var(--link); }
}
:root[data-theme="light"] .site-header { background: var(--head); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--line); }
:root[data-theme="light"] .btn-ghost { color: var(--text); background: rgb(255 255 255 / 0.7); box-shadow: inset 0 0 0 1px rgb(29 36 51 / 0.22); }
:root[data-theme="light"] .btn-light { background: #1d2433; color: #fff; }
:root[data-theme="light"] .theme-toggle, :root[data-theme="light"] .lang-menu summary { box-shadow: inset 0 0 0 1px rgb(29 36 51 / 0.2); color: var(--text); }
:root[data-theme="light"] .lang-menu ul { background: var(--menu); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -16px rgb(29 36 51 / 0.35); }
:root[data-theme="light"] .lang-menu li a:hover { background: rgb(29 36 51 / 0.05); }
:root[data-theme="light"] .pillars { background: linear-gradient(180deg, #fffaf1, var(--page)); }
:root[data-theme="light"] .pillar-list svg, :root[data-theme="light"] .pillar-list em,
:root[data-theme="light"] .eyebrow, :root[data-theme="light"] .step-num, :root[data-theme="light"] .legal a,
:root[data-theme="light"] .more-link a, :root[data-theme="light"] .support-more, :root[data-theme="light"] .node small,
:root[data-theme="light"] .compare .col-nodz, :root[data-theme="light"] .platforms li:first-child small { color: var(--link); stroke: var(--link); }
:root[data-theme="light"] .card-warm { background: linear-gradient(120deg, rgb(255 138 69 / 0.14), var(--surface) 55%); }
:root[data-theme="light"] .support-panel {
  background: radial-gradient(40rem 22rem at 100% 0%, rgb(255 138 69 / 0.22), transparent 60%), linear-gradient(135deg, #fff6ea, #fdeedd);
  box-shadow: inset 0 0 0 1px rgb(214 120 40 / 0.28), 0 30px 80px -50px rgb(255 138 69 / 0.6);
}
:root[data-theme="light"] .support-action { background: rgb(255 255 255 / 0.75); }
:root[data-theme="light"] .legal th, :root[data-theme="light"] .compare thead th { background: rgb(29 36 51 / 0.05); }
:root[data-theme="light"] .doc .notice { color: var(--text); background: #fff1df; }
:root[data-theme="light"] .step-n { color: var(--link); }

/* ---------- Legal notice ---------- */
.imprint { margin: 28px 0 8px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); padding: 6px 22px; }
.imprint div { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 6px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.imprint div:last-child { border-bottom: 0; }
.imprint dt { color: var(--muted); }
.imprint dd { margin: 0; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 560px) { .imprint div { grid-template-columns: 1fr; } }