/* ─────────────────────────────────────────────────────────────────────
   Blackstone Atelier · Couture des Pierres
   Aesthetic direction: French haute-couture editorial × master jeweler
   Display: Fraunces · Body: Inter Tight · Engravings: JetBrains Mono
   ───────────────────────────────────────────────────────────────────── */

:root {
  /* Stone & ink */
  --obsidian: #0c0a08;
  --smoke:    #14110e;
  --ink:      #2a241e;
  --char:     #1a1612;

  /* Parchment */
  --parchment:    #f3e9d5;
  --parchment-2:  #ece0c5;
  --bone:         #fbf4e6;
  --linen:        #fdf7eb;

  /* Brass family */
  --brass-light:  #f5dba1;
  --brass:        #c9a14a;
  --brass-deep:   #8a6731;
  --brass-shadow: #3a2a16;
  --vein:         #e6c98a;

  /* Accents */
  --patina:    #5d6e57;
  --bordeaux:  #6b2f2c;
  --teal:      #247f84;
  --teal-2:    #a9d5d0;

  /* States */
  --danger:    #a6473f;
  --success:   #3f7a58;
  --review:    #c9a14a;

  /* Lines */
  --line-warm:   rgba(122, 90, 50, 0.22);
  --line-deep:   rgba(58, 42, 22, 0.42);
  --line-light:  rgba(255, 248, 239, 0.16);
  --line-vein:   rgba(230, 201, 138, 0.32);

  /* Shadows */
  --shadow-soft:  0 8px 28px rgba(28, 20, 14, 0.10);
  --shadow:       0 18px 55px rgba(28, 20, 14, 0.16);
  --shadow-deep:  0 36px 90px rgba(12, 9, 7, 0.34);
  --shadow-brass: 0 14px 40px rgba(122, 86, 38, 0.32), 0 2px 0 rgba(255, 230, 178, 0.55) inset;

  /* Type */
  --serif: "Fraunces", "Cormorant Garamond", Georgia, serif;
  --sans:  "Inter Tight", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius:       10px;
  --radius-lg:    14px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--obsidian); }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  background:
    radial-gradient(1200px 480px at 18% 0%, rgba(201, 161, 74, 0.10), transparent 70%),
    radial-gradient(900px 420px at 88% 6%, rgba(36, 127, 132, 0.07), transparent 65%),
    linear-gradient(180deg,
      rgba(12, 10, 8, 0.98) 0,
      rgba(20, 17, 14, 0.96) 480px,
      rgba(243, 233, 213, 0.99) 481px,
      var(--parchment-2) 100%);
}

/* Ambient slab as faint backdrop above the seam */
.ambient-slab {
  position: fixed;
  inset: 0 0 auto 0;
  height: 540px;
  z-index: -3;
  pointer-events: none;
  opacity: 0.42;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, 0.18), rgba(10, 8, 6, 0.92) 95%),
    url("visuals/blackstone-slab-signature.png") center top / cover no-repeat;
}

/* Paper grain across the parchment portion */
.grain-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    radial-gradient(rgba(74, 54, 28, 0.10) 1px, transparent 1.2px),
    radial-gradient(rgba(255, 244, 218, 0.06) 1px, transparent 1.5px);
  background-size: 3px 3px, 5px 5px;
  mix-blend-mode: overlay;
}

/* Cursor spotlight — gold halo that follows cursor on the dark hero only */
.cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 380px;
  margin: -190px 0 0 -190px;
  pointer-events: none;
  z-index: 4;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(245, 219, 161, 0.18) 0, rgba(201, 161, 74, 0.05) 38%, transparent 70%);
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
  transform: translate3d(var(--cx, 0), var(--cy, 0), 0);
}
body.is-on-slab .cursor-spotlight { opacity: 1; }

/* ─── Buttons ──────────────────────────────────────────────────────── */

button, input, select, textarea {
  font-family: inherit;
  letter-spacing: 0.01em;
}

button {
  position: relative;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-warm);
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(245, 233, 210, 0.92));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 1px 2px rgba(28, 20, 14, 0.08);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform 0.22s cubic-bezier(.2,.7,.2,1),
              border-color 0.22s ease,
              background 0.22s ease,
              box-shadow 0.22s ease,
              color 0.22s ease;
}
button > span { display: inline-block; }

button:hover {
  transform: translateY(-1px);
  border-color: var(--brass);
  background: linear-gradient(180deg, rgba(255, 252, 245, 1), rgba(245, 219, 161, 0.9));
  box-shadow: 0 12px 30px rgba(122, 86, 38, 0.22), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
button:active { transform: translateY(0); }
button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 1px var(--bone),
    0 0 0 3px var(--brass),
    0 12px 30px rgba(122, 86, 38, 0.24);
}

button.primary {
  color: var(--bone);
  border-color: rgba(245, 219, 161, 0.35);
  background:
    radial-gradient(120% 180% at 30% -10%, rgba(245, 219, 161, 0.42), transparent 55%),
    linear-gradient(180deg, #2a2118, #14110e);
  box-shadow: 0 12px 28px rgba(8, 6, 4, 0.4), 0 1px 0 rgba(245, 219, 161, 0.25) inset;
}
button.primary:hover {
  background:
    radial-gradient(120% 180% at 30% -10%, rgba(245, 219, 161, 0.55), transparent 55%),
    linear-gradient(180deg, #34281c, #1a1612);
  border-color: var(--brass);
}

button.secondary {
  color: var(--char);
  border-color: rgba(122, 86, 38, 0.42);
  background: linear-gradient(180deg, #f5dba1, #d4ad5e);
  box-shadow: var(--shadow-brass);
}
button.secondary:hover {
  background: linear-gradient(180deg, #fbe7b4, #d9b465);
  border-color: var(--brass-deep);
}

button.ghost {
  color: var(--bone);
  border-color: rgba(245, 219, 161, 0.30);
  background: rgba(255, 250, 240, 0.04);
  backdrop-filter: blur(6px);
}
button.ghost:hover {
  color: var(--bone);
  background: rgba(245, 219, 161, 0.10);
  border-color: var(--brass);
}

/* ─── Header ───────────────────────────────────────────────────────── */

.app-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 36px 16px;
  color: var(--bone);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 280px;
}

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 18px;
  text-decoration: none;
  transition:
    transform 0.55s cubic-bezier(.2, .8, .2, 1),
    filter   0.55s cubic-bezier(.2, .8, .2, 1);
  will-change: transform, filter;
}
.brand img {
  width: 120px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.5));
  transition: filter 0.55s cubic-bezier(.2, .8, .2, 1);
}
.brand-mark:hover {
  transform: translateY(-2px) scale(1.06);
}
.brand-mark:hover img {
  filter:
    drop-shadow(0 14px 28px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 14px rgba(245, 219, 161, 0.35))
    brightness(1.08);
}
.brand-mark:focus-visible {
  outline: 1px solid var(--brass-light);
  outline-offset: 4px;
}

.brand-text { display: grid; gap: 4px; }

.brand-eyebrow {
  display: inline-block;
  color: var(--vein);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.85;
}
.brand-eyebrow em {
  font-style: italic;
  color: var(--brass-light);
}

.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  font-variation-settings: "opsz" 96, "SOFT" 100;
  line-height: 1.0;
  color: var(--bone);
  letter-spacing: -0.01em;
}

.brand p {
  margin: 0;
  color: rgba(245, 219, 161, 0.78);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-vein);
  border-radius: 999px;
  color: var(--vein);
  background: rgba(0, 0, 0, 0.28);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 8px rgba(201, 161, 74, 0.6);
}
.status-pill.dark {
  color: var(--char);
  border-color: var(--line-warm);
  background: var(--bone);
}
.status-pill.dark::before {
  background: var(--patina);
  box-shadow: 0 0 8px rgba(93, 110, 87, 0.5);
}

/* ─── Hero / Signature stage ───────────────────────────────────────── */

.signature-stage {
  position: relative;
  z-index: 3;
  max-width: 1500px;
  margin: 0 auto;
  padding: 8px 36px 22px;
}

.signature-slab {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(245, 219, 161, 0.22);
  border-radius: var(--radius-lg);
  background: var(--obsidian);
  box-shadow:
    var(--shadow-deep),
    0 1px 0 rgba(245, 219, 161, 0.18) inset,
    0 -1px 0 rgba(0, 0, 0, 0.5) inset;
  isolation: isolate;
}

.signature-slab > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.95;
  transform: scale(1.02);
}

.signature-slab::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(8, 6, 4, 0.78) 0, rgba(8, 6, 4, 0.10) 46%, rgba(8, 6, 4, 0.62) 100%),
    linear-gradient(180deg, rgba(255, 248, 239, 0.04), rgba(0, 0, 0, 0.30));
}

#slabSignatureCanvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.slab-sheen {
  position: absolute;
  inset: -25% -10%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 0, rgba(255, 248, 239, 0.16) 42%, transparent 55%);
  transform: translateX(-45%);
  animation: slabSheen 9s ease-in-out infinite;
  mix-blend-mode: screen;
}

@keyframes slabSheen {
  0%, 44%   { transform: translateX(-58%); opacity: 0; }
  55%       { opacity: 0.7; }
  86%, 100% { transform: translateX(48%); opacity: 0; }
}

/* Brass corner brackets — like cinematographer's framing marks */
.slab-corners { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px solid var(--vein);
  opacity: 0.5;
}
.corner.tl { top: 18px; left: 18px;    border-right: 0; border-bottom: 0; }
.corner.tr { top: 18px; right: 18px;   border-left: 0;  border-bottom: 0; }
.corner.bl { bottom: 18px; left: 18px; border-right: 0; border-top: 0; }
.corner.br { bottom: 18px; right: 18px; border-left: 0; border-top: 0; }

/* Hero copy */
.signature-copy {
  position: relative;
  z-index: 4;
  display: grid;
  align-content: center;
  min-height: 360px;
  max-width: 780px;
  padding: 42px 44px;
  color: var(--bone);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
  padding: 6px 12px;
  border: 1px solid rgba(230, 201, 138, 0.42);
  border-radius: 999px;
  color: var(--vein);
  background: rgba(0, 0, 0, 0.32);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

.hero-headline {
  margin: 0;
  font-family: var(--serif);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  font-weight: 400;
  font-size: clamp(42px, 6.4vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.022em;
  color: var(--bone);
}
.hero-headline .word {
  display: block;
  overflow: hidden;
  font-style: italic;
}
.hero-headline .word:nth-child(2) { font-style: normal; color: var(--vein); }
.hero-headline .word:nth-child(3) { font-style: italic; }
.hero-headline .word > span {
  display: inline-block;
  transform: translateY(110%);
  animation: heroRise 1.1s cubic-bezier(.2,.8,.2,1) forwards;
}
.hero-headline .word:nth-child(1) > span { animation-delay: 0.10s; }
.hero-headline .word:nth-child(2) > span { animation-delay: 0.28s; }
.hero-headline .word:nth-child(3) > span { animation-delay: 0.46s; }

@keyframes heroRise {
  to { transform: translateY(0); }
}

.hero-sub {
  max-width: 460px;
  margin: 18px 0 0;
  color: rgba(251, 244, 230, 0.78);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.5;
  font-variation-settings: "opsz" 14, "SOFT" 100;
  opacity: 0;
  transform: translateY(8px);
  animation: heroFade 0.9s ease forwards 0.7s;
}
@keyframes heroFade { to { opacity: 1; transform: translateY(0); } }

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  opacity: 0;
  animation: heroFade 0.9s ease forwards 0.9s;
}
.meta-rule {
  flex: 1 1 0;
  max-width: 90px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--vein) 50%, transparent);
}
.meta-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--vein);
  text-transform: uppercase;
}

/* ─── ✦ SIGNATURE FEATURE: The Veined Compass ✦ ──────────────────── */

.veined-compass {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 6%;
  width: 320px;
  height: 320px;
  margin-top: -160px;
  perspective: 900px;
  /* Entry fade — transform is intentionally NOT animated so JS-driven
     drag/positioning isn't overridden by the keyframe */
  animation: compassEnter 1.2s ease-out forwards 0.4s;
  opacity: 0;
  user-select: none;
  cursor: grab;
  touch-action: none;
}
.veined-compass.dragging { cursor: grabbing; transition: none !important; }
.veined-compass.dragging .compass-body { transition: none !important; }

@keyframes compassEnter {
  to { opacity: 1; }
}

.compass-shadow {
  position: absolute;
  inset: 14% 10% 6% 10%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 70%);
  filter: blur(10px);
  opacity: 0.65;
  pointer-events: none;
}

.compass-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform-style: preserve-3d;
  transition: transform 0.18s cubic-bezier(.2,.7,.2,1);
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
}
.compass-body::after {
  /* Brass rim highlight, cast above-center, like a real polished metal piece */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 28% 18%, rgba(255, 244, 218, 0.32), transparent 38%),
    radial-gradient(ellipse at 72% 86%, rgba(0, 0, 0, 0.24), transparent 42%);
  mix-blend-mode: screen;
}

.compass-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Outer ring rotates very slowly (idle, signaling life) */
.outer-ring { animation: outerSpin 90s linear infinite; }
@keyframes outerSpin { to { transform: rotate(360deg); } }

/* Pricing arc kept upright (rotation handled by SVG transform) */

/* Confidence dial — needle is updated by JS; ring is static */

/* Faceted gemstone core */
.compass-gem {
  position: absolute;
  width: 24%;
  height: 24%;
  top: 38%;
  left: 38%;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)) drop-shadow(0 0 12px rgba(245, 219, 161, 0.45));
  animation: gemRotate 18s linear infinite, gemPulse 3.4s ease-in-out infinite;
  transform-origin: center;
  pointer-events: none;
}
@keyframes gemRotate {
  to { transform: rotate(360deg); }
}
@keyframes gemPulse {
  0%, 100% { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)) drop-shadow(0 0 12px rgba(245, 219, 161, 0.4)); }
  50%      { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)) drop-shadow(0 0 22px rgba(245, 219, 161, 0.85)); }
}

/* Cardinal live readouts */
.compass-cardinal {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 3px;
  text-align: center;
  pointer-events: none;
  color: var(--bone);
}
.cardinal-label {
  display: block;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--vein);
  opacity: 0.78;
}
.compass-cardinal strong {
  display: block;
  font-family: var(--serif);
  font-variation-settings: "opsz" 96, "SOFT" 30;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  color: var(--bone);
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cardinal-n { top: 24%;    left: 50%; transform: translateX(-50%); }
.cardinal-s { bottom: 22%; left: 50%; transform: translateX(-50%); }
.cardinal-e { right: 16%;  top: 50%; transform: translateY(-50%); }
.cardinal-w { left: 16%;   top: 50%; transform: translateY(-50%); }

/* Fade cardinals when compass is "opened" so quick-action buttons take focus */
.veined-compass.is-open .compass-cardinal,
.veined-compass.is-open .compass-confidence {
  opacity: 0.18;
  transition: opacity 0.35s ease;
}
.compass-cardinal, .compass-confidence { transition: opacity 0.35s ease; }

.compass-confidence {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 11px;
  border: 1px solid rgba(230, 201, 138, 0.38);
  border-radius: 999px;
  background: rgba(8, 6, 4, 0.6);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--vein);
  pointer-events: none;
}

/* Quick-action ring — revealed when compass is "opened" */
.compass-actions {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.veined-compass.is-open .compass-actions { opacity: 1; pointer-events: auto; }

.compass-actions .qa {
  position: absolute;
  width: 56px;
  height: 56px;
  min-height: auto;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(245, 219, 161, 0.55);
  background: linear-gradient(180deg, #1c1611, #0c0a08);
  color: var(--vein);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(245, 219, 161, 0.2) inset;
  transform: scale(0) translate(-50%, -50%);
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(.2,.9,.2,1);
}
.veined-compass.is-open .qa-1 { transform: translate(-50%, -50%) translate(0, -130px); }
.veined-compass.is-open .qa-2 { transform: translate(-50%, -50%) translate(130px, 0); }
.veined-compass.is-open .qa-3 { transform: translate(-50%, -50%) translate(0, 130px); }
.veined-compass.is-open .qa-4 { transform: translate(-50%, -50%) translate(-130px, 0); }
.compass-actions .qa { top: 50%; left: 50%; }
.compass-actions .qa:hover {
  border-color: var(--brass-light);
  background: linear-gradient(180deg, #2a2118, #14110e);
  color: var(--bone);
  transform: translate(-50%, -50%) translate(var(--tx, 0), var(--ty, 0)) scale(1.07);
}
.veined-compass.is-open .qa-1:hover { --tx: 0; --ty: -130px; }
.veined-compass.is-open .qa-2:hover { --tx: 130px; --ty: 0; }
.veined-compass.is-open .qa-3:hover { --tx: 0; --ty: 130px; }
.veined-compass.is-open .qa-4:hover { --tx: -130px; --ty: 0; }

/* ─── Tabs (engraved brass tray with glide underline) ──────────────── */

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  gap: 4px;
  max-width: 1500px;
  margin: 14px auto 0;
  padding: 0 36px;
  background:
    linear-gradient(180deg, rgba(243, 233, 213, 0.85), rgba(243, 233, 213, 0.62));
  backdrop-filter: blur(14px);
}

.tab-rail {
  position: absolute;
  left: 36px;
  right: 36px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass) 12%, var(--brass-deep) 50%, var(--brass) 88%, transparent);
  opacity: 0.45;
  pointer-events: none;
}

.tab-glide {
  position: absolute;
  bottom: 0;
  left: 36px;
  width: 110px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--brass-light), var(--brass), var(--brass-deep));
  box-shadow: 0 0 14px rgba(201, 161, 74, 0.6);
  transition: left 0.55s cubic-bezier(.2,.85,.2,1), width 0.55s cubic-bezier(.2,.85,.2,1);
  pointer-events: none;
}

.tab {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-height: 50px;
  min-width: 110px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-variation-settings: "opsz" 14, "SOFT" 30;
  font-weight: 500;
  font-size: 15.5px;
  letter-spacing: 0.01em;
  box-shadow: none;
  transition: color 0.25s ease, transform 0.25s ease;
}
.tab:hover { color: var(--brass-deep); background: transparent; transform: translateY(-1px); box-shadow: none; border-color: transparent; }
.tab .tab-num {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--brass);
  letter-spacing: 0.18em;
  opacity: 0.8;
  text-transform: lowercase;
  font-variant: small-caps;
}
.tab .tab-label { font-style: italic; }
.tab.active { color: var(--char); background: transparent; border: 0; }
.tab.active .tab-num { color: var(--brass-deep); opacity: 1; }
.tab.active .tab-label { font-style: italic; }
.tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--brass) inset;
}

/* ─── Main + panels ────────────────────────────────────────────────── */

main {
  position: relative;
  z-index: 2;
  max-width: 1500px;
  margin: 0 auto;
  padding: 32px 36px 60px;
}

.panel { display: none; }
.panel.active {
  display: block;
  animation: panelFade 0.5s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes panelFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(330px, 0.74fr); }
.intake-grid { max-width: 760px; }
.pricing-grid { grid-template-columns: minmax(380px, 0.78fr) minmax(0, 1fr); }

/* ─── Editorial card surface ───────────────────────────────────────── */

.surface,
.viewer-wrap,
.piece-panel {
  position: relative;
  border: 1px solid var(--line-warm);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(249, 241, 226, 0.94));
  box-shadow: var(--shadow);
}

/* Brass corner ornaments on every surface */
.surface::before, .surface::after,
.viewer-wrap::before, .viewer-wrap::after,
.piece-panel::before, .piece-panel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--brass);
  opacity: 0.62;
  pointer-events: none;
}
.surface::before, .viewer-wrap::before, .piece-panel::before {
  top: 8px; left: 8px;
  border-right: 0; border-bottom: 0;
}
.surface::after, .viewer-wrap::after, .piece-panel::after {
  bottom: 8px; right: 8px;
  border-left: 0; border-top: 0;
}

.surface { padding: 26px 26px 24px; }

/* Section title with brass rule */
.section-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-warm);
}
.section-rule {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--brass), var(--brass-deep));
}
.section-title h2 {
  margin: 0;
  font-family: var(--serif);
  font-variation-settings: "opsz" 48, "SOFT" 30;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--char);
}
.section-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-deep);
}

/* ─── Form fields — couture inputs ─────────────────────────────────── */

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--line-warm);
  border-radius: 8px;
  color: var(--char);
  background: rgba(255, 252, 246, 0.96);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: 0.005em;
  text-transform: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input::placeholder { color: rgba(74, 64, 52, 0.42); font-style: italic; font-family: var(--serif); font-size: 14px; font-variation-settings: "opsz" 14; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--brass-deep) 50%), linear-gradient(135deg, var(--brass-deep) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brass);
  background: var(--bone);
  box-shadow:
    0 0 0 3px rgba(201, 161, 74, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.split label { margin-bottom: 0; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 400;
}
.check input {
  width: 18px;
  height: 18px;
  min-height: auto;
  appearance: none;
  border: 1px solid var(--brass);
  border-radius: 4px;
  background: var(--bone);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.check input:checked {
  background: linear-gradient(180deg, var(--brass-light), var(--brass));
  border-color: var(--brass-deep);
  box-shadow: 0 0 0 2px rgba(201, 161, 74, 0.18);
}
.check input:checked::after {
  content: "✓";
  display: block;
  margin: -2px 0 0 1px;
  color: var(--char);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 16px;
}
.check span { font-family: var(--sans); }

.button-row, .header-actions, .tool-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.button-row { margin-top: 6px; }

/* Dropzone — couture pattern envelope */
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 168px;
  padding: 24px;
  overflow: hidden;
  border: 1px dashed rgba(122, 86, 38, 0.55);
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(45deg,
      rgba(201, 161, 74, 0.045) 0,
      rgba(201, 161, 74, 0.045) 8px,
      transparent 8px,
      transparent 18px),
    linear-gradient(180deg, rgba(255, 252, 246, 0.95), rgba(245, 233, 210, 0.78));
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.dropzone::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--vein);
  border-radius: 10px;
  opacity: 0.55;
  pointer-events: none;
}
.dropzone:hover {
  border-color: var(--brass);
  background:
    repeating-linear-gradient(45deg,
      rgba(201, 161, 74, 0.08) 0,
      rgba(201, 161, 74, 0.08) 8px,
      transparent 8px,
      transparent 18px),
    linear-gradient(180deg, var(--bone), var(--parchment));
}
.dz-icon {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 300;
  color: var(--brass-deep);
  line-height: 1;
  margin-bottom: 4px;
}
.dz-title {
  font-family: var(--serif);
  font-variation-settings: "opsz" 14, "SOFT" 30;
  font-style: italic;
  font-size: 17px;
  color: var(--char);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
.dz-hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--brass-deep);
  text-transform: uppercase;
}
.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

/* ─── Review viewer ────────────────────────────────────────────────── */

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 20px;
}
.viewer-wrap { padding: 18px; }

.tool-strip { margin-bottom: 14px; }
.tool-strip button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.drawing-viewer {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 580px;
  overflow: auto;
  border: 1px solid var(--line-warm);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(36, 127, 132, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 127, 132, 0.07) 1px, transparent 1px),
    linear-gradient(180deg, var(--bone), var(--parchment-2));
  background-size: 28px 28px, 28px 28px, auto;
}
.drawing-viewer img { display: none; max-width: 100%; height: auto; }
.drawing-viewer.loaded img { display: block; }
.drawing-viewer.loaded #emptyViewer { display: none; }

#calibrationCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.drawing-viewer.calibrating #calibrationCanvas {
  pointer-events: auto;
  cursor: crosshair;
}

#emptyViewer {
  display: grid;
  justify-items: center;
  gap: 14px;
  color: var(--brass-deep);
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  font-variation-settings: "opsz" 14;
  letter-spacing: 0.01em;
}
#emptyViewer .ev-mark {
  font-size: 32px;
  font-weight: 300;
  color: var(--brass);
  font-style: normal;
}

/* Piece panel */
.piece-panel { min-width: 0; padding: 18px; }
.piece-cards { display: grid; gap: 14px; max-height: 700px; overflow: auto; padding-right: 4px; }

.piece-card {
  border: 1px solid var(--line-warm);
  border-radius: var(--radius);
  padding: 15px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(245, 233, 210, 0.74));
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.piece-card:hover {
  border-color: rgba(201, 161, 74, 0.55);
  box-shadow: 0 8px 24px rgba(122, 86, 38, 0.10);
  transform: translateY(-1px);
}
.piece-card.selected {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(201, 161, 74, 0.18), 0 8px 24px rgba(122, 86, 38, 0.14);
}
.piece-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.piece-head strong { font-family: var(--serif); font-size: 16px; font-variation-settings: "opsz" 14, "SOFT" 30; font-weight: 500; color: var(--char); }

.confidence {
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--bone);
  background: var(--success);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.confidence.review { background: var(--brass); color: var(--char); }
.confidence.low { background: var(--danger); }

.piece-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.piece-fields label { margin-bottom: 0; }

/* Calibration */
.calibration-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-warm);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bone), var(--parchment-2));
}
.calibration-panel label { width: 180px; margin: 0; }

.hidden { display: none !important; }

/* ─── Pricing summary ──────────────────────────────────────────────── */

.price-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.metric {
  position: relative;
  padding: 16px 14px;
  border: 1px solid var(--line-warm);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(245, 219, 161, 0.18));
  overflow: hidden;
}
.metric::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass) 50%, transparent);
  opacity: 0.6;
}
.metric span {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass-deep);
  margin-bottom: 8px;
}
.metric strong {
  display: block;
  overflow: hidden;
  font-family: var(--serif);
  font-variation-settings: "opsz" 48, "SOFT" 30;
  font-weight: 500;
  font-size: 22px;
  color: var(--char);
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.warnings { display: grid; gap: 10px; margin: 10px 0 14px; }
.warning {
  position: relative;
  padding: 12px 14px 12px 18px;
  border-radius: 8px;
  border-left: 3px solid var(--brass);
  background: linear-gradient(180deg, rgba(245, 219, 161, 0.22), rgba(245, 219, 161, 0.10));
  color: #5d4630;
  font-size: 13.5px;
}

/* ─── Tables ───────────────────────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
}
th, td {
  border-bottom: 1px solid var(--line-warm);
  padding: 12px 14px;
  text-align: left;
  font-size: 13.5px;
}
th {
  color: var(--bone);
  background: linear-gradient(180deg, var(--char), #2a2118);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
}
tr:nth-child(even) td { background: rgba(245, 233, 210, 0.42); }

.muted { color: var(--brass-deep); font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.10em; }

/* Code/match panel */
pre {
  min-height: 180px;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(245, 219, 161, 0.18);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--bone);
  background:
    linear-gradient(180deg, rgba(8, 6, 4, 0.78), rgba(8, 6, 4, 0.92)),
    url("visuals/blackstone-slab-signature.png") center / cover no-repeat;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.admin-summary { display: grid; gap: 12px; }
.admin-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 18px; }

.source-admin-grid {
  grid-template-columns: 380px minmax(0, 1fr);
  margin-top: 20px;
}

.reference-list, .quote-list { display: grid; gap: 12px; }

.reference-row, .quote-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-warm);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.92), rgba(245, 233, 210, 0.62));
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.reference-row:hover, .quote-row:hover {
  border-color: rgba(201, 161, 74, 0.55);
  box-shadow: 0 8px 22px rgba(122, 86, 38, 0.10);
}
.reference-row strong, .quote-row strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--char);
}
.reference-row p, .quote-row p {
  margin: 0;
  color: var(--brass-deep);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.55;
}

.reference-badge {
  border-radius: 999px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--patina), #4a5a44);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-gate { max-width: 540px; }

/* ─── Footer ──────────────────────────────────────────────────────── */

.atelier-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 30px 36px 50px;
}
.foot-rule {
  flex: 1 1 0;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass) 50%, transparent);
  opacity: 0.55;
}
.foot-mark {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass-deep);
}

/* ─── Toast ───────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(245, 219, 161, 0.30);
  border-radius: var(--radius);
  color: var(--bone);
  background:
    linear-gradient(180deg, rgba(20, 17, 14, 0.95), rgba(8, 6, 4, 0.96));
  box-shadow: var(--shadow-deep);
  font-family: var(--sans);
  font-size: 13.5px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 1240px) {
  .veined-compass {
    width: 280px;
    height: 280px;
    margin-top: -140px;
    right: 4%;
  }
  .signature-copy { max-width: 65%; }
}

@media (max-width: 1100px) {
  .app-header,
  .review-layout,
  .grid.two,
  .pricing-grid,
  .source-admin-grid {
    grid-template-columns: 1fr;
  }
  .app-header { display: grid; }

  .signature-copy { max-width: 100%; padding-right: 280px; }
  .veined-compass { width: 240px; height: 240px; margin-top: -120px; right: 4%; }
}

@media (max-width: 900px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }

  .app-header, .signature-stage, main, .tabs, .atelier-foot {
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
    padding-left: 16px;
    padding-right: 16px;
  }
  .app-header {
    gap: 14px;
    grid-template-columns: minmax(0, 1fr);
  }
  .brand { min-width: 0; }
  .brand-mark { width: 96px; height: 96px; }
  .brand img { width: 96px; }
  .brand h1 { font-size: 24px; }
  .brand p { font-size: 12px; }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }
  .header-actions .status-pill {
    grid-column: 1 / -1;
    justify-content: center;
    width: 100%;
  }
  .header-actions button,
  .button-row button {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding-inline: 12px;
    overflow: hidden;
    font-size: 13.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tabs { overflow-x: auto; padding: 0 16px; }
  .tab { min-width: 96px; }

  /* Hero: compass moves under copy */
  .signature-slab { min-height: 540px; }
  .signature-copy {
    min-height: auto;
    max-width: 100%;
    padding: 28px 22px 8px;
  }
  .hero-headline { font-size: clamp(36px, 11vw, 60px); }
  .hero-sub { max-width: 100%; }

  .veined-compass {
    position: relative;
    top: auto;
    right: auto;
    margin: 0 auto 26px;
    width: 240px;
    height: 240px;
  }

  .split, .price-cards, .piece-fields { grid-template-columns: 1fr; }
  .price-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reference-row, .quote-row { grid-template-columns: 1fr; }

  .surface { padding: 20px 18px; }
  .calibration-panel label { width: 100%; }
  .source-admin-grid { gap: 16px; }
}

@media (max-width: 480px) {
  .price-cards { grid-template-columns: 1fr; }
  .veined-compass { width: 220px; height: 220px; }
  .hero-headline { font-size: clamp(34px, 12vw, 48px); }
  .compass-cardinal strong { font-size: 14px; }
  .cardinal-label { font-size: 8px; letter-spacing: 0.22em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
  .hero-headline .word > span { transform: none; }
  .veined-compass { opacity: 1; transform: none; }
}
