/* ==========================================================================
   Nextendo Network
   Precision-instrument dark aesthetic. Steel-blue primary, one brass accent.
   Built against the impeccable / taste / ui-ux-pro-max anti-slop rules.
   ========================================================================== */

/* ---- Tokens ---- */
:root {
  /* Surfaces (cool near-black, brand-hue tinted) */
  --bg:        oklch(0.165 0.018 235);
  --bg-deep:   oklch(0.132 0.015 235);
  --surface:   oklch(0.205 0.020 236);
  --surface-2: oklch(0.245 0.022 236);

  /* Text */
  --ink:    oklch(0.962 0.006 230);
  --muted:  oklch(0.735 0.014 232);
  --faint:  oklch(0.580 0.014 232);

  /* Brand */
  --primary:        oklch(0.730 0.115 222);
  --primary-bright: oklch(0.820 0.105 220);
  --accent:         oklch(0.800 0.115 78);   /* brass, used sparingly */
  --signal:         oklch(0.800 0.130 158);  /* semantic "online" only */

  /* Lines / glow */
  --line:      color-mix(in oklch, var(--ink) 12%, transparent);
  --line-soft: color-mix(in oklch, var(--ink) 7%, transparent);
  --glow:      color-mix(in oklch, var(--primary) 40%, transparent);

  /* Type */
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  /* Radius (one system: 14 surfaces, pill interactive) */
  --r: 14px;
  --r-lg: 18px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --shell: 1180px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);

  /* Z scale */
  --z-nav: 100;
  --z-veil: -1;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--display);
  font-optical-sizing: auto;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: color-mix(in oklch, var(--primary) 35%, transparent); color: #fff; }
:focus-visible { outline: 2px solid var(--primary-bright); outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; letter-spacing: 0; }
.mono--dim { color: var(--faint); }

.skip-link {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -120%);
  background: var(--ink); color: var(--bg); padding: 0.55rem 1rem;
  border-radius: 0 0 10px 10px; z-index: 1000; font-weight: 600;
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(4rem, 9vw, 8rem); }
.section--tight { padding-block: clamp(2rem, 4vw, 3rem); }

/* ==========================================================================
   Morphism backdrop: two slow morphing fields + a faint grid veil
   ========================================================================== */
.backdrop { position: fixed; inset: 0; z-index: var(--z-veil); overflow: hidden; pointer-events: none; }
.field {
  position: absolute; filter: blur(80px); opacity: 0.42; will-change: transform, border-radius;
}
.field--a {
  width: 48vw; height: 48vw; max-width: 660px; max-height: 660px; top: -10%; right: -6%;
  background: radial-gradient(circle at 35% 35%, var(--primary), transparent 68%);
  border-radius: 44% 56% 60% 40% / 50% 44% 56% 50%;
  animation: morph 24s var(--ease-soft) infinite, drift1 32s ease-in-out infinite;
}
.field--b {
  width: 40vw; height: 40vw; max-width: 520px; max-height: 520px; top: 46%; left: -10%;
  background: radial-gradient(circle at 60% 40%, var(--accent), transparent 70%);
  opacity: 0.22;
  border-radius: 60% 40% 44% 56% / 56% 58% 42% 44%;
  animation: morph 30s var(--ease-soft) infinite reverse, drift2 38s ease-in-out infinite;
}
@keyframes morph {
  0%, 100% { border-radius: 44% 56% 60% 40% / 50% 44% 56% 50%; }
  33% { border-radius: 62% 38% 40% 60% / 42% 62% 38% 58%; }
  66% { border-radius: 38% 62% 56% 44% / 60% 38% 62% 40%; }
}
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-4%,5%) scale(1.07); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6%,-4%) scale(1.05); } }
.grid-veil {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(color-mix(in oklch, var(--ink) 3%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklch, var(--ink) 3%, transparent) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(125% 90% at 50% 0%, #000 35%, transparent 80%);
  mask-image: radial-gradient(125% 90% at 50% 0%, #000 35%, transparent 80%);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.97rem; line-height: 1; white-space: nowrap;
  padding: 0.9rem 1.35rem; border-radius: var(--r-pill);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn--sm { padding: 0.6rem 1rem; font-size: 0.9rem; }
.btn i { font-size: 1.05em; transition: transform 0.3s var(--ease); }

.btn--primary {
  color: oklch(0.18 0.03 235);
  background: var(--primary);
  box-shadow: 0 1px 0 color-mix(in oklch, white 35%, transparent) inset,
              0 10px 30px -12px var(--glow);
}
.btn--primary:hover { background: var(--primary-bright); transform: translateY(-2px); box-shadow: 0 16px 38px -14px var(--glow); }
.btn--primary:hover i { transform: translateX(3px); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--ink) 3%, transparent);
}
.btn--ghost:hover { border-color: color-mix(in oklch, var(--ink) 24%, transparent); transform: translateY(-2px); }

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  padding-block: 0.8rem;
  border-bottom: 1px solid transparent;
  transition: padding 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.nav.stuck {
  padding-block: 0.55rem;
  background: color-mix(in oklch, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom-color: var(--line-soft);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 48px; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand__mark { transition: transform 0.4s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.05); }
.brand__word { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.02em; white-space: nowrap; }
.brand__dim { color: var(--muted); font-weight: 500; }

.nav__links { display: flex; gap: 0.2rem; }
.nav__links a {
  color: var(--muted); font-size: 0.93rem; font-weight: 500; padding: 0.45rem 0.8rem; border-radius: 10px;
  position: relative; transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav__links a:hover { color: var(--ink); background: color-mix(in oklch, var(--ink) 4%, transparent); }
.nav__links a.active { color: var(--ink); }
.nav__links a.active::after {
  content: ""; position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.25rem; height: 2px;
  background: var(--primary); border-radius: 2px;
}

.nav__end { display: flex; align-items: center; gap: 0.65rem; }
.ghost-link { color: var(--muted); font-size: 0.92rem; font-weight: 500; display: inline-flex; align-items: center; gap: 0.35rem; transition: color 0.2s var(--ease); }
.ghost-link:hover { color: var(--ink); }

.burger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); }
.burger span { display: block; width: 17px; height: 2px; margin: 3px auto; background: var(--ink); border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-5px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-top: clamp(2rem, 5vw, 4rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.hero__grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; min-height: min(74vh, 640px); }

.status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; font-weight: 500; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 0.38rem 0.8rem; margin-bottom: 1.6rem;
  background: color-mix(in oklch, var(--ink) 2.5%, transparent);
}
.status__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 0 color-mix(in oklch, var(--signal) 55%, transparent); animation: ping 2.6s var(--ease-soft) infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--signal) 50%, transparent); } 70%,100% { box-shadow: 0 0 0 7px transparent; } }
.status--mini { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

.hero__title {
  font-weight: 600; font-size: clamp(2.4rem, 5.2vw, 4rem); line-height: 1.06;
  letter-spacing: -0.035em; text-wrap: balance; margin-bottom: 1.3rem;
}
.hl { color: var(--primary-bright); }

.hero__lede { font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--muted); max-width: 46ch; text-wrap: pretty; margin-bottom: 2rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; }

/* Hero visualization (canvas signal field) */
.hero__viz {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background:
    radial-gradient(120% 100% at 80% 0%, color-mix(in oklch, var(--primary) 12%, transparent), transparent 60%),
    var(--bg-deep);
  box-shadow: 0 30px 80px -50px #000;
  aspect-ratio: 56 / 46;
}
.hero__viz canvas { width: 100%; height: 100%; }
.hero__viz-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0.9rem; font-size: 0.74rem;
  background: linear-gradient(0deg, color-mix(in oklch, var(--bg-deep) 85%, transparent), transparent);
}

/* ==========================================================================
   Statement
   ========================================================================== */
.statement { padding-block: clamp(3rem, 7vw, 6rem); }
.statement__text {
  font-weight: 500; font-size: clamp(1.5rem, 3.6vw, 2.6rem); line-height: 1.2;
  letter-spacing: -0.03em; max-width: 22ch; text-wrap: balance;
}
.statement__soft { color: var(--muted); }

/* ==========================================================================
   Section heads
   ========================================================================== */
.head { max-width: 640px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.head--left { max-width: 560px; }
.head__title { font-weight: 600; font-size: clamp(1.7rem, 3.3vw, 2.6rem); line-height: 1.1; letter-spacing: -0.03em; text-wrap: balance; }
.head__lede { color: var(--muted); font-size: clamp(1rem, 1.3vw, 1.1rem); margin-top: 0.85rem; text-wrap: pretty; }

/* ==========================================================================
   Bento (features) - varied cells, exact count, spotlight on pointer
   ========================================================================== */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.85rem, 1.5vw, 1.1rem); }
.cell {
  position: relative; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background: color-mix(in oklch, var(--surface) 60%, transparent);
  padding: clamp(1.35rem, 2vw, 1.7rem);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.cell:hover { transform: translateY(-4px); border-color: color-mix(in oklch, var(--ink) 20%, transparent); background: color-mix(in oklch, var(--surface) 85%, transparent); }
.cell--lead { grid-column: span 2; padding: 0; display: flex; flex-direction: row; align-items: stretch; }
.cell--lead .cell__body { flex: 1 1 52%; padding: clamp(1.5rem, 2.4vw, 2rem); display: flex; flex-direction: column; justify-content: center; }
.cell--lead .cell__viz { flex: 1 1 48%; border-left: 1px solid var(--line-soft); min-height: 210px; }

.cell__ico { font-size: 1.5rem; color: var(--primary); display: inline-block; margin-bottom: 0.9rem; transition: transform 0.4s var(--ease); }
.cell:hover .cell__ico { transform: translateY(-2px); }
.cell h3 { font-weight: 600; font-size: 1.12rem; letter-spacing: -0.02em; margin-bottom: 0.45rem; }
.cell p { color: var(--muted); font-size: 0.95rem; text-wrap: pretty; }

.cell__viz { position: relative; background: var(--bg-deep); }
.cell__viz canvas { width: 100%; height: 100%; }

/* spotlight that follows the pointer (cool, purposeful, not glassmorphism) */
.cell[data-spotlight]::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s var(--ease);
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), color-mix(in oklch, var(--primary) 14%, transparent), transparent 60%);
}
.cell[data-spotlight]:hover::before { opacity: 1; }

/* ==========================================================================
   Architecture flow
   ========================================================================== */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 0.5rem; }
.node {
  border: 1px solid var(--line); border-radius: var(--r); padding: 1.5rem; text-align: center;
  background: color-mix(in oklch, var(--surface) 55%, transparent);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.node:hover { transform: translateY(-4px); border-color: color-mix(in oklch, var(--ink) 20%, transparent); }
.node--key { border-color: color-mix(in oklch, var(--primary) 35%, transparent); box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary) 18%, transparent), 0 18px 50px -28px var(--glow); }
.node__ico { font-size: 1.7rem; color: var(--primary); margin-bottom: 0.7rem; display: inline-block; }
.node--key .node__ico { color: var(--accent); }
.node h3 { font-weight: 600; font-size: 1.05rem; margin-bottom: 0.3rem; }
.node p { font-size: 0.88rem; color: var(--muted); }

.wire { position: relative; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.wire__pulse { position: absolute; top: 0; left: -30%; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, var(--primary), transparent); animation: wire 2.8s var(--ease-soft) infinite; }
.wire__pulse--2 { animation-delay: 1.4s; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
@keyframes wire { to { left: 130%; } }

/* ==========================================================================
   Install
   ========================================================================== */
.install { display: grid; grid-template-columns: 1fr 0.92fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }

.code { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 1.8rem; background: var(--bg-deep); }
.code__bar { display: flex; align-items: center; gap: 0.8rem; padding: 0.65rem 0.95rem; border-bottom: 1px solid var(--line-soft); }
.code__dots { display: flex; gap: 6px; }
.code__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.code pre { padding: 1.05rem 1.15rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.85; }
.c-c { color: var(--faint); }
.c-k { color: var(--primary-bright); }
.c-s { color: color-mix(in oklch, var(--accent) 85%, white 10%); }
.c-n { color: var(--signal); }

.steps { display: grid; gap: 0.5rem; }
.step { display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem 1.25rem; border-radius: var(--r); border: 1px solid transparent; transition: background 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease); }
.step:hover { background: color-mix(in oklch, var(--ink) 3%, transparent); border-color: var(--line-soft); transform: translateX(4px); }
.step__n { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; font-size: 0.9rem; font-weight: 600; color: var(--primary); border: 1px solid color-mix(in oklch, var(--primary) 30%, transparent); background: color-mix(in oklch, var(--primary) 8%, transparent); }
.step:hover .step__n { background: var(--primary); color: oklch(0.18 0.03 235); border-color: transparent; }
.step h3 { font-weight: 600; font-size: 1.05rem; margin-bottom: 0.25rem; }
.step p { color: var(--muted); font-size: 0.93rem; }

/* ==========================================================================
   Figures (sober, mono numbers, no gradient text)
   ========================================================================== */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; background: var(--line-soft); }
.figure { background: var(--bg); padding: clamp(1.5rem, 3vw, 2.2rem) 1.3rem; text-align: center; }
.figure__n { display: block; font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.figure__l { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq { display: grid; gap: 0.6rem; max-width: 820px; }
.qa { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: color-mix(in oklch, var(--surface) 45%, transparent); transition: border-color 0.3s var(--ease); }
.qa[open] { border-color: color-mix(in oklch, var(--primary) 28%, transparent); }
.qa summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.25rem; font-weight: 500; font-size: 1.02rem; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary i { flex: none; color: var(--muted); transition: transform 0.35s var(--ease), color 0.3s var(--ease); }
.qa[open] summary i { transform: rotate(45deg); color: var(--primary-bright); }
.qa__a { padding: 0 1.25rem 1.15rem; color: var(--muted); font-size: 0.96rem; text-wrap: pretty; }
.qa[open] .qa__a { animation: qaIn 0.35s var(--ease); }
@keyframes qaIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   CTA
   ========================================================================== */
.cta { position: relative; overflow: hidden; text-align: center; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(2.6rem, 6vw, 4.2rem) clamp(1.5rem, 4vw, 3rem); background: color-mix(in oklch, var(--surface) 40%, transparent); }
.cta__field { position: absolute; width: 70%; aspect-ratio: 1; left: 50%; top: -32%; translate: -50% 0; background: radial-gradient(circle, color-mix(in oklch, var(--primary) 22%, transparent), transparent 62%); filter: blur(30px); border-radius: 44% 56% 60% 40% / 50% 44% 56% 50%; animation: morph 20s var(--ease-soft) infinite; pointer-events: none; }
.cta h2 { position: relative; font-weight: 600; font-size: clamp(1.7rem, 3.6vw, 2.7rem); letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
.cta p { position: relative; color: var(--muted); max-width: 48ch; margin: 0.9rem auto 1.9rem; font-size: 1.05rem; text-wrap: pretty; }
.cta__actions { position: relative; display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { border-top: 1px solid var(--line-soft); padding-top: clamp(3rem, 6vw, 4.5rem); margin-top: clamp(2rem, 5vw, 4rem); }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1.7fr; gap: clamp(2rem, 5vw, 4rem); padding-bottom: 2.6rem; }
.footer__tag { color: var(--muted); font-size: 0.94rem; margin-top: 0.9rem; max-width: 28ch; }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.footer__cols h4 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.85rem; font-weight: 600; }
.footer__cols a { display: block; color: var(--ink); font-size: 0.93rem; padding: 0.26rem 0; transition: color 0.2s var(--ease); }
.footer__cols a:hover { color: var(--primary-bright); }
.footer__legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; border-top: 1px solid var(--line-soft); }
.footer__legal p { font-size: 0.8rem; color: var(--faint); max-width: 72ch; line-height: 1.7; }
.footer__copy { white-space: nowrap; }

/* ==========================================================================
   Reveal (content visible by default; JS enhances)
   ========================================================================== */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__viz { order: -1; max-width: 520px; }
  .install { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .cell--lead { grid-column: span 2; grid-row: auto; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav__links { display: none; }
  .ghost-link { display: none; }
  .nav__end > .btn--sm { display: none; }
  .burger { display: block; }
  .nav__links.open {
    display: flex; flex-direction: column; gap: 0.2rem;
    position: absolute; top: calc(100% + 0.5rem); left: var(--pad); right: var(--pad);
    background: color-mix(in oklch, var(--bg-deep) 96%, transparent);
    backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: var(--r-lg);
    padding: 0.55rem; box-shadow: 0 30px 70px -30px #000;
  }
  .nav__links.open a { padding: 0.8rem 0.95rem; }

  .flow { grid-template-columns: 1fr; gap: 0.6rem; }
  .wire { width: 2px; height: 34px; margin: 0 auto; }
  .wire__pulse { left: 0; top: -30%; width: 100%; height: 30%; background: linear-gradient(180deg, transparent, var(--primary), transparent); animation: wireV 2.8s var(--ease-soft) infinite; }
  .wire__pulse--2 { background: linear-gradient(180deg, transparent, var(--accent), transparent); }
  @keyframes wireV { to { top: 130%; } }

  .figures { grid-template-columns: repeat(2, 1fr); }
  .footer__legal { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 460px) {
  .bento { grid-template-columns: 1fr; }
  .cell--lead { grid-column: auto; flex-direction: column; }
  .cell--lead .cell__viz { border-left: 0; border-top: 1px solid var(--line-soft); min-height: 170px; }
  .figures { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .field { animation: none; }
}

/* ==========================================================================
   Reduced transparency fallback (glass used only on sticky nav)
   ========================================================================== */
@media (prefers-reduced-transparency: reduce) {
  .nav.stuck { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .nav__links.open { background: var(--bg-deep); backdrop-filter: none; }
}

/* ==========================================================================
   Comptes : auth (connexion / inscription) + espace compte
   ========================================================================== */
:root { --danger: oklch(0.68 0.17 22); }

.btn--block { width: 100%; }
.btn--lg { padding: 1rem 1.4rem; font-size: 1.02rem; }
.btn--soft { color: var(--ink); border: 1px solid var(--line); background: color-mix(in oklch, var(--ink) 4%, transparent); }
.btn--soft:hover { border-color: color-mix(in oklch, var(--ink) 24%, transparent); transform: translateY(-2px); }
.btn--danger { color: var(--danger); border: 1px solid color-mix(in oklch, var(--danger) 35%, transparent); background: color-mix(in oklch, var(--danger) 8%, transparent); }
.btn--danger:hover { background: color-mix(in oklch, var(--danger) 14%, transparent); }

/* ---- Layout d'authentification : aparté + carte ---- */
.auth { display: grid; grid-template-columns: 1.04fr 0.96fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; min-height: calc(100vh - 150px); padding-block: clamp(2rem, 5vw, 3.5rem); }
.auth__aside { max-width: 30rem; }
.auth__tag { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 500; color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.38rem 0.8rem; margin-bottom: 1.5rem; }
.auth__tag .status__dot { background: var(--signal); }
.auth__title { font-weight: 600; font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.035em; text-wrap: balance; }
.auth__lede { color: var(--muted); font-size: 1.05rem; margin-top: 1rem; text-wrap: pretty; }
.auth__points { display: grid; gap: 0.7rem; margin-top: 1.7rem; }
.auth__point { display: flex; align-items: center; gap: 0.7rem; color: var(--muted); font-size: 0.96rem; }
.auth__point .ck { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--signal); background: color-mix(in oklch, var(--signal) 14%, transparent); }

.auth__card { border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in oklch, var(--surface) 60%, transparent); padding: clamp(1.6rem, 3vw, 2.4rem); box-shadow: 0 40px 90px -60px #000; }
.auth__card h2 { font-weight: 600; font-size: 1.5rem; letter-spacing: -0.02em; }
.auth__card .sub { color: var(--muted); font-size: 0.95rem; margin-top: 0.35rem; margin-bottom: 1.4rem; }
.auth__foot { margin-top: 1.4rem; text-align: center; font-size: 0.92rem; color: var(--muted); }
.auth__foot a { color: var(--primary-bright); font-weight: 500; }
.auth__foot a:hover { text-decoration: underline; }
.auth__sep { display: flex; align-items: center; gap: 0.8rem; margin: 1.3rem 0; color: var(--faint); font-size: 0.82rem; }
.auth__sep::before, .auth__sep::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }

/* ---- Champs de formulaire (NB: .field est deja pris par les blobs du backdrop) ---- */
.fld { display: grid; gap: 0.45rem; margin-bottom: 1.05rem; }
.fld > label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.input { width: 100%; padding: 0.85rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in oklch, var(--bg-deep) 70%, transparent); color: var(--ink); font: inherit; font-size: 0.97rem; transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease); }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 22%, transparent); background: var(--bg-deep); }
.fld__hint { font-size: 0.8rem; color: var(--faint); min-height: 1em; }
.fld__hint.ok { color: var(--signal); }
.fld__hint.bad { color: var(--danger); }

.msg { display: none; }
.msg.show { display: block; padding: 0.75rem 0.95rem; border-radius: 11px; font-size: 0.9rem; margin-bottom: 1.1rem; line-height: 1.45; }
.msg--err { background: color-mix(in oklch, var(--danger) 14%, transparent); color: color-mix(in oklch, var(--danger) 70%, white 30%); border: 1px solid color-mix(in oklch, var(--danger) 32%, transparent); }
.msg--ok { background: color-mix(in oklch, var(--signal) 14%, transparent); color: color-mix(in oklch, var(--signal) 75%, white 25%); border: 1px solid color-mix(in oklch, var(--signal) 32%, transparent); }

/* ---- Carte membre (friend code), réutilisée partout ---- */
.member-card { position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 1.4rem 1.55rem 1.3rem; border: 1px solid color-mix(in oklch, var(--primary) 30%, transparent); background:
    radial-gradient(120% 130% at 100% 0%, color-mix(in oklch, var(--primary) 20%, transparent), transparent 55%),
    linear-gradient(160deg, var(--surface-2), var(--bg-deep)); box-shadow: 0 26px 60px -36px var(--glow), 0 1px 0 color-mix(in oklch, white 8%, transparent) inset; }
.member-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(115deg, transparent 0 7px, color-mix(in oklch, white 2.5%, transparent) 7px 8px); mix-blend-mode: overlay; }
.member-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.member-card__brand { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; }
.member-card__brand img { width: 18px; height: 18px; }
.member-card__chip { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent); border-radius: var(--r-pill); padding: 0.22rem 0.6rem; }
.member-card__label { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.member-card__code { font-family: var(--mono); font-size: clamp(1.25rem, 2.6vw, 1.55rem); font-weight: 600; letter-spacing: 0.03em; margin-top: 0.3rem; color: var(--ink); }
.member-card__foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 1.5rem; }
.member-card__name { font-weight: 600; font-size: 1.05rem; }
.member-card__name span { display: block; font-size: 0.64rem; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; font-weight: 600; margin-top: 0.15rem; }
.member-card__sig { width: 42px; height: 42px; border-radius: 11px; background: conic-gradient(from 210deg, var(--primary), var(--accent), var(--primary)); opacity: 0.85; box-shadow: 0 0 0 1px color-mix(in oklch, white 14%, transparent) inset; }

/* ==========================================================================
   Espace compte (dashboard)
   ========================================================================== */
.account { padding-block: clamp(2rem, 5vw, 3.2rem); min-height: calc(100vh - 150px); }
.account__head { margin-bottom: clamp(1.5rem, 3vw, 2.4rem); }
.account__hi { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1rem; }
.account__hi h1 { font-weight: 600; font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.03em; }
.account__live { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; color: var(--muted); }
.account__live .status__dot { background: var(--signal); }

.account__grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(1rem, 2vw, 1.6rem); align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--r); background: color-mix(in oklch, var(--surface) 55%, transparent); padding: clamp(1.2rem, 2vw, 1.6rem); }
.panel + .panel { margin-top: 1.1rem; }
.panel__h { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel__h h2 { font-weight: 600; font-size: 1.08rem; letter-spacing: -0.01em; }
.panel__h .ph { color: var(--primary); font-size: 1.2rem; }

.kv__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line-soft); }
.kv__row:last-child { border-bottom: 0; }
.kv__k { color: var(--muted); font-size: 0.92rem; }
.kv__v { font-weight: 500; font-size: 0.95rem; text-align: right; word-break: break-word; }
.kv__v.mono { font-size: 0.9rem; }

.copy-btn { font-size: 0.78rem; font-weight: 600; color: var(--primary-bright); border: 1px solid color-mix(in oklch, var(--primary) 30%, transparent); border-radius: var(--r-pill); padding: 0.28rem 0.7rem; transition: background 0.2s var(--ease), color 0.2s var(--ease); }
.copy-btn:hover { background: var(--primary); color: oklch(0.18 0.03 235); border-color: transparent; }
.inline-copy { display: inline-flex; align-items: center; gap: 0.6rem; }

.token-box { display: flex; align-items: center; gap: 0.7rem; background: var(--bg-deep); border: 1px solid var(--line); border-radius: 11px; padding: 0.7rem 0.85rem; }
.token-box code { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }

.hint { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.hint b { color: var(--ink); font-weight: 600; }
.callout { border: 1px solid color-mix(in oklch, var(--primary) 26%, transparent); background: color-mix(in oklch, var(--primary) 7%, transparent); border-radius: var(--r); padding: 1rem 1.15rem; }
.callout__h { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.callout__h .badge { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in oklch, var(--accent) 40%, transparent); border-radius: var(--r-pill); padding: 0.16rem 0.5rem; }

/* ---- Amis ---- */
.friends { display: grid; gap: 0.55rem; }
.friend { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line-soft); border-radius: 12px; transition: border-color 0.2s var(--ease), background 0.2s var(--ease); }
.friend:hover { border-color: var(--line); background: color-mix(in oklch, var(--ink) 2.5%, transparent); }
.friend__av { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; color: oklch(0.18 0.03 235); background: linear-gradient(150deg, var(--primary-bright), var(--primary)); overflow: hidden; }
.friend__av img { width: 100%; height: 100%; object-fit: cover; }
.friend__main { flex: 1; min-width: 0; }
.friend__name { font-weight: 600; font-size: 0.96rem; }
.friend__code { font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }
.friend__status { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.friend__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.friend__dot.on { background: var(--signal); box-shadow: 0 0 8px color-mix(in oklch, var(--signal) 60%, transparent); }

.add-friend { display: flex; gap: 0.6rem; margin-top: 0.9rem; }
.add-friend .input { flex: 1; }

.empty { text-align: center; color: var(--muted); font-size: 0.92rem; padding: 1.6rem 1rem; border: 1px dashed var(--line); border-radius: 12px; }

/* ---- Skeleton de chargement ---- */
.skeleton { color: transparent !important; background: linear-gradient(90deg, color-mix(in oklch, var(--ink) 6%, transparent) 25%, color-mix(in oklch, var(--ink) 12%, transparent) 37%, color-mix(in oklch, var(--ink) 6%, transparent) 63%); background-size: 400% 100%; border-radius: 6px; animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- Toast ---- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 18px); opacity: 0; display: flex; align-items: center; gap: 0.6rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.65rem 1.1rem; font-size: 0.9rem; font-weight: 500; box-shadow: 0 24px 50px -24px #000; pointer-events: none; z-index: 1000; transition: transform 0.35s var(--ease), opacity 0.35s var(--ease); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast__k { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--signal); color: oklch(0.16 0.03 160); font-size: 0.7rem; font-weight: 800; }

/* ---- Responsive comptes ---- */
@media (max-width: 920px) {
  .auth { grid-template-columns: 1fr; gap: 2rem; min-height: 0; }
  .auth__aside { order: 2; max-width: none; }
  .account__grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .add-friend { flex-direction: column; }
  .kv__v { font-size: 0.9rem; }
}

/* ==========================================================================
   Photo de profil + éditeur + historique de jeu
   ========================================================================== */
.account__id { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.account__avatar { flex: none; width: 70px; height: 70px; border-radius: 18px; overflow: hidden; background: linear-gradient(150deg, var(--primary-bright), var(--primary)); display: grid; place-items: center; font-weight: 700; font-size: 1.8rem; color: oklch(0.18 0.03 235); border: 1px solid var(--line); box-shadow: 0 12px 32px -16px var(--glow); }
.account__avatar img { width: 100%; height: 100%; object-fit: cover; }
.account__txt { min-width: 0; }
.account__edit { margin-left: auto; }
@media (max-width: 560px) { .account__edit { margin-left: 0; } }

/* avatar dans le pied de la carte membre */
.member-card__pic { width: 46px; height: 46px; border-radius: 12px; overflow: hidden; border: 1px solid color-mix(in oklch, white 18%, transparent); flex: none; }
.member-card__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Modal ---- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.2rem; }
.modal__backdrop { position: absolute; inset: 0; background: color-mix(in oklch, var(--bg-deep) 68%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal__panel { position: relative; width: min(640px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 50px 110px -50px #000; animation: modalIn 0.3s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 1.15rem 1.4rem; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: color-mix(in oklch, var(--surface) 93%, transparent); backdrop-filter: blur(8px); z-index: 1; }
.modal__head h2 { font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; }
.modal__x { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 1.1rem; border: 1px solid var(--line); }
.modal__x:hover { color: var(--ink); background: color-mix(in oklch, var(--ink) 5%, transparent); }
.modal__body { padding: 1.4rem; display: grid; gap: 1.3rem; }
.modal__foot { display: flex; justify-content: flex-end; gap: 0.7rem; padding: 1.05rem 1.4rem; border-top: 1px solid var(--line-soft); position: sticky; bottom: 0; background: color-mix(in oklch, var(--surface) 93%, transparent); backdrop-filter: blur(8px); }
.modal__sub { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }

/* ---- Éditeur de photo ---- */
.editor { display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: start; }
.editor__preview { display: grid; gap: 0.5rem; justify-items: center; }
.editor__preview canvas { width: 132px; height: 132px; border-radius: 24px; border: 1px solid var(--line); background: var(--bg-deep); display: block; }
.editor__preview span { font-size: 0.74rem; color: var(--faint); }
.editor__controls { display: grid; gap: 1rem; }
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 9px; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line) inset; transition: transform 0.15s var(--ease); cursor: pointer; }
.swatch:hover { transform: scale(1.12); }
.swatch.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary-bright); }
.swatch--custom { display: grid; place-items: center; color: var(--muted); background: var(--surface-2); position: relative; overflow: hidden; }
.swatch--custom .ph { font-size: 0.95rem; }
.swatch--custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; }

.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 0.5rem; }
.avatar-opt { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in oklch, var(--bg-deep) 55%, transparent); display: grid; place-items: center; color: var(--muted); transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease), color 0.15s var(--ease); }
.avatar-opt:hover { transform: translateY(-2px); color: var(--ink); border-color: color-mix(in oklch, var(--ink) 25%, transparent); }
.avatar-opt.sel { border-color: var(--primary-bright); background: color-mix(in oklch, var(--primary) 16%, transparent); color: var(--ink); box-shadow: 0 0 0 1px var(--primary-bright); }
.avatar-opt .ph { font-size: 1.45rem; }

.editor__upload { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.editor__upload .hint { font-size: 0.82rem; }

/* ---- Historique de jeu ---- */
.history { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.7rem; }
.history-card { display: flex; gap: 0.85rem; align-items: center; padding: 0.8rem 0.9rem; border: 1px solid var(--line-soft); border-radius: 12px; background: color-mix(in oklch, var(--surface) 40%, transparent); transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.history-card:hover { border-color: var(--line); transform: translateY(-2px); }
.history-card__ico { flex: none; width: 54px; height: 54px; border-radius: 11px; overflow: hidden; background: var(--bg-deep); display: grid; place-items: center; }
.history-card__ico img { width: 100%; height: 100%; object-fit: cover; }
.history-card__ico .ph { font-size: 1.5rem; color: var(--faint); }
.history-card__main { flex: 1; min-width: 0; }
.history-card__name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-card__time { font-family: var(--mono); font-size: 0.82rem; color: var(--primary-bright); margin-top: 0.15rem; }
.history-card__meta { font-size: 0.8rem; color: var(--muted); }

@media (max-width: 460px) {
  .editor { grid-template-columns: 1fr; justify-items: center; }
  .editor__controls { width: 100%; }
}

/* ---- Avatars images (galerie firmware/perso) ---- */
.avatar-opt--img { padding: 5px; }
.avatar-opt--img img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; image-rendering: auto; }

/* ---- Color picker custom (HSV) ---- */
.cpick { margin-top: 0.7rem; padding: 0.85rem; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in oklch, var(--bg-deep) 60%, transparent); display: grid; gap: 0.7rem; }
.cpick[hidden] { display: none; }
.cpick__sv { position: relative; width: 100%; height: 132px; border-radius: 9px; cursor: crosshair; touch-action: none; background-image: linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, rgba(255,255,255,0)); background-color: hsl(var(--ch, 200), 100%, 50%); }
.cpick__sv-thumb { position: absolute; width: 15px; height: 15px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.5); transform: translate(-50%, -50%); pointer-events: none; }
.cpick__hue { position: relative; width: 100%; height: 14px; border-radius: 7px; cursor: pointer; touch-action: none; background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); }
.cpick__hue-thumb { position: absolute; top: 50%; width: 9px; height: 20px; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.55); transform: translate(-50%, -50%); pointer-events: none; }
.cpick__row { display: flex; align-items: center; gap: 0.6rem; }
.cpick__prev { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.cpick__hex { flex: 1; max-width: 130px; text-transform: uppercase; font-family: var(--mono); letter-spacing: 0.04em; }
