:root {
  /* Palette lifted from the mccapes.net look: warm cream paper, warm-white
     cards, dark warm buttons, sky accent, and hard offset shadows. */
  --bg: #f4efe3;
  --bg-2: #ebe1cf;
  --surface: #fffdf7;
  --surface-2: #fffefb;
  --surface-3: #efe7d6;
  --line: #e4dcc9;
  --line-2: #c7bda8;
  --ink: #2a2724;
  --ink-strong: #262320;
  --muted: #6b665d;
  --faint: #9a948a;
  --primary: #36332d;
  --primary-light: #4c4840;
  --on-primary: #fdfbf4;
  --accent: #13b2ff;
  --accent-dark: #0e86c4;
  --accent-top: #95e4ff;
  --accent-soft: #e2f5ff;
  --sale: #e5544b;
  --sale-bg: #fdeeec;
  --deal: #2f6b45;
  --deal-bg: #eef5ef;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  /* the signature: offset "chunky" shadows, no blur */
  --shadow-card: 2px 3px 0 0 rgba(38, 35, 32, 0.1), 0 1px 1px 0 rgba(38, 35, 32, 0.12);
  --shadow-elev: 4px 5px 0 0 rgba(38, 35, 32, 0.15), 0 2px 4px 0 rgba(38, 35, 32, 0.15);
  --shadow-card-hover: 5px 7px 0 0 rgba(38, 35, 32, 0.13);
  --shadow-ring: 0 0 0 3px rgba(19, 178, 255, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --display: "DynaPuff", "Outfit", "IBM Plex Sans Arabic", sans-serif;
  --sans: "Outfit", "Inter", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --gutter: 28px;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Soft cream wash so the page is not one flat tone. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 82% -10%, rgba(19, 178, 255, 0.16), transparent 62%),
    radial-gradient(760px 460px at 6% 0%, rgba(255, 209, 102, 0.18), transparent 60%),
    radial-gradient(1000px 640px at 50% 106%, rgba(19, 178, 255, 0.1), transparent 66%),
    var(--bg);
}

/* Faint blueprint grid. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(38, 35, 32, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38, 35, 32, 0.035) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(1200px 700px at 50% 0%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(1200px 700px at 50% 0%, #000, transparent 78%);
}

a { color: inherit; }

img { max-width: 100%; height: auto; }

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

:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
  border-radius: 6px;
}

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

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 74px;
  padding: 0 var(--gutter);
  background: rgba(255, 253, 247, 0.86);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 2px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-strong);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 16px;
  text-decoration: none;
  flex: none;
}

.brand img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 6px 18px -7px rgba(38, 35, 32, 0.5);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.brand:hover img {
  transform: translateY(-2px) rotate(-3deg);
  box-shadow: 0 12px 26px -8px rgba(38, 35, 32, 0.6);
}

.site-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.site-nav a {
  padding: 9px 15px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-nav a:hover { color: var(--ink-strong); background: var(--surface-3); }

.site-nav a[aria-current="page"] {
  color: var(--on-primary);
  background: var(--primary);
}

.nav-end { display: flex; gap: 10px; align-items: center; flex: none; }

.nav-toggle {
  display: none;
  margin-inline-start: auto;
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 9px 16px;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Layout ---------- */

main {
  width: min(1180px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
}

.panel {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow-elev);
}

.narrow {
  width: min(680px, 100%);
  margin: clamp(32px, 6vw, 72px) auto;
}

.prose p, .facts p { line-height: 1.85; color: var(--muted); }
.prose h2, .faq h2 { margin: 32px 0 8px; font-size: 19px; color: var(--ink-strong); }
.prose h2:first-of-type, .faq h2:first-of-type { margin-top: 20px; }
.prose h1, .faq h1, .narrow h1 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.22;
}

/* ---------- Buttons ---------- */

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 28px; }

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 2px solid var(--ink-strong);
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  padding: 13px 24px;
  cursor: pointer;
  box-shadow: var(--shadow-elev);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.2s ease;
}

.button:hover, button.button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 8px 0 0 rgba(38, 35, 32, 0.18);
}

.button:active, button.button:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-card);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-card);
}

.button.secondary:hover, button.button.secondary:hover { background: var(--surface-2); }

.tg { display: block; flex: none; }

/* ---------- Landing ---------- */

.home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(32px, 5vw, 60px);
  align-items: center;
  min-height: min(calc(100vh - 74px), 720px);
  padding: clamp(44px, 7vw, 84px) 0 clamp(40px, 6vw, 72px);
}

.home > div { text-align: center; }
.home .row { justify-content: center; }
.home .home-meta { justify-content: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 16px;
  border: 2px solid var(--ink-strong);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: var(--shadow-card);
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--accent-dark);
}

.home h1 {
  margin: 22px 0 0;
  max-width: 14em;
  font-family: var(--display);
  font-size: clamp(40px, 6vw, 74px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-weight: 700;
  color: var(--ink-strong);
}

.lede {
  max-width: 34rem;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 18.5px);
  line-height: 1.8;
}

.home-meta {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 32px 0 0;
  color: var(--faint);
  font-size: 13.5px;
}

.home-meta span {
  padding: 6px 13px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.home-meta a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  color: var(--ink-strong);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.home-meta a:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Catalog ---------- */

/* ---------- Page transitions ---------- */

/* Switching between accounts, or any page to page, should dissolve rather
   than cut. Browsers with cross-document View Transitions (Chromium 126+)
   cross-fade the old and new page; everywhere else the fade-in below covers
   the arrival. Both are disabled under prefers-reduced-motion. */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: pageOut 0.22s ease-in both;
  }

  ::view-transition-new(root) {
    animation: pageIn 0.38s ease-out both;
  }
}

@keyframes pageOut {
  to { opacity: 0; }
}

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Fallback arrival fade for engines without cross-document transitions. */
@supports not (view-transition-name: fade) {
  @media (prefers-reduced-motion: no-preference) {
    main {
      animation: pageIn 0.34s ease-out both;
    }
  }
}

.catalog { padding: clamp(28px, 5vw, 52px) 0 clamp(56px, 9vw, 96px); }

.catalog-after-hero { padding-top: clamp(8px, 2vw, 20px); }

/* Category pages show two listings per row; the front page keeps the wider grid
   because it already has a large featured card above it. */
.catalog-two-up .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 760px) {
  .catalog-two-up .grid { grid-template-columns: 1fr; }
}

.name-account {
  font-family: var(--mono);
  letter-spacing: -0.01em;
}

html[dir="rtl"] .name-account { letter-spacing: 0; font-family: var(--display); }

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

input, textarea, select {
  font: inherit;
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:hover, textarea:hover, select:hover { border-color: var(--line-2); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-ring);
}

input::placeholder, textarea::placeholder { color: var(--faint); }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-inline-end: 38px;
}

textarea { min-height: 110px; resize: vertical; line-height: 1.7; }

/* ---------- Grid & cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  text-decoration: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s ease;
}

.product-card:hover {
  transform: translate(-3px, -3px);
  border-color: var(--ink-strong);
  box-shadow: var(--shadow-card-hover);
}

.featured-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
  padding: 22px;
}

.card-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 22px;
  text-align: start;
  width: 100%;
}

.featured-card .card-copy { padding: 8px 4px; }

.card-copy .muted {
  margin: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.card-copy h2 {
  margin: 8px 0 0;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink-strong);
}

.featured-card .card-copy h2 { font-size: clamp(24px, 2.6vw, 32px); }

.detail { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.view {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 16px;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 14px;
}

.view::after { content: "\2192"; transition: transform 0.3s var(--ease); }
.product-card:hover .view::after { transform: translateX(4px); }
/* RTL already gets a left-pointing glyph, so it only needs to nudge left.
   Mirroring here on top of that would flip the arrow on hover. */
html[dir="rtl"] .view::after { content: "\2190"; }
html[dir="rtl"] .product-card:hover .view::after { transform: translateX(-4px); }

.preview {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 22px 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(19, 178, 255, 0.14), transparent 70%),
    var(--surface-3);
  border-bottom: 2px solid var(--line);
  min-height: 176px;
}

/* Sits in the empty top corner of the picture area, not in the text below. */
.edition {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  padding: 8px 18px;
  border: 2px solid var(--ink-strong);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.92);
  color: var(--ink-strong);
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

html[dir="rtl"] .edition {
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 30px;
}

.offer-tag {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 4px 12px;
  border: 2px solid var(--sale);
  border-radius: 9px;
  background: var(--sale-bg);
  color: var(--sale);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price {
  display: flex;
  direction: ltr;
  justify-content: flex-start;
  align-items: baseline;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  margin: 12px 0 0;
  font-family: var(--mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.price .now { color: var(--ink-strong); font-size: 22px; font-weight: 700; }
.price.offer .now { color: var(--deal); }
.price s { color: var(--sale); font-size: 15px; text-decoration: line-through; }

/* ---------- Previews ---------- */

.preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 22px 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(19, 178, 255, 0.14), transparent 70%),
    var(--surface-3);
  border-bottom: 2px solid var(--line);
  min-height: 176px;
}

.featured-card .preview {
  border-bottom: 0;
  border-inline-end: 2px solid var(--line);
  min-height: 236px;
  padding: 26px;
}

[dir="rtl"] .featured-card .preview { border-inline-end: 0; border-inline-start: 2px solid var(--line); }

.preview-account, .cape-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: flex-end;
}

/* On a product page the capes shrink just enough to stay on one line, so a
   listing with eight capes is a single row instead of three stacked rows. */
.stage .cape-row { gap: 8px; }
.stage .cape-face { width: 48px; height: 77px; }

.face {
  width: 104px;
  height: 104px;
  image-rendering: pixelated;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line-2);
  background: var(--surface-2);
  box-shadow: var(--shadow-card);
}

.cape-face {
  width: 58px;
  height: 92px;
  image-rendering: pixelated;
  border-radius: 8px;
  border: 2px solid var(--line-2);
  background: var(--surface-2);
  box-shadow: var(--shadow-card);
}

.cape-large { width: 132px; height: 212px; border-radius: var(--radius-sm); }

/* Card previews keep every cape on one line. The images shrink only when a
   listing has more capes than fit, so an eight-cape account compresses while a
   three-cape one keeps full size. aspect-ratio tracks the box so the painting
   never distorts. */
.preview-account .cape-row {
  flex-wrap: nowrap;
  gap: 5px;
  max-width: 100%;
}

.preview-account .cape-face {
  flex: 0 1 46px;
  width: auto;
  min-width: 0;
  max-width: 46px;
  height: auto;
  aspect-ratio: 58 / 92;
}

/* the featured card is wide enough to show them larger */
.featured-card .preview-account .cape-face {
  flex-basis: 58px;
  max-width: 58px;
}

/* One horizontal rail per category on the front page. */
.rail-block + .rail-block { margin-top: clamp(28px, 4vw, 44px); }

.rail-head {
  font-size: clamp(19px, 2.1vw, 23px);
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  padding-bottom: 10px;
}

.rail > .product-card {
  flex: 0 0 clamp(228px, 21vw, 292px);
  scroll-snap-align: start;
}

.preview-missing {
  min-height: 140px;
  color: var(--faint);
  background: var(--surface-3);
  font-size: 14px;
}

.preview-cape { min-height: 240px; }

.preview.has-corner {
  padding-top: 68px;
  min-height: 250px;
}

/* A group card cross-fades between the faces of the accounts behind it.
   Each face runs the same fade on the same period; the phase offset is set
   inline per face so neighbours overlap and the switch dissolves. */
.faces {
  position: relative;
  width: 104px;
  height: 104px;
  flex: none;
  /* one full rotation through every face; each face is offset by 1/n of it */
  --step: 7s;
  --n: 1;
}

.faces-2  { --n: 2; }
.faces-3  { --n: 3; }
.faces-4  { --n: 4; }
.faces-5  { --n: 5; }
.faces-6  { --n: 6; }
.faces-7  { --n: 7; }
.faces-8  { --n: 8; }
.faces-9  { --n: 9; }
.faces-10 { --n: 10; }
.faces-11 { --n: 11; }
.faces-12 { --n: 12; }

.faces .face {
  position: absolute;
  inset: 0;
  margin: 0;
  animation: none;
}

.faces .d0  { --i: 0; }
.faces .d1  { --i: 1; }
.faces .d2  { --i: 2; }
.faces .d3  { --i: 3; }
.faces .d4  { --i: 4; }
.faces .d5  { --i: 5; }
.faces .d6  { --i: 6; }
.faces .d7  { --i: 7; }
.faces .d8  { --i: 8; }
.faces .d9  { --i: 9; }
.faces .d10 { --i: 10; }
.faces .d11 { --i: 11; }

/* Each face fades over the same period, shifted by one Nth of it, so exactly
   one is near peak at any moment. The shift is a fraction of the period on
   purpose: a whole-period offset would align everyone into one pulse. */
.faces .face.shown {
  animation-name: faceFade;
  animation-duration: var(--step);
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-delay: calc(var(--i, 0) * var(--step) / var(--n)) !important;
}

@keyframes faceFade {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .faces .face { animation: none !important; }
  .faces .face.shown { opacity: 1 !important; }
  .faces .face.shown:not(:first-child) { opacity: 0 !important; }
}

.product-card.is-group:hover .faces .face.shown {
  animation-play-state: paused;
}

.group-count {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 2px solid var(--ink-strong);
  border-radius: 999px;
  background: var(--ink-strong);
  color: var(--on-primary);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}

.options { margin-top: clamp(32px, 5vw, 48px); }
.options h2 { margin: 0 0 4px; font-size: 20px; }
.options .muted { margin: 0 0 16px; font-size: 14px; }

.option-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 14px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s ease;
}

.option .face { width: 72px; height: 72px; box-shadow: var(--shadow-card); }

.option:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-card-hover); }

.option.is-current {
  border-color: var(--ink-strong);
  box-shadow: var(--shadow-elev);
  background: var(--accent-soft);
}

.option-name { font-weight: 700; font-size: 15px; }

.option-price {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.preview-empty {
  margin: 0;
  color: var(--faint);
  font-size: 14px;
  text-align: center;
}

.preview-cosmetic img, .art {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line-2);
  background: var(--surface-2);
}

/* Images are painted client side, so they fade in once .shown lands. This is a
   pure opacity fade: a scale here reads as a pop when a row of faces loads. */
img[data-face], img[data-cape], img[data-still] {
  opacity: 0;
  transition: opacity 0.5s ease;
}

img[data-face].shown, img[data-cape].shown, img[data-still].shown {
  opacity: 1;
}

/* ---------- Product page ---------- */

.product-view { margin: 24px 0 clamp(56px, 9vw, 96px); }

.crumbs { margin: 0 0 22px; color: var(--faint); font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-dark); }
.crumbs span { opacity: 0.5; margin: 0 6px; }

.kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.product-layout {
  display: grid;
  direction: ltr;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}

html[dir="rtl"] .product-copy { direction: rtl; text-align: start; }
html[dir="ltr"] .product-copy { direction: ltr; text-align: start; }

.product-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.18;
  color: var(--ink-strong);
}

.product-copy > p { line-height: 1.85; }
.product-copy .price { margin-inline: 0; margin-top: 16px; }
.product-copy .price .now { font-size: clamp(24px, 3vw, 30px); }

.stage { display: flex; flex-direction: column; gap: 18px; }

.still {
  width: min(100%, 300px);
  display: block;
  margin-inline: auto;
  border-radius: var(--radius);
  border: 2px solid var(--line-2);
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(19, 178, 255, 0.16), transparent 68%),
    var(--surface-3);
}

.history { margin: 0; }
.history figcaption {
  margin-bottom: 10px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.buy {
  margin-top: 28px;
  padding: 22px;
  border: 2px solid var(--ink-strong);
  border-radius: var(--radius);
  background: var(--accent-soft);
  box-shadow: var(--shadow-elev);
}

.buy .row { margin-top: 18px; }

.facts { margin-top: 34px; padding-top: 26px; border-top: 2px solid var(--line); }
.facts h2, .buy h2, .stack h2 { margin: 26px 0 8px; font-size: 16px; color: var(--ink-strong); }
.facts h2:first-child, .buy h2:first-child, .stack h2:first-child { margin-top: 0; }
.facts p { margin: 0; }

.banner {
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
}

.banner.bad { background: var(--sale-bg); border-color: var(--sale); color: var(--sale); }

.related { margin-top: clamp(40px, 6vw, 64px); padding-top: clamp(28px, 4vw, 44px); border-top: 2px solid var(--line); }
.related h2 { margin: 0 0 20px; font-size: 21px; font-family: var(--display); }

.empty-hero { text-align: center; padding: clamp(44px, 8vw, 80px) 24px; }
.empty-hero h2 { margin: 0 0 8px; font-size: 22px; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.split { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--accent-dark);
  border-radius: 9px;
  padding: 5px 13px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
}

.badge.live { border-color: var(--deal); background: var(--deal-bg); color: var(--deal); }

.badge.hidden-flag { border-color: var(--sale); background: var(--sale-bg); color: var(--sale); }

.badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

label.toggle {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

label.toggle input { width: 18px; height: 18px; accent-color: var(--sale); cursor: pointer; }

/* ---------- Footer ---------- */

.site-foot {
  width: min(1180px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: 44px 0 56px;
  border-top: 2px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}

.signature { margin: 0; color: var(--ink-strong); font-weight: 700; }

.foot-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.site-foot nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 28px;
  margin: 26px 0;
  padding: 24px 0 0;
  border-top: 2px solid var(--line);
}

.site-foot nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.site-foot nav a:hover { color: var(--accent-dark); }

.site-foot p { line-height: 1.8; max-width: 60rem; }

/* ---------- Admin (kept functional, themed to match) ---------- */

.dropzone {
  border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  background: var(--surface-3);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone #zip-file { margin-top: 16px; max-width: 100%; }
.dropzone .file-name { font-weight: 700; color: var(--muted); }

input[type="file"] {
  font: inherit;
  font-size: 14px;
  padding: 10px;
  border: 2px dashed var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  font: inherit;
  font-weight: 700;
  margin-inline-end: 10px;
  padding: 8px 14px;
  border: 2px solid var(--ink-strong);
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  cursor: pointer;
}

.progress { height: 8px; background: var(--surface-3); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }

#progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-top), var(--accent));
  transition: width 0.25s ease;
}

.checks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }

.checks li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
}

.checks li.ok strong::before { content: "\2713 "; color: var(--deal); }
.checks li.bad strong::before { content: "\2717 "; color: var(--sale); }

.gallery { display: grid; gap: 18px; margin-bottom: 22px; }
.gallery figure { margin: 0; }
.gallery figcaption { margin-bottom: 8px; color: var(--faint); font-size: 13px; font-weight: 700; }

code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--ink-strong);
}

.retry { margin-top: 20px; }
.retry summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.retry summary:hover { color: var(--ink-strong); }

.admin .product-card { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px; }
.admin .product-card h2 { margin: 0; font-size: 17px; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
}

.admin-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 240px;
  min-width: 0;
  text-decoration: none;
  color: var(--ink);
}

.admin-row-main:hover strong { color: var(--accent-dark); }
.admin-row-main .muted { font-size: 13px; }
.admin-row form { margin: 0; }

.toggle-btn { padding: 9px 18px; font-size: 14px; }

/* ---------- Arabic / RTL typography ---------- */

html[dir="rtl"] body { line-height: 1.9; }
html[dir="rtl"] h1, html[dir="rtl"] h2 { line-height: 1.45; }

html[dir="rtl"] .eyebrow,
html[dir="rtl"] .kicker,
html[dir="rtl"] .card-copy .muted,
html[dir="rtl"] .offer-tag,
html[dir="rtl"] .badge,
html[dir="rtl"] .history figcaption {
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--sans);
}

html[dir="rtl"] .home h1 { letter-spacing: 0; max-width: 16em; }
html[dir="rtl"] .brand { letter-spacing: 0.04em; }
html[dir="rtl"] .home-meta span { font-family: var(--mono); }

html[dir="rtl"] .price { justify-content: flex-start; }

/* ---------- Motion ---------- */

/* Entry motion is CSS only: no inline script is allowed by the page CSP, and a
   JS gate would either flash or hide content when scripts fail. `backwards`
   fills the delay, then releases so hover transforms keep working. */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.home > div { animation: rise 0.8s var(--ease) backwards; }
.grid > .product-card, .featured { animation: rise 0.65s var(--ease) backwards; }
.featured { animation-delay: 0.06s; }

.grid > .product-card:nth-child(1) { animation-delay: 0.1s; }
.grid > .product-card:nth-child(2) { animation-delay: 0.16s; }
.grid > .product-card:nth-child(3) { animation-delay: 0.22s; }
.grid > .product-card:nth-child(4) { animation-delay: 0.28s; }
.grid > .product-card:nth-child(5) { animation-delay: 0.34s; }
.grid > .product-card:nth-child(6) { animation-delay: 0.4s; }
.grid > .product-card:nth-child(7) { animation-delay: 0.46s; }
.grid > .product-card:nth-child(8) { animation-delay: 0.52s; }
.grid > .product-card:nth-child(n + 9) { animation-delay: 0.56s; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .featured-card { grid-template-columns: 1fr; }
  [dir="rtl"] .featured-card .preview { border-inline-start: 0; border-inline-end: 0; border-bottom: 2px solid var(--line); }
}

@media (max-width: 860px) {
  :root { --gutter: 18px; }

  .nav { flex-wrap: wrap; padding: 12px var(--gutter); gap: 12px; }
  .nav-toggle { display: inline-flex; }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 0;
  }

  .site-nav a { padding: 12px 14px; }

  .home, .product-layout { grid-template-columns: 1fr; gap: 32px; min-height: 0; }
  .home { padding: 36px 0 56px; }
  .home h1 { max-width: none; }

  .grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
  .nav-end { width: 100%; justify-content: space-between; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .row .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
