/* Black Cartel Shop — visual system
 *
 * Bilingual by construction: every box uses logical properties
 * (inline-start / inline-end / margin-inline), so the single stylesheet lays
 * out correctly under dir="rtl" and dir="ltr" without a mirrored copy.
 *
 * Colour is OKLCH. One accent — a hot red-orange — kept under a few percent of
 * any screen. Everything else is a tinted neutral.
 */

:root {
  /* type — all three faces carry Hebrew and Latin */
  --font-display: 'Rubik', 'Heebo', system-ui, sans-serif;
  --font-body: 'Heebo', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;
  --text-display: clamp(2.25rem, 6vw + 0.75rem, 4.25rem);

  /* surfaces — elevation by lightness, never by glow */
  --paper: oklch(14% 0.008 40);
  --paper-2: oklch(18% 0.010 40);
  --paper-3: oklch(22% 0.012 40);
  --paper-4: oklch(27% 0.014 40);

  --rule: oklch(30% 0.012 40);
  --rule-2: oklch(42% 0.016 40);

  --ink: oklch(96% 0.006 60);
  --neutral: oklch(78% 0.010 50);
  --muted: oklch(66% 0.012 45);

  /* accent */
  --accent: oklch(62% 0.210 32);
  --accent-hover: oklch(68% 0.205 34);
  --accent-press: oklch(55% 0.195 30);
  --accent-ink: oklch(99% 0.005 40);
  --accent-text: oklch(74% 0.170 38);
  --accent-wash: oklch(26% 0.070 32);

  --amber: oklch(78% 0.160 68);
  --amber-wash: oklch(26% 0.055 68);

  --ok: oklch(74% 0.140 155);
  --ok-wash: oklch(25% 0.050 155);
  --danger: oklch(66% 0.200 25);
  --danger-wash: oklch(25% 0.060 25);

  --focus: oklch(85% 0.150 85);

  /* Neon layer — used only by the wordmark and the cursor light. Kept as
     tokens so the whole effect can be retuned from one place. */
  --neon-core: oklch(97% 0.020 30);   /* the lit filament itself */
  --neon-hot: oklch(72% 0.230 32);    /* inner bloom */
  --neon-far: oklch(58% 0.200 22);    /* outer halo, bleeds furthest */
  --neon-cool: oklch(70% 0.150 55);   /* warm amber edge, stops it reading pink */
  --cursor-light: oklch(70% 0.180 34);

  /* space — 4pt */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long: 400ms;

  --z-raised: 10;
  --z-sticky: 200;
  --z-drawer: 300;
  --z-modal: 400;
  --z-toast: 500;

  --header-h: 64px;
  --shell: 1180px;
}

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

html, body { overflow-x: clip; }

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

/* The ground colour lives on html, not body, so the cursor-light layer can sit
   at z-index:-1 — behind every piece of content, in front of the page ground.
   That is what keeps it from ever reducing text contrast. */
html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100dvh;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-style: normal;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

p { margin: 0; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ── header ──────────────────────────────────────────── */

.hdr {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: color-mix(in oklch, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--rule);
}

.hdr__inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-block-size: var(--header-h);
}

.hdr__brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-md);
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.hdr__brand:hover { text-decoration: none; }
.hdr__logo {
  inline-size: 32px;
  block-size: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex: none;
}

.hdr__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-inline-start: var(--space-lg);
}

.hdr__link {
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--neutral);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out),
              background-color var(--dur-micro) var(--ease-out);
}
.hdr__link:hover { color: var(--ink); background: var(--paper-3); text-decoration: none; }
.hdr__link.is-active { color: var(--accent-text); }

.hdr__spacer { flex: 1; }

.hdr__tools {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex: none;
}

/* language switcher */
.lang {
  display: inline-flex;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex: none;
}
.lang__btn {
  padding: var(--space-2xs) var(--space-xs);
  min-block-size: 32px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out);
}
.lang__btn:hover { color: var(--ink); background: var(--paper-3); }
.lang__btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* cart button */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-block-size: 38px;
  padding: 0 var(--space-sm);
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color var(--dur-micro) var(--ease-out),
              border-color var(--dur-micro) var(--ease-out);
}
.cart-btn:hover { background: var(--paper-4); border-color: var(--accent-text); }
.cart-btn:active { transform: translateY(1px); }
.cart-btn svg { inline-size: 18px; block-size: 18px; }

.cart-btn__count {
  min-inline-size: 20px;
  block-size: 20px;
  padding-inline: 5px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.cart-btn__count[hidden] { display: none !important; }

/* account chip */
.acct {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 3px var(--space-xs) 3px 3px;
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
[dir="rtl"] .acct { padding: 3px 3px 3px var(--space-xs); }
.acct__avatar {
  inline-size: 26px;
  block-size: 26px;
  border-radius: 50%;
  background: var(--paper-4);
  object-fit: cover;
  flex: none;
}

.hdr__burger {
  display: none;
  align-items: center;
  justify-content: center;
  inline-size: 38px;
  block-size: 38px;
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.hdr__burger svg { inline-size: 18px; block-size: 18px; }

/* ── buttons ─────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-block-size: 44px;
  padding: 0 var(--space-lg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out),
              transform var(--dur-micro) var(--ease-out),
              border-color var(--dur-micro) var(--ease-out);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { background: var(--accent-press); transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { inline-size: 18px; block-size: 18px; }

/* Primary buttons get a sheen that wipes across on hover. It is a transform on
   a pseudo-element, so it composites and never touches layout. */
.btn { position: relative; overflow: hidden; isolation: isolate; }

.btn::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: -60%;
  inline-size: 45%;
  background: linear-gradient(100deg, transparent, oklch(100% 0 0 / 0.28), transparent);
  transform: translateX(-140%);
  pointer-events: none;
  z-index: -1;
}

@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -8px oklch(62% 0.21 32 / 0.65);
  }
  .btn:not(:disabled):hover::after {
    transform: translateX(420%);
    transition: transform 620ms var(--ease-out);
  }
  .btn:not(:disabled):active { transform: translateY(1px); box-shadow: none; }
  /* the ghost/quiet variants are secondary — they lift but do not glow */
  .btn--ghost:not(:disabled):hover,
  .btn--quiet:not(:disabled):hover { box-shadow: none; }
}

.btn--ghost {
  background: transparent;
  border-color: var(--rule-2);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--paper-3); border-color: var(--muted); }
.btn--ghost:active { background: var(--paper-4); }

.btn--quiet {
  background: var(--paper-3);
  border-color: var(--rule);
  color: var(--neutral);
}
.btn--quiet:hover { background: var(--paper-4); color: var(--ink); }

.btn--danger { background: var(--danger); color: oklch(14% 0.02 25); }
.btn--danger:hover { background: oklch(72% 0.200 25); }

.btn--sm { min-block-size: 36px; padding: 0 var(--space-md); font-size: var(--text-sm); }
.btn--block { width: 100%; }

.btn[data-loading="true"] { pointer-events: none; opacity: 0.8; }
.btn[data-loading="true"] .btn__label { opacity: 0.6; }

.spinner {
  inline-size: 16px;
  block-size: 16px;
  border: 2px solid color-mix(in oklch, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── home ────────────────────────────────────────────── */

.hero {
  position: relative;
  padding-block: clamp(4rem, 13vw, 8.5rem) clamp(2.5rem, 8vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}

/* One quiet wash behind the title. Not a blob, not a mesh — a single
   directional gradient that fades to nothing. */
.hero::before {
  content: "";
  position: absolute;
  inset-block-start: -40%;
  inset-inline-start: 50%;
  translate: -50% 0;
  inline-size: min(1000px, 140%);
  block-size: 620px;
  background: radial-gradient(ellipse at center, var(--accent-wash), transparent 68%);
  opacity: 0.6;
  pointer-events: none;
  z-index: -2;
}

/* A single hairline horizon under the wordmark. Gives the block a floor to
   sit on so the type is not floating in empty space. */
.hero::after {
  content: "";
  position: absolute;
  inset-inline: 12%;
  inset-block-end: 0;
  block-size: 1px;
  background: linear-gradient(90deg, transparent, var(--rule-2) 22%, var(--accent-text) 50%, var(--rule-2) 78%, transparent);
  opacity: 0.5;
  pointer-events: none;
  z-index: -1;
}

.hero__inner { position: relative; text-align: center; }

/* ── the wordmark ────────────────────────────────────── */

.wordmark {
  margin: 0;
  line-height: 0.94;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.35rem, 1.2vw, 0.75rem);
}

/* Each line paints three times from one piece of text:
     the element   — the solid filament, always legible
     ::before      — a blurred copy behind it, the bloom (animates opacity only)
     ::after       — a narrow specular band that travels across (background-position)
   Only the bloom and the band move, so the readable layer never repaints. */
.wordmark__line {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--neon-core);
  letter-spacing: -0.02em;
  -webkit-text-size-adjust: none;
  /* Restrained on purpose. The halo has to stay off the letterforms themselves
     — the moment it bleeds inward the type goes soft and the whole thing reads
     cheap instead of lit. Crisp filament, halo kept outside. */
  text-shadow:
    0 0 9px oklch(72% 0.230 32 / 0.34),
    0 0 28px oklch(58% 0.200 22 / 0.20);
}

.wordmark__line::before,
.wordmark__line::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Both pseudos inherit the parent's text-shadow, and a shadow still paints
     under transparent text. Without this the sweep layer stamps a second copy
     of the red glow ON TOP of the white letters and the whole wordmark goes
     pink. Each layer supplies its own light instead. */
  text-shadow: none;
}

/* bloom */
.wordmark__line::before {
  color: var(--neon-hot);
  filter: blur(26px);
  opacity: 0.34;
  z-index: -1;
  animation: neon-breathe 5.5s var(--ease-in-out) infinite;
}

/* Travelling specular streak.
 *
 * The band is deliberately narrow: at background-size 250%, a stop range of
 * 47–53% is 6% of the image, which lands at ~15% of the word's width. Widen it
 * and the "highlight" stops being a streak and just washes the whole wordmark
 * pale — which is exactly what a 38–62% range did.
 *
 * Both ends of the travel park the band off the box, so the loop restart is
 * invisible and there is no jump. */
.wordmark__line::after {
  background-image: linear-gradient(
    100deg,
    transparent 47%,
    oklch(99% 0.02 60 / 0.5) 49.4%,
    oklch(99% 0.02 60 / 0.62) 50%,
    oklch(99% 0.02 60 / 0.5) 50.6%,
    transparent 53%
  );
  background-size: 250% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: neon-sweep 7s var(--ease-in-out) infinite;
}

@keyframes neon-breathe {
  0%, 100% { opacity: 0.26; }
  50%      { opacity: 0.46; }
}

/* 0% parks the band off the right edge, 100% off the left. The pass takes the
 * first 42% of the cycle; the remaining 58% is dark rest, so it reads as an
 * occasional glint rather than a strobe. */
@keyframes neon-sweep {
  0%        { background-position: 0% 0; }
  42%, 100% { background-position: 100% 0; }
}

.wordmark__line--main {
  font-size: clamp(2.6rem, 11vw, 6.5rem);
}

/* "SHOP" reads as the sub-brand: smaller, tracked wide, no bloom of its own. */
.wordmark__line--sub {
  font-size: clamp(0.85rem, 2.6vw, 1.5rem);
  font-weight: 700;
  letter-spacing: clamp(0.35em, 1.6vw, 0.72em);
  text-indent: clamp(0.35em, 1.6vw, 0.72em); /* balance the trailing letter-space */
  color: var(--neutral);
  text-shadow: 0 0 18px oklch(58% 0.200 22 / 0.4);
}
.wordmark__line--sub::before,
.wordmark__line--sub::after { content: none; }

.hero__sub {
  margin-block-start: var(--space-lg);
  margin-inline: auto;
  max-width: 48ch;
  color: var(--neutral);
  font-size: var(--text-md);
  text-wrap: balance;
}

.hero__cta {
  margin-block-start: var(--space-xl);
  display: inline-flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-md);
  padding-block-end: var(--space-3xl);
}

.step {
  position: relative;
  padding: var(--space-lg);
  background:
    linear-gradient(180deg, oklch(24% 0.014 40 / 0.55), oklch(18% 0.010 40 / 0.35));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--dur-short) var(--ease-out),
              transform var(--dur-short) var(--ease-out);
}

/* A 1px lit edge along the top — the cheapest way to make a flat panel read
   as a physical surface catching light from above. */
.step::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 12%;
  block-size: 1px;
  background: linear-gradient(90deg, transparent, oklch(80% 0.06 40 / 0.5), transparent);
  pointer-events: none;
}

/* Spotlight that tracks the pointer. --mx/--my are written by ambient.js and
   default to the card centre, so the card looks right before any mouse move
   and on devices that never send one. */
.step::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(
    280px circle at var(--mx, 50%) var(--my, 0%),
    oklch(70% 0.18 34 / 0.14),
    transparent 68%
  );
  opacity: 0;
  transition: opacity var(--dur-short) var(--ease-out);
  pointer-events: none;
  z-index: -1;
}

@media (hover: hover) and (pointer: fine) {
  .step:hover { border-color: var(--rule-2); transform: translateY(-3px); }
  .step:hover::after { opacity: 1; }
}
.step__n {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}
.step__t { margin-block-start: var(--space-xs); font-size: var(--text-md); font-weight: 700; }
.step__d { margin-block-start: var(--space-2xs); color: var(--muted); font-size: var(--text-sm); }

/* ── catalogue ───────────────────────────────────────── */

.page-head {
  padding-block: var(--space-xl) var(--space-lg);
}
.page-head__title { font-size: var(--text-xl); font-weight: 800; }

.tabs {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  padding-block-end: var(--space-lg);
}

.tab {
  min-block-size: 40px;
  padding: 0 var(--space-md);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--neutral);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out),
              border-color var(--dur-micro) var(--ease-out);
}
.tab:hover { color: var(--ink); border-color: var(--rule-2); }
.tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.grid {
  display: grid;
  /* minmax(min(100%, …)) rather than a bare 1fr so an image-bearing track can
     never push the row past the viewport. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: var(--space-md);
  padding-block-end: var(--space-3xl);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
  transition: border-color var(--dur-short) var(--ease-out),
              transform var(--dur-short) var(--ease-out);
}

@media (hover: hover) {
  .card:hover { border-color: var(--rule-2); transform: translateY(-2px); }
  .card:hover .card__img img { scale: 1.04; }
}

.card.is-out { opacity: 0.62; }

.card__img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper-3);
  overflow: hidden;
  cursor: pointer;
  border: 0;
  padding: 0;
  width: 100%;
  display: block;
}
.card__img img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: scale var(--dur-long) var(--ease-out);
}

/* No image yet — a typographic monogram beats a broken-image icon. */
.card__ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--rule-2);
  background:
    linear-gradient(135deg, var(--paper-3), var(--paper-2));
  user-select: none;
}

.badge {
  position: absolute;
  inset-block-start: var(--space-xs);
  inset-inline-start: var(--space-xs);
  padding: 3px var(--space-xs);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.01em;
}
.badge--sale { background: var(--accent); color: var(--accent-ink); }
.badge--out { background: var(--paper-4); color: var(--neutral); border: 1px solid var(--rule-2); }
.badge--low { background: var(--amber-wash); color: var(--amber); border: 1px solid var(--amber); }

.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-md);
  flex: 1;
  min-width: 0;
}

.card__name {
  font-size: var(--text-md);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.card__stock { font-size: var(--text-xs); color: var(--muted); }

.card__prices {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-block-start: auto;
  padding-block-start: var(--space-xs);
}

.price {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.price--was {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--muted);
  text-decoration: line-through;
}
.price--lg { font-size: var(--text-xl); }

.card__foot { padding: 0 var(--space-md) var(--space-md); }

/* ── modal ───────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--space-md);
  background: oklch(8% 0.01 40 / 0.72);
  animation: fade var(--dur-short) var(--ease-out);
}
@keyframes fade { from { opacity: 0; } }

.modal {
  width: min(560px, 100%);
  max-height: min(88dvh, 44rem);
  overflow-y: auto;
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  animation: pop var(--dur-short) var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: scale(0.97); } }

.modal__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-block-end: var(--space-md);
}
.modal__title { font-size: var(--text-lg); font-weight: 800; flex: 1; overflow-wrap: anywhere; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  inline-size: 36px;
  block-size: 36px;
  flex: none;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--neutral);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.icon-btn:hover { background: var(--paper-4); color: var(--ink); }
.icon-btn svg { inline-size: 16px; block-size: 16px; }

.modal__media {
  aspect-ratio: 16 / 9;
  background: var(--paper-3);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  margin-block-end: var(--space-md);
}
.modal__media img { inline-size: 100%; block-size: 100%; object-fit: cover; }

.modal__desc { color: var(--neutral); font-size: var(--text-sm); margin-block-end: var(--space-md); }

.modal__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding-block: var(--space-sm);
  border-block-start: 1px solid var(--rule);
}
.modal__label { font-size: var(--text-sm); color: var(--muted); }

.modal__actions {
  display: flex;
  gap: var(--space-xs);
  margin-block-start: var(--space-lg);
  flex-wrap: wrap;
}
.modal__actions .btn { flex: 1 1 auto; }

/* ── quantity stepper ────────────────────────────────── */

.qty {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper-3);
}

.qty__btn {
  inline-size: 42px;
  min-block-size: 42px;
  background: none;
  border: 0;
  color: var(--ink);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.qty__btn:hover { background: var(--paper-4); }
.qty__btn:active { background: var(--accent-wash); }
.qty__btn:disabled { opacity: 0.35; cursor: not-allowed; }

.qty__input {
  inline-size: 88px;
  min-block-size: 42px;
  padding-inline: var(--space-xs);
  background: var(--paper-4);
  border: 0;
  border-inline: 1px solid var(--rule-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty__input:focus-visible { outline-offset: -2px; }

.hint { font-size: var(--text-xs); color: var(--muted); margin-block-start: var(--space-2xs); }
.hint--error { color: var(--danger); font-weight: 600; }

/* ── cart drawer ─────────────────────────────────────── */

.drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  z-index: var(--z-drawer);
  inline-size: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper-2);
  border-inline-start: 1px solid var(--rule-2);
  animation: slide var(--dur-short) var(--ease-out);
}
@keyframes slide { from { transform: translateX(var(--slide-from, 100%)); } }
[dir="rtl"] .drawer { --slide-from: -100%; }

.drawer__scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: oklch(8% 0.01 40 / 0.6);
  border: 0;
  animation: fade var(--dur-short) var(--ease-out);
}

.drawer__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-block-end: 1px solid var(--rule);
}
.drawer__title { flex: 1; font-size: var(--text-md); font-weight: 800; }

.drawer__body { flex: 1; overflow-y: auto; padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); }
.drawer__foot { padding: var(--space-md); border-block-start: 1px solid var(--rule); background: var(--paper-2); }

.line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}

.line__img {
  inline-size: 56px;
  block-size: 56px;
  border-radius: var(--radius-sm);
  background: var(--paper-4);
  object-fit: cover;
  position: relative;
  overflow: hidden;
}
.line__ph {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--rule-2);
}

.line__main { min-width: 0; display: flex; flex-direction: column; gap: var(--space-2xs); }
.line__name { font-weight: 700; font-size: var(--text-sm); overflow-wrap: anywhere; }
.line__unit { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; }

.line__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); flex-wrap: wrap; }
.line__total { font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }

.qty--sm .qty__btn { inline-size: 32px; min-block-size: 32px; font-size: var(--text-base); }
.qty--sm .qty__input { inline-size: 56px; min-block-size: 32px; font-size: var(--text-sm); }

.totals { display: flex; flex-direction: column; gap: var(--space-2xs); margin-block-end: var(--space-md); }
.totals__row { display: flex; justify-content: space-between; gap: var(--space-sm); font-size: var(--text-sm); color: var(--neutral); }
.totals__row--grand {
  padding-block-start: var(--space-xs);
  border-block-start: 1px solid var(--rule);
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--ink);
}
.totals__row--save { color: var(--ok); }
.totals__val { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ── states ──────────────────────────────────────────── */

.empty {
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  color: var(--muted);
}
.empty__title { font-size: var(--text-md); font-weight: 700; color: var(--neutral); margin-block-end: var(--space-2xs); }

.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 37%, var(--paper-2) 63%);
  background-size: 400% 100%;
  animation: sheen 1.4s ease-in-out infinite;
  border-radius: var(--radius);
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skeleton--card { block-size: 300px; }

.notice {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  border: 1px solid var(--rule-2);
  background: var(--paper-3);
  margin-block-end: var(--space-md);
}
.notice--warn { background: var(--amber-wash); border-color: var(--amber); color: var(--amber); }
.notice--error { background: var(--danger-wash); border-color: var(--danger); color: var(--danger); }
.notice--ok { background: var(--ok-wash); border-color: var(--ok); color: var(--ok); }

/* ── toasts ──────────────────────────────────────────── */

.toasts {
  position: fixed;
  inset-block-end: var(--space-md);
  inset-inline-end: var(--space-md);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  pointer-events: none;
  max-inline-size: min(360px, calc(100vw - 2rem));
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in var(--dur-short) var(--ease-out);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast.is-out { animation: toast-out var(--dur-micro) var(--ease-in) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

.toast--ok { border-color: var(--ok); color: var(--ok); }
.toast--error { border-color: var(--danger); color: var(--danger); }
.toast svg { inline-size: 16px; block-size: 16px; flex: none; }

/* ── admin ───────────────────────────────────────────── */

.adm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: var(--space-sm);
  padding-block-end: var(--space-lg);
}
.adm-stat { padding: var(--space-md); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.adm-stat__n { font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 700; font-variant-numeric: tabular-nums; }
.adm-stat__l { font-size: var(--text-xs); color: var(--muted); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
}
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { padding: var(--space-sm) var(--space-md); text-align: start; white-space: nowrap; }
th {
  background: var(--paper-3);
  font-weight: 700;
  font-size: var(--text-xs);
  color: var(--neutral);
  border-block-end: 1px solid var(--rule-2);
  position: sticky;
  top: 0;
}
td { border-block-end: 1px solid var(--rule); }
tbody tr:last-child td { border-block-end: 0; }
tbody tr:hover td { background: var(--paper-3); }
td.num, th.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-inline-size: 180px; }

.pill {
  display: inline-block;
  padding: 2px var(--space-xs);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  border: 1px solid currentColor;
}
.pill--pending { color: var(--amber); }
.pill--approved { color: var(--ok); }
.pill--cancelled { color: var(--muted); }
.pill--failed { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0; }
.field > label { font-size: var(--text-xs); font-weight: 700; color: var(--neutral); }

.input {
  min-block-size: 42px;
  padding: var(--space-xs) var(--space-sm);
  background: var(--paper-3);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  width: 100%;
  transition: background-color var(--dur-micro) var(--ease-out);
}
.input:hover { background: var(--paper-4); }
.input::placeholder { color: var(--muted); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
textarea.input { min-block-size: 88px; resize: vertical; line-height: 1.5; }
select.input { cursor: pointer; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-md);
}
.field--full { grid-column: 1 / -1; }

.check-row { display: flex; align-items: center; gap: var(--space-xs); font-size: var(--text-sm); cursor: pointer; }
.check-row input { inline-size: 18px; block-size: 18px; accent-color: var(--accent); cursor: pointer; }

.toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding-block-end: var(--space-md);
}
.toolbar__spacer { flex: 1; }

/* ── cursor light ────────────────────────────────────── */

/* Two lamps, not a particle trail: a wide halo that lags behind the pointer and
   a tight core that keeps up. The lag between them reads as motion without
   drawing a single extra element per frame.
   Inert until ambient.js adds .has-cursor-light to <html>, so a browser with JS
   off, a touch device, or reduced-motion never renders any of it. */
.cursor-light {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  display: none;
  contain: strict;
}

.has-cursor-light .cursor-light { display: block; }

.cursor-light__lamp {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  border-radius: 50%;
  /* parked off-screen until the first pointer sample lands */
  transform: translate3d(-9999px, -9999px, 0);
  will-change: transform;
  opacity: 0;
  transition: opacity 500ms var(--ease-out);
}

.has-cursor-light.cursor-active .cursor-light__lamp { opacity: 1; }

.cursor-light__lamp--halo {
  inline-size: 620px;
  block-size: 620px;
  margin: -310px 0 0 -310px;
  background: radial-gradient(circle closest-side, oklch(70% 0.180 34 / 0.15), transparent 70%);
}

.cursor-light__lamp--core {
  inline-size: 240px;
  block-size: 240px;
  margin: -120px 0 0 -120px;
  background: radial-gradient(circle closest-side, oklch(78% 0.150 45 / 0.18), transparent 66%);
}

/* ── responsive ──────────────────────────────────────── */

@media (max-width: 62rem) {
  .hdr__nav {
    display: none;
    position: absolute;
    inset-block-start: var(--header-h);
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-inline-start: 0;
    padding: var(--space-xs);
    background: var(--paper-2);
    border-block-end: 1px solid var(--rule-2);
  }
  .hdr__nav.is-open { display: flex; }
  .hdr__link { min-block-size: 44px; display: flex; align-items: center; }
  .hdr__burger { display: inline-flex; order: -1; }
}

/* Long / short label pair. The long one is the default; the short one only
   appears once the header runs out of room. */
.label--short { display: none; }

@media (max-width: 46rem) {
  .label--long { display: none; }
  .label--short { display: inline; }
}

@media (max-width: 30rem) {
  .hdr__brand span { display: none; }
  .cart-btn__label { display: none; }
  .acct__name { display: none; }
  .hdr__inner { gap: var(--space-xs); }
  .hdr__tools { gap: var(--space-2xs); }
  .btn--sm { padding: 0 var(--space-sm); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--space-sm); }
  .card__body { padding: var(--space-sm); }
  .card__foot { padding: 0 var(--space-sm) var(--space-sm); }
  .modal { padding: var(--space-md); }
  .toasts { inset-inline: var(--space-xs); max-inline-size: none; }
}

/* The neon is display-scale type. Below the tablet breakpoint the bloom radius
   has to come down with it or it turns into a smear. */
@media (max-width: 48rem) {
  .wordmark__line { text-shadow: 0 0 6px oklch(72% 0.230 32 / 0.32), 0 0 18px oklch(58% 0.200 22 / 0.18); }
  .wordmark__line::before { filter: blur(16px); }
}

@media (max-width: 30rem) {
  .wordmark__line::before { filter: blur(12px); opacity: 0.3; }
  .hero::after { inset-inline: 4%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .spinner, .skeleton { animation-duration: 900ms !important; animation-iteration-count: infinite !important; }
  .card:hover, .step:hover { transform: none; }
  html { scroll-behavior: auto; }

  /* The wordmark keeps its static glow — it is the brand, not an animation —
     but stops breathing and sweeping. The cursor light is switched off in JS. */
  .wordmark__line::before { animation: none; opacity: 0.5; }
  .wordmark__line::after { animation: none; opacity: 0; }
  .cursor-light { display: none !important; }
}
