/* centralhub.one — own stylesheet (WS-004, direction B "Instrument").
   Reference: centralhub-projects/websites/reference/2026-10-27--ws-004--mock-b-instrument.html.
   Theme blocks keep colour tokens as 6-digit hex: tests/theme.test.ts checks every
   text token against --bg and --card (≥ 4.5:1). */

/* ---------- tokens ---------- */

:root,
[data-theme="dark"] {
  --bg: #070b12; --card: #0a0f18; --fg: #e3e8ef; --fg-muted: #9aa7b8; --fg-faint: #7a889b;
  --line: #16202e; --accent: #6fd3ff;
  --grid: rgba(120, 160, 220, .06); --header: rgba(7, 11, 18, .78); --glow: 0 0 10px var(--accent);
}
[data-theme="light"] {
  --bg: #f4f6f9; --card: #ffffff; --fg: #0b1220; --fg-muted: #4a5668; --fg-faint: #5c6777;
  --line: #d8dee7; --accent: #0a5fd0;
  --grid: rgba(10, 40, 90, .055); --header: rgba(244, 246, 249, .8); --glow: none;
}
[data-theme="paper"] {
  --bg: #f3efe6; --card: #fbf8f1; --fg: #1b1915; --fg-muted: #5c5649; --fg-faint: #665f52;
  --line: #dcd3c1; --accent: #2346c4;
  --grid: rgba(60, 45, 20, .055); --header: rgba(243, 239, 230, .82); --glow: none;
}
[data-theme="phosphor"] {
  --bg: #040904; --card: #07100a; --fg: #d6efd8; --fg-muted: #86a88b; --fg-faint: #6b8a71;
  --line: #15291a; --accent: #33ff66;
  --grid: rgba(51, 255, 102, .05); --header: rgba(4, 9, 4, .8); --glow: 0 0 10px var(--accent);
}
:root {
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

/* ---------- base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg); color: var(--fg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px;
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 32px; }

h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- header ---------- */

.site-header { position: sticky; top: 0; z-index: 10; background: var(--header); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { font-weight: 650; font-size: 18px; letter-spacing: -.01em; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }
.site-nav { display: flex; align-items: baseline; gap: 26px; margin-left: auto; font-size: 14px; }
.site-nav a, .header-controls a { color: var(--fg-muted); text-decoration: none; }
.site-nav a:hover, .header-controls a:hover { color: var(--fg); }
/* the subpage entry: path-style behind a divider in the middle of the gap (WS-004 D11) */
.site-nav .page-link { position: relative; font: 13px var(--mono); color: var(--fg-faint); }
.site-nav .page-link::before { content: ""; position: absolute; left: -13px; top: 50%; width: 1px; height: 16px; margin-top: -8px; background: var(--line); }
.site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.header-controls { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.theme-toggle { font: 12px var(--mono); letter-spacing: .06em; color: var(--fg-muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.theme-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- section frame ---------- */

section { position: relative; }
.marker { font: 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h2 { font-weight: 650; font-size: 38px; letter-spacing: -.025em; line-height: 1.1; margin: 10px 0 30px; }
.block { padding: 96px 0 0; }
.hero + .block { padding-top: 0; }
/* nav jumps: the marker lands below the sticky header (64 px; 83 px on phones) */
.hero + .block { scroll-margin-top: 92px; }

/* ---------- hero ---------- */

.hero { padding: 120px 0 110px; overflow: hidden; }
.hero .curve { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .container { position: relative; }
.sline { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 26px; font: 12px var(--mono); letter-spacing: .07em; color: var(--fg-muted); text-transform: uppercase; }
.sline li { overflow-wrap: anywhere; position: relative; padding-left: 16px; }
.sline li::before { content: "●"; color: var(--accent); position: absolute; left: 0; }
h1 { font-weight: 650; font-size: 64px; line-height: 1.03; letter-spacing: -.035em; margin-top: 24px; max-width: 800px; }
h1 em { font-style: normal; color: var(--accent); hyphens: manual; }
.lead { font-size: 19px; line-height: 1.6; color: var(--fg-muted); max-width: 640px; margin-top: 24px; }
.cta { position: relative; display: inline-flex; align-items: center; gap: 10px; margin-top: 34px; padding: 14px 22px; border-radius: 8px;
  background: var(--card); color: var(--fg); font-weight: 600; text-decoration: none; isolation: isolate; border: 1px solid var(--line); }

/* ---------- questions ---------- */

.qa { display: grid; grid-template-columns: 64px 1fr 1.3fr; gap: 26px; padding: 26px 28px; margin-top: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.qa .n { font: 12px var(--mono); color: var(--accent); padding-top: 4px; }
.qa h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.qa p { font-size: 15px; color: var(--fg-muted); }
.door { display: inline-block; margin-top: 12px; font: 13px var(--mono); color: var(--accent); text-decoration: none; letter-spacing: .02em; }

/* ---------- process track ---------- */

.track { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; padding-top: 34px; }
.track::before { content: ""; position: absolute; top: 6px; left: 6px; right: 6px; height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--line) 70%); }
.step { position: relative; }
.step::before { content: ""; position: absolute; top: -34px; left: 0; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); }
.step:first-child::before { background: var(--accent); box-shadow: var(--glow); }
.step .n { font: 12px var(--mono); color: var(--accent); letter-spacing: .1em; }
.step h3 { font-size: 19px; font-weight: 600; margin: 6px 0 8px; letter-spacing: -.01em; }
.step p { font-size: 15px; color: var(--fg-muted); }

/* ---------- fields grid ---------- */

.fields { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.field { padding: 26px 26px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.field .n { font: 11px var(--mono); color: var(--fg-faint); letter-spacing: .12em; }
.field h3 { font-size: 18px; font-weight: 600; margin: 8px 0 6px; }
.field p { font-size: 15px; color: var(--fg-muted); }

/* ---------- about + contact ---------- */

/* plain paragraphs only: the section's p.marker, p.links and p.fineprint keep their own style */
.about p:not([class]) { max-width: 720px; font-size: 17px; color: var(--fg-muted); margin-bottom: 16px; }
.about h2 + p:not([class]) { color: var(--fg); }
.links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 10px; font: 14px var(--mono); }
.links a { color: var(--accent); text-decoration: none; }
.contact { padding-bottom: 110px; }
.contact p:not([class]) { max-width: 640px; color: var(--fg-muted); font-size: 17px; }
.cta.mail { font: 500 15px var(--mono); overflow-wrap: anywhere; }
.contact .fineprint { margin-top: 26px; font-size: 13px; color: var(--fg-faint); }
.fineprint a { color: var(--fg-muted); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 22px 0 40px; font: 12px var(--mono); color: var(--fg-faint); letter-spacing: .04em; }
.site-footer .titleblock { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.site-footer a { color: var(--fg-muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); }

/* ---------- prose pages (subpage, imprint, privacy) ---------- */

.page { padding: 96px 0 110px; }
.prose { max-width: 720px; }
.prose h1 { font-size: 38px; letter-spacing: -.025em; line-height: 1.1; margin: 0 0 30px; max-width: none; }
.prose h2 { font-weight: 650; font-size: 26px; letter-spacing: -.02em; line-height: 1.2; margin: 48px 0 14px; }
.prose h3 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: 32px 0 10px; }
.prose h4 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.prose p, .prose ul, .prose ol, .prose table { margin-bottom: 16px; }
.prose p, .prose li { font-size: 17px; color: var(--fg-muted); }
.prose ul, .prose ol { padding-left: 22px; }
.prose strong { color: var(--fg); font-weight: 600; }
.prose a { color: var(--accent); overflow-wrap: anywhere; }
.prose code { font: .9em var(--mono); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
/* the principles table as a readout: mono header row, 1 px rules, no zebra */
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; border-top: 1px solid var(--line); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: break-word; hyphens: auto; }
.prose th { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--fg-muted); }
.prose td { color: var(--fg-muted); }
.prose td:first-child { color: var(--fg); font-weight: 600; padding-right: 24px; hyphens: manual; }
/* breadcrumb above the title and the subpage's closing buttons (WS-004 D12) */
.prose .crumb { font-size: 17px; margin-bottom: 18px; }
.crumb a { color: var(--accent); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
.crumb .slash { color: var(--fg-faint); margin: 0 8px; }
.crumb .here { color: var(--fg-muted); }
.endblock { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.endblock .cta { margin-top: 0; }

/* ---------- between phone and full desktop ---------- */

@media (max-width: 980px) {
  .site-nav { gap: 18px; }
  .site-nav .page-link::before { left: -9px; }
  h1 { font-size: 52px; }
  .qa { grid-template-columns: 64px 1fr; gap: 10px 20px; }
  .qa .n { grid-row: span 2; }
  .fields { grid-template-columns: repeat(2, 1fr); }
  .track { grid-template-columns: 1fr; padding-top: 0; padding-left: 30px; gap: 26px; }
  .track::before { top: 6px; bottom: 6px; left: 6px; right: auto; width: 1px; height: auto; background: linear-gradient(180deg, var(--accent), var(--line) 70%); }
  .step::before { top: 4px; left: -30px; }
}

/* ---------- phones ---------- */

@media (max-width: 760px) {
  .container { padding: 0 16px; }
  .site-header .container { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 10px; gap: 10px 16px; }
  /* the scroll box clips at its padding edge: 5 px of padding keep the focus ring (2 px + 3 px offset) visible */
  .site-nav { order: 3; width: calc(100% + 10px); padding: 5px; margin: -5px; gap: 18px; overflow-x: auto; white-space: nowrap; font-size: 13px; }
  .header-controls { margin-left: auto; }
  .site-nav a[aria-current="page"] { text-underline-offset: 4px; }
  .prose .crumb { font-size: 13px; }
  .hero { padding: 56px 0 230px; }
  h1 { font-size: 40px; }
  .lead { font-size: 17px; }
  h2, .prose h1 { font-size: 30px; }
  .block, .page { padding-top: 72px; }
  .hero + .block { padding-top: 0; }
  .block { scroll-margin-top: 40px; }
  .hero + .block { scroll-margin-top: 112px; }
  .qa { grid-template-columns: 1fr; gap: 8px; padding: 20px; }
  .qa .n { grid-row: auto; }
  .fields { grid-template-columns: 1fr; }
  .links { flex-direction: column; gap: 10px; }
  .prose table { font-size: 14px; }
  .prose td:first-child { padding-right: 14px; }
}

/* ---------- motion (WS-004 D8): one turn on load, again on hover and keyboard focus ---------- */

@property --a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes ch-spin { to { --a: 360deg; } }
.cta::before { content: ""; position: absolute; inset: -1px; border-radius: 9px; padding: 1px; z-index: -1;
  background: conic-gradient(from var(--a), var(--accent), transparent 30%, transparent 70%, var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: ch-spin 4s linear 1; }
.cta:focus-visible::before { animation: ch-spin 4s linear infinite; }
/* hover only where a pointer can leave: a tap on a touch screen would keep :hover and the light spinning */
@media (hover: hover) {
  .cta:hover::before { animation: ch-spin 4s linear infinite; }
}

@media (prefers-reduced-motion: reduce) {
  .cta::before, .cta:hover::before, .cta:focus-visible::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- print ---------- */

@media print {
  :root, [data-theme] {
    --bg: #ffffff; --card: #ffffff; --fg: #0b1220; --fg-muted: #4a5668; --fg-faint: #5c6777;
    --line: #d8dee7; --accent: #0a5fd0; --glow: none;
  }
  body { background: none; }
  .site-header { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .curve, .theme-toggle { display: none; }
}
