/* ────────────────────────────────────────────────
   BETR Docs · vendor document portal
   ink #0A0A0A · paper #F7F7F5 · electric blue #2563EB
   Satoshi (display) · Space Grotesk (body) · Be Vietnam Pro (vi)
   ──────────────────────────────────────────────── */

@font-face {
  font-family: "Satoshi";
  src: url("/fonts/Satoshi-Variable.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-Variable.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("/fonts/BeVietnamPro-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("/fonts/BeVietnamPro-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Be Vietnam Pro";
  src: url("/fonts/BeVietnamPro-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #0a0a0a;
  --paper: #f7f7f5;
  --paper-2: #eeeeea;
  --blue: #2563eb;
  --stone: #75756f;
  --faint: #b3b3ad;
  --hair: rgba(10, 10, 10, 0.16);
  --hair-soft: rgba(10, 10, 10, 0.08);
  --red: #d43d2a;
  --display: "Satoshi", "Be Vietnam Pro", system-ui, sans-serif;
  --body: "Space Grotesk", "Be Vietnam Pro", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.44, 1);
  --gut: clamp(22px, 6vw, 96px);
}
html[lang="vi"] {
  --display: "Be Vietnam Pro", system-ui, sans-serif;
  --body: "Be Vietnam Pro", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  z-index: 70;
  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='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--blue); color: #fff; }
b { font-weight: 700; }

/* ── custom cursor ── */
.cursor { display: none; }
@media (pointer: fine) {
  body.has-cursor { cursor: none; }
  body.has-cursor a, body.has-cursor button, body.has-cursor input,
  body.has-cursor label, body.has-cursor [role="button"] { cursor: none; }
  /* display: contents removes the wrapper from rendering, so the dot
     and ring blend directly against the page. A positioned wrapper
     would isolate the blend and the inversion would stop working. */
  body.has-cursor .cursor { display: contents; }
  .cursor-dot {
    position: fixed;
    left: -100px; top: -100px;
    z-index: 100;
    pointer-events: none;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    mix-blend-mode: difference;
    translate: -50% -50%;
  }
  .cursor-ring {
    position: fixed;
    left: -100px; top: -100px;
    z-index: 100;
    pointer-events: none;
    width: 30px; height: 30px;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    mix-blend-mode: difference;
    translate: -50% -50%;
    transition: width 0.25s var(--ease), height 0.25s var(--ease);
  }
  body.cursor-hot .cursor-ring { width: 46px; height: 46px; }
  body.cursor-hot .cursor-dot { width: 9px; height: 9px; }
}

/* ── upload progress ── */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 90; pointer-events: none; }
.topbar span {
  display: block; height: 100%;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s linear, opacity 0.4s;
  opacity: 0;
}
.topbar.is-on span { opacity: 1; }

/* ── chrome ── */
.bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(20px, 3vw, 34px) var(--gut);
}
.lockup { width: clamp(130px, 11vw, 164px); height: auto; display: block; }
.bar-right { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); }
.bar-clock {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
  55% { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0); }
}
.lang {
  display: inline-flex;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.lang-btn {
  font: 600 11.5px/1 var(--body);
  letter-spacing: 0.08em;
  color: var(--stone);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
}
.lang-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ── page column ── */
.page {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 clamp(22px, 5vw, 40px);
}

/* ── hero (full bleed) ── */
.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: clamp(30px, 6vh, 70px) var(--gut) clamp(40px, 8vh, 90px);
  min-height: calc(88svh - 110px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.h1 {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.9rem, 9.3vw, 11.5rem);
  line-height: 0.92;
  letter-spacing: -0.015em;
  margin-bottom: clamp(26px, 4.5vh, 52px);
  animation: rise 1s var(--ease) both;
  transition: opacity 0.45s ease;
}
.h1.is-hidden { animation: none; opacity: 0; }
/* the living-headline swap: instant, so dots and type never coexist */
.h1.is-dots { opacity: 0 !important; transition: none !important; animation: none !important; }
/* the intro flag is set inline in <head>, before first paint, so the
   headline is never visible ahead of the particles. The 5s keyframe
   is a failsafe: if script ever fails, the text still appears. */
html.intro .h1 { opacity: 0; animation: h1safe 0.45s ease 5s forwards; }
html.intro .h1.is-settled { opacity: 1; animation: none; }
@keyframes h1safe { to { opacity: 1; } }
.h1.is-settled { animation: none; }
.h1-accent { color: var(--blue); }
.sub {
  max-width: 30em;
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--stone);
  animation: rise 1s var(--ease) 1.25s both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* post-login handoff: the gate's swarm rebuilds the headline, and the
   rest of the hero rises in underneath it on a fresh stagger */
html.postlogin .bar { animation: rise 0.8s var(--ease) 1.15s both; }
html.postlogin .sub { animation: rise 0.9s var(--ease) 1.4s both; }
html.postlogin .cue { animation: rise 0.9s var(--ease) 1.65s both; }

/* scroll cue */
.cue {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  margin-top: clamp(44px, 8vh, 90px);
  background: none;
  border: 0;
  padding: 0;
  color: var(--stone);
  cursor: pointer;
  animation: rise 1s var(--ease) 1.5s both;
  transition: color 0.25s;
}
.cue:hover { color: var(--blue); }
.cue-ring {
  width: 58px; height: 58px;
  border: 1.5px solid var(--hair);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.3s var(--ease);
}
.cue:hover .cue-ring { border-color: var(--blue); transform: translateY(3px); }
.cue-ring svg {
  width: 21px; height: 21px;
  animation: cuedrop 1.9s cubic-bezier(0.45, 0, 0.3, 1) infinite;
}
@keyframes cuedrop {
  0%   { transform: translateY(-30px); opacity: 0; }
  38%  { transform: translateY(0); opacity: 1; }
  62%  { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(30px); opacity: 0; }
}
.cue-text {
  font: 600 13px/1 var(--body);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ── sections ── */
.sect { padding: clamp(48px, 9vh, 104px) 0 0; }
.sect-send { padding-bottom: clamp(56px, 10vh, 120px); }

.micro {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font: 600 11.5px/1 var(--body);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: clamp(34px, 5vh, 52px);
}
.micro-aside { letter-spacing: 0.05em; font-weight: 500; font-variant-numeric: tabular-nums; text-transform: none; }
.micro-clear {
  font: 500 12px/1 var(--body);
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--stone);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hair);
  padding: 0 0 2px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.micro-clear:hover { color: var(--blue); border-color: var(--blue); }
html[lang="vi"] .micro { letter-spacing: 0.14em; }

/* fields */
.field { position: relative; margin-bottom: 42px; }
.field input {
  width: 100%;
  font: 500 clamp(19px, 2vw, 23px)/1.4 var(--body);
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hair);
  padding: 20px 0 12px;
  outline: none;
  border-radius: 0;
}
.field label {
  position: absolute;
  left: 0;
  top: 20px;
  font: 500 clamp(19px, 2vw, 23px)/1 var(--body);
  color: var(--faint);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.3s var(--ease), color 0.3s;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  transform: translateY(-20px) scale(0.6);
  color: var(--stone);
}
.field input:focus + label { color: var(--blue); }
.field-line {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.field input:focus ~ .field-line { transform: scaleX(1); }
.field.is-bad input { border-color: var(--red); }
.field.is-bad label { color: var(--red); }

/* ── tray ── */
.tray {
  position: relative;
  min-height: clamp(280px, 38vh, 360px);
  padding: clamp(24px, 3.5vw, 38px);
  outline: none;
  transition: background 0.3s;
  border-radius: 4px;
}
.tray input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }

.tray-corner {
  position: absolute;
  width: 28px; height: 28px;
  border: 0 solid var(--ink);
  transition: border-color 0.3s, transform 0.3s var(--ease);
  pointer-events: none;
}
.tc-tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.tc-tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.tc-bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.tc-br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

.tray.is-drag { background: rgba(37, 99, 235, 0.05); }
.tray.is-drag .tray-corner { border-color: var(--blue); }
.tray.is-drag .tc-tl { transform: translate(-6px, -6px); }
.tray.is-drag .tc-tr { transform: translate(6px, -6px); }
.tray.is-drag .tc-bl { transform: translate(-6px, 6px); }
.tray.is-drag .tc-br { transform: translate(6px, 6px); }

.tray-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 9px;
  pointer-events: none;
  transition: opacity 0.3s;
}
.tray.has-files .tray-empty { opacity: 0; }
.tray-title { font: 500 clamp(20px, 2.2vw, 26px)/1.3 var(--display); letter-spacing: -0.01em; }
.tray-title b { color: var(--blue); font-weight: 500; }
.tray-hint { font-size: 12.5px; color: var(--stone); letter-spacing: 0.03em; }
.tray.is-drag .tray-title { color: var(--blue); }

/* cards — pointer-events pass through the list so the file input
   underneath keeps taking clicks; only the cards themselves are solid */
.cards {
  position: relative;
  z-index: 2;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 16px;
  align-items: flex-start;
  pointer-events: none;
}
.card {
  pointer-events: auto;
  position: relative;
  width: 150px;
  min-height: 180px;
  background: #fff;
  border: 1px solid var(--hair-soft);
  box-shadow: 0 12px 26px -12px rgba(10, 10, 10, 0.3);
  padding: 14px 12px 12px;
  rotate: var(--r, 0deg);
  animation: drop 0.55s var(--spring) both;
  transition: rotate 0.3s var(--ease), translate 0.3s var(--ease), box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}
.card:hover { rotate: 0deg; translate: 0 -4px; box-shadow: 0 20px 34px -14px rgba(10, 10, 10, 0.36); }
@keyframes drop {
  from { opacity: 0; transform: translateY(-48px) scale(1.06) rotate(4deg); }
  to   { opacity: 1; transform: none; }
}
.card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  border-style: solid;
  border-width: 0 22px 22px 0;
  border-color: var(--paper) var(--paper) var(--paper-2) var(--paper-2);
  box-shadow: -2px 2px 3px rgba(10, 10, 10, 0.07);
}
.card-ext {
  align-self: flex-start;
  font: 700 9.5px/1 var(--body);
  letter-spacing: 0.1em;
  color: var(--paper);
  background: var(--ink);
  border-radius: 4px;
  padding: 5px 6px;
  margin-bottom: 10px;
}
.card-name {
  font: 600 12.5px/1.35 var(--body);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card-size { font-size: 11px; color: var(--stone); margin-top: 10px; font-variant-numeric: tabular-nums; }
.card-lines {
  margin-top: 8px;
  height: 14px;
  background: repeating-linear-gradient(to bottom, var(--hair-soft) 0 1px, transparent 1px 5px);
}
.card-x {
  position: absolute;
  top: -9px; left: -9px;
  width: 24px; height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  scale: 0.6;
  transition: opacity 0.2s, scale 0.25s var(--spring), background 0.2s;
}
.card:hover .card-x { opacity: 1; scale: 1; }
.card-x:hover { background: var(--red); }

/* the fold: each card folds up into a plane, in place */
.tray.is-folding .card {
  animation: cardfold 0.5s cubic-bezier(0.55, 0, 0.45, 1) both;
}
.tray.is-folding .card .card-x { display: none; }
@keyframes cardfold {
  0%   { transform: perspective(600px) rotateY(0deg); opacity: 1; }
  45%  { transform: perspective(600px) rotateY(70deg) scale(0.92); opacity: 1; }
  80%  { transform: perspective(600px) rotateY(78deg) rotateX(48deg) scale(0.62); opacity: 1; }
  100% { transform: perspective(600px) rotateY(84deg) rotateX(62deg) scale(0.4); opacity: 0; }
}

/* stamp */
.stamp {
  position: absolute;
  z-index: 5;
  top: 50%; left: 50%;
  translate: -50% -50%;
  opacity: 0;
  pointer-events: none;
}
.stamp-inner {
  width: clamp(150px, 20vw, 186px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 5px solid var(--blue);
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  rotate: -11deg;
  mix-blend-mode: multiply;
}
.stamp-inner img { width: 34%; height: auto; }
.stamp-arc { font: 700 13px/1 var(--body); letter-spacing: 0.34em; margin-left: 0.34em; }
.stamp.is-in { animation: thunk 0.5s var(--ease) both; }
@keyframes thunk {
  0%   { opacity: 0; transform: scale(2.1) rotate(6deg); }
  60%  { opacity: 1; transform: scale(0.94); }
  80%  { transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

/* the paper plane */
.plane {
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
  width: clamp(46px, 5vw, 60px);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 10px 16px rgba(10, 10, 10, 0.18));
}
.plane svg { width: 100%; height: auto; display: block; }

/* reason + message */
.field textarea {
  width: 100%;
  font: 500 17px/1.55 var(--body);
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--hair);
  padding: 10px 0 12px;
  outline: none;
  border-radius: 0;
  resize: vertical;
  min-height: 88px;
}
.field textarea:focus ~ .field-line { transform: scaleX(1); }
/* ── kind toggle (submit documents / request VAT invoice) ── */
.kind {
  display: inline-flex;
  margin-top: 56px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  max-width: 100%;
}
.kind-btn {
  font: 600 13.5px/1.2 var(--body);
  letter-spacing: 0.03em;
  color: var(--stone);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s, background 0.25s;
}
.kind-btn:hover { color: var(--ink); }
.kind-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
@media (max-width: 520px) {
  .kind { width: 100%; }
  .kind-btn { flex: 1; padding: 12px 8px; white-space: normal; }
}

.tray-opt { font-weight: 500; color: var(--stone); }

.field-static { margin-top: 52px; margin-bottom: 0; }
.field-static label {
  position: static;
  transform: none;
  display: block;
  font: 600 11.5px/1 var(--body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0;
}
html[lang="vi"] .field-static label { letter-spacing: 0.1em; }
.field-static input { font-size: 17px; padding: 10px 0 12px; }
.field-static input::placeholder,
.field-static textarea::placeholder { color: var(--faint); opacity: 1; }
.field-static.is-bad label { color: var(--red); }
.tax-note { font-size: 13px; color: var(--stone); margin-top: 10px; }

.formerr { color: var(--red); font-size: 14.5px; margin-top: 18px; }

/* ── send ── */
.send {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 560 16.5px/1 var(--display);
  letter-spacing: 0.01em;
  padding: 23px 42px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s var(--ease), box-shadow 0.3s;
}
.send:hover:not(:disabled) {
  background: var(--blue);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px -16px rgba(37, 99, 235, 0.6);
}
.send:active:not(:disabled) { transform: scale(0.98); }
.send:disabled { cursor: default; opacity: 0.85; }
.send-arrow { width: 18px; height: 18px; transition: transform 0.3s var(--ease); }
.send:hover:not(:disabled) .send-arrow { transform: translateX(4px); }
.fineprint { font-size: 12.5px; color: var(--stone); margin-top: 20px; max-width: 30em; }

/* ── success ── */
.done { padding: clamp(60px, 12vh, 130px) 0; animation: rise 0.7s var(--ease) both; }
.done-kicker {
  font: 600 12px/1 var(--body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 20px;
}
.done-kicker b { color: var(--blue); }
.done-title {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.92;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
}
.done-copy { color: var(--stone); max-width: 30em; margin-bottom: 34px; font-size: 17px; }
.done-copy b { color: var(--ink); }
.done-list { list-style: none; max-width: 440px; margin-bottom: 42px; }
.done-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--hair-soft);
  font-size: 14px;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}
.done-list li span:first-child {
  color: var(--ink);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.again {
  font: 560 15px/1 var(--display);
  color: var(--ink);
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 16px 30px;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.2s var(--ease);
}
.again:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }

/* ── footer ── */
.foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 26px var(--gut) 34px;
  border-top: 1px solid var(--hair-soft);
  font-size: 13px;
  color: var(--stone);
  letter-spacing: 0.02em;
}
.foot a { color: var(--stone); text-decoration: none; transition: color 0.2s; }
.foot a:hover { color: var(--ink); }

/* ── responsive ── */
@media (max-width: 640px) {
  .bar-clock { display: none; }
  .hero { min-height: calc(80svh - 90px); }
  .cue-ring { width: 50px; height: 50px; }
  .card { width: calc(50% - 8px); min-height: 152px; }
  .field { margin-bottom: 34px; }
}

/* ── motion safety ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse, .cue-ring svg { animation: none !important; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; }
  .hero-canvas { display: none; }
}

/* ── vendor gate ── */
html.locked { overflow: hidden; }
html.locked .page, html.locked .foot { visibility: hidden; }
.bar { z-index: 10; }
/* the gate is a fixed overlay; the in-flow header can be scrolled
   off-screen behind it, so the gate carries its own lockup */
html.locked .bar { visibility: hidden; }
.gate-lockup {
  position: absolute;
  top: clamp(20px, 3vw, 34px);
  left: var(--gut);
  width: clamp(130px, 11vw, 164px);
  height: auto;
  z-index: 3;
}
html.gintro .gate-lockup { animation: rise 0.8s var(--ease) 0s both; }
/* language toggle on the login screen — the header bar (and its toggle) is
   hidden while locked, so the gate carries its own, top-right, mirroring
   the lockup. Both toggles stay in sync via applyLang(). */
.gate-lang {
  position: absolute;
  top: clamp(20px, 3vw, 34px);
  right: var(--gut);
  z-index: 3;
  background: rgba(247, 247, 245, 0.7);
  backdrop-filter: blur(6px);
}
html.gintro .gate-lang { animation: rise 0.8s var(--ease) 0s both; }
/* stack while locked / morphing: veil (paper, 4) < swarm canvas (5)
   < gate content (6). The gate itself is transparent so fading it never
   takes the dots down with it. */
.gate-veil {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: var(--paper);
  display: none;
  transition: opacity 0.75s ease;
}
html.locked .gate-veil, .gate-veil.is-up { display: block; }
.gate-veil.is-fading { opacity: 0; }
.gate { display: none; }
html.locked .gate, .gate.is-up { display: flex; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 6;
  align-items: center;
  justify-content: center;
  padding: 100px var(--gut) 50px;
}
.gate-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  display: none;
  transition: opacity 0.5s ease;
}
html.locked .gate-canvas, .gate-canvas.is-up { display: block; }
.gate-inner {
  position: relative;
  z-index: 2;
  max-width: 600px;
  width: 100%;
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
}
.gate-inner.is-gone { opacity: 0; transform: translateY(-14px); pointer-events: none; }
.micro-gate { margin-bottom: 16px; color: var(--blue); }
.gate-title {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.95;
  font-size: clamp(34px, 5.4vw, 72px);
  margin-bottom: 36px;
}
.gate-form {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
  transition: border-color 0.3s;
}
.gate-form:focus-within { border-color: var(--blue); }
.gate-input {
  flex: 1;
  min-width: 0;
  font: 600 clamp(20px, 2.4vw, 28px)/1.2 var(--body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: none;
  border: 0;
  outline: none;
  padding: 8px 0;
}
.gate-input::placeholder { color: var(--faint); }
.gate-go {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.25s, transform 0.2s var(--ease);
}
.gate-go:hover:not(:disabled) { background: var(--blue); transform: translateX(2px); }
.gate-go:disabled { cursor: default; opacity: 0.7; }
.gate-go svg { width: 20px; height: 20px; }
.gate-hint { font-size: 13px; color: var(--stone); margin-top: 18px; max-width: 32em; }
.gate-form.is-shake { animation: shake 0.4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
.gate-company {
  position: absolute;
  left: var(--gut);
  right: var(--gut);
  top: 50%;
  translate: 0 -50%;
  text-align: center;
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  line-height: 0.95;
  font-size: clamp(30px, 6.4vw, 110px);
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 3;
}
.gate-company.is-on { opacity: 1; }
.gate-stamp { z-index: 6; }
.field.is-locked input { opacity: 0.9; }
.field.is-locked .field-line { display: none; }
.foot-right { display: inline-flex; gap: 22px; align-items: baseline; }
.foot-btn { background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
@media (max-width: 640px) {
  .gate { padding-top: 84px; }
  .gate-go { width: 46px; height: 46px; }
}

/* gate entrances + exit */
html.gintro .micro-gate { animation: rise 0.8s var(--ease) 0.05s both; }
html.gintro .gate-title { animation: rise 0.8s var(--ease) 0.15s both; }
html.gintro .gate-form { animation: rise 0.8s var(--ease) 0.3s both; }
html.gintro .gate-hint { animation: rise 0.8s var(--ease) 0.45s both; }
.gate { transition: opacity 0.6s ease; }
.gate.is-open { opacity: 0; }

/* header sign-out */
.signout-top {
  font: 600 11.5px/1 var(--body);
  letter-spacing: 0.06em;
  color: var(--stone);
  background: none;
  border: 1px solid var(--hair);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
}
.signout-top:hover { color: var(--ink); border-color: var(--ink); }
