/* OMEGA AI LABS
   Palette derived from the logo: slate-violet disc, platinum lettering, warm metal highlights. */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-serif-4-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-serif-4-greek-opsz-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-sans-3-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --page: #23212d;
  --surface: #2c2938;
  --rule: #403d4f;
  --text: #e7e4ec;
  --muted: #aba7ba;
  --metal: #d3cbbe;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, p, ul, dl, dd, figure { margin: 0; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--metal);
  outline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--text);
  color: var(--page);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(35, 33, 45, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-right: auto;
}
.brand img { display: block; width: 40px; height: 40px; }
.brand-name {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
}
.site-nav {
  display: flex;
  gap: 24px;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--text); }
.lang {
  display: flex;
  gap: 4px;
  padding-left: 24px;
  border-left: 1px solid var(--rule);
}
.lang-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 6px 6px 4px;
  font: 600 0.85rem/1 var(--sans);
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  cursor: pointer;
}
.lang-btn:hover { color: var(--text); }
.lang-btn[aria-pressed="true"] {
  color: var(--text);
  border-bottom-color: var(--metal);
}

/* Hero */
.hero { padding-block: clamp(56px, 9vw, 112px) clamp(64px, 10vw, 128px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}
.hero h1 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(2.375rem, 4.4vw + 0.5rem, 4.25rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  max-width: 17ch;
  text-wrap: balance;
}
.hero-sub {
  margin-top: 28px;
  font-size: 1.25rem;
  line-height: 1.5;
  max-width: 44ch;
}
.hero-intro {
  margin-top: 16px;
  color: var(--muted);
  max-width: 58ch;
}
.hero .button { margin-top: 36px; }

.button {
  display: inline-block;
  padding: 13px 26px;
  background: var(--text);
  color: var(--page);
  border: 1px solid var(--text);
  border-radius: 2px;
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.button:hover { background: transparent; color: var(--text); }
.button:disabled { opacity: 0.6; cursor: progress; }

/* Figure 1: phase portrait */
.portrait { color: var(--text); }
.portrait-stage {
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
}
.portrait svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.portrait svg.is-replaced { display: none; }
.portrait-canvas {
  display: block;
  cursor: crosshair;
  touch-action: manipulation;
}
.portrait-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 520px;
  margin: 16px auto 0;
  font-size: 0.95rem;
}
.portrait-controls[hidden] { display: none; }
.text-button {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 0;
  font: 600 0.95rem/1.2 var(--sans);
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--metal);
  text-underline-offset: 4px;
  cursor: pointer;
}
.text-button:hover { text-decoration-thickness: 2px; }
.noise-control {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.noise-control input { width: 150px; accent-color: var(--metal); }
.omega-point { fill: var(--metal); }
.omega-ring { fill: var(--page); stroke: var(--metal); stroke-opacity: 0.6; stroke-width: 1; }
.omega-label {
  fill: var(--metal);
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  stroke: var(--page);
  stroke-width: 6px;
  stroke-linejoin: round;
  paint-order: stroke;
}
.portrait figcaption {
  margin: 20px auto 0;
  max-width: 520px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: no-preference) {
  .trajectories path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 3.4s cubic-bezier(0.25, 0.6, 0.2, 1) forwards;
    animation-delay: calc(var(--i) * 70ms);
  }
  .omega-point, .omega-ring, .omega-label {
    opacity: 0;
    animation: appear 0.8s ease 3.3s forwards;
  }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

/* Document sections */
.doc-section {
  border-top: 1px solid var(--rule);
  padding-block: clamp(56px, 7vw, 88px);
}
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  column-gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.doc-grid h2 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(1.75rem, 1.6vw + 1rem, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  max-width: 14ch;
  position: sticky;
  top: calc(var(--header-h) + 32px);
}
.doc-body { max-width: 62ch; }
.doc-body > * + * { margin-top: 20px; }
.doc-body p { color: var(--muted); }

.points {
  list-style: none;
  padding: 0;
}
.points li {
  position: relative;
  padding-left: 28px;
  color: var(--text);
}
.points li + li { margin-top: 8px; }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.82em;
  width: 14px;
  height: 1px;
  background: var(--metal);
}

.doc-body .statement {
  margin-top: 36px;
  font-family: var(--serif);
  font-size: clamp(1.375rem, 1vw + 1rem, 1.75rem);
  line-height: 1.35;
  color: var(--text);
  max-width: 30ch;
}

/* Technology areas */
.areas { grid-column: 1 / -1; margin-top: 40px; }
.area {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  column-gap: clamp(32px, 5vw, 64px);
  padding-block: 28px;
  border-top: 1px solid var(--rule);
}
.area dt {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.3;
  max-width: 22ch;
}
.area dd {
  color: var(--muted);
  max-width: 62ch;
}

/* Form */
.access-form {
  margin-top: 40px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.access-form > * + * { margin-top: 20px; }
.access-form > .hp + * { margin-top: 0; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  background: var(--page);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font: 400 1rem/1.4 var(--sans);
}
.field textarea { resize: vertical; min-height: 120px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--metal);
  outline-offset: 1px;
  border-color: var(--metal);
}
.field [aria-invalid="true"] { border-color: #e39a8f; }
.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--metal); }
.check label { margin: 0; font-weight: 400; color: var(--muted); }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.form-status { color: var(--text); font-size: 0.98rem; }
.form-status.is-error { color: #f0b3aa; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding-block: 48px 40px;
  font-size: 0.92rem;
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  column-gap: clamp(32px, 5vw, 64px);
  row-gap: 32px;
}
.footer-grid p + p { margin-top: 4px; }
.footer-name {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
}
.copyright {
  grid-column: 1 / -1;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

/* Responsive */
@media (max-width: 980px) {
  .site-nav { display: none; }
  .lang { border-left: 0; padding-left: 0; }
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .portrait-stage, .portrait-controls, .portrait figcaption { max-width: 380px; }
  .doc-grid, .area, .footer-grid { grid-template-columns: 1fr; }
  .doc-grid h2 { position: static; margin-bottom: 24px; max-width: none; }
  .area dt { margin-bottom: 8px; max-width: none; }
  .areas { margin-top: 0; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .brand-name { font-size: 0.85rem; letter-spacing: 0.1em; }
  .hero-sub { font-size: 1.125rem; }
}

/* Simple pages (confirmation, 404) */
.simple-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  max-width: 640px;
}
.simple-page h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  line-height: 1.1;
}
.simple-page p { color: var(--muted); }
.simple-page .button { margin-top: 12px; }

/* Agent: "Ask the laboratory" */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.agent {
  margin-top: 40px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--rule);
  border-left: 2px solid var(--metal);
  border-radius: 2px;
}
.agent[hidden] { display: none; }
.doc-body .agent-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
}
.doc-body .agent-intro { margin-top: 8px; }
.agent-log {
  margin-top: 20px;
  max-height: 440px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agent-log:empty { display: none; }
.agent-msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-msg-user {
  align-self: flex-end;
  max-width: 85%;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 2px;
}
.agent-msg-agent { color: var(--text); max-width: 62ch; }
.agent-msg-agent.is-pending { color: var(--muted); }
.agent-msg-note { color: var(--muted); font-size: 0.95rem; }
.agent-request {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 2px;
}
.doc-body .agent-request-title { margin: 0; color: var(--text); font-weight: 600; }
.agent-suggestions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.agent-suggestions[hidden] { display: none; }
.agent-suggestions .text-button { font-weight: 400; text-align: left; color: var(--muted); }
.agent-suggestions .text-button:hover { color: var(--text); }
.agent-form {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}
.agent-form[hidden] { display: none; }
.agent-form textarea {
  width: 100%;
  min-height: 52px;
  max-height: 160px;
  padding: 11px 13px;
  resize: vertical;
  background: var(--page);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 2px;
  font: 400 1rem/1.4 var(--sans);
}
.agent-form textarea::placeholder { color: var(--muted); opacity: 1; }
.agent-form textarea:focus-visible { outline: 2px solid var(--metal); outline-offset: 1px; border-color: var(--metal); }
.doc-body .agent-note { margin-top: 12px; font-size: 0.9rem; }
@media (prefers-reduced-motion: no-preference) {
  .agent-msg-agent.is-pending { animation: pending 1.2s ease-in-out infinite; }
}
@keyframes pending { 50% { opacity: 0.35; } }
@media (max-width: 560px) {
  .agent-form { grid-template-columns: 1fr; }
  .agent-form .button { justify-self: start; }
}

/* Systems in operation */
:root {
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --live: #8fdcaa;
  --down: #f0b3aa;
}
.systems-section {
  background:
    linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / 48px 100%;
  background-color: var(--page);
  background-blend-mode: normal;
  position: relative;
}
.systems-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 0%, rgba(35, 33, 45, 0.55), var(--page) 70%);
  pointer-events: none;
}
.systems-section > .wrap { position: relative; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.console {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--surface);
  font: 500 0.92rem/1.3 var(--mono);
  color: var(--text);
}
.console[hidden], .hero-live[hidden] { display: none; }
.console .dot, .hero-live .dot { background: var(--live); box-shadow: 0 0 0 0 rgba(143, 220, 170, 0.6); }
.console.is-degraded .dot, .hero-live.is-degraded .dot { background: var(--down); }
.console-sep { color: var(--muted); }

.hero-live {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-top: 22px;
  font: 500 0.92rem/1.3 var(--mono);
  color: var(--muted);
  text-decoration: none;
}
.hero-live:hover { color: var(--text); }
.hero-live strong { color: var(--text); }

.systems {
  grid-column: 1 / -1;
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}
.system {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 18px;
  background: rgba(44, 41, 56, 0.92);
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.system:hover { border-color: var(--metal); }
@media (prefers-reduced-motion: no-preference) {
  .system:hover { transform: translateY(-2px); }
}
.system-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font: 500 0.8rem/1.2 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
}
.system-live { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.system-live .lbl { display: none; }
.system[data-state="unknown"] .lbl-unknown,
.system[data-state="up"] .lbl-up,
.system[data-state="down"] .lbl-down,
.system[data-state="internal"] .lbl-internal { display: inline; }
.system[data-state="up"] .system-live { color: var(--live); }
.system[data-state="up"] .dot { background: var(--live); }
.system[data-state="down"] .system-live { color: var(--down); }
.system[data-state="down"] .dot { background: var(--down); }
.system[data-state="internal"] .dot { background: var(--metal); }
.system h3.system-name {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.6rem;
  line-height: 1.15;
}
.system p { margin: 0; }
.system-kind { color: var(--metal); font-weight: 600; }
.system-desc { color: var(--muted); }
.chips {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips li {
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font: 500 0.78rem/1.4 var(--mono);
  color: var(--text);
}
.system-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  font: 500 0.82rem/1.3 var(--mono);
}
.phase { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.phase-dev, .phase-res { color: var(--metal); }
.system-link { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--metal); }
.system-link:hover { border-bottom-width: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .system[data-state="up"] .dot,
  .console .dot,
  .hero-live .dot { animation: live-pulse 2.4s ease-out infinite; }
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(143, 220, 170, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(143, 220, 170, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 220, 170, 0); }
}
@media (max-width: 820px) {
  .systems { margin-top: 28px; }
}
/* the cards span the full width: the section title must not stay pinned over them */
.systems-section .doc-grid h2 { position: static; }
