/* ==========================================================================
   TensuraLabs — design tokens & base
   Sizes are expressed in "design units" (--u): 1u = 1px at a 1440px viewport.
   ========================================================================== */
:root {
  --u: clamp(0.72px, 0.06944vw, 1.6px);
  --font-serif: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --font-sans: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --ink: #0b0c12;
  --ink-2: #16171f;
  --paper: #d5d7de;
  --cream-1: #fbf6ea;
  --cream-2: #e8d7ab;
  --gold: #c9a65a;
  --gold-bright: #f0dfae;
  --gold-soft: rgba(232, 215, 171, 0.35);
  --gold-line: rgba(201, 166, 90, 0.32);
  --gold-ink: #8a6f38;
  --navy-1: #2738b9;
  --navy-2: #141f86;
  --slime: #5ea8ff;
  --slime-deep: #1d3fbf;
  --text-dim: #b7b8c6;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --vh: 1vh;

  /* RGB triplets for rgba() theming hooks (values mirror --slime / --violet). */
  --accent-rgb: 94, 168, 255;
  --accent-2-rgb: 181, 155, 255;

  /* Shared radius + elevation scales. Prefer these over magic numbers. */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --z-sticky: 50;
  --z-overlay: 80;
  --z-modal: 100;
  --z-toast: 200;
  --header-top: calc(14 * var(--u));
  --header-h: calc(61 * var(--u));
  --content-w: calc(1091 * var(--u));
  color-scheme: dark;
}

@media (max-width: 1100px) and (min-width: 769px) {
  :root { --u: clamp(0.66px, 0.085vw, 1px); --content-w: 94vw; }
}

@media (max-width: 768px) {
  :root {
    --u: clamp(0.82px, 0.2564vw, 1.3px); /* 1u = 1px at 390px */
    --header-top: 0px;
    --header-h: calc(64 * var(--u));
    --content-w: 100vw;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ink);
}
body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-sans);
  font-weight: 500;
  color: #f2f2f5;
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
svg { fill: currentColor; }

:focus-visible { outline: 2px solid var(--slime); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.gold-text {
  background: linear-gradient(180deg, var(--cream-1) 0%, var(--cream-2) 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Gilded utilities -------------------------------------------------------- */
/** Serif display treatment for headlines on dark surfaces. */
.lux-serif { font-family: var(--font-serif); font-weight: 700; letter-spacing: 0.01em; }

/** Ornamental centred divider (svg.ornament) — gold hairlines around a diamond. */
.ornament { display: block; width: clamp(120px, 22vw, 220px); height: 14px; color: var(--gold); }
.ornament-wrap { display: grid; justify-items: center; }

/** Film-grain overlay: one inline SVG turbulence texture, tiled. Compositor-only (opacity only). */
.grain-layer {
  position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.85 0 0 0 0 0.7 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/** Corner-bracket ornaments for framed panels (Silver-Palace-style filigree corners). */
.lux-corners { position: relative; }
.lux-corners::before, .lux-corners::after {
  content: ''; position: absolute; width: 22px; height: 22px; pointer-events: none;
  border: 1px solid var(--gold-line);
}
.lux-corners::before { top: 9px; left: 9px; border-right: 0; border-bottom: 0; }
.lux-corners::after { right: 9px; bottom: 9px; border-left: 0; border-top: 0; }

.noscript { position: fixed; inset: auto 0 0; padding: 16px; text-align: center; background: #111; z-index: 9999; }

/* App outlet & views ---------------------------------------------------- */
.app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}
.view {
  position: absolute;
  inset: 0;
  outline: none;
  overflow: hidden;
  z-index: 1;
}
.view.is-entering { z-index: 2; }
.view.is-liquid-top { z-index: 3; will-change: clip-path; }
.view.is-leaving { pointer-events: none; }
.view-shade { position: absolute; inset: 0; z-index: 50; background: #000; opacity: 0; pointer-events: none; }

.liquid-canvas {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
}
.liquid-canvas.is-active { opacity: 1; }

/* Generic states --------------------------------------------------------- */
.state { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 48px 16px; font-size: max(14px, calc(15 * var(--u))); }
.state small { opacity: 0.6; }
.state--empty { grid-column: 1 / -1; color: #555; }

/* Pills & round arrows -------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: calc(109 * var(--u));
  height: max(30px, calc(31 * var(--u)));
  padding: 0 calc(18 * var(--u));
  border-radius: calc(8 * var(--u));
  font-size: max(12px, calc(13 * var(--u)));
  font-weight: 700;
  color: #ececf0;
  background: linear-gradient(180deg, #17181f, #050508);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s var(--ease-out), background 0.25s, box-shadow 0.25s;
}
.pill svg { width: 12px; height: 12px; }
.pill:hover { transform: translateY(-1px); }
.pill.is-active {
  color: #241d12;
  background: linear-gradient(180deg, var(--gold-bright, #f0dfae), var(--gold, #c9a65a));
  box-shadow: inset 0 0 0 1px rgba(255, 250, 235, 0.5), 0 4px 14px rgba(201, 166, 90, 0.35);
}
.pill--light { color: #1b1b1f; background: linear-gradient(180deg, var(--cream-1), var(--cream-2)); }
.pill--dark { color: #fff; }

.round-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: max(26px, calc(24 * var(--u)));
  height: max(26px, calc(24 * var(--u)));
  border-radius: 50%;
  color: #2b2620;
  background: radial-gradient(circle at 40% 35%, #fffaf0, #e3d2a6);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(232, 215, 171, 0.25);
  transition: transform 0.2s var(--ease-out), filter 0.2s;
}
.round-arrow svg { width: 60%; height: 60%; }
.round-arrow:hover { transform: scale(1.08); filter: brightness(1.08); }
.round-arrow:active { transform: scale(0.94); }

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