/*
VOICE   precise, calm, quietly confident — an engineer who also designs
IDEA    a technical drawing of a world at first light: annotations, dimension lines, one live horizon
PICTURE the real Earth, lit by the real Sun at this minute (Immersive) or a drawn horizon (Essential)
COLOUR  obsidian ground, graphite surfaces, midnight bands, atmospheric blue for action, silver for notes
TYPE    Archivo variable: wide + light for statements, condensed for annotations, regular for reading
*/
:root {
  color-scheme: dark;
  --obsidian: #05070b;
  --graphite: #11151c;
  --graphite-2: #1a2029;
  --midnight: #0b1a33;
  --atmos: #6aaeff;
  --atmos-deep: #2f6fd1;
  --atmos-soft: rgba(106, 174, 255, .14);
  --silver: #a7b1bf;
  --white: #eef3fa;
  --line: rgba(238, 243, 250, .12);
  --line-strong: rgba(238, 243, 250, .28);
  --ok: #7fd1a8;
  --warn: #f0c36a;
  --danger: #ff8a8a;

  --font: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --step--1: 13px;
  --step-0: 16.5px;
  --step-1: 20px;
  --step-2: clamp(24px, 2.2vw, 30px);
  --step-3: clamp(32px, 4vw, 48px);
  --step-4: clamp(40px, 7.2vw, 96px);
  --wide: 118;
  --narrow: 74;
  --radius-s: 6px;
  --radius-m: 12px;
  --content: 1240px;
  --pad: max(5vw, 18px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--obsidian);
  color: var(--white);
  font: 400 var(--step-0)/1.6 var(--font);
  font-variation-settings: "wdth" 100;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--atmos); }
button, input, select, textarea { font: inherit; color: inherit; }
p { margin: 0 0 1em; max-width: 68ch; }
h1, h2, h3, h4 { margin: 0; font-weight: 350; line-height: 1.06; text-wrap: balance; letter-spacing: -.015em; }
h1, .display { font-size: var(--step-4); font-variation-settings: "wdth" var(--wide); font-weight: 300; letter-spacing: -.03em; }
h2 { font-size: var(--step-3); font-variation-settings: "wdth" 112; font-weight: 320; }
h3 { font-size: var(--step-1); font-weight: 520; letter-spacing: 0; line-height: 1.25; }
.note, .annot {
  font-size: var(--step--1);
  font-variation-settings: "wdth" var(--narrow);
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--silver);
  line-height: 1.45;
}
.muted { color: var(--silver); }
.lead { font-size: var(--step-1); line-height: 1.5; color: #d6dde8; max-width: 52ch; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--atmos); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--white); color: var(--obsidian); padding: 10px 14px; border-radius: var(--radius-s); }
.skip:focus { top: 12px; }

/* Layout */
.wrap { width: min(100% - 2 * var(--pad), var(--content)); margin-inline: auto; }
.band { padding-block: clamp(56px, 9vw, 128px); position: relative; }
.band--midnight { background: linear-gradient(180deg, var(--obsidian), var(--midnight) 30%, var(--midnight) 70%, var(--obsidian)); }
.band--graphite { background: var(--graphite); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 56px); max-width: 860px; }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; gap: 16px; padding-inline: var(--pad);
  background: linear-gradient(180deg, rgba(5, 7, 11, .86), rgba(5, 7, 11, .55) 70%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand img { width: 30px; height: 30px; }
.brand b { font-weight: 500; font-variation-settings: "wdth" 125; letter-spacing: .14em; font-size: 15px; }
.brand span { display: block; font-size: 11px; color: var(--silver); font-variation-settings: "wdth" 80; letter-spacing: .02em; margin-top: -2px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; padding: 10px 12px; border-radius: 8px; font-size: 15px; color: #d6dde8; }
.nav a[aria-current="page"] { color: var(--white); box-shadow: inset 0 -1px 0 var(--atmos); border-radius: 0; }
.tools { display: flex; gap: 6px; align-items: center; flex: none; }
.chip-btn {
  min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; cursor: pointer; font-size: 13.5px; font-variation-settings: "wdth" 85; font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px;
}
.chip-btn:hover { border-color: var(--atmos); }
.chip-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--atmos); box-shadow: 0 0 10px var(--atmos); }
.chip-btn[data-mode="essential"] .dot { background: var(--silver); box-shadow: none; }
.menu-btn { display: none; }
@media (max-width: 980px) {
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; padding: 12px var(--pad) 20px; background: rgba(5, 7, 11, .97); border-bottom: 1px solid var(--line); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 6px; font-size: 18px; }
  .menu-btn { display: inline-flex; }
  .tools { margin-left: auto; }
}
@media (max-width: 420px) { .brand span { display: none; } .chip-btn .label-long { display: none; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: 999px; border: 1px solid var(--white); background: var(--white); color: var(--obsidian);
  font-weight: 550; text-decoration: none; cursor: pointer; font-size: 15.5px; transition: transform .2s var(--ease), background .2s;
}
.btn:hover { color: var(--obsidian); background: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--white); border-color: var(--line-strong); }
.btn--ghost:hover { color: var(--white); background: rgba(238, 243, 250, .06); border-color: var(--white); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Annotation system — taken from technical drawings: a leader line, a tick and a short note. */
.callout { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.callout::before { content: ""; height: 1px; background: var(--line-strong); margin-top: .72em; position: relative; }
.dim { display: flex; align-items: center; gap: 10px; color: var(--silver); }
.dim::before, .dim::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat; border-inline: 1px solid var(--line-strong); height: 9px; }

.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-variation-settings: "wdth" 80; font-weight: 550; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--live { color: var(--ok); }
.status--beta { color: var(--atmos); }
.status--dev { color: var(--warn); }
.status--proto { color: var(--silver); }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; font-size: 14px; color: var(--silver); }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--obsidian); font-weight: 600; }
.panel { background: var(--graphite); border: 1px solid var(--line); border-radius: var(--radius-m); }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: 14px; font-weight: 520; color: #d6dde8; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: rgba(5, 7, 11, .6); font-size: 16px; color: var(--white);
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--atmos); outline: none; box-shadow: 0 0 0 3px var(--atmos-soft); }
.hint { font-size: 13px; color: var(--silver); }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 90; background: var(--white); color: var(--obsidian); padding: 12px 18px; border-radius: 12px; font-weight: 520; transition: .3s var(--ease); pointer-events: none; max-width: min(92vw, 520px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

.site-footer { border-top: 1px solid var(--line); padding-block: 40px 56px; color: var(--silver); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer-grid h4 { font-size: 14px; color: var(--white); font-weight: 550; margin-bottom: 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

.workspace-menu { position: relative; white-space: nowrap; }
.workspace-menu summary { cursor: pointer; }
.workspace-menu-links { position: absolute; right: 0; top: calc(100% + 10px); display: grid; min-width: max-content; padding: 12px; gap: 7px; border: 1px solid var(--line); background: var(--obsidian); }
.workspace-menu:not([open]) .workspace-menu-links { display: none; }
.workspace-menu-links a { padding: 6px 8px; }
.footer-admin { display: inline-block; margin-top: 10px; }
@media (max-width: 980px) {
  .workspace-menu-links { position: static; min-width: 0; }
}
