/* ============================================================================
   DarkDir — main2.css
   Dark minimal design system (Vercel / Linear / Apple). Monochrome; the only
   non-grey colours are --green (hero-dot, .copied, .verified, focus ring,
   ::selection) and the per-project colour that arrives inline on
   .status-dot-live.

   Motion model (100% vanilla — no libraries, no build step)
   ─ CSS springs      → all state transitions use --ease-spring / --ease-out.
   ─ JS (main.js)     → IntersectionObserver adds .visible (+ --stagger);
                        rAF spring engine drives --mag-x/--mag-y (magnetic
                        hover), --rx/--ry (tilt) and hero parallax transforms.
   ─ reduced-motion   → everything visible & static: no animation, no parallax,
                        no smooth scroll. (JS also checks the same media query.)

   Custom properties driven by JS (all default to a neutral value):
     --mx / --my      cursor position (%) for the card spotlight
     --mag-x / --mag-y magnetic offset (px) — springs toward the cursor
     --rx / --ry      tilt angles (deg) on .market-gif-wrap
     --stagger        per-element reveal delay (ms), set by JS per group
   Custom properties driven by CSS state (registered via @property so they
   can transition):
     --lift           hover lift (px)      --press   :active scale (number)
   ============================================================================ */

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  --bg:        #080808;
  --bg-1:      #101010;
  --bg-2:      #181818;
  --border:    rgba(255,255,255,0.07);
  --border-h:  rgba(255,255,255,0.13);
  --hairline:  rgba(255,255,255,0.05);   /* 1px inner top highlight            */
  --text:      #f0f0f0;
  --text-2:    #777777;
  --text-3:    #3d3d3d;
  --green:     #4ade80;
  --green-a:   rgba(74,222,128,0.55);    /* focus ring                         */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  /* motion curves */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);        /* material-ish, colours   */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);      /* quick settle            */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);       /* Apple-style overshoot   */
  --ease-momentum: cubic-bezier(0.19, 1, 0.22, 1);    /* long tail, "inertia"    */
  --spring:      var(--ease-spring);                  /* legacy alias            */

  --nav-h:     58px;
  --mono:      ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.02) inset;
  --shadow:    0 8px 24px -8px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.35);
  --shadow-lg: 0 24px 48px -16px rgba(0,0,0,0.7), 0 8px 16px -8px rgba(0,0,0,0.5);

  /* liquid glass */
  --glass-bg:        rgba(8,8,8,0.55);
  --glass-bg-strong: rgba(8,8,8,0.76);
  --glass-blur:      22px;
  --glass-blur-strong: 30px;
}

/* Registered custom properties: lets hover/active states transition on the
   spring curve while JS writes --mag-*/--r* every frame without fighting.
   Browsers without @property still work — the values just switch instantly. */
@property --lift   { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --press  { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --mag-x  { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --mag-y  { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --rx     { syntax: '<angle>';  inherits: false; initial-value: 0deg; }
@property --ry     { syntax: '<angle>';  inherits: false; initial-value: 0deg; }

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Inter, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* atmosphere: dot grid that fades towards the edges, plus a faint top glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.045) 1px, transparent 1.2px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 35%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 35%, transparent 100%);
}

main { flex: 1 0 auto; }

img, svg { max-width: 100%; height: auto; display: inline-block; vertical-align: middle; }
button { font: inherit; color: inherit; }
a { color: inherit; }
code { font-family: var(--mono); }
ul, ol { list-style-position: inside; }

/* Navigation / structural lists: no bullets, no indent */
.navbar ul, .navbar li,
.navbar-nav ul, .navbar-nav li,
.breadcrumb-list, .breadcrumb-list li,
.footer-nav, .faq-list, .steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* focus ring: thin, accent green, only for keyboard users */
:focus-visible {
  outline: 1.5px solid var(--green-a);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
::selection { background: var(--green); color: var(--bg); }
::-moz-selection { background: var(--green); color: var(--bg); }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navbar — Liquid Glass ──────────────────────────────────────────────────
   Layer stack (bottom → top):
     .navbar background      translucent base + backdrop blur/saturate
     .navbar::before         vertical body sheen (bright top → clear bottom)
     .navbar-sheen (span)    diagonal specular highlight, drifts on scroll
     .navbar::after          bottom hairline as a horizontal gradient
     box-shadow inset        1px inner top highlight (glass rim)
   .scrolled (set by JS at scrollY > 8): denser glass, more blur, soft drop. */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
          backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 1px 0 rgba(0,0,0,0.2);
  isolation: isolate;
  transition:
    background 0.6s var(--ease-out),
    box-shadow 0.6s var(--ease-out),
    -webkit-backdrop-filter 0.6s var(--ease-out),
    backdrop-filter 0.6s var(--ease-out);
}

/* layer: vertical body sheen */
.navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.065) 0%,
    rgba(255,255,255,0.02) 40%,
    rgba(255,255,255,0) 100%);
  transition: opacity 0.6s var(--ease-out);
}

/* layer: bottom hairline (gradient, brightest under the content column) */
.navbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.02) 0%,
    rgba(255,255,255,0.10) 20%,
    rgba(255,255,255,0.14) 50%,
    rgba(255,255,255,0.10) 80%,
    rgba(255,255,255,0.02) 100%);
  transition: opacity 0.6s var(--ease-out), background 0.6s var(--ease-out);
}

/* layer: diagonal specular sheen (span added in base.html, aria-hidden) */
.navbar-sheen {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.75;
  transition: opacity 0.6s var(--ease-out);
}

.navbar-sheen::before {
  content: '';
  position: absolute;
  top: -50%;
  bottom: -50%;
  left: -10%;
  width: 60%;
  background: linear-gradient(115deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.025) 35%,
    rgba(255,255,255,0.055) 50%,
    rgba(255,255,255,0.025) 65%,
    rgba(255,255,255,0) 100%);
  transform: translate3d(0, 0, 0) skewX(-8deg);
  transition: transform 1.2s var(--ease-momentum);
  will-change: transform;
}

/* scrolled: denser, deeper */
.navbar.scrolled {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur-strong)) saturate(190%);
          backdrop-filter: blur(var(--glass-blur-strong)) saturate(190%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.085),
    0 1px 0 rgba(0,0,0,0.35),
    0 16px 40px -18px rgba(0,0,0,0.75);
}

.navbar.scrolled::before { opacity: 0.8; }
.navbar.scrolled::after {
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.13) 20%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0.13) 80%,
    rgba(255,255,255,0.03) 100%);
}
.navbar.scrolled .navbar-sheen { opacity: 1; }
.navbar.scrolled .navbar-sheen::before { transform: translate3d(90%, 0, 0) skewX(-8deg); }

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  position: relative;
  z-index: 2;
}

.logo-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.3s var(--ease), transform 0.5s var(--ease-spring);
}

.logo-text:hover { opacity: 0.85; }
.logo-text:active { transform: scale(0.97); }

.navbar-nav { display: block; }

.navbar-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
}

.navbar-nav li { list-style: none; display: block; }

/* nav pill: magnetic (JS → --mag-x/--mag-y) + press (CSS → --press) */
.nav-link {
  position: relative;
  display: inline-block;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  transform: translate3d(var(--mag-x, 0px), var(--mag-y, 0px), 0) scale(var(--press, 1));
  transition:
    color 0.3s var(--ease),
    background 0.4s var(--ease-out),
    box-shadow 0.4s var(--ease-out),
    --press 0.45s var(--ease-spring);
}

.nav-link:hover {
  color: var(--text);
  background: rgba(255,255,255,0.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.nav-link:active { --press: 0.96; }

.nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.065);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 0 0 1px rgba(255,255,255,0.045);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  transition: background 0.3s var(--ease), transform 0.4s var(--ease-spring);
}

.hamburger:hover { background: rgba(255,255,255,0.05); }
.hamburger:active { transform: scale(0.92); }

.hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  margin: 0 auto;
  background: var(--text-2);
  border-radius: 1px;
  transition: transform 0.5s var(--ease-spring), opacity 0.25s var(--ease), background 0.2s;
}

.hamburger:hover span { background: var(--text); }

.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */
.breadcrumb {
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-2);
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.7rem 0;
  margin: 0;
}

.breadcrumb-list li { list-style: none; }

.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: var(--text-3); user-select: none; }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* ── Hero ───────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  isolation: isolate;
  padding: 5.5rem 0 3.75rem;
  text-align: center;
}

.hero.hero-compact { padding: 3.5rem 0 2.5rem; }

/* decorative glow (in templates; purely visual; JS parallaxes it) */
.hero-glow {
  position: absolute;
  inset: -20% 0 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 0%, rgba(255,255,255,0.05), transparent 70%),
    radial-gradient(ellipse 40% 35% at 50% 10%, rgba(74,222,128,0.045), transparent 70%);
  will-change: transform, opacity;
}

.hero-inner { position: relative; }

/* .hero-layer — parallax wrapper (data-parallax="<speed>") added in templates.
   JS moves the wrapper, so the CSS entrance keyframes on the child never
   fight the inline transform. */
.hero-layer { will-change: transform; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 0.32rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(16,16,16,0.7);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 1px 2px rgba(0,0,0,0.3);
  margin-bottom: 1.6rem;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.hero-eyebrow:hover { border-color: var(--border-h); color: var(--text); }

.hero-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: heroPulse 2.2s ease-in-out infinite;
}

.hero-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(74,222,128,0.5);
  animation: heroRing 2.2s ease-out infinite;
}

@keyframes heroPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.8); }
}

@keyframes heroRing {
  0%   { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.1rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.02;
  color: var(--text);
  margin: 0 auto 1.3rem;
  max-width: 18ch;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 0%, #f1f1f1 45%, #cfcfcf 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-compact .hero-title { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }

.hero-subtitle {
  font-size: 1.02rem;
  color: var(--text-2);
  max-width: 52ch;
  margin: 0 auto;
  line-height: 1.7;
  text-wrap: pretty;
}

/* .hero-rule — thin gradient divider under the hero (decorative, templates) */
.hero-rule {
  height: 1px;
  margin: 3.25rem auto 0;
  max-width: 1080px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.10) 30%,
    rgba(255,255,255,0.16) 50%,
    rgba(255,255,255,0.10) 70%,
    rgba(255,255,255,0) 100%);
  pointer-events: none;
}

/* CSS hero entrance: spring + blur-in, staggered.
   fill-mode "backwards": the end keyframe equals the natural state, so once
   finished the element's own hover/magnet transforms take over untouched. */
.hero-eyebrow, .hero-title, .hero-subtitle,
.market-badge, .market-title, .market-desc,
.market-gif-wrap, .market-hero-top > .project-monogram, .back-link {
  animation: heroIn 1s var(--ease-spring) backwards;
}
.hero-title, .market-title       { animation-delay: 0.08s; }
.hero-subtitle, .market-desc     { animation-delay: 0.18s; }
.market-gif-wrap,
.market-hero-top > .project-monogram { animation-delay: 0.22s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(22px); filter: blur(7px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* ── Sections ───────────────────────────────────────────────────────────────── */
.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid var(--border); }

.projects-section { padding: 0 0 4rem; }

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

.section-title + .cards,
.section-title + .steps,
.section-title + .faq-list { margin-top: 1.5rem; }

/* ── Project cards (1px grid) ───────────────────────────────────────────────
   The grid keeps its 1px seam: the <a> never moves; hover lift/magnet act on
   the inner wrapper (.project-card-inner, added in templates), so the seam
   stays intact while the content floats toward the cursor. */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-sm);
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-1);
  padding: 1.75rem;
  overflow: hidden;
  transition: background 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  --mx: 50%;
  --my: 50%;
}

/* cursor spotlight (position fed by JS via --mx/--my) */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255,255,255,0.06), transparent 45%);
  transition: opacity 0.5s var(--ease-out);
}

/* top-edge highlight that brightens on hover */
.project-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0) 100%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

.project-card:hover { background: var(--bg-2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.project-card:hover::before,
.project-card:hover::after { opacity: 1; }
.project-card:focus-visible { outline-offset: -3px; z-index: 1; }

.project-card > * { position: relative; }

/* .project-card-inner — wrapper (templates) that receives magnet + lift */
.project-card-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 100%;
  transform: translate3d(var(--mag-x, 0px), calc(var(--mag-y, 0px) + var(--lift, 0px)), 0) scale(var(--press, 1));
  transition: --lift 0.7s var(--ease-spring), --press 0.5s var(--ease-spring);
  will-change: transform;
}

.project-card:hover .project-card-inner  { --lift: -2px; }
.project-card:active .project-card-inner { --press: 0.985; }

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.project-monogram {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--bg-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.7s var(--ease-spring), border-color 0.4s var(--ease), box-shadow 0.5s var(--ease-out);
}

.project-card:hover .project-monogram {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--border-h);
  box-shadow: var(--shadow);
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.status-dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-2); /* overridden inline by project colour */
  flex-shrink: 0;
  animation: dotPulse 2.5s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.project-card-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.project-card-tagline {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-top: -0.35rem;
}

.project-card-desc {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.6;
  flex: 1;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.meta-pill {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.project-card:hover .meta-pill { border-color: var(--border-h); }

.project-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.feature-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}

.project-card-arrow {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.3s var(--ease), transform 0.7s var(--ease-spring);
}

.project-card:hover .project-card-arrow { color: var(--text); transform: translateX(4px); }

/* ── Safety notice ──────────────────────────────────────────────────────────── */
.safety-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--hairline);
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.65;
  margin: 0 0 2rem;
  transition: border-color 0.4s var(--ease), box-shadow 0.5s var(--ease-out);
}

.safety-notice:hover { border-color: var(--border-h); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06); }
.safety-notice p { margin: 0; }
.safety-notice strong { color: var(--text); font-weight: 600; }

.safety-icon {
  display: inline-flex;
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--text-2);
}

.safety-icon svg { width: 16px; height: 16px; }

/* ── Market page ────────────────────────────────────────────────────────────── */
.market-hero { position: relative; isolation: isolate; padding: 2.5rem 0 2rem; }

.market-hero .hero-glow { inset: -10% 0 auto; height: 60%; }

/* back pill: magnet + press */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 1.75rem;
  padding: 0.3rem 0.7rem 0.3rem 0.55rem;
  margin-left: -0.55rem;
  border-radius: 100px;
  transition: color 0.3s var(--ease), background 0.4s var(--ease-out), transform 0.6s var(--ease-spring);
}

.back-link:hover { color: var(--text); background: rgba(255,255,255,0.05); transform: translateX(-3px); }
.back-link:active { transform: translateX(-3px) scale(0.97); }

.market-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.market-hero-text { flex: 1 1 auto; min-width: 0; }

/* monogram fallback on the market page (no gif) */
.market-hero-top > .project-monogram {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* gif frame: magnet (--mag-*) + tilt (--rx/--ry) + hover lift (--lift) */
.market-gif-wrap {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  overflow: hidden;
  padding: 4px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.05);
  transform:
    perspective(900px)
    rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg))
    translate3d(var(--mag-x, 0px), calc(var(--mag-y, 0px) + var(--lift, 0px)), 0);
  transition:
    border-color 0.4s var(--ease),
    box-shadow 0.6s var(--ease-out),
    --lift 0.8s var(--ease-spring);
  will-change: transform;
}

.market-gif-wrap:hover {
  --lift: -4px;
  border-color: var(--border-h);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.07);
}

.market-gif {
  display: block;
  width: 520px;
  max-width: 100%;
  height: auto;
  border-radius: calc(var(--radius-lg) - 4px);
  object-fit: cover;
}

.market-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.32rem 0.8rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: rgba(16,16,16,0.7);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 1px 2px rgba(0,0,0,0.3);
  color: var(--text-2);
  margin-bottom: 1rem;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}

.market-badge:hover { border-color: var(--border-h); color: var(--text); }

.market-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: 0.8rem;
  text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 0%, #f1f1f1 45%, #cfcfcf 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}

.market-desc {
  font-size: 0.95rem;
  color: var(--text-2);
  max-width: 56ch;
  line-height: 1.7;
}

/* .market-divider — thin gradient rule between hero and stats (decorative) */
.market-divider {
  height: 1px;
  margin: 0 0 1.75rem;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.14) 0%,
    rgba(255,255,255,0.07) 40%,
    rgba(255,255,255,0) 100%);
  pointer-events: none;
}

/* stats bar */
.stats-bar {
  display: flex;
  align-items: stretch;
  padding: 1.25rem 1.5rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--hairline);
  margin-bottom: 1.5rem;
  gap: 1.5rem;
  transition: border-color 0.4s var(--ease);
}

.stats-bar:hover { border-color: var(--border-h); }

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 0;
  min-width: 0;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-value.verified { color: var(--green); }

.stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-sep {
  width: 1px;
  align-self: stretch;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, var(--border-h) 50%, rgba(255,255,255,0) 100%);
  flex-shrink: 0;
}

/* onion addresses */
.onion-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--hairline);
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: border-color 0.4s var(--ease);
}

.onion-card:hover { border-color: var(--border-h); }

.onion-card-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 0.8rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  margin: 0;
}

.onion-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.35s var(--ease-out);
}

.onion-row:last-child { border-bottom: 0; }
.onion-row:hover { background: var(--bg-2); }

.onion-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  flex: 0 0 4.5rem;
  white-space: nowrap;
}

.onion-addr {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

/* copy pill: press via --press */
.onion-copy {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transform: translate3d(0, var(--lift, 0px), 0) scale(var(--press, 1));
  transition:
    color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    background 0.3s var(--ease),
    box-shadow 0.4s var(--ease-out),
    --lift 0.5s var(--ease-spring),
    --press 0.4s var(--ease-spring);
}

.onion-copy:hover {
  --lift: -1px;
  color: var(--text);
  border-color: var(--border-h);
  background: var(--bg-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 12px -6px rgba(0,0,0,0.6);
}

.onion-copy:active { --press: 0.96; }

.onion-copy.copied {
  color: var(--green);
  border-color: rgba(74,222,128,0.3);
  background: rgba(74,222,128,0.06);
}

/* feature badges: magnet + lift */
.feature-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  transform: translate3d(var(--mag-x, 0px), calc(var(--mag-y, 0px) + var(--lift, 0px)), 0) scale(var(--press, 1));
  transition:
    border-color 0.3s var(--ease),
    color 0.3s var(--ease),
    box-shadow 0.5s var(--ease-out),
    --lift 0.7s var(--ease-spring),
    --press 0.4s var(--ease-spring);
}

.feature-badge:hover {
  --lift: -3px;
  border-color: var(--border-h);
  color: var(--text);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.06);
}

.badge-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.3s var(--ease);
}

.feature-badge:hover .badge-icon { opacity: 0.9; }

/* ── Generic cards (1px grid) ───────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.card {
  position: relative;
  background: var(--bg-1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  transition: background 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  --mx: 50%;
  --my: 50%;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgba(255,255,255,0.05), transparent 45%);
  transition: opacity 0.5s var(--ease-out);
}

.card:hover { background: var(--bg-2); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }

.card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.card-head img,
.card-head svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.3s var(--ease), transform 0.7s var(--ease-spring);
}

.card:hover .card-head img,
.card:hover .card-head svg { opacity: 0.9; transform: translateY(-1px); }

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
  transition: transform 0.7s var(--ease-spring);
}

.card:hover .card-title { transform: translateX(2px); }

.card-text {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ── Steps ──────────────────────────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  counter-reset: step;
}

.steps > * {
  background: var(--bg-1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.5s var(--ease-out);
}

.steps > *:hover { background: var(--bg-2); }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 28px;
  height: 28px;
  padding: 0 0.6rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
}

.step-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.step-desc {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ── FAQ ────────────────────────────────────────────────────────────────────── */
.faq-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.faq-item {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.4s var(--ease-out);
}

.faq-item:hover { background: var(--bg-2); }
.faq-item:last-child { border-bottom: 0; }

.faq-q {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.faq-a {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.7;
}

.faq-a p + p { margin-top: 0.75rem; }

/* ── Long-form content ──────────────────────────────────────────────────────── */
.content {
  max-width: 68ch;
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.75;
}

.content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.content h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 1.75rem 0 0.5rem;
}

.content p { margin-bottom: 1rem; }
.content ul, .content ol { margin: 0 0 1rem 1.25rem; list-style-position: outside; }
.content li { margin-bottom: 0.35rem; }
.content strong { color: var(--text); font-weight: 600; }
.content code { font-size: 0.85em; padding: 0.1em 0.4em; background: var(--bg-2); border: 1px solid var(--border); border-radius: 4px; color: var(--text); }

.content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.3s var(--ease);
}

.content a:hover { text-decoration-color: var(--text); }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  margin-top: auto;
  padding: 2.25rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-2);
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.012) 100%);
}

.site-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  width: min(60%, 640px);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy { margin: 0; color: var(--text-2); }

.footer-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.footer-nav a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}

.footer-nav a:hover { color: var(--text); }

.footer-disclaimer {
  margin: 1rem 0 0;
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.6;
}

/* ── Scroll reveal ──────────────────────────────────────────────────────────
   .fade-in / [data-reveal]: hidden until JS adds .visible, then a one-shot
   keyframe (opacity + translateY + scale 0.98→1 + blur) on the spring curve.
   Uses animation with fill-mode "backwards" (not a transition), so once done
   the element's own hover transitions/transforms are untouched and no
   `transition` shorthand conflicts with the element's own.
   --stagger (ms) is set by JS per group index. */
.fade-in,
[data-reveal] { opacity: 0; }

.fade-in.visible,
[data-reveal].visible {
  opacity: 1;
  animation: revealIn 0.9s var(--ease-spring) backwards;
  animation-delay: calc(var(--stagger, 0) * 1ms);
}

@keyframes revealIn {
  from { opacity: 0; transform: translate3d(0, 20px, 0) scale(0.98); filter: blur(5px); }
  60%  { filter: blur(0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .projects-grid, .cards, .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }

  .hamburger { display: flex; }

  .navbar-nav { display: none; }

  /* mobile dropdown: same glass recipe as the bar */
  .navbar-nav.open {
    display: block;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(var(--glass-blur-strong)) saturate(180%);
            backdrop-filter: blur(var(--glass-blur-strong)) saturate(180%);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.07),
      0 1px 0 rgba(255,255,255,0.06),
      0 24px 48px -16px rgba(0,0,0,0.75);
    z-index: 99;
    transform-origin: top center;
    animation: navDrop 0.55s var(--ease-spring) both;
    isolation: isolate;
  }

  .navbar-nav.open::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0) 100%);
  }

  @keyframes navDrop {
    from { opacity: 0; transform: translateY(-10px) scale(0.99); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }

  .navbar-nav.open ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
    gap: 0.25rem;
  }

  .navbar-nav.open .nav-link { display: block; padding: 0.65rem 0.8rem; font-size: 0.85rem; }

  .hero { padding: 3.5rem 0 2.5rem; }
  .hero.hero-compact { padding: 2.5rem 0 2rem; }
  .hero-rule { margin-top: 2.25rem; }

  .projects-grid, .cards, .steps { grid-template-columns: 1fr; }
  .project-card { padding: 1.5rem; }

  .market-hero-top { flex-direction: column; gap: 1.5rem; }
  .market-gif-wrap { width: 100%; }
  .market-gif { width: 100%; max-width: 100%; }
  .market-gif-wrap:hover { --lift: 0px; }

  .stats-bar { flex-wrap: wrap; padding: 1rem; gap: 1rem; }
  .stat-item { flex: 1 1 calc(50% - 0.5rem); }
  .stat-sep { display: none; }

  .onion-row { flex-direction: column; align-items: flex-start; gap: 0.375rem; }
  .onion-label { flex-basis: auto; }
  .onion-addr { font-size: 0.68rem; width: 100%; white-space: normal; word-break: break-all; }
  .onion-copy { align-self: flex-end; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero-title { font-size: 2rem; }
  .stat-item { flex-basis: 100%; }
}

/* touch / coarse pointers: no lift, no magnet residue */
@media (hover: none) {
  .project-card-inner, .feature-badge, .nav-link, .market-gif-wrap, .onion-copy {
    --lift: 0px; --mag-x: 0px; --mag-y: 0px; --rx: 0deg; --ry: 0deg;
  }
}

/* ── Typewriter cursor ──────────────────────────────────────────────────────── */
.tw-cursor {
  display: inline-block;
  width: 0.06em;
  height: 0.9em;
  margin-left: 0.08em;
  vertical-align: -0.08em;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* ── Reduced motion ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }

  .fade-in, [data-reveal] { opacity: 1; animation: none; }
  .fade-in.visible, [data-reveal].visible { animation: none; }

  .hero-eyebrow, .hero-title, .hero-subtitle,
  .market-badge, .market-title, .market-desc,
  .market-gif-wrap, .market-hero-top > .project-monogram, .back-link {
    animation: none; opacity: 1; transform: none; filter: none;
  }

  .tw-cursor { animation: none; }
  .hero-dot, .hero-dot::after, .status-dot-live { animation: none; }
  .hero-dot::after { display: none; }

  .hero-layer, .hero-glow { transform: none !important; opacity: 1 !important; }

  .project-card-inner, .feature-badge, .nav-link, .market-gif-wrap, .onion-copy, .logo-text,
  .project-monogram, .project-card-arrow, .card-title, .card-head img, .card-head svg, .back-link {
    transform: none !important;
  }

  .navbar-sheen::before { transition: none; }
}
