/* Self-hosted fonts, latin subset (licences in /fonts) */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/hanken-grotesk-latin-wght.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-500.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-600.woff2') format('woff2');
}

/* Omneo brand tokens, v0.4 (see Omneo-Brand-Board-v0_4.html) */
:root {
  --sl-primary: #2A52E0;
  --sl-console: #101A2E;
  --sl-go: #12A86B;
  --sl-known: #E8A000;
  --sl-nogo: #E0383C;

  --sl-font: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --sl-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--sl-console);
  color: #fff;
  font-family: var(--sl-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  background: var(--sl-console);
  color: #fff;
  overflow: hidden;
}

/* Blue glow behind Oko. Eased stops instead of a two-stop fade keep the
   falloff from banding on the dark console colour. */
.hero::before {
  --glow-at: 72% 48%;
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 65% at var(--glow-at),
      rgba(42, 82, 224, 0.36) 0%,
      rgba(42, 82, 224, 0.31) 12%,
      rgba(42, 82, 224, 0.24) 25%,
      rgba(42, 82, 224, 0.16) 40%,
      rgba(42, 82, 224, 0.09) 55%,
      rgba(42, 82, 224, 0.04) 70%,
      rgba(42, 82, 224, 0.01) 85%,
      rgba(42, 82, 224, 0) 100%),
    radial-gradient(ellipse 120% 90% at 10% 100%,
      rgba(6, 13, 28, 0.55) 0%,
      rgba(6, 13, 28, 0.3) 40%,
      rgba(6, 13, 28, 0) 75%);
}

/* Fine grain on top dithers whatever banding is left. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-inner {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  align-content: center;
  gap: 48px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px 32px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

.omark-letter {
  width: 0.74em;
  height: 0.74em;
  flex: none;
  margin-right: 0.035em;
  transform: translateY(0.012em);
  overflow: visible;
}

a.wordmark {
  color: inherit;
  text-decoration: none;
}

/* 404 and other single-column pages */
.hero-inner--single {
  grid-template-columns: minmax(0, 1fr);
}

.hero:has(.hero-inner--single)::before { --glow-at: 28% 45%; }

.back {
  display: inline-block;
  margin-top: 28px;
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--sl-primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.back:hover,
.back:focus-visible {
  color: #DDE3F0;
}

.claim {
  margin: 40px 0 14px;
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.claim .accent {
  color: var(--sl-primary);
}

.tag {
  max-width: 44ch;
  color: #A9B4CC;
  font-size: 18px;
}

.poll {
  display: grid;
  gap: 3px;
  margin-top: 36px;
  color: #7E8AA6;
  font-family: var(--sl-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.poll b {
  font-weight: 600;
  transition: color 0.35s ease;
}

[data-call="go"] { color: var(--sl-go); }
[data-call="known"] { color: var(--sl-known); }
[data-call="nogo"] { color: var(--sl-nogo); }

/* ---------- Oko ---------- */
/* Above the copy, so lines spinning out of Oko emerge from behind his arcs. */
.oko-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.oko {
  --d1: var(--sl-go);
  --d2: var(--sl-go);
  --d3: var(--sl-go);
  --glow: var(--sl-go);
  display: block;
  width: min(340px, 72vw);
  height: auto;
  overflow: visible;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.oko .body,
.oko .arc {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.oko .halo {
  fill: var(--glow);
  opacity: 0.16;
  transition: fill 0.35s ease;
}

.oko .stroke {
  transition: stroke 0.35s ease, filter 0.2s ease;
}

.oko .d1 { stroke: var(--d1); }
.oko .d2 { stroke: var(--d2); }
.oko .d3 { stroke: var(--d3); }

.oko .pupil {
  fill: var(--glow);
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 0.35s ease, transform 0.3s ease;
}

.oko .hit {
  stroke: transparent;
  pointer-events: stroke;
  transition: stroke 0.2s ease;
}

.oko .pupil-hit {
  fill: transparent;
  transition: fill 0.2s ease;
}

.oko .arc,
.oko .eye {
  cursor: pointer;
  outline: none;
}

.oko .arc:hover .stroke { filter: brightness(1.18); }
.oko .arc:focus-visible .hit { stroke: rgba(255, 255, 255, 0.16); }
.oko .eye:focus-visible .pupil-hit { fill: rgba(255, 255, 255, 0.12); }

/* standing by after a while without input */
.oko.is-sleepy .body {
  --d1: #3C4A66;
  --d2: #3C4A66;
  --d3: #3C4A66;
  --glow: #5A6886;
}
.oko.is-sleepy .pupil { animation: doze 3.2s ease-in-out infinite; }

/* entrance on page load: spins in, then the pupil pops open with a blink */
.oko.intro .body { animation: oko-in 1.3s cubic-bezier(0.2, 0.7, 0.3, 1) 0.15s both; }
.oko.intro .pupil { animation: pupil-in 1.75s ease-out 0.15s both; }
.oko.intro ~ .oko-caption { animation: fade-in 0.5s ease-out 1.6s both; }

@keyframes oko-in {
  0% { opacity: 0; transform: rotate(-540deg) scale(0.3); }
  60% { opacity: 1; transform: rotate(12deg) scale(1.05); }
  80% { transform: rotate(-4deg) scale(0.98); }
}

@keyframes pupil-in {
  0%, 70% { transform: scale(0); }
  82% { transform: scale(1.2); }
  91% { transform: scale(1, 0.1); }
}

@keyframes fade-in {
  from { opacity: 0; }
}

/* The copy spins out of Oko while he settles, one line after the other.
   --from-x/--from-y are rough defaults; oko.js aims them at Oko's centre. */
.spin-out {
  --from-x: 42vw;
  --from-y: 0px;
  animation: spin-out 0.95s cubic-bezier(0.2, 0.75, 0.25, 1) calc(0.55s + var(--i, 0) * 0.08s) both;
}

.wordmark.spin-out { --i: 0; }
.claim.spin-out { --i: 1; }
.tag.spin-out { --i: 2; }
.poll .spin-out:nth-child(1) { --i: 3; }
.poll .spin-out:nth-child(2) { --i: 4; }
.poll .spin-out:nth-child(3) { --i: 5; }

@keyframes spin-out {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translate(var(--from-x), var(--from-y)) rotate(-35deg) scale(0.1);
  }
  30% { opacity: 1; }
  100% {
    filter: none;
    transform: none;
  }
}

/* forced hold after too many pokes: red, eye shut */
.oko.is-resting .body {
  --d1: var(--sl-nogo);
  --d2: var(--sl-nogo);
  --d3: var(--sl-nogo);
  --glow: var(--sl-nogo);
}
.oko.is-resting .pupil { transform: scaleY(0.12); }

.oko .arc.pop { animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.oko .body.squash { animation: squash 0.55s ease-out; }
.oko .body.stretch { animation: stretch 0.8s ease-out; }
.oko .body.wobble { animation: wobble 1.1s ease-out; }
.oko .pupil.blink { animation: blink 0.22s ease-in-out; }
.oko .pupil.blink-twice { animation: blink 0.22s ease-in-out 2; }

@keyframes pop {
  40% { transform: scale(1.07); }
}

@keyframes squash {
  25% { transform: scale(1.12, 0.78); }
  55% { transform: scale(0.94, 1.08); }
  80% { transform: scale(1.03, 0.97); }
}

@keyframes stretch {
  30% { transform: scale(0.94, 1.1); }
  60% { transform: scale(1.04, 0.96); }
}

@keyframes wobble {
  15% { transform: rotate(-10deg); }
  35% { transform: rotate(8deg); }
  55% { transform: rotate(-5deg); }
  75% { transform: rotate(3deg); }
}

@keyframes blink {
  50% { transform: scaleY(0.1); }
}

@keyframes doze {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(0.45); }
}

.oko-caption {
  min-height: 1.6em;
  color: #6C7897;
  font-family: var(--sl-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.oko-caption.is-speaking { color: #DDE3F0; }


/* ---------- small screens ---------- */
@media (max-width: 820px) {
  .hero::before { --glow-at: 50% 26%; }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 32px 16px 48px;
  }

  .oko-stage { order: -1; }
  .spin-out { --from-x: 0px; --from-y: -40vh; }
  .oko { width: min(240px, 62vw); }
  .wordmark { font-size: 34px; }
  .claim { margin-top: 24px; }
  .tag { font-size: 16px; }
  .poll { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .oko *,
  .oko-caption,
  .spin-out,
  .poll b {
    animation: none !important;
    transition: none !important;
  }
}
