/* KNX Atlas – knxatlas.com
   Minimal, system fonts only (no external requests), light and dark via prefers-color-scheme. */

:root {
  --blue: #015ac3;
  --blue-strong: #004a9f;
  --green: #4cac3a;
  --navy: #001e50;

  --bg: #fbfbfd;
  --bg-tint: #f2f4f8;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #5b6270;
  --faint: #8a909c;
  --line: rgba(0, 30, 80, 0.1);
  --line-strong: rgba(0, 30, 80, 0.18);
  --accent: var(--blue);
  --accent-soft: rgba(1, 90, 195, 0.08);
  --on-accent: #ffffff;
  --dark-bg: #0b1424;
  --dark-text: #e9edf5;
  --dark-muted: #a3adbf;
  --shadow: 0 1px 2px rgba(0, 30, 80, 0.06), 0 12px 40px -12px rgba(0, 30, 80, 0.22);
  --shadow-lg: 0 2px 6px rgba(0, 30, 80, 0.06), 0 40px 80px -30px rgba(0, 30, 80, 0.35);

  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --bg-tint: #12151c;
    --surface: #171a22;
    --text: #f2f4f8;
    --muted: #a5adbb;
    --faint: #7d8696;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --accent: #4d9bff;
    --accent-soft: rgba(77, 155, 255, 0.12);
    --on-accent: #ffffff;
    --dark-bg: #060a12;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 40px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.12; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(780px + 2 * var(--gutter)); }

.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--on-accent); border-radius: 10px; }
.skip:focus { top: 12px; }

.icon { width: 18px; height: 18px; flex: none; }
.logo { width: 28px; height: 28px; flex: none; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { color: var(--muted); font-size: 15px; }
.nav a:hover { color: var(--text); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 14px; font-weight: 600; padding: 6px 8px; border-radius: 8px; }
.lang:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.lang .icon { width: 16px; height: 16px; }

.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; padding: 8px; border-radius: 10px; color: var(--text); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary .icon { width: 22px; height: 22px; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(300px, calc(100vw - 32px));
  display: flex; flex-direction: column; padding: 10px; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.menu-panel a { color: var(--text); padding: 9px 12px; border-radius: 8px; font-size: 16px; }
.menu-panel a:hover { background: var(--accent-soft); text-decoration: none; }

@media (max-width: 900px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .menu { display: block; }
}
@media (max-width: 480px) {
  .header-actions .btn-small { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  border: 1px solid transparent; transition: background-color .15s, transform .15s;
}
.btn:hover { text-decoration: none; background: var(--blue-strong); }
@media (prefers-color-scheme: dark) { .btn:hover { background: #2f87f5; } }
.btn:active { transform: scale(0.98); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-small { min-height: 34px; padding: 0 14px; font-size: 14px; }

/* ---------- Typography helpers ---------- */

.kicker { color: var(--accent); font-weight: 600; font-size: 15px; letter-spacing: 0; margin-bottom: 10px; }
.lead { color: var(--muted); font-size: clamp(18px, 2vw, 21px); line-height: 1.5; }
.fineprint { color: var(--faint); font-size: 13px; margin-top: 18px; }

.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-tint { background: var(--bg-tint); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(32px, 4.6vw, 52px); }
.section-head .lead { margin-top: 16px; }

/* ---------- Hero ---------- */

.hero { padding-top: clamp(56px, 9vw, 112px); overflow: hidden; }
.hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
.status {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px;
  padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(76, 172, 58, 0.18); }
.hero h1 { font-size: clamp(38px, 6.4vw, 76px); max-width: 15ch; letter-spacing: -0.035em; line-height: 1.04; }
.hero-platforms { margin-top: 18px; font-size: clamp(22px, 2.8vw, 30px); font-weight: 600; letter-spacing: -0.02em; color: var(--green); }
.hero .lead { margin-top: 18px; max-width: 680px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 32px; }

.hero-stage { position: relative; margin-top: clamp(48px, 7vw, 80px); padding-bottom: 40px; }
.hero-mac { width: 88%; }
.hero-mac img { border-radius: 12px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.hero-phone { position: absolute; right: var(--gutter); bottom: 0; width: 23%; max-width: 270px; }
@media (max-width: 700px) {
  .hero-mac { width: 100%; }
  .hero-phone { width: 34%; right: calc(var(--gutter) - 4px); bottom: -8px; }
  .hero-stage { padding-bottom: 72px; }
}

/* Device frames */
.zoom { display: block; cursor: zoom-in; }
.device-iphone img, .device-ipad img { border-radius: 13% / 6%; border: 6px solid #1d1d1f; box-shadow: var(--shadow-lg); background: #1d1d1f; }
.device-ipad img { border-radius: 5.5% / 4.1%; border-width: 8px; }
.device-mac img { border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (prefers-color-scheme: dark) { .device-iphone img, .device-ipad img { border-color: #3a3d45; } }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: clamp(40px, 6vw, 72px); background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.facts li { background: var(--surface); padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.facts strong { font-size: 16px; }
.facts span { color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { .facts { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .facts { grid-template-columns: 1fr; } }

/* ---------- Features ---------- */

.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }
.feature a {
  display: flex; flex-direction: column; height: 100%; padding: 26px 24px 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feature a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.feature-icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: 20px; padding: 6px; background: var(--accent-soft); border-radius: 10px; }
.feature h3 { font-size: 19px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 15.5px; line-height: 1.5; flex: 1; }
.more { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--accent); font-size: 15px; font-weight: 600; }
.more .icon { width: 16px; height: 16px; transition: transform .2s; }
a:hover .more .icon { transform: translateX(3px); }

/* ---------- Screenshot tour ---------- */

.tour-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 32px; }
.no-js .tour-controls { display: none; }
.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.segmented button {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font: 600 15px var(--font); cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.tour-tabs { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; padding-bottom: 4px; scrollbar-width: none; }
.tour-tabs::-webkit-scrollbar { display: none; }
.tour-tabs button {
  flex: none; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text); font: 500 15px var(--font); cursor: pointer; white-space: nowrap;
}
.tour-tabs button:hover { background: var(--accent-soft); }
.tour-tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.tour-panel { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: center; }
.tour-panel[hidden] { display: none; }
.no-js .tour-panel[hidden] { display: grid; }
.no-js .tour-panel + .tour-panel { margin-top: 56px; }
.tour-media { display: flex; justify-content: center; min-height: 200px; }
.tour-shot { display: none; width: 100%; }
.tour[data-device="mac"] .tour-shot[data-device="mac"],
.tour[data-device="ipad"] .tour-shot[data-device="ipad"],
.tour[data-device="iphone"] .tour-shot[data-device="iphone"] { display: block; }
.tour-shot[data-device="ipad"] { max-width: 470px; }
.tour-shot[data-device="iphone"] { max-width: 300px; }
.tour-caption h3 { font-size: 28px; margin-bottom: 12px; }
.tour-caption p { color: var(--muted); font-size: 18px; }
.js .tour-panel:not([hidden]) .tour-media, .js .tour-panel:not([hidden]) .tour-caption { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .tour-panel { grid-template-columns: 1fr; gap: 24px; }
  .tour-caption { text-align: center; max-width: 560px; margin: 0 auto; }
}

/* ---------- Workflow ---------- */

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; counter-reset: step; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }
.steps li { position: relative; padding-top: 22px; border-top: 2px solid var(--line-strong); }
.steps li:first-child { border-top-color: var(--accent); }
.steps .num { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 16px; }
.steps h3 { font-size: 21px; margin-bottom: 8px; }
.steps p { color: var(--muted); font-size: 16px; }

/* ---------- Principle (dark band) ---------- */

.section-dark { background: var(--dark-bg); color: var(--dark-text); }
.section-dark .kicker { color: #7fb6ff; }
.section-dark .lead { color: var(--dark-muted); }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 40px; }
@media (max-width: 900px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }
.principles li { display: flex; gap: 14px; }
.check { width: 26px; height: 26px; flex: none; padding: 4px; border-radius: 50%; background: rgba(76, 172, 58, 0.2); color: #7ad468; }
.principles h3 { font-size: 18px; margin-bottom: 6px; }
.principles p { color: var(--dark-muted); font-size: 15.5px; }

/* ---------- Chapter cards ---------- */

.chapter-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .chapter-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .chapter-cards { grid-template-columns: 1fr; } }
.chapter-cards a {
  display: flex; flex-direction: column; height: 100%; padding: 26px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: transform .2s, box-shadow .2s;
}
.chapter-cards a:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.chapter-cards li[aria-current] a { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chapter-cards .num { font: 600 14px var(--mono); color: var(--faint); margin-bottom: 18px; }
.chapter-card-title { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.chapter-card-text { color: var(--muted); font-size: 15.5px; flex: 1; }

/* ---------- Platforms ---------- */

.platforms { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px; align-items: end; }
@media (max-width: 900px) { .platforms { grid-template-columns: 1fr 1fr; } .platform-mac { grid-column: 1 / -1; } }
@media (max-width: 520px) { .platforms { grid-template-columns: 1fr; } }
.platform-media { display: flex; justify-content: center; align-items: flex-end; margin-bottom: 26px; }
.platform-ipad .platform-media .zoom { max-width: 230px; }
.platform-iphone .platform-media .zoom { max-width: 170px; }
.platform h3 { display: flex; align-items: center; gap: 8px; font-size: 21px; margin-bottom: 8px; }
.platform h3 .icon { color: var(--accent); width: 20px; height: 20px; }
.platform p { color: var(--muted); font-size: 16px; }
.requirement { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }

/* ---------- Privacy ---------- */

.privacy-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .privacy-grid { grid-template-columns: 1fr; gap: 0; } }
.privacy-points { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 560px) { .privacy-points { grid-template-columns: 1fr; } }
.privacy-points li { padding-left: 18px; border-left: 2px solid var(--green); }
.privacy-points h3 { font-size: 18px; margin-bottom: 6px; }
.privacy-points p { color: var(--muted); font-size: 15.5px; }

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

.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; }
.faq-toggle { position: relative; width: 14px; height: 14px; flex: none; }
.faq-toggle::before, .faq-toggle::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 2px; background: var(--muted); transition: transform .2s; }
.faq-toggle::after { transform: rotate(90deg); }
.faq-item[open] .faq-toggle::after { transform: rotate(0deg); }
.faq-answer { padding: 0 0 24px; color: var(--muted); max-width: 70ch; }

/* ---------- CTA ---------- */

.cta {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(48px, 7vw, 80px) clamp(20px, 5vw, 64px);
  background: linear-gradient(160deg, var(--surface), var(--bg-tint)); border: 1px solid var(--line); border-radius: 28px;
}
.cta .logo { width: 64px; height: 64px; margin-bottom: 24px; }
.cta h2 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 14px; }
.cta .lead { max-width: 620px; margin-bottom: 28px; }

/* ---------- Chapter pages ---------- */

.chapter-hero { padding-top: clamp(40px, 6vw, 72px); }
.breadcrumb { display: flex; gap: 8px; font-size: 14px; color: var(--faint); margin-bottom: 28px; }
.breadcrumb a { color: var(--muted); }
.chapter-hero h1 { font-size: clamp(36px, 5.6vw, 64px); max-width: 18ch; letter-spacing: -0.035em; line-height: 1.05; }
.chapter-hero .lead { margin-top: 20px; max-width: 720px; }
.chapter-visual { margin-top: clamp(40px, 6vw, 64px); }
.chapter-visual .figure { margin: 0; }
.chapter-visual-iphone .figure, .chapter-visual-ipad .figure { display: flex; flex-direction: column; align-items: center; }
.chapter-visual-iphone .zoom { max-width: 300px; }
.chapter-visual-ipad .zoom { max-width: 440px; }

.figure { margin: 32px 0 0; }
.figure figcaption { margin-top: 14px; color: var(--faint); font-size: 14px; text-align: center; }
.figure-iphone, .figure-ipad { display: flex; flex-direction: column; align-items: center; }
.chapter-content .figure-iphone .zoom { max-width: 260px; }
.chapter-content .figure-ipad .zoom { max-width: 380px; }

.chapter-body { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 64px; padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); }
@media (max-width: 900px) { .chapter-body { grid-template-columns: 1fr; gap: 32px; } }
.toc { position: relative; }
.toc nav { position: sticky; top: 92px; }
.toc h2 { font-size: 13px; font-weight: 600; color: var(--faint); letter-spacing: 0; margin-bottom: 12px; }
.toc ol { counter-reset: toc; border-left: 1px solid var(--line); }
.toc li { counter-increment: toc; }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: 14.5px; line-height: 1.35; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a[aria-current="true"] { color: var(--accent); border-left-color: var(--accent); }
@media (max-width: 900px) { .toc nav { position: static; padding: 18px 20px; background: var(--bg-tint); border-radius: var(--radius-sm); } }

.chapter-content { max-width: 760px; }
.chapter-section + .chapter-section { margin-top: clamp(56px, 7vw, 80px); }
.section-num { font: 600 14px var(--mono); color: var(--accent); margin-bottom: 10px; }
.chapter-section h2 { font-size: clamp(26px, 3.2vw, 34px); margin-bottom: 18px; }
.chapter-section > p { color: var(--text); opacity: .86; font-size: 17.5px; line-height: 1.65; }
.chapter-section > p + p { margin-top: 14px; }
.items { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
@media (max-width: 560px) { .items { grid-template-columns: 1fr; } }
.items li { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.items h3 { font-size: 16.5px; margin-bottom: 4px; }
.items p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.note { margin-top: 26px; padding: 18px 22px; border-radius: var(--radius-sm); background: var(--accent-soft); border-left: 3px solid var(--accent); }
.note strong { display: block; font-size: 14px; color: var(--accent); margin-bottom: 4px; }
.note p { font-size: 15.5px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 72px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.pager a:hover { text-decoration: none; border-color: var(--accent); }
.pager span { color: var(--faint); font-size: 14px; }
.pager strong { font-size: 17px; }
.pager-next { text-align: right; grid-column: 2; }
@media (max-width: 520px) { .pager { grid-template-columns: 1fr; } .pager-next { grid-column: auto; } }

/* KNX Secure diagram */
.secure-diagram {
  display: grid; grid-template-columns: auto 1fr auto 0.6fr auto; align-items: center; gap: 0;
  padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 48px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.sd-node { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 120px; text-align: center; font-size: 14px; font-weight: 600; }
.sd-node .logo, .sd-node .icon { width: 48px; height: 48px; padding: 10px; border-radius: 14px; background: var(--bg-tint); color: var(--accent); }
.sd-link { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 10px 18px; gap: 2px; font-size: 13px; color: var(--muted); }
.sd-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 4px; border-radius: 4px; background: var(--line-strong); }
.sd-link strong { color: var(--text); font-size: 15px; }
.sd-ip::after { background: var(--accent); }
.sd-span { grid-column: 1 / -1; margin-top: 26px; padding-top: 14px; border-top: 4px solid var(--green); display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: 13px; color: var(--muted); text-align: center; }
.sd-span strong { color: var(--text); font-size: 15px; }
@media (max-width: 640px) {
  .secure-diagram { grid-template-columns: 1fr; justify-items: center; gap: 8px; }
  .sd-link { padding: 8px 0 18px; width: 100%; }
}

/* ---------- Legal / 404 ---------- */

.legal { padding: clamp(40px, 6vw, 72px) 0 clamp(64px, 8vw, 112px); }
.legal h1 { font-size: clamp(34px, 5vw, 52px); }
.legal section { margin-top: 40px; }
.legal h2 { font-size: 22px; margin-bottom: 12px; }
.legal p { color: var(--muted); }
.legal p + p { margin-top: 10px; }

.not-found { padding: clamp(80px, 14vw, 160px) 0; text-align: center; }
.not-found .wrap { display: flex; flex-direction: column; align-items: center; }
.not-found .logo { width: 64px; height: 64px; margin-bottom: 24px; }
.not-found h1 { font-size: clamp(34px, 5vw, 52px); margin-bottom: 14px; }
.not-found .lead { margin-bottom: 28px; }

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

.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 440px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { margin-top: 12px; color: var(--muted); }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav h2 { font-size: 13px; font-weight: 600; color: var(--faint); letter-spacing: 0; margin-bottom: 4px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-legal { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--faint); font-size: 13px; }
.footer-legal p:first-child { max-width: 760px; }

/* ---------- Lightbox ---------- */

.lightbox { width: min(96vw, 1500px); max-height: 94vh; padding: 0; border: 0; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(6, 10, 18, 0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox img { max-width: 100%; max-height: 84vh; margin: 0 auto; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox-caption { margin-top: 14px; text-align: center; color: #e9edf5; font-size: 15px; }
.lightbox-close {
  position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }
