/* Candas AI — "Precision instrument" design system: tokens, base, type, buttons, nav */

:root {
  color-scheme: dark;
  --bg: #08090a;
  --bg-1: #0d0e10;
  --bg-2: #131417;
  --bg-3: #1a1b1f;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);
  --fg: #ededec;
  --fg-2: #a3a5aa;
  --fg-3: #6c6f75;
  --bone: #ebe6da;        /* primary action surface */
  --bone-ink: #121212;
  --signal: #ffb547;      /* live / active indicators only */
  --signal-soft: rgba(255, 181, 71, 0.14);

  --font-sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --step--1: clamp(0.8rem, 0.78rem + 0.1vw, 0.86rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --step-3: clamp(2.2rem, 1.5rem + 3vw, 4.1rem);
  --step-4: clamp(2.7rem, 1.5rem + 4.3vw, 5.6rem);

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --gutter: clamp(1.1rem, 0.6rem + 2.2vw, 2.75rem);
  --section: clamp(5rem, 3.5rem + 5.5vw, 9rem);
  --max: 1320px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --press: 140ms;
  --hover: 220ms;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
body::after { /* fine grain, fixed so it never repaints on scroll */
  content: '';
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }
::selection { background: var(--bone); color: var(--bone-ink); }
:focus-visible { outline: 1.5px solid var(--bone); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 200;
  background: var(--bone); color: var(--bone-ink); padding: 0.6rem 1rem; border-radius: 999px;
  font-size: var(--step--1); transition: transform var(--hover) var(--ease-out);
}
.skip:focus { transform: translateY(5rem); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ── Type ─────────────────────────────────────────── */
.h-display {
  font-weight: 500;
  font-size: var(--step-4);
  line-height: 0.98;
  letter-spacing: -0.048em;
  text-wrap: balance;
}
.h-section {
  font-weight: 500;
  font-size: var(--step-3);
  line-height: 1.02;
  letter-spacing: -0.042em;
  text-wrap: balance;
}
.h-card { font-weight: 500; font-size: var(--step-2); line-height: 1.08; letter-spacing: -0.03em; }
.muted { color: var(--fg-2); }
.quiet { color: var(--fg-3); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--fg-2); letter-spacing: -0.012em; max-width: 34rem; text-wrap: pretty; }
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.38rem 0.75rem 0.38rem 0.6rem;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg-2);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); flex: none; }
.dot-live { animation: live 2.4s var(--ease-in-out) infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 7px rgba(255, 181, 71, 0); } }

/* Line-mask for split headline reveals */
.line-mask { display: block; overflow: clip; padding-bottom: 0.08em; margin-bottom: -0.08em; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  --h: 3.1rem;
  position: relative;
  display: inline-flex; align-items: center; gap: 0.85rem;
  height: var(--h); padding: 0 0.4rem 0 1.35rem;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 0.95rem; font-weight: 500; letter-spacing: -0.01em;
  cursor: pointer; white-space: nowrap;
  transition: transform var(--press) var(--ease-out), background-color var(--hover) ease, border-color var(--hover) ease, color var(--hover) ease;
}
.btn:active { transform: scale(0.97); }
.btn-icon {
  width: calc(var(--h) - 0.8rem); height: calc(var(--h) - 0.8rem);
  display: grid; place-items: center; border-radius: 50%;
  transition: transform 360ms var(--ease-out);
}
.btn-icon svg { width: 14px; height: 14px; }
.btn-primary { background: var(--bone); color: var(--bone-ink); }
.btn-primary .btn-icon { background: rgba(0, 0, 0, 0.08); }
.btn-ghost { border-color: var(--line-2); color: var(--fg); padding-right: 1.35rem; }
.btn-ghost .btn-icon { display: none; }
.btn-sm { --h: 2.5rem; font-size: 0.86rem; padding-left: 1.05rem; }
.btn-ghost.btn-sm { padding-right: 1.05rem; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: #fff; }
  .btn:hover .btn-icon { transform: translate(2px, -1px) scale(1.06); }
  .btn-ghost:hover { border-color: var(--line-3); background: rgba(255, 255, 255, 0.04); }
}

/* ── Floating island nav ─────────────────────────── */
.nav {
  position: fixed; z-index: 80; top: 1rem; left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 2rem), 760px);
  display: flex; align-items: center; gap: 1rem;
  padding: 0.45rem 0.45rem 0.45rem 1.1rem;
  border-radius: 999px;
  background: rgba(14, 15, 17, 0.72);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; flex: none; }
.nav-links { display: none; gap: 0.25rem; margin: 0 auto; }
.nav-links a {
  padding: 0.45rem 0.8rem; border-radius: 999px; color: var(--fg-2); font-size: 0.9rem;
  transition: color var(--hover) ease, background-color var(--hover) ease;
}
.nav-links a:hover { color: var(--fg); background: rgba(255, 255, 255, 0.05); }
.nav .btn { margin-left: auto; }
.menu-btn {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--line-2);
  background: transparent; cursor: pointer; position: relative; flex: none;
}
.menu-btn span {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; background: var(--fg);
  transition: transform 360ms var(--ease-out);
}
.menu-btn span:first-child { transform: translate(-50%, -4px); }
.menu-btn span:last-child { transform: translate(-50%, 3px); }
.menu-open .menu-btn span:first-child { transform: translate(-50%, -0.5px) rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: translate(-50%, -0.5px) rotate(-45deg); }
@media (min-width: 860px) {
  .nav-links { display: flex; }
  .menu-btn { display: none; }
  .nav .btn { margin-left: 0; }
}

.sheet {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(8, 9, 10, 0.86);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column; justify-content: center; gap: 0.25rem;
  padding: 6rem var(--gutter) 3rem;
  opacity: 0; visibility: hidden;
  transition: opacity 300ms var(--ease-out), visibility 0s linear 300ms;
}
.menu-open .sheet { opacity: 1; visibility: visible; transition: opacity 300ms var(--ease-out); }
.sheet a {
  font-size: var(--step-3); font-weight: 500; letter-spacing: -0.04em; line-height: 1.15;
  opacity: 0; transform: translateY(1.5rem);
  transition: opacity 400ms var(--ease-out), transform 500ms var(--ease-out);
}
.menu-open .sheet a { opacity: 1; transform: none; }
.menu-open .sheet a:nth-child(2) { transition-delay: 50ms; }
.menu-open .sheet a:nth-child(3) { transition-delay: 100ms; }
.menu-open .sheet a:nth-child(4) { transition-delay: 150ms; }
.menu-open .sheet a:nth-child(5) { transition-delay: 200ms; }
.sheet .mono { margin-top: 2rem; }

/* ── Bezel (machined double-enclosure) ───────────── */
.bezel {
  padding: 6px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
}
.bezel-core {
  height: 100%;
  border-radius: calc(var(--radius-lg) - 6px);
  background: var(--bg-1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 0 rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
}

/* Reveal states (only when JS has booted, so content is never hidden without it) */
.js [data-reveal] { opacity: 0; }
.js [data-split] { visibility: hidden; }

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js [data-reveal] { opacity: 1; }
  .js [data-split] { visibility: visible; }
}
