/* smart-neuro-nerd.com — private placeholder
   Light, slightly grey surface; anthracite type; the logo is the only coloured element. */

@font-face {
  font-family: "Saira Stencil One";
  src: url("fonts/saira-stencil-one.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter Tight";
  src: url("fonts/inter-tight-var.woff2") format("woff2-variations"),
       url("fonts/inter-tight-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* primitives: neutral ramp with a faint cool cast (contrast vs --n-50 in comments) */
  --n-50: oklch(0.965 0.002 286);   /* #f3f3f5  surface */
  --n-100: oklch(0.985 0.001 286);  /* raised surface */
  --n-200: oklch(0.86 0.003 286);   /* 1.4:1  hairlines */
  --n-400: oklch(0.64 0.004 286);   /* 3.0:1  UI borders */
  --n-600: oklch(0.40 0.005 286);   /* 8.3:1  secondary text */
  --n-800: oklch(0.27 0.005 286);   /* 13.6:1 primary text (not pure black) */

  /* semantic tokens */
  --color-bg: var(--n-50);
  --color-surface: var(--n-100);
  --color-fg: var(--n-800);
  --color-fg-soft: var(--n-600);
  --color-border: var(--n-200);
  --color-border-strong: var(--n-400);
  --color-focus: var(--n-800);
  --color-shade: oklch(0.965 0.002 286 / 0.88);

  /* canvas colours (hex for broad canvas support) */
  --net-ink: #262629;
  --net-paper: #f3f3f5;

  --font-display: "Saira Stencil One", "Arial Black", Impact, sans-serif;
  --font-body: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: clamp(0.8125rem, 0.78rem + 0.15vw, 0.9375rem);
  --step-1: clamp(1.0625rem, 0.98rem + 0.45vw, 1.375rem);
  --wordmark: clamp(1.625rem, 0.55rem + 5.4vw, 5rem);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --gutter: clamp(16px, 5vw, 64px);

  --radius-full: 9999px;
  --dur-fast: 160ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--color-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
p {
  margin: 0;
}

::selection {
  background: var(--color-fg);
  color: var(--color-bg);
}

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

/* ---------- background network ---------- */

.neural-net {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.topbar,
.stage {
  position: relative;
  z-index: 1;
}

/* soft local lightening so lines never cross the text */
.shade {
  position: relative;
  isolation: isolate;
}

.shade::before {
  content: "";
  position: absolute;
  inset: -14% -10%;
  z-index: -1;
  background: radial-gradient(closest-side, var(--color-shade) 58%, oklch(0.965 0.002 286 / 0) 100%);
  pointer-events: none;
}

/* ---------- controls ---------- */

.topbar {
  display: flex;
  justify-content: flex-end;
  padding: max(var(--space-4), env(safe-area-inset-top)) var(--gutter) 0;
}

.controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lang-switch {
  display: flex;
  padding: 2px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-surface);
}

.chip {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-fg-soft);
  font: 600 var(--step--1) / 1 var(--font-mono);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.chip:hover {
  color: var(--color-fg);
}

.chip:active {
  transform: scale(0.94);
}

.chip:focus-visible {
  border-radius: var(--radius-full);
}

.chip[aria-pressed="true"] {
  background: var(--color-fg);
  color: var(--color-bg);
}

.chip-icon,
.chip-icon[aria-pressed="true"] {
  padding: 0;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-fg);
}

.chip-icon:hover {
  border-color: var(--color-fg);
}

.icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.icon-play,
[data-motion="off"] .icon-pause {
  display: none;
}

[data-motion="off"] .icon-play {
  display: block;
}

/* ---------- stage ---------- */

.stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--space-7) var(--gutter) var(--space-8);
  overflow-x: clip;
}

.stage-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 920px;
  text-align: center;
}

/* Interactive logo. Stack: near shadow, far shadow, tilt > float > lift > [black mark, colour layer].
   --px / --py (-1…1) come from the drag spring in site.js. --logo-fade is set per colour change. */
.logo {
  --logo-fade: 1800ms;
  --logo-ease: cubic-bezier(0.45, 0, 0.25, 1);
  position: relative;
  z-index: 3;                                   /* in front of wordmark, tagline and network */
  width: clamp(200px, 64vw, 460px);
  aspect-ratio: 265.03 / 150.31;
  margin-bottom: var(--space-6);
  perspective: 900px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: logo-in 520ms var(--ease-out) both;
}

.logo.is-held {
  cursor: grabbing;
}

.logo:focus-visible {
  outline-offset: 10px;
  border-radius: var(--radius-sm);
}

.logo > *,
.logo-float,
.logo-lift,
.logo-mark,
.logo-color,
.logo-shadow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.logo-tilt {
  transform: translate3d(calc(var(--px, 0) * 26%), calc(var(--py, 0) * 26%), 0)
             rotateY(calc(var(--px, 0) * 16deg)) rotateX(calc(var(--py, 0) * -13deg));
  will-change: transform;
}

.logo-float {
  animation: logo-float 9s ease-in-out 600ms infinite;
}

.logo-lift {
  transform-origin: 50% 60%;
  transition: transform var(--logo-fade) var(--logo-ease);
}

.logo-color {
  opacity: 0;
  -webkit-mask: url(logo-mono.svg) center / 100% 100% no-repeat;
  mask: url(logo-mono.svg) center / 100% 100% no-repeat;
  transition: opacity var(--logo-fade) var(--logo-ease);
}

/* shadow = blurred copy of the silhouette; it trails the logo and softens when the logo lifts */
.logo-shadow {
  transition: opacity var(--logo-fade) var(--logo-ease), transform var(--logo-fade) var(--logo-ease);
}

.logo-shadow-near {
  filter: blur(clamp(4px, 1.8vw, 9px));
  opacity: 0.3;
  transform: translate(calc(var(--px, 0) * 18%), calc(5% + var(--py, 0) * 18%)) scale(0.985);
}

.logo-shadow-far {
  filter: blur(clamp(10px, 4.6vw, 24px));
  opacity: 0;
  transform: translate(calc(var(--px, 0) * 22%), calc(8% + var(--py, 0) * 22%)) scale(0.99);
}

.logo.is-vivid .logo-color { opacity: 1; }
.logo.is-vivid .logo-lift { transform: translateY(-2.5%) scale(1.035); }
.logo.is-vivid .logo-shadow-near { opacity: 0; }
.logo.is-vivid .logo-shadow-far {
  opacity: 0.2;
  transform: translate(calc(var(--px, 0) * 22%), calc(12% + var(--py, 0) * 22%)) scale(1.01);
}

/* wordmark + tagline drift slightly against the logo (depth) */
.copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate3d(calc(var(--px, 0) * -9px), calc(var(--py, 0) * -9px), 0);
}

/* the network sits furthest back and moves least */
.neural-net {
  transform: translate3d(calc(var(--px, 0) * -6px), calc(var(--py, 0) * -6px), 0) scale(1.02);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--wordmark);
  line-height: 1.02;
  letter-spacing: 0.015em;
  color: var(--color-fg);
  text-wrap: balance;
  animation: rise-in 480ms var(--ease-out) 120ms both;
}

/* one size for the whole tagline; term and claim differ only in weight and tone */
.tagline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-5);
  max-width: 60ch;
  font-size: var(--step-1);
  line-height: 1.35;
  color: var(--color-fg-soft);
  animation: rise-in 480ms var(--ease-out) 220ms both;
}

.tagline-term {
  font-weight: 650;
  color: var(--color-fg);
}

.tagline-sep {
  display: none;
}

.tagline-claim {
  font-weight: 450;
  text-wrap: balance;
}

@media (min-width: 1180px) {
  .tagline {
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-2);
    max-width: none;
    white-space: nowrap;
  }

  .tagline-sep {
    display: inline;
  }
}

/* ---------- motion ---------- */

@keyframes logo-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* paused via toggle: the entrance (logo-in) always completes, only the float loop freezes */
[data-motion="off"] .logo-float {
  animation-play-state: paused;
}

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

  /* bloom only runs if the visitor explicitly re-enabled motion: keep it a soft fade, never a jump */
  .logo-tilt,
  .copy,
  .neural-net {
    transform: none !important;
  }

  .logo-color,
  .logo-lift,
  .logo-shadow {
    transition-duration: var(--logo-fade, 1800ms) !important;
  }
}
