/* =====================================================================
   MATTEO MARTIN — Personal portfolio · Coming soon
   Art direction: NEO BRUTALISM — DIGITAL PLAYGROUND
   ---------------------------------------------------------------------
   01 Tokens        05 Header / logo     09 Band
   02 Base          06 Hero / title      10 Footer
   03 Cursor        07 Object            11 Intro states
   04 Background    08 Foot blocks       12 Responsive / motion
   ===================================================================== */

/* ---------- 01 TOKENS → css/tokens.css (shared with the portal) ---------- */

/* ---------- 02 BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; background: var(--ink); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--ink);
  color: var(--white);
  font-family: var(--f-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .6s ease, color .6s ease;
}

p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--pink); color: var(--ink); }

:focus-visible { outline: 2px solid var(--pink); outline-offset: 5px; }

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

.skip {
  position: fixed; left: 16px; top: -80px; z-index: 1000;
  padding: 12px 16px;
  background: var(--pink); color: var(--ink);
  font: 700 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  box-shadow: 4px 4px 0 var(--white);
  transition: top .3s var(--ease-out);
}
.skip:focus { top: 16px; }

/* Mono technical label */
.coords, .status, .brand__sub, .loading__head, .footer, .object__tag {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* ---------- 03 CURSOR ---------- */
.cursor { display: none; }

.has-cursor, .has-cursor * { cursor: none !important; }

.has-cursor .cursor {
  display: block;
  position: fixed; inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease;
}
.has-cursor .cursor.is-visible { opacity: 1; }
.has-cursor .cursor.is-hidden { opacity: 0; }

.cursor__dot, .cursor__ring, .cursor__trail i {
  position: absolute; left: 0; top: 0;
  will-change: transform;
}

.cursor__dot::before {
  content: ""; position: absolute;
  width: 6px; height: 6px; left: -3px; top: -3px;
  background: var(--pink);
  transition: transform .25s var(--ease-back);
}
.cursor.is-hover .cursor__dot::before { transform: scale(0); }

.cursor__circle {
  position: absolute;
  width: 40px; height: 40px; left: -20px; top: -20px;
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  transition: transform .45s var(--ease-out), background-color .3s, border-color .3s, border-radius .45s var(--ease-out);
}
.cursor.is-hover .cursor__circle {
  transform: scale(2.1);
  border-color: var(--pink);
  background: rgba(255, 107, 214, .12);
}
.cursor.is-down .cursor__circle { transform: scale(.7); border-radius: 22%; border-color: var(--blue); }
.cursor.is-hover.is-down .cursor__circle { transform: scale(1.7); }

.cursor__label {
  position: absolute; left: 0; top: 0;
  transform: translate(-50%, -50%) scale(.6);
  font: 700 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .25s, transform .4s var(--ease-out);
}
.cursor.has-label .cursor__label { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.cursor__trail i::before {
  content: ""; position: absolute;
  left: -3px; top: -3px; width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--acc-1);
  opacity: calc(var(--spd, 0) * .7);
}
.cursor__trail i:nth-child(2)::before { transform: scale(.85); background: var(--acc-2); }
.cursor__trail i:nth-child(3)::before { transform: scale(.7); }
.cursor__trail i:nth-child(4)::before { transform: scale(.55); background: var(--acc-2); }
.cursor__trail i:nth-child(5)::before { transform: scale(.4); }

/* Click burst — rotated square shockwave */
.burst {
  position: fixed; z-index: 998;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2px solid var(--pink);
  pointer-events: none;
  animation: burst .7s var(--ease-out) forwards;
}
.burst::after {
  content: ""; position: absolute; inset: 5px;
  border: 1px solid var(--blue);
}
@keyframes burst {
  from { transform: rotate(45deg) scale(.2); opacity: 1; }
  to   { transform: rotate(135deg) scale(3.2); opacity: 0; }
}

/* ---------- 04 BACKGROUND ---------- */
.bg {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 1.1s ease;
}

.halo { position: absolute; will-change: transform; }
.halo span {
  display: block; width: 100%; height: 100%;
  border-radius: 50%;
  animation: drift 22s ease-in-out infinite alternate;
}
.halo--1 { width: 78vmax; height: 78vmax; left: -28vmax; top: -34vmax; }
.halo--1 span { background: radial-gradient(closest-side, color-mix(in srgb, var(--acc-1) 52%, transparent), transparent 100%); }
.halo--2 { width: 70vmax; height: 70vmax; right: -30vmax; bottom: -38vmax; }
.halo--2 span { background: radial-gradient(closest-side, color-mix(in srgb, var(--acc-2) 46%, transparent), transparent 100%); animation-duration: 28s; animation-delay: -9s; }
.halo--3 { width: 42vmax; height: 42vmax; left: 38%; top: 14%; }
.halo--3 span { background: radial-gradient(closest-side, color-mix(in srgb, var(--acc-3) 20%, transparent), transparent 100%); animation-duration: 18s; animation-delay: -4s; }

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(6vmax, 4vmax, 0) scale(1.08); }
  100% { transform: translate3d(-4vmax, 7vmax, 0) scale(.94); }
}

/* Brutalist column grid */
.bg__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: calc((100% - 2 * var(--gutter)) / 6) 100%, 100% 33.333%;
  background-position: var(--gutter) 0, 0 0;
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 80%);
}

/* Film grain */
.bg__grain {
  position: absolute; inset: -50%;
  opacity: var(--grain-o);
  transition: opacity .6s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .9s steps(5) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -5%); }
  60%  { transform: translate(-6%, -2%); }
  80%  { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

/* Dirt: large stains + vignette (theme hook --dirt-o, off by default) */
.bg__dirt {
  position: absolute; inset: 0;
  opacity: var(--dirt-o);
  transition: opacity .8s ease;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(0, 0, 0, .75) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .05 0 0 0 0 .01 0 0 0 0 .01 0 0 0 -2.2 1.35'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)'/%3E%3C/svg%3E");
  background-size: 100% 100%, 600px 600px;
  mix-blend-mode: multiply;
}

/* Floating geometry */
.shapes { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.sw { position: absolute; will-change: transform; transition: opacity 1s ease; }
.shape { display: block; animation: float 9s ease-in-out infinite; }

.sw--ring  { right: 5vw; top: 13vh; }
.shape--ring {
  width: clamp(120px, 15vmax, 260px); aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  animation: spin 26s linear infinite;
}
.shape--ring i {
  position: absolute; left: 50%; top: -5px;
  width: 10px; height: 10px; margin-left: -5px;
  background: var(--acc-3);
}

.sw--block { left: 21vw; top: 15vh; }
.shape--block {
  width: clamp(70px, 8vmax, 130px); height: clamp(18px, 2vmax, 30px);
  background: var(--acc-2);
  transform: rotate(-14deg);
  box-shadow: 6px 6px 0 var(--ink), 6px 6px 0 1px rgba(255,255,255,.4);
  animation-duration: 11s;
}

.sw--tri { right: 21vw; bottom: 25vh; }
.shape--tri { width: clamp(38px, 4vmax, 64px); overflow: visible; animation-duration: 13s; animation-delay: -3s; }
.shape--tri path { fill: none; stroke: var(--acc-3); stroke-width: 5; stroke-linejoin: miter; }

.sw--bars { left: 44vw; top: 14vh; }
.shape--bars { display: grid; gap: 5px; animation-duration: 10s; animation-delay: -6s; }
.shape--bars i { display: block; height: 3px; width: 54px; background: var(--acc-1); }
.shape--bars i:nth-child(2) { width: 34px; margin-left: 12px; }
.shape--bars i:nth-child(3) { width: 18px; margin-left: 30px; background: var(--white); }

.sw--cube { left: 31vw; bottom: 17vh; }
.shape--cube {
  width: 22px; height: 22px;
  border: 2px solid var(--white);
  box-shadow: 5px 5px 0 var(--acc-3);
  animation: float 8s ease-in-out infinite, spin 18s linear infinite;
}

.shape--plus { width: 14px; height: 14px; position: relative; }
.shape--plus::before, .shape--plus::after { content: ""; position: absolute; background: rgba(255, 255, 255, .5); }
.shape--plus::before { left: 6px; top: 0; width: 2px; height: 14px; }
.shape--plus::after  { top: 6px; left: 0; height: 2px; width: 14px; }
.sw--plus1 { left: 5vw; top: 24vh; }
.sw--plus2 { right: 36vw; bottom: 12vh; }

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}
@keyframes spin { to { rotate: 360deg; } }

/* ---------- 05 HEADER / LOGO ---------- */
.header {
  position: relative; z-index: 6;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: max(clamp(16px, 2.6vw, 34px), env(safe-area-inset-top)) var(--gutter) 0;
}

.brand {
  display: inline-flex; align-items: center; gap: 16px;
  text-decoration: none;
  padding: 4px 4px 4px 0;
}

/* 3D mark: extruded M (depth layers driven by --i × --d) + chrome sphere */
.mark { display: block; overflow: visible; }
.brand__mark .mark__depth use { fill: color-mix(in srgb, var(--depth-far) calc((var(--i) - 1) * 9.09%), var(--depth-near)); }
.brand__mark #h-face stop:nth-child(1) { stop-color: var(--logo-hi); }
.brand__mark #h-face stop:nth-child(2) { stop-color: var(--logo-mid); }
.brand__mark #h-face stop:nth-child(3) { stop-color: var(--logo-lo); }
.brand__mark #h-edge stop:nth-child(2) { stop-color: var(--ball-2); }
.brand__mark { width: 74px; height: auto; --d: 1px; }
/* ring (piste C): theme colours, travelling glint, slow tilt; faster on hover */
.brand__mark #h-ring stop:nth-child(1), .brand__mark #h-ring stop:nth-child(5) { stop-color: var(--ball-4); }
.brand__mark #h-ring stop:nth-child(2), .brand__mark #h-ring stop:nth-child(4) { stop-color: var(--ball-3); }
.brand__mark .mark__glint { animation: mm-glint 3.6s linear infinite; }
.brand__mark .mark__tilt { transform-box: view-box; transform-origin: 54px 47px; animation: mm-tilt 7s ease-in-out infinite; }
.brand:hover .brand__mark .mark__glint, .brand:focus-visible .brand__mark .mark__glint { animation-duration: 1.1s; }
.brand:hover .brand__mark .mark__tilt, .brand:focus-visible .brand__mark .mark__tilt { animation-duration: 2.2s; }
@keyframes mm-glint { to { stroke-dashoffset: -1; } }
@keyframes mm-tilt { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-3deg) translateY(-1px); } }
.mark__depth use {
  transform: translate(calc(var(--i) * var(--d)), calc(var(--i) * var(--d)));
  transition: transform .6s var(--ease-out) calc(var(--i) * 18ms);
}
.mark__face { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .6s var(--ease-out); }

.brand:hover .brand__mark, .brand:focus-visible .brand__mark { --d: 1.45px; }
.brand:hover .mark__face, .brand:focus-visible .mark__face { transform: translate(-2px, -2px); }
.brand__text { display: grid; gap: 7px; }
.brand__name {
  font: 800 clamp(15px, 1.25vw, 19px)/.9 var(--f-display);
  letter-spacing: .01em;
  text-transform: uppercase;
}
.brand__sub { color: var(--muted); font-size: 10px; }

.header__meta { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); }

.coords { color: var(--muted); font-variant-numeric: tabular-nums; }
.coords span { color: var(--white); }
.coords b { color: var(--acc-3); font-weight: 400; }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 13px 9px 11px;
  border: 1.5px solid var(--white);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--acc-1);
  white-space: nowrap;
}
.status__dot {
  width: 8px; height: 8px;
  background: var(--acc-3);
  animation: blink 1.4s steps(2, jump-none) infinite;
}
@keyframes blink { 50% { opacity: .15; } }

/* Theme switcher */
.themes { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.themes__label { font: 400 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.themes__list { display: inline-flex; gap: 6px; }
.theme-btn {
  width: 24px; height: 24px; padding: 0;
  border: 1.5px solid var(--line);
  background: linear-gradient(135deg, var(--sw-a) 0 50%, var(--sw-b) 50% 100%);
  transition: transform .35s var(--ease-back), box-shadow .3s, border-color .3s;
}
.theme-btn[data-theme-set="electric"] { --sw-a: #792AFF; --sw-b: #FF6BD6; }
.theme-btn[data-theme-set="gold"]     { --sw-a: #6B4F12; --sw-b: #FFE08A; }
.theme-btn[data-theme-set="ice"]      { --sw-a: #1F4E8C; --sw-b: #E6FBFF; }
.theme-btn:hover { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--white); }
.theme-btn[aria-pressed="true"] { border-color: var(--white); box-shadow: 3px 3px 0 var(--acc-3); transform: translate(-1px, -1px); }

/* ---------- 06 HERO / TITLE ---------- */
.hero {
  position: relative; z-index: 3;
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(28px, 5vh, 72px) var(--gutter) clamp(12px, 2.5vh, 32px);
}

.stack { position: relative; --ghost-r: calc(clamp(320px, 48vw, 830px) * .33); }

.title {
  position: relative; z-index: 1;
  margin: 0;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: var(--title-size);
  line-height: .8;
  letter-spacing: -.05em;
  font-kerning: none;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
}
.title__visual { display: block; }
.title__line { display: block; white-space: nowrap; }
.title__line--2 { text-align: right; margin-top: .05em; }
.title__gap { display: inline-block; width: .22em; }

.w { display: inline-block; position: relative; }

/* Stacked title (narrow / portrait) — toggled by JS fitTitle() */
.title-stacked .title .w { display: block; width: max-content; }
.title-stacked .title .title__line .w:last-child { margin-left: auto; }
.title-stacked .title__gap { display: none; }
/* Stacked (mobile/portrait): the orb sits behind the full chrome title for legibility */
.title-stacked .title:not(.title--ghost) { z-index: 3; pointer-events: none; }
.title-stacked .title--ghost { display: none; }

.ch {
  display: inline-block;
  transform-origin: 50% 100%;
  color: var(--white);
  will-change: transform;
}
.w--outline .ch {
  color: transparent;
  -webkit-text-stroke: max(1.5px, .012em) var(--white);
}

/* ---- Chrome title (solid layer only; the ghost stays a pure outline) ----
   Each letter clips 3 background layers to its glyph:
   1. pink tint driven by cursor proximity (--f)
   2. moving light sheen, offset per letter (--bx, set by JS) so it reads
      as one continuous glint across the whole title
   3. chrome gradient: bright top, lavender horizon line, light bottom    */
.title .title__line--2 .w:last-child .ch { --chrome: var(--chrome-hot); }
.title:not(.title--ghost) .w:not(.w--outline) .ch {
  color: transparent;
  background-image:
    linear-gradient(color-mix(in srgb, var(--acc-3) calc(var(--f, 0) * 90%), transparent), color-mix(in srgb, var(--acc-3) calc(var(--f, 0) * 90%), transparent)),
    linear-gradient(104deg, transparent 43%, rgba(255, 255, 255, .25) 47%, #FFFFFF 50%, rgba(255, 220, 245, .25) 53%, transparent 57%),
    var(--chrome);
  background-size: 100% 100%, var(--tw, 100vw) 100%, 100% 100%;
  background-position: 0 0, calc(var(--sheen) - var(--bx, 0px)) 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
          background-clip: text;
}
/* 3D extrusion matching the logo: stacked drop-shadows, blue → ink, down-right */
.title:not(.title--ghost) .title__visual {
  filter:
    drop-shadow(.012em .012em 0 var(--ex-1))
    drop-shadow(.012em .012em 0 var(--ex-2))
    drop-shadow(.012em .012em 0 var(--ex-3))
    drop-shadow(.014em .014em 0 var(--ex-4));
}
.title-stacked .title:not(.title--ghost) .title__visual {
  filter:
    drop-shadow(1.2px 1.2px 0 var(--ex-1))
    drop-shadow(1.2px 1.2px 0 var(--ex-2))
    drop-shadow(1.2px 1.2px 0 var(--ex-3))
    drop-shadow(1.4px 1.4px 0 var(--ex-4));
}
.is-live:not(.reduced) .title:not(.title--ghost) .title__visual { animation: sheen 7.5s var(--ease-io) .2s infinite; }
@keyframes sheen {
  0%        { --sheen: -110vw; }
  24%, 100% { --sheen: 120vw; }
}

/* Ghost twin: outline drawn above the object so letters "read through" it */
.title--ghost {
  position: absolute; left: 0; top: 0; right: 0;
  z-index: 3;
  pointer-events: none;
}
/* Ghost = translucent chrome letters, only around the orb (radial mask).
   No text-stroke: Syne's overlapping contours draw stray lines when stroked. */
.title--ghost {
  -webkit-mask-image: radial-gradient(circle var(--ghost-r, 30vw) at 50% 50%, #000 92%, transparent 100%);
          mask-image: radial-gradient(circle var(--ghost-r, 30vw) at 50% 50%, #000 92%, transparent 100%);
}
.title--ghost .w:not(.w--outline) .ch {
  color: transparent;
  background-image: var(--chrome);
  -webkit-background-clip: text;
          background-clip: text;
  opacity: .5;
}
.title--ghost .w--outline .ch {
  color: transparent;
  -webkit-text-stroke: max(1px, .008em) var(--white);
}

/* Glitch on COMING. — RGB slices in the palette */
.w--glitch::before, .w--glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
}
.w--glitch::before { color: var(--pink); clip-path: inset(12% 0 58% 0); transform: translateX(-.04em); }
.w--glitch::after  { color: var(--blue); clip-path: inset(62% 0 6% 0);  transform: translateX(.05em); }

.is-live:not(.reduced) .w--glitch::before { animation: glitch-a 6.5s steps(1) 1.5s infinite; }
.is-live:not(.reduced) .w--glitch::after  { animation: glitch-b 6.5s steps(1) 1.5s infinite; }
.is-glitch .w--glitch::before { animation: glitch-a .6s steps(1) 1 !important; }
.is-glitch .w--glitch::after  { animation: glitch-b .6s steps(1) 1 !important; }

@keyframes glitch-a {
  0%, 89%, 100% { opacity: 0; }
  90% { opacity: .95; transform: translateX(-.05em); clip-path: inset(10% 0 60% 0); }
  92% { opacity: .95; transform: translateX(.03em);  clip-path: inset(40% 0 30% 0); }
  94% { opacity: .95; transform: translateX(-.02em); clip-path: inset(70% 0 4% 0); }
  96% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 89%, 100% { opacity: 0; }
  90% { opacity: .95; transform: translateX(.05em);  clip-path: inset(60% 0 10% 0); }
  93% { opacity: .95; transform: translateX(-.04em); clip-path: inset(20% 0 55% 0); }
  95% { opacity: .95; transform: translateX(.02em);  clip-path: inset(2% 0 82% 0); }
  97% { opacity: 0; }
}

/* ---------- 07 OBJECT ---------- */
.object {
  position: absolute; z-index: 2;
  width: clamp(320px, 48vw, 830px);
  aspect-ratio: 1;
  left: 50%; top: 50%;
  margin-left: calc(clamp(320px, 48vw, 830px) / -2);
  margin-top: calc(clamp(320px, 48vw, 830px) / -2);
  pointer-events: none;
}
.object__inner { position: absolute; inset: 0; will-change: transform; }

.object__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  pointer-events: auto;
  touch-action: pan-y;
  border-radius: 50%;
  outline-offset: -12px;
  transition: opacity .6s ease;
}
.is-dragging .object__canvas { cursor: grabbing; }

.object__tag {
  position: absolute; right: 8%; top: 14%;
  font-size: 10px; color: var(--muted);
  padding-left: 30px;
  pointer-events: none;
}
.object__tag::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 22px; height: 1px; background: var(--acc-3);
}

/* CSS fallback when WebGL is unavailable */
.object__fallback { display: none; }
.no-webgl .object__canvas { opacity: 0; }
.no-webgl .object__fallback {
  display: block;
  position: absolute; inset: 22%;
  border-radius: 46% 54% 52% 48% / 50% 44% 56% 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff 0 4%, transparent 14%),
    conic-gradient(from 210deg, var(--violet), var(--blue), #fff 22%, var(--pink), var(--violet) 55%, var(--ink) 70%, var(--blue) 85%, var(--violet));
  box-shadow: inset -24px -30px 60px rgba(23, 16, 32, .85), inset 18px 16px 40px rgba(255, 255, 255, .25), 0 0 120px rgba(121, 42, 255, .45);
  animation: morph 9s ease-in-out infinite alternate, spin 24s linear infinite;
}
@keyframes morph {
  50% { border-radius: 58% 42% 40% 60% / 44% 58% 42% 56%; }
  100% { border-radius: 40% 60% 56% 44% / 58% 40% 60% 42%; }
}

/* ---------- 08 FOOT BLOCKS ---------- */
.hero__foot {
  position: relative; z-index: 4;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-items: end;
  margin-top: clamp(24px, 5vh, 64px);
}

.lede {
  grid-column: 1 / span 4;
  max-width: 21ch;
  padding-left: 18px;
  border-left: 4px solid var(--acc-3);
  font: 500 clamp(16px, 1.45vw, 22px)/1.18 var(--f-sans);
  letter-spacing: -.005em;
  text-transform: uppercase;
}

/* Columns 5–8 of 12 → exactly centred on the page axis, like the object */
.loading { grid-column: 5 / span 4; display: grid; gap: 12px; text-align: center; }
.loading__head { line-height: 1.5; }
.dots i { font-style: normal; animation: dot 1.2s steps(1) infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 0%, 60%, 100% { opacity: 1; } 30% { opacity: .1; } }

.loading__bar {
  position: relative;
  height: 16px;
  border: 1.5px solid var(--white);
  box-shadow: 4px 4px 0 var(--acc-2);
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, transparent 0 11px, rgba(255, 255, 255, .12) 11px 12px);
}
.loading__fill {
  position: absolute; inset: 2px auto 2px 2px;
  width: 0;
  background: repeating-linear-gradient(-45deg, var(--acc-1) 0 6px, var(--acc-3) 6px 12px);
  background-size: 17px 100%;
  animation: fill 7s var(--ease-io) infinite, stripes .6s linear infinite;
}
.loading__scan {
  position: absolute; top: 0; bottom: 0; width: 18%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  mix-blend-mode: overlay;
  animation: scan 2.4s var(--ease-io) infinite;
}
/* Decorative only — loops, never reaches the end, no percentage */
@keyframes fill {
  0%   { width: 0; }
  18%  { width: 22%; }
  30%  { width: 26%; }
  48%  { width: 51%; }
  62%  { width: 55%; }
  82%  { width: 78%; }
  92%  { width: 80%; opacity: 1; }
  100% { width: 80%; opacity: 0; }
}
@keyframes stripes { to { background-position: 17px 0; } }
@keyframes scan { from { left: -20%; } to { left: 110%; } }

/* Magnetic remix button */
.remix {
  grid-column: 11 / span 2;
  justify-self: end;
  width: clamp(104px, 9vw, 136px); aspect-ratio: 1;
  padding: 0;
  border: 0; border-radius: 50%;
  background: transparent;
  will-change: transform;
}
.remix__body {
  display: grid; place-items: center; align-content: center; gap: 8px;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--pink);
  color: var(--ink);
  border: 2px solid var(--white);
  box-shadow: 6px 6px 0 var(--acc-1);
  transition: box-shadow .35s var(--ease-out), background-color .3s;
  will-change: transform;
}
.remix:hover .remix__body, .remix:focus-visible .remix__body { box-shadow: 2px 2px 0 var(--acc-1); background: var(--white); }
.remix:active .remix__body { box-shadow: 0 0 0 var(--acc-1); }
.remix__icon {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square;
  transition: transform .7s var(--ease-out);
}
.remix:hover .remix__icon, .remix:focus-visible .remix__icon { transform: rotate(180deg); }
.remix__text {
  font: 700 11px/1.15 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; text-align: center;
}

/* ---------- 09 BAND ---------- */
.band {
  position: relative; z-index: 4;
  margin: clamp(14px, 3vh, 36px) -4vw 0;
  padding: 11px 0 10px;
  background: color-mix(in srgb, var(--acc-1) 72%, var(--ink));
  color: var(--white);
  border-block: 2px solid var(--white);
  transform: rotate(-1.4deg);
  overflow: hidden;
}
.band__track { display: flex; width: max-content; animation: marquee 34s linear infinite; }
.band__track span {
  padding-right: .9em;
  font: 800 clamp(14px, 1.35vw, 20px)/1 var(--f-display);
  letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
}
.band__track b { display: inline-block; margin: 0 .5em; color: var(--acc-3); font-weight: 400; }

@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 10 FOOTER ---------- */
.footer {
  position: relative; z-index: 4;
  display: flex; justify-content: space-between; align-items: center; gap: 16px 24px;
  flex-wrap: wrap;
  padding: clamp(20px, 3.4vh, 32px) var(--gutter) max(clamp(18px, 3vh, 28px), env(safe-area-inset-bottom));
  color: var(--muted);
}
.footer__sig { display: inline-flex; align-items: center; gap: 12px; }
.mark--mini { display: block; width: 32px; height: auto; filter: var(--mini-filter); transition: filter .6s ease; }
.footer__chips { display: flex; gap: 0; }
.footer__chips i { width: 14px; height: 14px; border: 1px solid rgba(255,255,255,.35); }
.footer__chips i:nth-child(1) { background: var(--violet); }
.footer__chips i:nth-child(2) { background: var(--blue); }
.footer__chips i:nth-child(3) { background: var(--pink); }
.footer__chips i:nth-child(4) { background: var(--white); }
.footer__time time { color: var(--white); font-variant-numeric: tabular-nums; }

/* ---------- 11 INTRO STATES ----------
   1 bg → 2 MM mark → 3 name → 4 title → 5 object (JS) → 6 interactions (.is-live) */
.js.is-loading .bg { opacity: 0; }
.js.is-loading .sw { opacity: 0; }
.js .sw { transition: opacity 1.2s ease .9s; }

.js.is-loading .brand__mark { --d: 0px; }
.js .brand__mark .mark__band { stroke-dasharray: 1; stroke-dashoffset: 0; }
.js.is-loading .brand__mark .mark__band { stroke-dashoffset: 1; }
.js.is-in .brand__mark .mark__band { transition: stroke-dashoffset 1.15s var(--ease-io) .55s; }
.js.is-loading .brand__mark .mark__glint { opacity: 0; }
.js.is-in .brand__mark .mark__glint { transition: opacity .6s ease 1.5s; }
.js.is-loading .mark__face { transform: scale(.6); opacity: 0; }
.js.is-in .mark__face { transition: transform .7s var(--ease-back) .05s, opacity .3s ease .05s; }
.js.is-in .mark__depth use { transition-delay: calc(.3s + var(--i) * 30ms); }
.js.is-live .mark__depth use { transition-delay: calc(var(--i) * 18ms); }

.js .brand__text { clip-path: inset(0 0 0 0); transition: clip-path .8s var(--ease-io) .35s; }
.js.is-loading .brand__text { clip-path: inset(0 100% 0 0); }

.js .header__meta, .js .hero__foot > *, .js .footer, .js .band {
  transition: opacity .8s ease, translate .9s var(--ease-out);
}
.js.is-loading .header__meta { opacity: 0; translate: 0 -10px; }
.js.is-in .header__meta { transition-delay: .5s; }

.js.is-in .title__line { clip-path: inset(-50% -5% 0 -5%); }
.js.is-live .title__line { clip-path: none; }
.js.title-stacked.is-in .title__line { clip-path: none; }
.js.title-stacked.is-in:not(.is-live) .title .w { clip-path: inset(-50% -5% 0 -5%); }
.js.is-loading .ch { transform: translateY(112%) rotate(8deg); }
.js.is-in:not(.is-live) .ch { animation: ch-in .85s var(--ease-out) calc(.45s + var(--i, 0) * 26ms) backwards; }
@keyframes ch-in {
  from { transform: translateY(112%) rotate(8deg); }
  to   { transform: translateY(0) rotate(0); }
}

.js.is-loading .hero__foot > * { opacity: 0; translate: 0 22px; }
.js.is-in .lede { transition-delay: 1s; }
.js.is-in .loading { transition-delay: 1.1s; }
.js.is-in .remix { transition-delay: 1.2s; }
.js.is-loading .band { opacity: 0; translate: 0 30px; }
.js.is-in .band { transition-delay: 1.05s; }
.js.is-loading .footer { opacity: 0; }
.js.is-in .footer { transition-delay: 1.25s; }
.js.is-loading .object__tag { opacity: 0; }
.js .object__tag { transition: opacity .8s ease 1.4s; }

/* ---------- 12 RESPONSIVE / MOTION ---------- */
@media (max-width: 1100px) {
  .object { width: clamp(300px, 60vw, 720px); margin-left: calc(clamp(300px, 60vw, 720px) / -2); margin-top: calc(clamp(300px, 60vw, 720px) / -2); left: 50%; }
  .lede { grid-column: 1 / span 4; }
  .loading { grid-column: 5 / span 4; }
  .stack { --ghost-r: calc(clamp(300px, 60vw, 720px) * .33); }
  .remix { grid-column: 11 / span 2; }
  .sw--bars, .sw--plus2 { display: none; }
}

@media (max-width: 720px) {
  .header { flex-direction: column; gap: 18px; }
  .header__meta { width: 100%; justify-content: space-between; }
  .coords { display: none; }
  .brand__mark { width: 62px; }
  .status { font-size: 10px; padding: 8px 11px 8px 9px; }

  .hero { justify-content: flex-start; padding-top: clamp(28px, 8vw, 56px); }
  .object {
    width: min(100vw, 480px);
    margin-left: calc(min(100vw, 480px) / -2);
    margin-top: calc(min(100vw, 480px) / -2);
    left: 50%; top: 50%;
  }
  .object__tag { display: none; }

  .hero__foot {
    grid-template-columns: 1fr auto;
    row-gap: 28px;
    margin-top: clamp(36px, 10vw, 64px);
  }
  .lede { grid-column: 1 / -1; }
  .loading { grid-column: 1 / 2; align-self: center; }
  .remix { grid-column: 2 / 3; width: 96px; }
  .remix__text { font-size: 9.5px; }

  .sw--block { display: none; }
  .sw--tri { right: 9vw; top: 14vh; bottom: auto; }
  .sw--ring { right: -40px; top: 18vh; }
  .sw--cube, .sw--plus1 { display: none; }
  .footer { justify-content: flex-start; font-size: 10px; }
  .footer__chips { order: 3; }
}

@media (max-width: 720px) {
  .header__meta { justify-content: flex-start; column-gap: 14px; }
  .enter__body { padding: 8px 10px; font-size: 10px; }
}

/* Short desktop windows */
@media (min-width: 721px) and (max-height: 720px) {
  .hero { padding-top: 16px; }
  .hero__foot { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .2s !important;
    transition-delay: 0s !important;
  }
  .js.is-in .ch { animation: none !important; }
  .loading__fill { width: 46%; }
  .loading__scan, .bg__grain { display: none; }
  .band__track { transform: none; }
}

@media (forced-colors: active) {
  .object__canvas, .bg, .shapes { display: none; }
  .remix__body, .status, .loading__bar { border: 2px solid CanvasText; }
}

/* =====================================================================
   13 ACCESS — Enter button, code gate, warp transition
   ===================================================================== */
.enter {
  padding: 0; border: 0; background: transparent;
  will-change: transform;
}
.enter__body {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 11px;
  background: var(--acc-3); color: var(--ink);
  border: 1.5px solid var(--white);
  box-shadow: 4px 4px 0 var(--acc-1);
  font: 700 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap;
  transition: box-shadow .3s var(--ease-out), background-color .3s;
  will-change: transform;
}
.enter:hover .enter__body, .enter:focus-visible .enter__body { box-shadow: 1px 1px 0 var(--acc-1); background: var(--white); }
.enter__lock {
  position: relative; width: 9px; height: 7px; margin-top: 4px;
  background: currentColor;
}
.enter__lock::before {
  content: ""; position: absolute; left: 1px; right: 1px; bottom: 6px; height: 5px;
  border: 1.5px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0;
  transition: transform .35s var(--ease-back);
  transform-origin: 100% 100%;
}
.enter:hover .enter__lock::before, .enter.is-authed .enter__lock::before { transform: rotate(28deg) translate(2px, -1px); }
.enter__arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: square; transition: transform .4s var(--ease-out); }
.enter:hover .enter__arrow { transform: translateX(3px); }

/* ---- Dialog ---- */
.gate {
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--white);
  overflow: visible;
}
.gate::backdrop {
  background:
    radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--acc-1) 22%, transparent), transparent 70%),
    rgba(5, 3, 8, .78);
  -webkit-backdrop-filter: blur(6px) saturate(1.2);
          backdrop-filter: blur(6px) saturate(1.2);
}
.gate[open] { animation: gate-in .55s var(--ease-out); }
.gate[open]::backdrop { animation: fade-in .4s ease; }
@keyframes gate-in {
  from { opacity: 0; transform: translateY(24px) scale(.96); clip-path: inset(0 0 100% 0); }
  to   { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
}
@keyframes fade-in { from { opacity: 0; } }

.gate__panel {
  position: relative;
  padding: 22px 22px 20px;
  background: var(--ink);
  border: 2px solid var(--white);
  box-shadow: 10px 10px 0 var(--acc-1), 10px 10px 0 2px var(--white);
  overflow: hidden;
}
.gate__panel::before { /* grain */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.gate__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.gate__tag { font: 400 10px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.gate__tag b { color: var(--acc-3); font-weight: 400; }
.gate__close {
  width: 30px; height: 30px; padding: 6px;
  border: 1.5px solid var(--line); background: transparent; color: var(--white);
  transition: border-color .25s, transform .4s var(--ease-back);
}
.gate__close:hover, .gate__close:focus-visible { border-color: var(--white); transform: rotate(90deg); }
.gate__close svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; }

.gate__title {
  margin: 0 0 10px;
  font: 800 min(34px, 8.2vw)/.88 var(--f-display);
  letter-spacing: -.045em; text-transform: uppercase;
}
.gate__title span { display: block; }
.gate__title span + span {
  color: transparent;
  background: var(--chrome-hot);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(2px 2px 0 var(--ex-1)) drop-shadow(2px 2px 0 var(--ex-3));
}
.gate__hint { font: 400 13px/1.4 var(--f-sans); color: var(--muted); margin-bottom: 18px; }

.gate__field { position: relative; display: block; margin-bottom: 16px; }
.gate__input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0;
  font-size: 16px; /* avoids iOS zoom */
  color: transparent; caret-color: transparent;
  z-index: 2;
}
.gate__cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gate__cells i {
  position: relative;
  height: 74px;
  border: 1.5px solid var(--line);
  background: color-mix(in srgb, var(--white) 3%, transparent);
  transition: border-color .2s, background-color .2s, transform .35s var(--ease-back), box-shadow .3s;
}
.gate__cells i::after { /* filled mark */
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  background: var(--chrome-hot);
  box-shadow: 3px 3px 0 var(--ex-1);
  transform: scale(0) rotate(45deg);
  transition: transform .35s var(--ease-back);
}
.gate__cells i.is-filled { border-color: var(--white); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--acc-1); }
.gate__cells i.is-filled::after { transform: scale(1) rotate(45deg); }
.gate__cells i.is-active::before { /* caret */
  content: ""; position: absolute; left: 50%; bottom: 14px; width: 18px; height: 3px; margin-left: -9px;
  background: var(--acc-3);
  animation: blink 1s steps(2, jump-none) infinite;
}
.gate__field:focus-within .gate__cells i.is-active { border-color: var(--acc-3); }

.gate__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.gate__pad button {
  height: 44px;
  border: 1.5px solid var(--line);
  background: transparent; color: var(--white);
  font: 700 15px/1 var(--f-mono);
  transition: background-color .15s, color .15s, transform .15s, border-color .2s;
}
.gate__pad button:hover { border-color: var(--white); background: color-mix(in srgb, var(--white) 8%, transparent); }
.gate__pad button:active { transform: translate(2px, 2px); background: var(--acc-3); color: var(--ink); }
.gate__pad .is-fn { font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.gate__pad .is-ok { color: var(--ink); background: var(--acc-3); border-color: var(--acc-3); }

.gate__status {
  min-height: 1.4em;
  font: 700 11px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}

/* scanline sweep while checking */
.gate__scan {
  position: absolute; left: 0; right: 0; top: -30%; height: 30%;
  background: linear-gradient(transparent, color-mix(in srgb, var(--acc-3) 22%, transparent), transparent);
  opacity: 0; pointer-events: none;
}
.gate[data-state="checking"] .gate__scan { opacity: 1; animation: scan-y 1s linear infinite; }
@keyframes scan-y { to { top: 100%; } }
.gate[data-state="checking"] .gate__cells i { animation: cell-pulse .6s ease-in-out infinite alternate; }
.gate[data-state="checking"] .gate__cells i:nth-child(2) { animation-delay: .1s; }
.gate[data-state="checking"] .gate__cells i:nth-child(3) { animation-delay: .2s; }
.gate[data-state="checking"] .gate__cells i:nth-child(4) { animation-delay: .3s; }
@keyframes cell-pulse { to { box-shadow: 4px 4px 0 var(--acc-3); } }

.gate[data-state="denied"] .gate__cells, .gate[data-state="locked"] .gate__cells { animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
.gate[data-state="denied"] .gate__cells i, .gate[data-state="locked"] .gate__cells i { border-color: #FF3B3B; box-shadow: 4px 4px 0 #7A0F12; }
.gate[data-state="denied"] .gate__status, .gate[data-state="locked"] .gate__status { color: #FF5A5A; }
.gate[data-state="locked"] .gate__pad { opacity: .3; pointer-events: none; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px) skewX(-4deg); }
  40%, 60% { transform: translateX(8px) skewX(4deg); }
}
.gate[data-state="granted"] .gate__cells i { border-color: var(--acc-3); box-shadow: 4px 4px 0 var(--acc-3); }
.gate[data-state="granted"] .gate__status { color: var(--acc-3); }
.gate[data-state="granted"] .gate__panel { animation: granted .7s var(--ease-io) forwards; }
@keyframes granted { 60% { transform: scale(1.02); } 100% { transform: scale(.94); opacity: 0; filter: blur(4px); } }

/* ---- Warp into the system ---- */
.warp-flash {
  position: fixed; inset: 0; z-index: 900; pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, #fff 0%, var(--acc-3) 22%, var(--acc-1) 48%, var(--ink) 80%);
}
.is-warping .warp-flash { animation: flash 1.3s ease-in forwards; }
@keyframes flash { 0%, 55% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: scale(1.6); } }
.is-warping .object__inner { transition: transform 1.25s cubic-bezier(.7, 0, .84, 0) !important; transform: scale(3.6) !important; }
.is-warping .header, .is-warping .hero__foot, .is-warping .band, .is-warping .footer, .is-warping .shapes {
  transition: opacity .6s ease, filter .6s ease; opacity: 0; filter: blur(6px);
}
.is-warping .title--ghost { opacity: 0; transition: opacity .3s; }

@media (max-width: 720px) {
  .header__meta { flex-wrap: wrap; row-gap: 12px; }
  .gate__cells i { height: 64px; }
  .gate__pad button { height: 40px; }
}
@media (hover: none) and (pointer: coarse) {
  .gate__pad { display: none; } /* the native numeric keyboard is used instead */
}
@media (prefers-reduced-motion: reduce) {
  .gate[open], .gate[data-state="granted"] .gate__panel { animation: none; }
}

/* =====================================================================
   14 LANGUAGE — EN / FR switch + title swap animation
   ===================================================================== */
.langs {
  display: inline-flex; align-items: center; gap: 2px;
  font: 700 11px/1 var(--f-mono); letter-spacing: .14em;
}
.langs__sep { color: var(--muted); padding: 0 2px; }
.lang-btn {
  padding: 6px 6px; border: 1.5px solid transparent; background: none;
  color: var(--muted); font: inherit; letter-spacing: inherit;
  transition: color .25s, border-color .25s, box-shadow .3s, transform .3s var(--ease-back);
}
.lang-btn:hover { color: var(--white); transform: translateY(-2px); }
.lang-btn[aria-pressed="true"] { color: var(--ink); background: var(--white); border-color: var(--white); box-shadow: 3px 3px 0 var(--acc-3); }

.title-swap .title__line { clip-path: inset(-50% -5% 0 -5%); }
.title-stacked.title-swap .title__line { clip-path: none; }
.title-stacked.title-swap .title .w { clip-path: inset(-50% -5% 0 -5%); }
.title-swap .ch { animation: ch-in .8s var(--ease-out) calc(var(--i, 0) * 22ms) backwards; }
