/* ============================================================
   PINTEAN 2.0 — Core Styles
   Paleta: Dark Navy + Gold (π) + Electric Blue
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  /* Backgrounds */
  --bg:        #080C17;
  --bg-2:      #0D1428;
  --surface:   #111829;
  --surface-2: #18213A;
  --glass:     rgba(8, 12, 23, 0.75);
  --glass-2:   rgba(13, 20, 40, 0.6);

  /* Gold accent (π brand) */
  --gold:        #C9A84C;
  --gold-2:      #E8C77A;
  --gold-dim:    rgba(201, 168, 76, 0.08);
  --gold-border: rgba(201, 168, 76, 0.18);
  --gold-glow:   rgba(201, 168, 76, 0.25);

  /* Blue accent (from marketmakers palette) */
  --blue:        #3D8EF0;
  --blue-2:      #6BAAFF;
  --blue-dim:    rgba(61, 142, 240, 0.08);
  --blue-border: rgba(61, 142, 240, 0.15);
  --blue-glow:   rgba(61, 142, 240, 0.2);

  /* Cyan highlight */
  --cyan:     #22D3EE;
  --cyan-dim: rgba(34, 211, 238, 0.08);

  /* Text */
  --text-1: #EDF0FA;
  --text-2: rgba(237, 240, 250, 0.52);
  --text-3: rgba(237, 240, 250, 0.28);

  /* Borders */
  --border:   rgba(255, 255, 255, 0.06);
  --border-2: rgba(255, 255, 255, 0.1);

  /* Status */
  --green:     #22C55E;
  --green-dim: rgba(34, 197, 94, 0.1);
  --red:       #EF4444;
  --red-dim:   rgba(239, 68, 68, 0.1);

  /* Typography */
  --font-sans: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --nav-h:       72px;
  --container:   1200px;
  --gutter:      clamp(20px, 5vw, 60px);

  /* Radii */
  --r-sm:   6px;
  --r-md:   12px;
  --r-lg:   20px;
  --r-xl:   32px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.5);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
input, textarea { font-family: inherit; }

/* ---- Cross-page transitions ----
   Chrome/Edge: native cross-document View Transitions — a plain root
   crossfade (no per-element view-transition-name), timed to match the
   JS fallback below so both feel the same, not "fancy in Chrome, plain
   elsewhere." Safari/Firefox don't parse @view-transition at all, so
   this block is simply invisible to them — no fallback needed here. */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* Safari/Firefox fallback — see js/main.js initPageFade(). A page only
   ever starts hidden if the PREVIOUS page set the sessionStorage flag
   right before navigating here (see html.vt-fallback below in each
   page's <head>), so a direct visit / bookmark / reload never risks
   getting stuck invisible if JS fails to run. */
html.vt-fallback.vt-incoming body { opacity: 0; }
html.vt-fallback body { transition: opacity 0.22s ease; }
@media (prefers-reduced-motion: reduce) {
  html.vt-fallback body { transition: none; }
}

/* ---- Typography Scale ---- */
.display-xl {
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--text-1);
}
.display-lg {
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--text-1);
}
.display-md {
  font-size: clamp(1.8rem, 3.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-1);
}
h2 { font-size: clamp(1.6rem, 3vw, 2.8rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }
p  { line-height: 1.8; }

.mono { font-family: var(--font-mono); }

/* Text gradient gold */
.text-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Text gradient blue */
.text-blue {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Mixed gradient headline */
.text-gradient {
  background: linear-gradient(135deg, var(--text-1) 0%, var(--gold-2) 50%, var(--blue-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Layout ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}

/* ---- Scroll Progress Bar ---- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--blue) 100%);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* ---- Preloader (sub-pages) ---- */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), visibility 0.8s;
}
#preloader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-logo {
  width: 180px;
  opacity: 0;
  animation: preloader-fade-in 0.6s 0.2s forwards;
}
@keyframes preloader-fade-in {
  to { opacity: 1; }
}

/* ---- Intro Overlay (index.html) — π types NTEAN → glitch → tail → exit ---- */
.intro-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Clean exit (fallback / reduced motion): decisive fade with a slight lift */
.intro-overlay.intro-exit {
  animation: intro-exit 0.9s cubic-bezier(0.76, 0, 0.24, 1) forwards;
  pointer-events: none;
}
@keyframes intro-exit {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}
/* Morph exit: only the dark backdrop fades — the logo itself keeps flying
   (via inline transform) into the header logo slot, where the real header
   logo takes over pixel-for-pixel */
.intro-overlay.intro-morph {
  background: transparent;
  transition: background-color 0.45s ease 0.2s;
  pointer-events: none;
}
.intro-logo-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, 60vw);
  overflow: visible;
}
/* NTEAN letters (and "pi") start invisible; JS flips each to opacity:1 as it's
   "typed" — the transition is what gives it a soft typing feel instead of a snap */
.intro-letter,
#intro-pi-t { opacity: 0; transition: opacity 0.16s ease; }
/* The gold bar loads left→right — starts only once "pi" has flickered into
   the π mark (Phase 3 in main.js), completes, then the exit begins.
   Class is 'tail-on' to avoid colliding with the generic .reveal utility. */
#intro-pi-tail.tail-on {
  animation: tail-reveal 2.8s linear forwards;
}
@keyframes tail-reveal {
  from { stroke-dashoffset: 200; }
  to   { stroke-dashoffset: 0; }
}
.intro-cursor-blink {
  animation: intro-cursor-blink-anim 0.65s step-end infinite;
}
@keyframes intro-cursor-blink-anim {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}


/* ---- Navigation ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
/* Same flat, edge-to-edge bar + breathing gold hairline as the OS-board
   header on index.html, so every page reads as one product. */
.site-header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 8%, var(--gold-border) 50%, transparent 92%);
  opacity: 0.7;
  pointer-events: none;
}
/* Edge-to-edge, fixed 20px padding — matches .os-header exactly (not
   --gutter, which scales up to 60px) so the page-picker sits at the same
   inset on every page and doesn't visibly jump on navigation. */
.nav {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
}
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.logo-img {
  height: 28px;
  width: auto;
}
/* ---- .td dropdown component ----
   The exact "choose tool" dropdown from the OS-board (index.html), moved
   here so it's shared: About/Blog/Contact/Library reuse it verbatim for
   their page-picker instead of a separate lookalike, so it never drifts. */
.td { position: relative; }
.td-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 236px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(160deg, #0e1526 0%, #080c17 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 8px 22px;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 1px 3px rgba(0, 0, 0, 0.5);
  transition: color 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.td-trigger:hover,
.td-trigger[aria-expanded="true"] {
  color: var(--text-1);
  border-color: rgba(201, 168, 76, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 0 0 1px rgba(201, 168, 76, 0.1),
    0 6px 22px rgba(201, 168, 76, 0.14);
}
/* Compact icon-only variant — the marketing pages' page-picker. Same
   glossy chrome as the full text trigger, just a symbol instead of a
   label, so it reads as a discreet corner control rather than a menu bar. */
.td-trigger.td-icon {
  min-width: 0;
  gap: 0;
  padding: 8px;
  border-radius: var(--r-full);
}
.td-trigger.td-icon svg.td-icon-glyph { width: 16px; height: 16px; fill: currentColor; }
.td-chev {
  width: 12px;
  height: 12px;
  color: var(--gold);
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px var(--gold-glow));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.td.open .td-chev { transform: rotate(180deg); }

.td-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 80;
  min-width: 216px;
  padding: 8px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0) 32%),
    linear-gradient(180deg, rgba(11, 16, 30, 0.97) 0%, rgba(5, 8, 16, 0.98) 100%);
  backdrop-filter: blur(22px) saturate(1.5);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(201, 168, 76, 0.04);
  perspective: 700px;          /* 3D stage for the unfolding items */
  opacity: 0;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.td.open .td-menu { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
/* Right-aligned variant — the page-picker sits at the header's right edge,
   so its menu opens flush right instead of centered under the trigger. */
.td-menu.td-menu-right {
  left: auto;
  right: 0;
  transform: translateY(-6px);
}
.td.open .td-menu.td-menu-right { transform: none; }

.td-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px 9px 14px;
  border-radius: 9px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  position: relative;
  transform-origin: top center;     /* fold down from the top edge */
  transform: rotateX(-92deg);
  opacity: 0;
  transition: color 0.2s ease, background 0.2s ease;
}
.td.open .td-item { animation: td-unfold 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.td.open .td-item:nth-child(1) { animation-delay: 0.02s; }
.td.open .td-item:nth-child(2) { animation-delay: 0.05s; }
.td.open .td-item:nth-child(3) { animation-delay: 0.08s; }
.td.open .td-item:nth-child(4) { animation-delay: 0.11s; }
.td.open .td-item:nth-child(5) { animation-delay: 0.14s; }
.td.open .td-item:nth-child(6) { animation-delay: 0.17s; }
.td.open .td-item:nth-child(7) { animation-delay: 0.20s; }
@keyframes td-unfold {
  from { opacity: 0; transform: rotateX(-92deg); }
  to   { opacity: 1; transform: rotateX(0); }
}
/* thin glowing accent bar — grows in on hover/active, HUD-style */
.td-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 22%;
  bottom: 22%;
  width: 2px;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold-glow);
  transform: scaleY(0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.td-item:hover,
.td-item:focus-visible {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}
.td-item:hover::before,
.td-item:focus-visible::before { transform: scaleY(1); }
.td-item.active { color: var(--gold); }
.td-item.active::before { transform: scaleY(1); }
/* Only the Journal tool is live for now — the rest stay in the DOM (so
   they're one attribute-flip away from launching) but read as inert. */
.td-item:disabled {
  cursor: default;
  opacity: 0.5;
}
.td-item:disabled:hover,
.td-item:disabled:focus-visible {
  color: var(--text-2);
  background: none;
}
.td-item:disabled:hover::before,
.td-item:disabled:focus-visible::before { transform: scaleY(0); }
.td-soon-tag {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-2);
  padding: 2px 7px;
  border-radius: var(--r-full);
}
.td-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-2);
  flex-shrink: 0;
  transition: background 0.2s ease;
}
.td-item:hover .td-dot { background: var(--text-3); }
.td-item.active .td-dot { background: var(--gold); box-shadow: 0 0 6px var(--gold-glow); }
.td-sep {
  height: 1px;
  margin: 6px 8px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1) 50%, transparent);
}
.td-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 4px 12px 6px;
}
.td-pages a {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--text-3);
  transition: color 0.2s ease;
}
.td-pages a:hover { color: var(--text-1); }
@media (prefers-reduced-motion: reduce) {
  .td-menu, .td-chev, .td-item { transition: none; }
  .td.open .td-item { animation: none; opacity: 1; transform: none; }
}

/* ---- Page-nav (About/Blog/Contact/Library header) ----
   Wraps the shared .td component; only adds "push to the header's right
   edge" positioning, which the OS-board doesn't need (its dropdown is
   grid-centered instead). */
.page-nav { margin-left: auto; }
.page-nav .td-item.active,
html[data-page="home"] .page-nav .td-item[href="index.html"],
html[data-page="about"] .page-nav .td-item[href="about.html"],
html[data-page="blog"] .page-nav .td-item[href="blog.html"],
html[data-page="contact"] .page-nav .td-item[href="contact.html"] {
  color: var(--gold);
}
html[data-page="home"] .page-nav .td-item[href="index.html"] .td-dot,
html[data-page="about"] .page-nav .td-item[href="about.html"] .td-dot,
html[data-page="blog"] .page-nav .td-item[href="blog.html"] .td-dot,
html[data-page="contact"] .page-nav .td-item[href="contact.html"] .td-dot {
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold-glow);
}
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px;
}
.lang-btn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3);
  padding: 6px 10px;
  border-radius: var(--r-full);
  transition: all 0.2s ease;
  text-transform: uppercase;
}
.lang-btn.active {
  color: var(--gold);
  background: var(--gold-dim);
}
.lang-sep {
  color: var(--text-3);
  font-size: 0.65rem;
  font-family: var(--font-mono);
}
.nav-cta {
  flex-shrink: 0;
}
/* ---- Live session clock (header) ---- */
.session-clock {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  margin: 0 8px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-3);
  white-space: nowrap;
}
.sc-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sc-city { color: var(--text-3); font-weight: 700; }
.sc-dot {
  display: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}
.sc-item.open .sc-dot { background: var(--green); }
.sc-status { color: var(--red); font-weight: 700; }
.sc-item.open .sc-status { color: var(--green); }
.sc-sep { opacity: 0.5; }
.sc-time {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  min-width: 8ch;
  text-align: right;
  margin-left: 2px;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
  border-radius: var(--r-full);
  background: var(--surface);
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-1);
  transition: all 0.3s ease;
}
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-nav.open {
  display: flex;
  opacity: 1;
  pointer-events: all;
}
.mobile-nav a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 14px 32px;
  border-radius: var(--r-full);
  transition: all 0.2s ease;
  width: 100%;
  text-align: center;
  max-width: 280px;
}
.mobile-nav a:hover { color: var(--text-1); background: var(--surface); }
.mobile-nav-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}
.mobile-lang {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-nav-close {
  position: absolute;
  top: 20px;
  right: 24px;
  padding: 12px;
  color: var(--text-2);
  font-size: 1.5rem;
  line-height: 1;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--r-sm);
  padding: 13px 24px;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--gold);
  color: #07090F;
  box-shadow: 0 0 0 rgba(201,168,76,0);
}
.btn-primary:hover {
  background: var(--gold-2);
  box-shadow: 0 8px 32px var(--gold-glow), 0 0 0 1px var(--gold-border);
  transform: translateY(-1px);
}
/* Story CTAs pointing at not-yet-launched tools — same gold look as an
   active primary button, just inert (no hover lift, not clickable). */
.btn.btn-disabled {
  pointer-events: none;
  cursor: default;
}
.btn.btn-disabled:hover {
  transform: none;
}
.btn-outline {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border-2);
}
.btn-outline:hover {
  border-color: var(--gold-border);
  color: var(--gold-2);
  background: var(--gold-dim);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-1);
  border-color: var(--border-2);
  background: var(--surface);
}
.btn-blue {
  background: var(--blue);
  color: #fff;
}
.btn-blue:hover {
  background: var(--blue-2);
  box-shadow: 0 8px 32px var(--blue-glow);
  transform: translateY(-1px);
}
.btn-lg { padding: 16px 32px; font-size: 0.82rem; }
.btn-sm { padding: 10px 18px; font-size: 0.72rem; }
.btn-pill { border-radius: var(--r-full); }

/* ---- Section Label ---- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.section-label::before {
  content: '//';
  opacity: 0.5;
}

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--gold-border);
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.3), 0 0 0 1px var(--gold-border);
}

/* ---- Magnetic card tilt + glow ----
   A <span class="card-glow"> is injected by js/main.js initCardGlow()
   into each card; its background is set inline per-frame to a radial
   gradient centered on the cursor. The card itself gets a live
   perspective/rotate transform from the same mousemove handler — the
   card's own existing hover transition (border-color/box-shadow/etc.,
   already defined per class above) picks up the transform change too,
   so it eases in the same rhythm as everything else on that card. */
.card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.card-magnetic:hover .card-glow { opacity: 1; }
.card-glass {
  background: var(--glass-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
}
.card-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  flex-shrink: 0;
}

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--r-full);
}
.badge-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.2); }
.badge-gold  { background: var(--gold-dim);  color: var(--gold);  border: 1px solid var(--gold-border); }
.badge-blue  { background: var(--blue-dim);  color: var(--blue-2); border: 1px solid var(--blue-border); }
.badge-muted { background: var(--surface);   color: var(--text-3); border: 1px solid var(--border); }
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ---- Section spacing ---- */
.section { padding: clamp(80px, 10vw, 140px) 0; }
.section-sm { padding: clamp(48px, 6vw, 80px) 0; }
.section-divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ---- Grid utilities ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.gap-sm  { gap: 12px; }
.gap-md  { gap: 24px; }
.gap-lg  { gap: 40px; }

/* ---- Flex utilities ---- */
.flex     { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-wrap  { flex-wrap: wrap; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ---- Text utilities ---- */
.text-center  { text-align: center; }
.text-sm  { font-size: 0.85rem; }
.text-xs  { font-size: 0.75rem; }
.text-muted { color: var(--text-3); }
.text-secondary { color: var(--text-2); }
.text-gold-color { color: var(--gold); }
.tj-title-accent { color: var(--gold); font-weight: 800; }
.text-blue-color { color: var(--blue-2); }
.fw-700 { font-weight: 700; }
.lh-loose { line-height: 1.85; }

/* ---- Terminal box ---- */
.terminal-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 28px;
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
}
.terminal-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-dim) 0%, transparent 60%);
  pointer-events: none;
}
.terminal-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.terminal-row:last-of-type { border-bottom: none; }
.terminal-label { color: var(--text-2); letter-spacing: 0.04em; }
.terminal-value { color: var(--gold); font-weight: 700; letter-spacing: 0.05em; flex-shrink: 0; }
.terminal-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ---- Glow effects ---- */
.glow-gold {
  box-shadow: 0 0 40px var(--gold-glow), 0 0 80px rgba(201,168,76,0.1);
}
.glow-blue {
  box-shadow: 0 0 40px var(--blue-glow), 0 0 80px rgba(61,142,240,0.1);
}

/* ---- Cursor blink ---- */
.cursor-blink {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--gold);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: cursor-blink 1.06s step-end infinite; /* 530ms on / 530ms off — terminal cadence */
}
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ---- Noise texture overlay ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.018;
  pointer-events: none;
  z-index: 0;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 60px 0 40px;
}
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand .logo-img { height: 24px; opacity: 0.85; }
.footer-tagline {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-top: 12px;
}
.footer-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 6px 12px;
  border-radius: var(--r-full);
  transition: color 0.2s, background 0.2s;
}
.footer-links a:hover { color: var(--text-1); background: var(--surface); }
.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* ---- Page hero (inner pages) ---- */
.page-hero {
  padding: calc(var(--nav-h) + 80px) 0 80px;
}

/* ---- Form ---- */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}
.form-input,
.form-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
  outline: none;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.form-textarea { min-height: 140px; }

/* ---- Data bars ---- */
.data-bar-wrap { display: flex; flex-direction: column; gap: 20px; }
.data-bar-item { display: flex; flex-direction: column; gap: 8px; }
.data-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.data-bar-label { font-size: 0.82rem; color: var(--text-2); }
.data-bar-pct {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}
.data-bar-track {
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.data-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-2) 100%);
  width: 0%;
  transition: width 1.4s cubic-bezier(0.16,1,0.3,1);
}
.data-bar-fill.bar-animated { width: var(--bar-w, 0%); }
.data-bar-fill-dim {
  background: linear-gradient(90deg, var(--text-3) 0%, var(--text-2) 100%);
}
.data-bar-note {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
}

