/* Layan.ai — base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--abyss);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
h1 { font-size: var(--fs-hero); letter-spacing: -0.035em; }
h2 { font-size: var(--fs-3xl); letter-spacing: -0.03em; }
h3 { font-size: var(--fs-xl); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
code, .mono { font-family: var(--font-mono); font-size: 0.8em; letter-spacing: 0.02em; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: var(--r-sm); }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.muted { color: var(--muted); }
.frost { color: var(--frost); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 42px; padding: 0 18px; border-radius: var(--r-pill);
  font-weight: 500; font-size: var(--fs-sm); white-space: nowrap;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--paper); color: var(--abyss); }
.btn-primary:hover { background: #fff; box-shadow: 0 0 0 4px rgba(228, 241, 255, 0.12); }
.btn-signal { background: var(--cobalt); color: #fff; box-shadow: var(--glow-signal); }
.btn-signal:hover { background: #2F5CD8; }
.btn-ghost { color: var(--paper); background: rgba(170, 206, 253, 0.06); border: 1px solid var(--line-strong); }
.btn-ghost:hover { background: rgba(170, 206, 253, 0.12); }
.btn-quiet { color: var(--frost); }
.btn-quiet:hover { color: var(--paper); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* evidence tokens */
.ev {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em;
  padding: 3px 8px; border-radius: 4px; line-height: 1.2;
  color: var(--ev-c, var(--ev-unknown));
  background: color-mix(in srgb, var(--ev-c, var(--ev-unknown)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ev-c, var(--ev-unknown)) 32%, transparent);
}
.ev::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.ev-observed { --ev-c: var(--ev-observed); }
.ev-user { --ev-c: var(--ev-user); }
.ev-researched { --ev-c: var(--ev-researched); }
.ev-inferred { --ev-c: var(--ev-inferred); }
.ev-estimated { --ev-c: var(--ev-estimated); }
.ev-assumed { --ev-c: var(--ev-assumed); }
.ev-unknown { --ev-c: var(--ev-unknown); }

/* status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 500; padding: 3px 9px; border-radius: var(--r-pill);
  background: rgba(170, 206, 253, 0.08); color: var(--frost); border: 1px solid var(--line);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pill-c, var(--muted)); }
.pill-ok { --pill-c: var(--ok); }
.pill-warn { --pill-c: var(--warn); }
.pill-bad { --pill-c: var(--bad); }
.pill-signal { --pill-c: var(--signal); }
.pill-live::before { box-shadow: 0 0 0 0 var(--pill-c); animation: pulse 1.6s infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pill-c) 60%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }

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

/* ---------- brand: Whisp mark + calligraphic wordmark (shared by every page) ---------- */
.brand { position: relative; text-decoration: none; color: inherit; }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; transition: width var(--t-slow) var(--ease-io), opacity var(--t-slow) var(--ease-io); }
/* play mode: the mark spot folds away and the wisps orbit the word on a canvas that overhangs the brand box */
.brand.is-play .brand-mark { width: 6px; opacity: 0; }
.brand .whisp-swarm { position: absolute; pointer-events: none; z-index: 2; display: none; }
.brand.is-play .whisp-swarm { display: block; }
.brand.is-play .brand-mark .whisp-canvas { display: none; }
.whisp-toggle { appearance: none; border: 1px solid var(--line-strong); background: var(--glass); color: var(--muted); width: 22px; height: 22px; border-radius: 50%; margin-left: 6px; padding: 0; display: inline-grid; place-items: center; cursor: pointer; flex: 0 0 auto; transition: border-color var(--t-ui), background var(--t-ui); }
.whisp-toggle span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); transition: background var(--t-ui), box-shadow var(--t-ui); }
.whisp-toggle[aria-pressed="true"] { border-color: rgba(96, 157, 252, 0.6); }
.whisp-toggle[aria-pressed="true"] span { background: var(--signal); box-shadow: 0 0 10px 2px rgba(96, 157, 252, 0.6); }
.whisp-toggle:hover { border-color: var(--frost); }
.whisp-toggle:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.brand-mark[data-size="22"] { width: 22px; height: 22px; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-mark.is-live svg { visibility: hidden; }
.brand-mark .whisp-canvas { position: absolute; left: 50%; top: 50%; width: 220%; height: 220%; transform: translate(-50%, -50%); pointer-events: none; }
.brand-word {
  font-family: "Great Vibes", "Brush Script MT", "Segoe Script", cursive;
  font-weight: 400; font-size: 2.05em; line-height: 1; letter-spacing: 0.005em;
  padding-right: 0.12em; transform: translateY(-0.06em);
  background: linear-gradient(100deg, var(--paper) 0%, var(--frost) 45%, var(--signal) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
/* the LIVE tag was removed at the owner's request (2026-09-24); the wordmark stands alone */
.brand-word { position: relative; }
.ob-shell[data-theme="light"] .brand-word { background-image: linear-gradient(100deg, #0B1B3F 0%, var(--cobalt) 60%, var(--signal) 100%); }
.nav a { white-space: nowrap; }
/* laptops (900-1180px): seven links, the wisp toggle and the actions only fit with tighter spacing and without the secondary "Set up" */
@media (max-width: 1180px) and (min-width: 901px) {
  .nav .nav-links { gap: 12px; }
  .nav .nav-links a { font-size: 0.875rem; }
  .nav-actions .btn-quiet { display: none; }
}
/* phones: the navbar holds the logo, the wisp toggle and one call to action; secondary buttons step aside */
@media (max-width: 520px) {
  .nav-actions { gap: 6px; }
  .nav-actions .btn-quiet { display: none; }
  .nav-actions .btn { height: 38px; padding: 0 12px; font-size: var(--fs-xs); }
  .nav .brand-word { font-size: 1.8em; }
}
@media (max-width: 420px) { .whisp-toggle { display: none; } }
/* the word (and its LIVE tag) sit above the swarm, so wisps pass behind the name instead of covering the tag */
.brand-word { z-index: 3; }

/* ---------- theme switch (js/theme.js): shows the moon in light mode, the sun in dark ---------- */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto;
  color: var(--frost); background: var(--glass); border: 1px solid var(--line-strong);
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-ui) var(--ease-out);
}
.theme-toggle:hover { color: var(--paper); border-color: var(--signal); }
.theme-toggle:active { transform: rotate(-20deg) scale(0.94); }
.theme-toggle svg { width: 17px; height: 17px; }
:root[data-theme="light"] .theme-toggle .i-sun, :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }

/* ---------- light theme: the few base colours that are not tokens ---------- */
:root[data-theme="light"] .btn-primary:hover { background: var(--cobalt); box-shadow: 0 0 0 4px rgba(37, 78, 193, 0.14); }
:root[data-theme="light"] .btn-ghost { background: rgba(11, 27, 63, 0.03); }
:root[data-theme="light"] .btn-ghost:hover { background: rgba(11, 27, 63, 0.07); }
:root[data-theme="light"] .pill { background: rgba(37, 78, 193, 0.07); }

/* ---------- primary calls to action: a slow light sweep loops across the label (not on small utility buttons).
   :where() keeps the specificity at zero so no page rule is overridden; off under reduced motion. ---------- */
@media (prefers-reduced-motion: no-preference) {
  :where(.btn-primary, .btn-signal):not(.btn-sm) { position: relative; overflow: hidden; }
  :where(.btn-primary, .btn-signal):not(.btn-sm)::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: linear-gradient(105deg, transparent 30%, var(--btn-sheen, rgba(255, 255, 255, 0.38)) 50%, transparent 70%);
    transform: translateX(-120%); animation: btn-sheen 4.2s var(--ease-io) infinite;
  }
  :where(.btn-primary):not(.btn-sm) { --btn-sheen: rgba(96, 157, 252, 0.42); }
  :root[data-theme="light"] :where(.btn-primary):not(.btn-sm) { --btn-sheen: rgba(170, 206, 253, 0.4); }
  :where(.btn-primary, .btn-signal):not(.btn-sm):disabled::after { animation: none; opacity: 0; }
}
@keyframes btn-sheen { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(120%); } }
