/* tanglement.ai — shared stylesheet.
   Design ported from the Tanglement teaser site (packages/teaser-site/src/app/globals.css,
   Session 10 working tree): always-dark theme, brand tokens, Geist type, `.card-surface` glass cards,
   gradient mesh, gradient wordmark. Plain CSS, no build step. */

@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/geist-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/geist-mono-latin.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  /* Brand (teaser globals.css) */
  --brand-primary: #0a2540;
  --brand-secondary: #635bff;
  --brand-accent: #00d4ff;
  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  /* Neutrals */
  --gray-100: #e6ebf1;
  --gray-200: #d1dae5;
  --gray-300: #b4c1d3;
  --gray-400: #8898aa;
  --gray-500: #727f96;
  --gray-800: #1a1f36;
  --gray-900: #0a0f1e;
  /* Always-on dark theme tokens (teaser `.dark`) */
  --background: #070b14;
  --foreground: #e6ebf1;
  --surface-primary: #0a0f1e;
  --surface-tertiary: #1a1f36;
  --border-primary: #1a1f36;
  /* Type */
  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, 'Courier New', monospace;
  /* Spacing / radius (4px grid) */
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --max: 1200px;
  --prose: 46rem;
}

*, *::before, *::after { box-sizing: border-box; }
* { border-color: var(--border-primary); }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: 'rlig' 1, 'calt' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Static gradient mesh (teaser `.gradient-mesh`) behind every page; the home hero adds the WebGL layer. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(at 0% 0%, rgba(10, 37, 64, 0.55) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(99, 91, 255, 0.16) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(0, 212, 255, 0.12) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(10, 37, 64, 0.35) 0px, transparent 50%);
}

img { max-width: 100%; height: auto; }

a { color: var(--brand-accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: 4px; }
::selection { background-color: var(--brand-secondary); color: #fff; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface-primary); color: var(--foreground); padding: var(--space-sm) var(--space-md); z-index: 100;
}
.skip-link:focus { left: var(--space-md); top: var(--space-md); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header (teaser components/layout/Navbar.tsx, scrolled state) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 15, 30, 0.88); /* no backdrop blur: it re-rendered every animation frame */
  border-bottom: 1px solid var(--gray-800);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  min-height: 4rem; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 2.25rem; height: 2.25rem; transition: transform 0.3s; }
.brand:hover img { transform: scale(1.1); }
.brand-name {
  font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em;
  background: linear-gradient(90deg, #4f8fd8, var(--brand-accent));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { color: var(--gray-300); font-size: 0.875rem; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--brand-accent); text-decoration: none; }

/* ---------- Main ---------- */
main { flex: 1 0 auto; padding-block: var(--space-2xl) var(--space-3xl); }

.breadcrumb { font-size: 0.875rem; color: var(--gray-400); margin: 0 0 var(--space-lg); }
.breadcrumb a { color: var(--gray-300); }
.breadcrumb span[aria-hidden] { margin: 0 0.4rem; color: var(--gray-500); }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.015em; color: #fff; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; margin: 0 0 var(--space-md); }
h2 { font-size: 1.5rem; font-weight: 700; margin: var(--space-2xl) 0 var(--space-md); }
h3 { font-size: 1.15rem; font-weight: 600; margin: var(--space-xl) 0 var(--space-sm); }
p, ul, ol, table, pre, blockquote, figure { margin: 0 0 var(--space-md); }
ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }
li::marker { color: var(--brand-accent); }
strong { color: #fff; }
hr { border: 0; border-top: 1px solid var(--gray-800); margin: var(--space-2xl) 0; }

code, pre, kbd { font-family: var(--font-mono); font-size: 0.9em; }
code { background: rgba(26, 31, 54, 0.8); border: 1px solid var(--gray-800); border-radius: 6px; padding: 0.1em 0.35em; }
pre { background: rgba(4, 6, 9, 0.75); border: 1px solid var(--gray-800); border-radius: var(--radius-lg); padding: var(--space-md); overflow-x: auto; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; }
/* Long inline code (URLs, formulas) wraps instead of widening the page on phones. */
:not(pre) > code { overflow-wrap: anywhere; word-break: break-word; }
blockquote { border-left: 3px solid var(--brand-secondary); margin-left: 0; padding: 0.25rem 0 0.25rem var(--space-md); color: var(--gray-300); }

.table-wrap { overflow-x: auto; margin: 0 0 var(--space-md); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--gray-800); }
th { color: #fff; font-weight: 600; background: rgba(26, 31, 54, 0.5); }

.lead { font-size: 1.15rem; color: var(--gray-300); max-width: 42rem; }
.muted { color: var(--gray-400); }
.note {
  border: 1px solid rgba(0, 212, 255, 0.35); background: rgba(0, 212, 255, 0.06);
  border-radius: var(--radius-lg); padding: var(--space-md) var(--space-lg); color: var(--gray-200);
}
.placeholder { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border-radius: 4px; padding: 0 0.25em; font-weight: 600; }

/* ---------- Cards (teaser `.card-surface` + Features.tsx card) ---------- */
.card-surface, .card {
  background-color: rgba(10, 15, 30, 0.5);
  border: 1px solid rgba(26, 31, 54, 0.9);
  border-radius: var(--radius-2xl);
}
.card { position: relative; padding: var(--space-lg); transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s, box-shadow 0.5s; }
a.card { display: block; color: inherit; }
/* Teaser `.card-3d:hover`: slants forward slightly. */
a.card:hover { text-decoration: none; border-color: rgba(0, 212, 255, 0.5); box-shadow: 0 25px 50px -12px rgba(0, 212, 255, 0.2);
  transform: perspective(1000px) rotateX(2deg) rotateY(5deg) scale(1.02); }
/* Same slant on the big content pane (teaser CodeSamples `group card-3d`). Perspective scaled up for the pane's
   size so the edge lift matches the teaser's ~900px code block (~4%), instead of distorting a tall page. */
.panel { transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s, box-shadow 0.5s; }
.panel { position: relative; }
.panel::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; z-index: -1; opacity: 0; filter: blur(8px);
  background: linear-gradient(90deg, var(--brand-primary, #0a2540), var(--brand-accent, #00d4ff), var(--brand-secondary, #635bff)); transition: opacity 0.5s; pointer-events: none; }

@media (prefers-reduced-motion: reduce) { a.card:hover, .panel:hover, .pane:hover { transform: none; } }
a.card::after {
  content: ''; position: absolute; top: 0; left: 12.5%; width: 75%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand-accent), transparent);
  opacity: 0; transition: opacity 0.4s;
}
a.card:hover::after { opacity: 1; }
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
a.card:hover h3 { color: var(--brand-accent); }
.card p { margin: 0; color: var(--gray-400); font-size: 0.925rem; line-height: 1.55; }
.card .meta { margin-top: 0.75rem; font-size: 0.8rem; color: var(--gray-500); }

.grid { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); margin: 0 0 var(--space-lg); }

/* Prose panel for legal and support pages */
.prose { max-width: var(--prose); }
.panel { padding: clamp(1.25rem, 4vw, 2.5rem); }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.prose h2:first-of-type { margin-top: var(--space-xl); }
.updated { color: var(--gray-400); font-size: 0.9rem; margin-bottom: var(--space-lg); }

.page-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 var(--space-xl); padding: 0; list-style: none; }
.page-links li { margin: 0; }
.page-links a {
  display: inline-block; padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.875rem;
  border: 1px solid var(--gray-800); background: rgba(10, 15, 30, 0.55); color: var(--gray-200);
}
.page-links a:hover, .page-links a[aria-current='page'] { border-color: rgba(0, 212, 255, 0.5); color: var(--brand-accent); text-decoration: none; }

.btn, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.4rem; border-radius: var(--radius-lg); font-weight: 600; font-size: 0.95rem;
  transition: filter 0.2s, box-shadow 0.2s; border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.btn { background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary)); color: #fff; }
.btn-secondary { background: rgba(10, 15, 30, 0.55); border-color: var(--gray-800); color: var(--gray-100); }
/* No transform on hover: a scaled button moves its own hit area, and inside a tilted card the edge pixel
   falls in and out of the button every frame (hover flicker, clicks miss). Glow and brighten instead. */
.btn:hover, .btn-secondary:hover { text-decoration: none; filter: brightness(1.12); box-shadow: 0 10px 25px -10px rgba(99, 91, 255, 0.6); }

/* ---------- Home hero (teaser sections/Hero + FluidBackground) ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(4rem, 12vw, 8rem); margin-top: calc(-1 * var(--space-2xl)); }
/* Fixed WebGL background (teaser FluidBackground: position fixed, 100vw x 100vh, z -1). Content scrolls over it. */
.bg-fluid { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; display: block; }
/* Readability over the moving light: hero copy gets a soft shadow, everything else sits on glass. */
.hero h1, .hero .lead, .hero .eyebrow { text-shadow: 0 2px 18px rgba(3, 6, 14, 0.85), 0 1px 3px rgba(3, 6, 14, 0.9); }
.hero .lead { color: var(--gray-200, #e5e7eb); }
.hero h1 .gradient-text { text-shadow: none; filter: drop-shadow(0 2px 14px rgba(3, 6, 14, 0.85)); }
.panel { background-color: rgba(8, 12, 24, 0.55);
  border: 1px solid rgba(26, 31, 54, 0.9); border-radius: var(--radius-2xl); padding: clamp(1.25rem, 4vw, 2.5rem); }
#products { background-color: transparent;
  border: 1px solid rgba(26, 31, 54, 0.8); border-radius: var(--radius-2xl); padding-block: var(--space-xl); }
#products .section-head h2, #products .section-head p, #products > p, .panel { text-shadow: 0 1px 6px rgba(3, 6, 14, 0.75); }
/* No backdrop-filter on panels/cards: re-blurring ~70 panes over an animated canvas every frame was the main paint cost. */
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); max-width: 18ch; }
.gradient-text {
  background: linear-gradient(135deg, #7aa7ff, var(--brand-secondary) 45%, var(--brand-accent));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-xl); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 600; color: var(--brand-accent); margin-bottom: var(--space-md); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; margin-top: var(--space-3xl); }
.section-head h2 { margin: 0 0 var(--space-md); }
.section-head p { margin: 0 0 var(--space-md); color: var(--gray-400); }

/* ---------- Footer (teaser sections/Footer.tsx) ---------- */
.site-footer { border-top: 1px solid rgba(255, 255, 255, 0.1); background: rgba(4, 6, 9, 0.6); padding-block: var(--space-3xl) var(--space-xl); font-size: 0.9rem; }
.footer-grid { display: grid; gap: var(--space-xl); grid-template-columns: 2fr repeat(3, 1fr); margin-bottom: var(--space-2xl); }
.footer-grid h4 { margin: 0 0 0.75rem; font-size: 0.95rem; color: #fff; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 0 0 0.45rem; }
.footer-grid li::marker { content: none; }
.footer-grid a { color: var(--gray-400); }
.footer-grid a:hover { color: var(--brand-accent); text-decoration: none; }
.footer-about p { color: var(--gray-400); max-width: 26rem; margin-top: var(--space-md); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: var(--space-xl); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-md); color: var(--gray-500); font-size: 0.85rem; }
.footer-bottom p { margin: 0; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .site-header .container { padding-block: 0.6rem; }
}

/* ---------- Uninstall survey (product-kit pages/uninstall.html) ---------- */
.survey label { display: block; margin: 0.4rem 0; color: var(--gray-200); cursor: pointer; }
.survey input[type='radio'] { accent-color: var(--brand-accent); margin-right: 0.5rem; }
.survey textarea {
  width: 100%; margin-top: var(--space-sm); padding: 0.6rem 0.75rem; font: inherit; color: var(--foreground);
  background: rgba(4, 6, 9, 0.6); border: 1px solid var(--gray-800); border-radius: var(--radius-md);
}

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

/* Front-page store groups: static solid panes behind the cards. */
#products { border: 0; padding-block: 0; }
.pane { position: relative; margin: 0 0 var(--space-2xl); padding: clamp(1.25rem, 3vw, 2rem);
  background-color: rgba(3, 7, 18, 0.72); border: 1px solid rgba(26, 31, 54, 0.95); border-radius: var(--radius-2xl);
  transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s, box-shadow 0.5s; }
.pane::before { content: ''; position: absolute; inset: -2px; border-radius: inherit; z-index: -1; opacity: 0; filter: blur(8px);
  background: linear-gradient(90deg, var(--brand-primary, #0a2540), var(--brand-accent, #00d4ff), var(--brand-secondary, #635bff));
  transition: opacity 0.5s; pointer-events: none; }
.pane .section-head { margin-top: 0; }
.pane .grid { margin-bottom: 0; }

/* Cards (the small ones) carry the teaser's card-3d slant plus a CodeSamples-style gradient glow; containers stay still. */
a.card:hover { box-shadow: -8px 0 18px -4px rgba(99, 91, 255, 0.35), 8px 0 18px -4px rgba(0, 212, 255, 0.35), 0 25px 50px -12px rgba(0, 212, 255, 0.2); }

/* "Available now" cards are <div class="card live"> (they hold a buy button plus a details link), so they get the same slant and glow as a.card. */
.card.live { display: flex; flex-direction: column; }
.card.live > a { color: inherit; }
.card.live > a:hover { text-decoration: none; }
/* Live cards hold buttons, so they glow but never move: tilting them shifted the buttons under a still cursor. */
.card.live:hover { border-color: rgba(0, 212, 255, 0.5);
  box-shadow: -8px 0 18px -4px rgba(99, 91, 255, 0.35), 8px 0 18px -4px rgba(0, 212, 255, 0.35), 0 25px 50px -12px rgba(0, 212, 255, 0.2); }
.card.live:hover h3 { color: var(--brand-accent); }
.card.live .buy { margin-top: auto; padding-top: 0.9rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.card.live .buy .btn, .card.live .buy .btn-secondary { padding: 0.5rem 0.9rem; font-size: 0.875rem; }

/* Product images (2026-10-04) */
.shot{display:block;width:100%;height:auto;border-radius:12px;margin:1rem 0;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.03)}
.shots{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.75rem}
.shots .shot{margin:0}
.card .shot{margin:0 0 .75rem}
.hero-offers{margin-top:1.5rem;text-align:left}
/* Home: compact hero so the three buy cards fit in the first screen */
.hero.hero-compact{padding-block:1.25rem 2rem}
.hero.hero-compact h1{font-size:clamp(1.6rem,4vw,2.4rem);margin-bottom:.25rem}
.hero.hero-compact .lead{margin:.25rem 0 1rem}
.hero-offers .card .buy{margin:.5rem 0}
.hero-offers .card p{font-size:.92rem}
@media (max-width:600px){.hero-offers .card p,.hero-offers .card .shot{display:none}.hero-offers .card{padding:.75rem 1rem}.hero.hero-compact .lead{display:none}}
.card .thumb{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;object-position:top center;border-radius:8px;margin:0 0 .6rem;background:#0a0f1e}
.shots .shot{aspect-ratio:16/9;object-fit:cover;object-position:top center;background:#0a0f1e}
.shot-link{display:block;cursor:zoom-in}
@media (max-width:600px){.shots{grid-template-columns:1fr 1fr}}
