/* =====================================================================
   A.M. ART — Design tokens & core components  (ARCHITECT · read-only)
   ---------------------------------------------------------------------
   Luxury black + gold (from the logo) with warm thread-colour accents.
   Dark-first. Use `.theme-ivory` on a section for a light, paper-like band.

   Class index (components defined here):
     Layout     .container .container--narrow .container--wide .section .section--tight
                .section-head .stack .stack-sm .stack-lg .cluster .grid .grid--auto
                .grid--2 .grid--3 .grid--4 .split
     Type       .eyebrow .display .lede .gold-text .urdu .text-muted .text-center
                .text-sm .text-lg .prose
     Ornament   .thread-divider .ornament .frame-gold
     Buttons    .btn  --primary --secondary --ghost --dark --whatsapp --danger
                      --sm --lg --block --icon  .is-loading
     Forms      .field .label .req .input .select .textarea .hint .field-error
                .check .radio-cards .radio-card .input-group .file-drop
     Cards      .card .card--hover .card--art (.card__media .card__body .card__title
                .card__meta .card__footer) .art-placeholder
     Data       .price .price--sale .price__old .badge (--gold --outline --success
                --warning --danger --muted --thread-<name>) .chip .stat .table-wrap .table
     Feedback   .alert (--success --warning --danger --info) .skeleton .spinner
                .toast-region .toast .empty-state
     Nav        .pagination .breadcrumbs .tabs .skip-link
     Overlay    dialog.dialog (.dialog__header .dialog__body .dialog__footer .dialog__close)
     Media      .ratio-1 .ratio-4-5 .ratio-9-16 .ratio-16-9 .cover
     Utility    .sr-only .hidden .mt-0 .mt-s .mt-m .mt-l .mb-0 .w-full .no-scroll
     Motion     [data-reveal] → .is-visible (set by layout.js)
   ===================================================================== */

:root {
  color-scheme: dark;

  /* ---------- Ink (blacks / charcoals) ---------- */
  --ink-950: #060607;
  --ink-900: #0b0b0c;
  --ink-850: #101012;
  --ink-800: #151518;
  --ink-750: #1a1a1e;
  --ink-700: #202026;
  --ink-600: #2b2b33;
  --ink-500: #3a3a44;
  --ink-400: #55555f;

  /* ---------- Ivory / paper ---------- */
  --ivory-50:  #fdfaf3;
  --ivory-100: #f6efe0;
  --ivory-200: #ebdfc6;
  --ivory-300: #d3c6ab;   /* body-muted on ink: 11:1 */
  --stone-400: #a39883;   /* secondary text on ink: ~6.7:1 */
  --stone-600: #6b6252;   /* secondary text on ivory: ~5.9:1 */

  /* ---------- Gold ---------- */
  --gold-100: #fbf1d2;
  --gold-200: #f6e3a8;
  --gold-300: #ecc977;
  --gold-400: #d4af37;    /* primary accent on ink: ~9.6:1 */
  --gold-500: #b8912a;
  --gold-600: #8f6b1c;
  --gold-700: #6b4f12;    /* gold text on ivory: ~6.8:1 */
  --gold-gradient: linear-gradient(135deg, #f6e3a8 0%, #d4af37 32%, #a67c1f 58%, #f0d58a 82%, #b8912a 100%);
  --gold-gradient-soft: linear-gradient(135deg, rgba(246,227,168,.18), rgba(212,175,55,.08) 50%, rgba(166,124,31,.14));
  --gold-line: linear-gradient(90deg, transparent, var(--gold-400) 20%, var(--gold-200) 50%, var(--gold-400) 80%, transparent);

  /* ---------- Thread accents (the studio's spools) ---------- */
  --thread-rose:    #e46a86;
  --thread-saffron: #f2a541;
  --thread-teal:    #2fb5a5;
  --thread-emerald: #46a96f;
  --thread-plum:    #a36ee8;
  --thread-coral:   #ff7f5e;
  --thread-gold:    var(--gold-400);
  --thread-spectrum: linear-gradient(90deg, var(--thread-rose), var(--thread-saffron), var(--gold-300), var(--thread-emerald), var(--thread-teal), var(--thread-plum));

  /* ---------- Semantic ---------- */
  --color-bg: var(--ink-900);
  --color-bg-deep: var(--ink-950);
  --color-surface: var(--ink-800);
  --color-surface-2: var(--ink-750);
  --color-surface-3: var(--ink-700);
  --color-border: rgba(212, 175, 55, 0.18);
  --color-border-strong: rgba(212, 175, 55, 0.42);
  --color-border-subtle: rgba(255, 255, 255, 0.07);
  --color-text: var(--ivory-100);
  --color-text-strong: var(--ivory-50);
  --color-text-muted: var(--stone-400);
  --color-accent: var(--gold-400);
  --color-accent-strong: var(--gold-300);
  --color-on-accent: var(--ink-900);
  --color-success: #5cc98f;
  --color-warning: #f2b45a;
  --color-danger:  #f07a7a;
  --color-info:    #6db3ec;
  --color-whatsapp: #25d366;
  --color-overlay: rgba(6, 6, 7, 0.78);

  /* ---------- Typography ---------- */
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* fluid type scale (360px → 1280px) */
  --step--2: clamp(0.72rem, 0.70rem + 0.10vw, 0.78rem);
  --step--1: clamp(0.84rem, 0.82rem + 0.12vw, 0.92rem);
  --step-0:  clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1:  clamp(1.18rem, 1.11rem + 0.33vw, 1.38rem);
  --step-2:  clamp(1.40rem, 1.26rem + 0.62vw, 1.80rem);
  --step-3:  clamp(1.68rem, 1.43rem + 1.10vw, 2.40rem);
  --step-4:  clamp(2.02rem, 1.60rem + 1.85vw, 3.20rem);
  --step-5:  clamp(2.45rem, 1.78rem + 2.95vw, 4.30rem);
  --step-6:  clamp(2.90rem, 1.90rem + 4.40vw, 5.60rem);

  --leading-tight: 1.1;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-loose: 1.8;
  --tracking-wide: 0.08em;
  --tracking-wider: 0.18em;

  /* ---------- Spacing ---------- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --space-3xl: 6.5rem;
  --section-pad: clamp(3.5rem, 2rem + 6vw, 7rem);
  --gutter: clamp(16px, 4vw, 32px);
  --container: 1240px;
  --container-narrow: 760px;
  --container-wide: 1440px;
  --header-h: 72px;

  /* ---------- Radii ---------- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* ---------- Shadows ---------- */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.45);
  --shadow-md: 0 8px 24px -8px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.75), 0 6px 18px rgba(0,0,0,.4);
  --shadow-gold: 0 0 0 1px rgba(212,175,55,.35), 0 12px 40px -12px rgba(212,175,55,.35);
  --shadow-inset-gold: inset 0 0 0 1px rgba(212,175,55,.28);

  /* ---------- Focus ---------- */
  --focus-ring: 0 0 0 3px var(--ink-900), 0 0 0 5px var(--gold-300);

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-fast: 150ms;
  --dur: 260ms;
  --dur-slow: 650ms;

  /* ---------- Z-index ---------- */
  --z-header: 50;
  --z-float: 60;
  --z-overlay: 90;
  --z-toast: 100;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0.01ms;
    --dur: 0.01ms;
    --dur-slow: 0.01ms;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Light band (ivory paper) ---------- */
.theme-ivory {
  color-scheme: light;
  --color-bg: var(--ivory-100);
  --color-surface: var(--ivory-50);
  --color-surface-2: #fffdf8;
  --color-surface-3: var(--ivory-200);
  --color-border: rgba(107, 79, 18, 0.22);
  --color-border-strong: rgba(107, 79, 18, 0.45);
  --color-border-subtle: rgba(0,0,0,.07);
  --color-text: #1f1b14;
  --color-text-strong: #0b0b0c;
  --color-text-muted: var(--stone-600);
  --color-accent: var(--gold-700);
  --color-accent-strong: var(--gold-700); /* gold-600 is only 4.28:1 on ivory-200; gold-700 is 6.66:1 */
  --focus-ring: 0 0 0 3px var(--ivory-100), 0 0 0 5px var(--gold-700);
  background: var(--color-bg);
  color: var(--color-text);
}

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video, canvas, iframe { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, li, figcaption { text-wrap: pretty; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-text-strong);
  text-wrap: balance;
  letter-spacing: -0.005em;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
h5, h6 { font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; }

a { color: var(--color-accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; transition: color var(--dur-fast) ease; }
a:hover { color: var(--color-accent-strong); }
strong, b { font-weight: 700; color: var(--color-text-strong); }
small { font-size: var(--step--1); }
hr { border: 0; height: 1px; background: var(--color-border); margin-block: var(--space-l); }
::selection { background: var(--gold-400); color: var(--ink-900); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}
[tabindex="-1"]:focus-visible { box-shadow: none; }

[hidden] { display: none !important; }

/* =====================================================================
   Layout
   ===================================================================== */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.container--wide { max-width: calc(var(--container-wide) + 2 * var(--gutter)); }

.section { padding-block: var(--section-pad); position: relative; }
.section--tight { padding-block: calc(var(--section-pad) * 0.6); }
.section--deep { background: var(--color-bg-deep); }

.section-head { display: grid; gap: var(--space-xs); margin-bottom: var(--space-xl); max-width: 46rem; }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section-head--split { max-width: none; grid-template-columns: 1fr auto; align-items: end; gap: var(--space-m); }
@media (max-width: 640px) { .section-head--split { grid-template-columns: 1fr; } }

.stack > * + * { margin-top: var(--stack-gap, var(--space-s)); }
.stack-sm { --stack-gap: var(--space-2xs); }
.stack-lg { --stack-gap: var(--space-l); }

.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--space-xs)); align-items: center; }

.grid { display: grid; gap: var(--grid-gap, var(--space-m)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 260px)), 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199px) { .grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 959px)  { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px)  { .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); } }

.split { display: grid; gap: var(--space-xl); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
@media (max-width: 899px) { .split { grid-template-columns: minmax(0, 1fr); gap: var(--space-l); } }

/* =====================================================================
   Typography helpers
   ===================================================================== */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }
.section-head--center .eyebrow::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .7; }

.display { font-family: var(--font-display); font-size: var(--step-6); font-weight: 600; line-height: 1.02; letter-spacing: -0.015em; }
.lede { font-size: var(--step-1); color: var(--color-text-muted); line-height: var(--leading-snug); max-width: 40rem; }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: var(--step--1); }
.text-lg { font-size: var(--step-1); }
.italic-display { font-family: var(--font-display); font-style: italic; font-weight: 500; }

.gold-text {
  color: var(--gold-300);
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@media (forced-colors: active) { .gold-text { -webkit-text-fill-color: currentColor; background: none; } }

.urdu {
  font-family: var(--font-urdu);
  direction: rtl;
  line-height: 2.1;
  color: var(--gold-200);
  font-size: var(--step-1);
}

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: .35em; }

/* =====================================================================
   Ornaments
   ===================================================================== */
.thread-divider {
  height: 2px; border: 0; margin-block: var(--space-l);
  background: var(--thread-spectrum);
  opacity: .85;
  border-radius: 2px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.ornament {
  display: flex; align-items: center; gap: var(--space-s);
  color: var(--color-accent);
}
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: var(--gold-line); }
.frame-gold {
  position: relative;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-inset-gold), var(--shadow-lg);
}
.frame-gold::after {
  content: ""; position: absolute; inset: 8px; border-radius: calc(var(--radius-lg) - 6px);
  border: 1px solid rgba(236, 201, 119, .35); pointer-events: none;
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
  --btn-bg: var(--color-surface-2);
  --btn-fg: var(--color-text-strong);
  --btn-border: var(--color-border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 46px;
  padding: 0.7em 1.4em;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.1;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out),
              background-color var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { color: var(--btn-fg); border-color: var(--color-accent); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

.btn--primary {
  --btn-fg: var(--ink-900);
  --btn-border: transparent;
  background: var(--gold-gradient);
  background-size: 180% 180%;
  background-position: 0% 50%;
  box-shadow: 0 6px 20px -8px rgba(212,175,55,.55);
}
.btn--primary:hover { --btn-fg: var(--ink-900); background-position: 100% 50%; box-shadow: var(--shadow-gold); }
.btn--secondary { --btn-bg: transparent; --btn-fg: var(--color-accent-strong); --btn-border: var(--color-border-strong); }
.btn--secondary:hover { --btn-bg: rgba(212,175,55,.08); --btn-fg: var(--gold-200); }
.theme-ivory .btn--secondary:hover { --btn-fg: var(--gold-700); }
.btn--ghost { --btn-bg: transparent; --btn-border: transparent; --btn-fg: var(--color-text); }
.btn--ghost:hover { --btn-bg: rgba(255,255,255,.05); border-color: transparent; }
.theme-ivory .btn--ghost:hover { --btn-bg: rgba(107,79,18,.08); }
.btn--dark { --btn-bg: var(--ink-900); --btn-fg: var(--gold-200); --btn-border: var(--ink-600); }
.btn--whatsapp { --btn-bg: var(--color-whatsapp); --btn-fg: #06210f; --btn-border: transparent; }
.btn--whatsapp:hover { --btn-fg: #06210f; filter: brightness(1.06); border-color: transparent; }
.btn--danger { --btn-bg: transparent; --btn-fg: var(--color-danger); --btn-border: rgba(240,122,122,.5); }
.btn--danger:hover { --btn-bg: rgba(240,122,122,.1); --btn-fg: #ffb0b0; border-color: var(--color-danger); }

.btn--sm { min-height: 36px; padding: 0.5em 1em; font-size: var(--step--2); }
.btn--lg { min-height: 54px; padding: 0.9em 1.9em; font-size: var(--step-0); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 44px; min-height: 44px; border-radius: 50%; }
.btn--icon.btn--sm { width: 36px; min-height: 36px; }

.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 1.1em; height: 1.1em; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent;
  animation: spin .7s linear infinite;
}

/* =====================================================================
   Forms
   ===================================================================== */
.field { display: grid; gap: 0.4rem; }
.field + .field { margin-top: var(--space-s); }
.label { font-size: var(--step--1); font-weight: 600; color: var(--color-text-strong); letter-spacing: 0.01em; }
.label .req, .req { color: var(--gold-300); margin-left: 0.15em; }
.theme-ivory .label .req, .theme-ivory .req { color: var(--gold-700); }
.hint { font-size: var(--step--1); color: var(--color-text-muted); }
.field-error { font-size: var(--step--1); color: var(--color-danger); font-weight: 600; }
.field-error:empty { display: none; }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.95rem;
  background: var(--color-surface-2);
  color: var(--color-text-strong);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem; /* ≥16px prevents iOS zoom */
  line-height: 1.4;
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background-color var(--dur-fast) ease;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--color-text-muted); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--color-border-strong); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  border-color: var(--color-accent);
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(240,122,122,.18);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.textarea { min-height: 130px; resize: vertical; }
.select {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d4af37' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
}
.select option { background: var(--ink-800); color: var(--ivory-100); }
input[type="date"].input { color-scheme: dark; }
.theme-ivory input[type="date"].input { color-scheme: light; }

.input-group { display: flex; gap: var(--space-2xs); }
.input-group > .input { flex: 1; min-width: 0; }

.check { display: inline-flex; align-items: flex-start; gap: 0.6rem; cursor: pointer; line-height: 1.4; min-height: 44px; align-items: center; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--gold-400); flex: none; }

.radio-cards { display: grid; gap: var(--space-xs); grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); border: 0; padding: 0; }
.radio-card { position: relative; display: block; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.radio-card__body {
  display: grid; gap: 0.25rem; height: 100%;
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.radio-card__title { font-weight: 700; color: var(--color-text-strong); }
.radio-card__desc { font-size: var(--step--1); color: var(--color-text-muted); }
.radio-card:hover .radio-card__body { border-color: var(--color-border-strong); }
.radio-card input:checked + .radio-card__body { border-color: var(--color-accent); background: var(--gold-gradient-soft); box-shadow: var(--shadow-inset-gold); }
.radio-card input:focus-visible + .radio-card__body { box-shadow: var(--focus-ring); }

.file-drop {
  display: grid; place-items: center; gap: var(--space-2xs); text-align: center;
  padding: var(--space-l) var(--space-m);
  border: 1.5px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  background: rgba(212,175,55,.03);
  color: var(--color-text-muted);
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.file-drop.is-dragover, .file-drop:focus-within { border-color: var(--color-accent); background: rgba(212,175,55,.07); }

fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

/* =====================================================================
   Cards
   ===================================================================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-m);
  box-shadow: var(--shadow-sm);
}
.card--hover { transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) ease; }
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--color-border); }

.card--art {
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  position: relative;
  background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
}
.card--art .card__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--ink-700); }
.card--art .card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease-out); }
.card--art:hover .card__media img { transform: scale(1.045); }
.card--art .card__badges { position: absolute; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 1; }
.card__body { padding: var(--space-s) var(--space-m) var(--space-m); display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.35rem; flex: 1; align-content: start; }
.card__title { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; line-height: 1.15; color: var(--color-text-strong); }
.card__title a { color: inherit; text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; } /* whole-card link */
.card__title a:focus-visible { box-shadow: none; }
.card--art:has(.card__title a:focus-visible) { box-shadow: var(--focus-ring); }
.card__meta { font-size: var(--step--1); color: var(--color-text-muted); }
.card__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); margin-top: auto; padding-top: var(--space-2xs); position: relative; z-index: 1; }

.art-placeholder { width: 100%; height: 100%; object-fit: cover; background: var(--ink-800); }

/* =====================================================================
   Price, badges, chips, stats
   ===================================================================== */
.price { font-family: var(--font-body); font-weight: 700; color: var(--color-accent-strong); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.theme-ivory .price { color: var(--gold-700); }
.price--lg { font-size: var(--step-2); }
.price--sale { color: var(--thread-coral); }
.price__old { color: var(--color-text-muted); text-decoration: line-through; font-weight: 500; margin-left: 0.5em; font-size: .9em; }
.price__from { font-weight: 500; color: var(--color-text-muted); margin-right: .3em; font-size: .85em; text-transform: lowercase; }

.badge {
  --badge-bg: rgba(255,255,255,.08);
  --badge-fg: var(--color-text-strong);
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.28em 0.7em;
  border-radius: var(--radius-pill);
  background: var(--badge-bg);
  color: var(--badge-fg);
  border: 1px solid transparent;
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
}
.badge--gold { --badge-bg: var(--gold-gradient); --badge-fg: var(--ink-900); background: var(--gold-gradient); }
.badge--outline { --badge-bg: transparent; --badge-fg: var(--color-accent-strong); border-color: var(--color-border-strong); }
.badge--success { --badge-bg: rgba(92,201,143,.16); --badge-fg: #8fe3b6; }
.badge--warning { --badge-bg: rgba(242,180,90,.16); --badge-fg: #f8cf8f; }
.badge--danger  { --badge-bg: rgba(240,122,122,.16); --badge-fg: #ffb0b0; }
.badge--info    { --badge-bg: rgba(109,179,236,.16); --badge-fg: #a9d4f7; }
.badge--muted   { --badge-bg: rgba(255,255,255,.06); --badge-fg: var(--color-text-muted); }
.badge--dark    { --badge-bg: rgba(6,6,7,.78); --badge-fg: var(--gold-200); border-color: rgba(212,175,55,.3); backdrop-filter: blur(6px); }
.theme-ivory .badge--outline { --badge-fg: var(--gold-700); }
.theme-ivory .badge--success { --badge-fg: #1f6b43; }
.theme-ivory .badge--warning { --badge-fg: #7a4d07; }
.theme-ivory .badge--danger  { --badge-fg: #9b2c2c; }

/* thread accents: dot + tinted text, used for category chips */
[class*="badge--thread-"]::before, [class*="chip--thread-"]::before { content: ""; flex: none; width: .55em; height: .55em; border-radius: 50%; background: var(--thread, var(--gold-400)); }
.badge--thread-rose, .chip--thread-rose { --thread: var(--thread-rose); }
.badge--thread-saffron, .chip--thread-saffron { --thread: var(--thread-saffron); }
.badge--thread-teal, .chip--thread-teal { --thread: var(--thread-teal); }
.badge--thread-emerald, .chip--thread-emerald { --thread: var(--thread-emerald); }
.badge--thread-plum, .chip--thread-plum { --thread: var(--thread-plum); }
.badge--thread-coral, .chip--thread-coral { --thread: var(--thread-coral); }
.badge--thread-gold, .chip--thread-gold { --thread: var(--gold-400); }

.chip {
  display: inline-flex; align-items: center; gap: 0.5em;
  min-height: 40px;
  padding: 0.45em 1em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.chip:hover { border-color: var(--color-border-strong); color: var(--color-text-strong); }
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip.is-active {
  background: var(--gold-gradient-soft); border-color: var(--color-accent); color: var(--gold-200);
}
.chip__count { font-size: var(--step--2); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

.stat { display: grid; gap: 0.2rem; }
.stat__value { font-family: var(--font-display); font-size: var(--step-4); font-weight: 600; line-height: 1; color: var(--color-accent-strong); font-variant-numeric: lining-nums tabular-nums; }
.stat__label { font-size: var(--step--1); color: var(--color-text-muted); letter-spacing: .04em; }

/* =====================================================================
   Tables
   ===================================================================== */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 640px; }
.table th, .table td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border-subtle); vertical-align: middle; }
.table th { font-size: var(--step--2); text-transform: uppercase; letter-spacing: .1em; color: var(--color-text-muted); font-weight: 700; background: var(--color-surface-2); position: sticky; top: 0; }
.table tbody tr:hover { background: rgba(212,175,55,.04); }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* =====================================================================
   Feedback
   ===================================================================== */
.alert {
  --alert-c: var(--color-info);
  display: flex; gap: var(--space-xs); align-items: flex-start;
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--alert-c) 45%, transparent);
  background: color-mix(in srgb, var(--alert-c) 10%, transparent);
  color: var(--color-text-strong);
}
.alert--success { --alert-c: var(--color-success); }
.alert--warning { --alert-c: var(--color-warning); }
.alert--danger  { --alert-c: var(--color-danger); }
.alert--info    { --alert-c: var(--color-info); }

.skeleton {
  position: relative; overflow: hidden;
  background: var(--ink-750);
  border-radius: var(--radius-sm);
  min-height: 1em;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,.07), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton--text { height: .9em; margin-block: .35em; }
.skeleton--media { aspect-ratio: 4 / 5; border-radius: var(--radius-lg); }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid rgba(212,175,55,.25); border-top-color: var(--gold-400);
  animation: spin .8s linear infinite;
}

.empty-state {
  display: grid; justify-items: center; gap: var(--space-s); text-align: center;
  padding: var(--space-2xl) var(--space-m);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text-muted);
}
.empty-state h3 { color: var(--color-text-strong); }

.toast-region {
  position: fixed; z-index: var(--z-toast);
  right: var(--gutter); bottom: var(--gutter);
  display: grid; gap: var(--space-2xs);
  width: min(380px, calc(100vw - 2 * var(--gutter)));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-md);
  background: var(--ink-750);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  color: var(--color-text-strong);
  font-size: var(--step--1);
  animation: toast-in var(--dur) var(--ease-out);
}
.toast--success { border-color: rgba(92,201,143,.55); }
.toast--danger  { border-color: rgba(240,122,122,.6); }

/* =====================================================================
   Navigation bits
   ===================================================================== */
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 1000;
  padding: 0.75rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--gold-400); color: var(--ink-900); font-weight: 700; text-decoration: none;
}
.skip-link:focus, .skip-link:focus-visible { top: 12px; color: var(--ink-900); }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--space-xl); list-style: none; padding: 0; }
.pagination a, .pagination button, .pagination span {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .8rem;
  border-radius: var(--radius-pill); border: 1px solid var(--color-border);
  background: transparent; color: var(--color-text); text-decoration: none; font-weight: 600; font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
}
.pagination a:hover, .pagination button:hover { border-color: var(--color-accent); color: var(--gold-200); }
.pagination [aria-current="page"] { background: var(--gold-gradient); color: var(--ink-900); border-color: transparent; }
.pagination [disabled], .pagination [aria-disabled="true"] { opacity: .4; pointer-events: none; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; font-size: var(--step--1); color: var(--color-text-muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: .4rem; opacity: .5; }
.breadcrumbs a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs [aria-current="page"] { color: var(--color-text-strong); }

.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--color-border-subtle); scrollbar-width: thin; }
.tabs [role="tab"], .tabs a, .tabs button {
  padding: .75rem 1rem; min-height: 44px; border: 0; background: none; color: var(--color-text-muted);
  font-weight: 600; font-size: var(--step--1); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs [aria-selected="true"], .tabs [aria-current="page"], .tabs .is-active { color: var(--gold-200); border-bottom-color: var(--gold-400); }

/* =====================================================================
   Dialog
   ===================================================================== */
dialog.dialog {
  width: min(560px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--ink-800);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
  overflow: auto;
}
dialog.dialog--wide { width: min(900px, calc(100vw - 2 * var(--gutter))); }
dialog.dialog--media { width: min(420px, calc(100vw - 2 * var(--gutter))); background: #000; }
dialog.dialog::backdrop { background: var(--color-overlay); backdrop-filter: blur(4px); }
dialog.dialog[open] { animation: dialog-in var(--dur) var(--ease-out); }
.dialog__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-s); padding: var(--space-m) var(--space-m) 0; }
.dialog__header h2 { font-size: var(--step-2); }
.dialog__body { padding: var(--space-m); }
.dialog__footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2xs); padding: 0 var(--space-m) var(--space-m); }
.dialog__close { flex: none; }

/* =====================================================================
   Media helpers
   ===================================================================== */
.ratio-1 { aspect-ratio: 1 / 1; }
.ratio-4-5 { aspect-ratio: 4 / 5; }
.ratio-9-16 { aspect-ratio: 9 / 16; }
.ratio-16-9 { aspect-ratio: 16 / 9; }
.cover { width: 100%; height: 100%; object-fit: cover; }

/* =====================================================================
   Utilities
   ===================================================================== */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mt-s { margin-top: var(--space-s) !important; }
.mt-m { margin-top: var(--space-m) !important; }
.mt-l { margin-top: var(--space-l) !important; }
.mt-xl { margin-top: var(--space-xl) !important; }
.mb-0 { margin-bottom: 0 !important; }
.w-full { width: 100%; }
.no-scroll { overflow: hidden; }
.nowrap { white-space: nowrap; }

/* =====================================================================
   Reveal on scroll (layout.js toggles .is-visible)
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
  .js [data-reveal].is-visible { opacity: 1; transform: none; }
  .js [data-reveal="fade"] { transform: none; }
}

/* =====================================================================
   Keyframes
   ===================================================================== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes thread-draw { from { stroke-dashoffset: var(--thread-length, 1000); } to { stroke-dashoffset: 0; } }
@keyframes shine { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }

/* Windows high contrast */
@media (forced-colors: active) {
  .btn, .chip, .badge, .input, .select, .textarea { border: 1px solid CanvasText; }
  :focus-visible { outline: 2px solid Highlight; }
}
