@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Gemvello brand — "Editorial Minimalism": warm ivory ground, deep forest
     teal as the primary actionable color, deep garnet reserved for live/
     urgent states. Sourced from the Aug 2026 Claude Design homepage export
     (DESIGN.md — "Gemstone House" token set) so every page shares one
     palette, not just the homepage. */
  --color-bg: #f8f6f0;      /* Ivory — page ground */
  --color-surface: #fcfbf8; /* Warm White — cards, floating elements */
  --color-text: #1c2422;    /* Charcoal */
  --color-accent: #123b36;  /* Deep Forest — primary buttons, active nav, kickers */
  --color-accent-2: #9b4b4b; /* Deep Garnet — live-auction / urgency accent only */
  --color-divider: color-mix(in srgb, #1c2422 35%, transparent);

  /* Tonal ramps on one shared lightness scale. */
  --color-neutral-100: #fcfbf8; /* Warm White */
  --color-neutral-200: #f1f4f3; /* Mist */
  --color-neutral-300: #dde3e0; /* Stone */
  --color-neutral-400: #c0c8c6;
  --color-neutral-500: #97a19e;
  --color-neutral-600: #5f6b68; /* Slate — secondary text/metadata */
  --color-neutral-700: #414847;
  --color-neutral-800: #2a3230;
  --color-neutral-900: #1c2422; /* Charcoal */

  /* Deep Forest → Primary/XK Teal ramp. 200–400 are lifted verbatim from
     the source token set (primary-fixed / inverse-primary / on-primary-
     container) so tints stay authentic rather than interpolated. */
  --color-accent-100: #e7f5f2;
  --color-accent-200: #c1ebe3;
  --color-accent-300: #a5cfc7;
  --color-accent-400: #7da59e;
  --color-accent-500: #3f8f83;
  --color-accent-600: #0b5f59; /* primary-button hover, per source spec */
  --color-accent-700: #0f766e; /* Primary Teal — active state, links */
  --color-accent-800: #123b36; /* Deep Forest — kicker/label text on Ivory */
  --color-accent-900: #081f1b;

  /* Deep Garnet ramp — unused before this pass; now backs "Live Now" /
     ending-soon accents on auction cards, kept out of the main Forest
     ramp so it never leaks into ordinary buttons or links. */
  --color-accent-2-100: #fbeeee;
  --color-accent-2-200: #f3d6d6;
  --color-accent-2-300: #e6b0b0;
  --color-accent-2-400: #cd8686;
  --color-accent-2-500: #b46464;
  --color-accent-2-600: #9b4b4b;
  --color-accent-2-700: #7a3a3a;
  --color-accent-2-800: #5c2c2c;
  --color-accent-2-900: #3d1d1d;

  --font-heading: "Inter", system-ui, sans-serif;
  --font-heading-weight: 700;
  --font-body: "Inter", system-ui, sans-serif;

  --space-1: 4.0px;
  --space-2: 8.0px;
  --space-3: 12.0px;
  --space-4: 16.0px;
  --space-6: 24.0px;
  --space-8: 32.0px;

  /* Rounded (0.5rem) per the source spec — chips/badges get the smaller
     radius, buttons/cards/inputs the standard one, large photo panels the
     bigger one. Replaces the old fully-square (0px) shape language. */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, #1c2422 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #1c2422 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #1c2422 22%, transparent);

  /* Motion — two durations cover every transition/animation in the
     system: fast for small state changes (dropdowns, loading toggles),
     base for the page-load fade. Kept as tokens so nothing sets a
     one-off duration ad hoc. */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.grayscale{filter:grayscale(1) contrast(1.08)}

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS on plain HTML.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr {
  height: 2px; border: 0; margin: var(--space-4) 0;
  background: var(--color-divider);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); justify-content: flex-start; text-align: left; }

/* — loading spinner —
   Opt-in via submit-loading.js on any button carrying data-xk-loading:
   the button stays visible (no text swap, no layout shift risk) and a
   small spinner is inserted before its label. currentColor means it
   never needs to know which button variant it's inside. Also reused
   standalone (no .btn ancestor) for the Explore live-filter overlay. */
.btn.is-loading { cursor: wait; }
.xk-spinner {
  display: inline-block; width: 16px; height: 16px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: xk-spin 0.6s linear infinite;
}
.btn .xk-spinner { width: 14px; height: 14px; }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }

/* — searchable select —
   searchable-select.js progressively enhances the real <select> this
   wraps (Country, and the gemstone Variety/Species/Shape/Cut/Clarity/
   Treatment fields); .is-enhanced only gets added once that JS actually
   runs, so the native select stays visible (and fully functional) if it
   doesn't. */
.xk-searchable-select { position: relative; }
.xk-searchable-select.is-enhanced .xk-searchable-select-native { display: none; }
.xk-searchable-select-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  max-height: 240px; overflow-y: auto; background: var(--color-bg);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); padding: var(--space-1) 0;
}
.xk-searchable-select-option { padding: 8px 12px; font-size: 14px; cursor: pointer; }
.xk-searchable-select-option:hover, .xk-searchable-select-option.is-highlighted { background: var(--color-neutral-100); }
.xk-searchable-select-option.is-active { color: var(--color-accent-800); font-weight: 600; }
.xk-searchable-select-empty { padding: 8px 12px; font-size: 13px; color: var(--color-neutral-600); }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px; white-space: nowrap; flex-shrink: 0;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 2px solid var(--color-divider);
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 2px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* — live pulse dot —
   Deep Garnet indicator next to "Live Now" / "Ending Soon" labels on
   auction sections. Kept as its own tiny component (not folded into .tag)
   since it's a dot, not a chip. */
.xk-live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent-2-600); flex: none;
  animation: xk-pulse 1.6s ease-in-out infinite;
}

/* — "coming soon" placeholder tile —
   Fills out a grid when real inventory is shorter than the design calls
   for. Deliberately inert: no price, seller, or image — just an outline
   tile with honest copy, so it can never be mistaken for a real,
   clickable listing. Matches the surrounding card's aspect ratio via
   whatever wrapper sets it; this only styles the inner content. */
.xk-coming-soon {
  aspect-ratio: 4/3; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-2); text-align: center;
  padding: var(--space-4); border: 1px dashed var(--color-neutral-400);
  border-radius: var(--radius-lg); color: var(--color-neutral-600);
  background: var(--color-neutral-100);
}
.xk-coming-soon-icon { font-size: 22px; opacity: 0.5; }
.xk-coming-soon-label {
  font-family: var(--font-heading); font-weight: 600; font-size: 12px;
  letter-spacing: 0.03em; color: var(--color-neutral-700);
}

/* — page section rhythm —
   Generous vertical spacing + a barely-there divider between stacked
   sections on long, editorial pages (currently the homepage). 80px is the
   source design's section-gap token; 30%-opacity keeps the divider a
   whisper rather than a hard rule. */
.xk-section { padding: 80px 0; border-bottom: 1px solid color-mix(in srgb, var(--color-neutral-300) 30%, transparent); }

/* — listing card grids —
   Shared by the homepage, Explore results, and Seller Profile listings.
   Cards carry their own background/radius now (xk_listing_card()), so the
   gap here is just breathing room between distinct card surfaces, not the
   sole thing separating them — trimmed down from 48px so cards read as a
   tighter grid instead of floating apart. Column count is the one thing
   that changes per breakpoint. */
.xk-card-grid { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 36px; row-gap: 64px; }
.xk-card-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 36px; row-gap: 64px; }

/* — Explore live-filter loading state —
   explore-live-filter.js dims the panel and overlays a spinner while the
   AJAX fragment loads; the transition here is what turns that dim from
   an instant snap into an actual fade. Panel keeps its old content (and
   height) underneath until the new fragment replaces it, so no min-height
   hack is needed. */
.xk-explore-results { position: relative; transition: opacity var(--transition-fast); }
.xk-panel-spinner-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--color-bg) 70%, transparent);
}

/* — responsive breakpoints —
   Two used consistently across every page: 860px (tablet — nav collapses
   to a hamburger, 4/3-col grids drop to 2/1-col, side-by-side page
   sections stack) and 480px (phone — tighter shell padding, form/detail
   grids that survived at tablet width stack too). */
@media (max-width: 860px) {
  .xk-card-grid { grid-template-columns: repeat(2, 1fr); column-gap: 20px; row-gap: 40px; }
  .xk-card-grid-3 { grid-template-columns: 1fr; row-gap: 40px; }
  .table { font-size: 13px; }
  .table th, .table td { padding: var(--space-2) var(--space-2); white-space: nowrap; }
}

/* — motion — */
@keyframes xk-spin { to { transform: rotate(360deg); } }
@keyframes xk-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes xk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (prefers-reduced-motion: reduce) {
  .xk-spinner { animation-duration: 1.5s; }
  .xk-shell { animation: none; }
  .xk-live-dot { animation: none; }
}
