/* ─────────────────────────────────────────────────────────────────────
   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);
}

/* Destructive-action button.
   The `.danger` variant must be readable on the cream `.quote-row` and
   Library surface backgrounds that host destructive quote actions. The ghost
   variant is reserved for any future dark-backdrop destructive actions.

   - button.danger          → dark bordeaux text on a faint pink-cream wash
                              (good contrast on cream rows).
   - button.ghost.danger    → faint-pink text on a translucent bordeaux fill
                              (good contrast on dark backdrops).
*/
button.danger {
  color: var(--danger);
  border-color: rgba(166, 71, 63, 0.42);
  background: linear-gradient(180deg, rgba(255, 245, 243, 0.96), rgba(248, 218, 213, 0.88));
}
button.danger:hover {
  color: var(--bone);
  border-color: var(--danger);
  background: linear-gradient(180deg, var(--danger), #862e29);
  box-shadow: 0 12px 30px rgba(120, 36, 30, 0.32), 0 1px 0 rgba(255, 200, 192, 0.5) inset;
}

button.ghost.danger {
  color: rgba(255, 220, 214, 0.92);
  border-color: rgba(166, 71, 63, 0.55);
  background: rgba(166, 71, 63, 0.10);
  backdrop-filter: blur(6px);
}
button.ghost.danger:hover {
  color: var(--bone);
  border-color: var(--danger);
  background: rgba(166, 71, 63, 0.28);
  box-shadow: 0 8px 22px rgba(120, 36, 30, 0.22), 0 1px 0 rgba(255, 200, 192, 0.18) inset;
}

/* Library user picker — labelled select using the same pill chrome as the
   header export-mode select. Lives on the dark Library surface. */
.library-user-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(230, 201, 138, 0.78);
}
.library-user-picker > span {
  white-space: nowrap;
}
.library-user-picker > select {
  /* Reuse .export-mode-select's chrome but allow it to size up a bit so long
     slugs stay readable. */
  max-width: 260px;
  min-width: 160px;
}

/* ─── 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: 16px 36px 4px;
  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 {
  --header-action-width: 124px;
  display: grid;
  grid-template-columns: repeat(4, var(--header-action-width));
  align-items: center;
  justify-content: end;
  gap: 8px 8px;
  min-width: 0;
}

.header-actions .status-pill {
  grid-column: 1 / -1;
  justify-self: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions button {
  width: var(--header-action-width);
  min-height: 28px;
  padding: 0 10px;
  border-color: rgba(245, 219, 161, 0.24);
  font-size: 11px;
  letter-spacing: 0.01em;
  box-shadow: 0 7px 20px rgba(8, 6, 4, 0.18), 0 1px 0 rgba(245, 219, 161, 0.16) inset;
}

.header-actions button:hover {
  box-shadow: 0 10px 24px rgba(122, 86, 38, 0.18), 0 1px 0 rgba(245, 219, 161, 0.22) inset;
}

/* Export mode select — sized as a slim pill matching the header buttons.
   Native <select> needs explicit width or it stretches to content + UA padding,
   which makes long option labels (e.g. "Internal Worksheet") balloon the bar. */
.export-mode-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: auto;
  max-width: 188px;
  min-height: 34px;
  padding: 0 32px 0 14px;
  border: 1px solid rgba(245, 219, 161, 0.30);
  border-radius: 999px;
  color: var(--bone);
  background-color: rgba(255, 250, 240, 0.04);
  /* Brass chevron drawn inline so we don't need an extra asset. */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23e6c98a' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 7px 20px rgba(8, 6, 4, 0.18), 0 1px 0 rgba(245, 219, 161, 0.16) inset;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.export-mode-select:hover {
  border-color: var(--brass);
  background-color: rgba(245, 219, 161, 0.10);
}
.export-mode-select:focus {
  outline: none;
  border-color: var(--brass-light);
  box-shadow:
    0 0 0 2px rgba(245, 219, 161, 0.22),
    0 7px 20px rgba(8, 6, 4, 0.18),
    0 1px 0 rgba(245, 219, 161, 0.16) inset;
}
/* The dropdown menu itself is rendered by the OS, but we can hint at the dark theme
   for the option list on browsers that honor it (Chromium, Firefox). */
.export-mode-select option {
  background: var(--char);
  color: var(--bone);
}

.header-actions .export-mode-select {
  width: var(--header-action-width);
  min-height: 28px;
  padding: 0 24px 0 10px;
  font-size: 11px;
}


/* Header export picker readability guard.
   Native selects can inherit the later global select:focus cream field styling;
   keep the closed header pill dark/brass so the selected label never vanishes
   when clicked or while the OS dropdown is open. */
.header-actions .export-mode-select,
.header-actions .export-mode-select:hover,
.header-actions .export-mode-select:focus,
.header-actions .export-mode-select:focus-visible,
.header-actions .export-mode-select:active {
  color: #fffaf0 !important;
  -webkit-text-fill-color: #fffaf0 !important;
  opacity: 1 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.72);
  background-color: rgba(22, 17, 12, 0.92) !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23e6c98a' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 10px 6px !important;
  border-color: rgba(245, 219, 161, 0.38) !important;
  box-shadow: 0 8px 22px rgba(8, 6, 4, 0.22), 0 1px 0 rgba(245, 219, 161, 0.18) inset;
  color-scheme: dark;
}
.header-actions .export-mode-select:focus,
.header-actions .export-mode-select:focus-visible {
  border-color: var(--brass-light) !important;
  box-shadow:
    0 0 0 2px rgba(245, 219, 161, 0.24),
    0 8px 22px rgba(8, 6, 4, 0.24),
    0 1px 0 rgba(245, 219, 161, 0.20) inset;
}
.header-actions .export-mode-select option {
  background: #17110c;
  color: #fffaf0;
  -webkit-text-fill-color: #fffaf0;
}
.header-actions .export-mode-select optgroup {
  background: #17110c;
  color: #fffaf0;
  -webkit-text-fill-color: #fffaf0;
}
.header-actions .export-mode-select option:checked {
  background: #3b2a15;
  color: #fffaf0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(230, 201, 138, 0.24);
  border-radius: 999px;
  color: rgba(230, 201, 138, 0.82);
  background: rgba(0, 0, 0, 0.20);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(8, 6, 4, 0.14);
}
.status-pill::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 7px rgba(201, 161, 74, 0.52);
}
.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: 0 36px 54px;
}

.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%;
}

.piece-ledger-tags {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.meridian-hit-target {
  position: absolute;
  z-index: 1;
  width: var(--meridian-hit-size, 68px);
  height: var(--meridian-hit-size, 68px);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: transparent;
  font-size: 0;
  transform: translate(-50%, -50%);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.meridian-hit-target:focus-visible {
  opacity: 1;
  outline: 1px solid rgba(255, 244, 218, 0.44);
  outline-offset: -22px;
}

.meridian-focus-card {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  border: 1px solid rgba(245, 219, 161, 0.56);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  color: var(--bone);
  background:
    radial-gradient(circle at 16px 50%, rgba(245, 219, 161, 0.22), transparent 18px),
    linear-gradient(120deg, rgba(255, 244, 218, 0.10), transparent 36%),
    linear-gradient(180deg, rgba(21, 15, 10, 0.92), rgba(8, 5, 3, 0.88));
  backdrop-filter: blur(10px) saturate(1.08);
  -webkit-backdrop-filter: blur(10px) saturate(1.08);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(245, 219, 161, 0.10),
    0 0 24px rgba(245, 219, 161, 0.14);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  transform: translateY(-50%);
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease,
    transform 0.22s ease;
  pointer-events: none;
}

.meridian-focus-card::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 9px;
  height: 9px;
  background: var(--brass-light);
  box-shadow: 0 0 18px rgba(245, 219, 161, 0.78);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.meridian-focus-card.from-left::before {
  left: auto;
  right: -18px;
}

.meridian-id {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  min-width: 43px;
  min-height: 22px;
  border-radius: 999px;
  color: var(--char);
  background: linear-gradient(180deg, var(--brass-light), var(--brass));
  box-shadow: 0 1px 0 rgba(255, 248, 239, 0.45) inset;
  font-weight: 700;
}

.meridian-copy {
  position: relative;
  z-index: 1;
  overflow: hidden;
  color: rgba(251, 244, 230, 0.94);
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 0 6px rgba(0, 0, 0, 0.42);
}

.meridian-focus-card.pinned {
  border-color: rgba(255, 238, 190, 0.9);
  background:
    linear-gradient(120deg, rgba(255, 244, 218, 0.14), transparent 34%),
    linear-gradient(180deg, rgb(28, 20, 14), rgb(10, 7, 4));
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(245, 219, 161, 0.2),
    0 0 28px rgba(245, 219, 161, 0.28);
  transform: translateY(-50%) translateY(-2px);
}

.meridian-focus-card.warning {
  border-color: rgba(166, 71, 63, 0.76);
}

.meridian-focus-card.warning .meridian-id {
  color: var(--bone);
  background: linear-gradient(180deg, #b35a52, var(--danger));
}

.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 */
#confidenceNeedle {
  opacity: 0;
  transform: rotate(-90deg);
  transform-box: view-box;
  transform-origin: 160px 160px;
  transition:
    opacity 0.55s ease,
    transform 0.9s cubic-bezier(.2,.85,.2,1);
}
#confidenceNeedle.is-live {
  opacity: 1;
}

/* 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: 0 auto;
  padding: 0 36px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.tabs::before,
.tabs::after,
.tab-rail {
  display: none !important;
  content: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.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: 6px 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, .tool-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.button-row { margin-top: 6px; }

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.source-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(98, 76, 48, 0.18);
  background: rgba(255, 252, 244, 0.64);
  border-radius: 8px;
  font-size: 12px;
}

.source-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-badge {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4b3d2d;
  font-size: 10px;
  border: 1px solid rgba(98, 76, 48, 0.22);
  padding: 3px 6px;
  border-radius: 999px;
}

/* 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;
  text-align: center;
  isolation: isolate;
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 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));
}
.dropzone.drag-over {
  transform: translateY(-1px);
  border-color: var(--brass);
  box-shadow: 0 18px 44px rgba(83, 61, 27, 0.18);
}
.dropzone.has-file {
  border-style: solid;
  border-color: rgba(69, 116, 82, 0.82);
  background:
    linear-gradient(135deg, rgba(69, 116, 82, 0.12), transparent 34%),
    repeating-linear-gradient(45deg,
      rgba(201, 161, 74, 0.07) 0,
      rgba(201, 161, 74, 0.07) 8px,
      transparent 8px,
      transparent 18px),
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(241, 236, 220, 0.92));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 18px 42px rgba(43, 61, 40, 0.16);
}
.dropzone.is-uploaded {
  border-color: rgba(122, 86, 38, 0.70);
}
.dropzone.is-uploaded .dz-status {
  border-color: rgba(122, 86, 38, 0.28);
  color: var(--brass-deep);
}
.dropzone.has-file::before {
  border-color: rgba(69, 116, 82, 0.42);
  opacity: 1;
}
.dropzone.has-file::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 8px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.48), transparent 42%);
  pointer-events: none;
  z-index: -1;
}
.dropzone > span,
.dropzone .dz-file-card,
.dropzone .dz-clear {
  position: relative;
  z-index: 1;
}
.dz-icon {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 300;
  color: var(--brass-deep);
  line-height: 1;
  margin-bottom: 4px;
  transition: color 0.25s ease, transform 0.25s ease;
}
.dropzone.has-file .dz-icon {
  transform: scale(0.9);
  color: #457452;
}
.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;
  max-width: 100%;
}
.dz-hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--brass-deep);
  text-transform: uppercase;
  max-width: 100%;
  line-height: 1.55;
}
.dz-hint:empty {
  display: none;
}
.dz-status {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(69, 116, 82, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #386243;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(43, 61, 40, 0.10);
}
.dropzone.has-file .dz-status {
  display: inline-flex;
}
.dropzone.has-file .dz-status:empty {
  display: none;
}
.dz-file-card {
  display: none;
  width: min(100%, 420px);
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid rgba(85, 110, 77, 0.22);
  border-radius: 8px;
  background: rgba(255, 252, 246, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 30px rgba(61, 47, 29, 0.10);
}
.dropzone.has-file .dz-file-card {
  display: grid;
}
.dz-file-badge {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 34px;
  padding: 0 10px;
  border-radius: 7px;
  background: #241f1c;
  color: var(--bone);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.dz-file-copy {
  min-width: 0;
  text-align: left;
}
.dz-file-name {
  display: block;
  overflow: hidden;
  color: var(--char);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dz-file-meta {
  display: block;
  margin-top: 3px;
  color: rgba(52, 47, 42, 0.66);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dz-clear {
  position: relative;
  z-index: 3;
  min-height: 32px;
  padding: 0 10px;
  border-color: rgba(52, 47, 42, 0.18);
  background: rgba(255, 255, 255, 0.70);
  color: var(--char);
  font-size: 10px;
  box-shadow: none;
}
.dz-clear:hover {
  border-color: rgba(122, 86, 38, 0.36);
  background: var(--bone);
}
.dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.dropzone.has-file input {
  cursor: pointer;
}

/* ─── 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-card.ledger-active {
  border-color: rgba(36, 127, 132, 0.62);
  box-shadow:
    0 0 0 3px rgba(36, 127, 132, 0.13),
    0 12px 30px rgba(36, 127, 132, 0.13);
  transform: translateY(-1px);
}
.piece-card.selected.ledger-active {
  border-color: var(--brass);
  box-shadow:
    0 0 0 3px rgba(201, 161, 74, 0.18),
    0 0 0 6px rgba(36, 127, 132, 0.10),
    0 12px 30px rgba(122, 86, 38, 0.16);
}
.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;
}

.library-user-picker[hidden] {
  display: none !important;
}

.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%;
    max-width: min(100%, 860px);
    margin-inline: auto;
    justify-content: center;
    justify-items: center;
    gap: 14px 18px;
  }
  .header-actions .status-pill {
    grid-column: 1 / -1;
    justify-content: center;
    justify-self: center;
    width: 100%;
    max-width: 100%;
  }
  .header-actions .export-mode-select,
  .header-actions button {
    justify-self: center;
    width: min(100%, 278px);
    max-width: 100%;
    text-align: center;
  }
  .header-actions .export-mode-select {
    color: #fffaf0 !important;
    -webkit-text-fill-color: #fffaf0 !important;
    opacity: 1 !important;
    text-align-last: center;
    background-color: rgba(22, 17, 12, 0.94) !important;
    border-color: rgba(245, 219, 161, 0.46) !important;
    color-scheme: dark;
  }
  .header-actions .export-mode-select:focus,
  .header-actions .export-mode-select:focus-visible,
  .header-actions .export-mode-select:active {
    color: #fffaf0 !important;
    -webkit-text-fill-color: #fffaf0 !important;
    background-color: rgba(22, 17, 12, 0.96) !important;
  }
  .header-actions .export-mode-select option {
    color: #fffaf0 !important;
    -webkit-text-fill-color: #fffaf0 !important;
    background: #17110c !important;
  }
  .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;
  }
  .header-actions button {
    min-height: 32px;
    padding-inline: 12px;
    overflow: hidden;
    font-size: 12px;
    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%; }
  .meridian-focus-card {
    max-width: min(330px, calc(100vw - 48px));
    min-height: 30px;
    font-size: 8.5px;
  }
  .meridian-id {
    min-width: 40px;
    min-height: 20px;
  }

  .veined-compass {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    bottom: auto;
    margin: 16px auto 22px;
    width: min(240px, 62vw);
    height: min(240px, 62vw);
    transform: none !important;
    cursor: pointer;
    touch-action: manipulation;
  }
  .veined-compass.is-open { z-index: 8; }
  .compass-actions .qa {
    width: 46px;
    height: 46px;
    font-size: 8px;
    letter-spacing: 0.12em;
  }
  .veined-compass.is-open .qa-1 { transform: translate(-50%, -50%) translate(0, -92px); }
  .veined-compass.is-open .qa-2 { transform: translate(-50%, -50%) translate(92px, 0); }
  .veined-compass.is-open .qa-3 { transform: translate(-50%, -50%) translate(0, 92px); }
  .veined-compass.is-open .qa-4 { transform: translate(-50%, -50%) translate(-92px, 0); }
  .veined-compass.is-open .qa-1:hover { --tx: 0; --ty: -92px; }
  .veined-compass.is-open .qa-2:hover { --tx: 92px; --ty: 0; }
  .veined-compass.is-open .qa-3:hover { --tx: 0; --ty: 92px; }
  .veined-compass.is-open .qa-4:hover { --tx: -92px; --ty: 0; }

  .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: min(220px, 60vw);
    height: min(220px, 60vw);
  }
  .compass-actions .qa {
    width: 42px;
    height: 42px;
    font-size: 7.5px;
  }
  .veined-compass.is-open .qa-1 { transform: translate(-50%, -50%) translate(0, -82px); }
  .veined-compass.is-open .qa-2 { transform: translate(-50%, -50%) translate(82px, 0); }
  .veined-compass.is-open .qa-3 { transform: translate(-50%, -50%) translate(0, 82px); }
  .veined-compass.is-open .qa-4 { transform: translate(-50%, -50%) translate(-82px, 0); }
  .veined-compass.is-open .qa-1:hover { --tx: 0; --ty: -82px; }
  .veined-compass.is-open .qa-2:hover { --tx: 82px; --ty: 0; }
  .veined-compass.is-open .qa-3:hover { --tx: 0; --ty: 82px; }
  .veined-compass.is-open .qa-4:hover { --tx: -82px; --ty: 0; }
  .hero-headline { font-size: clamp(34px, 12vw, 48px); }
  .compass-cardinal strong { font-size: 14px; }
  .cardinal-label { font-size: 8px; letter-spacing: 0.22em; }
  .meridian-focus-card {
    gap: 6px;
    padding-right: 9px;
  }
  .meridian-copy { max-width: 206px; }
}

@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; }
}

/* ─────────────────────────────────────────────────────────────────────
   L'Empreinte — The Engraver's Mark
   A signature loading state that continues the Atelier's design language:
   brass armillary on obsidian, marble veining, three-movement stage
   indicators (Measure · Price · Present), corner brackets for framing.
   ───────────────────────────────────────────────────────────────────── */

.atelier-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 380ms ease, visibility 380ms ease;
}
.atelier-loader.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loader-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(36, 28, 20, 0.82), rgba(8, 6, 4, 0.96) 70%),
    rgba(8, 6, 4, 0.85);
  backdrop-filter: blur(18px) saturate(1.08);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
}
/* Drifting dust motes in the backdrop — barely visible, adds atmosphere. */
.loader-backdrop::before,
.loader-backdrop::after {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at 20% 30%, rgba(245, 219, 161, 0.06) 0, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(245, 219, 161, 0.04) 0, transparent 40%);
  filter: blur(40px);
  animation: motesDrift 28s ease-in-out infinite alternate;
}
.loader-backdrop::after {
  background:
    radial-gradient(circle at 70% 20%, rgba(245, 219, 161, 0.05) 0, transparent 40%),
    radial-gradient(circle at 30% 80%, rgba(245, 219, 161, 0.04) 0, transparent 40%);
  animation-duration: 36s;
  animation-direction: alternate-reverse;
}
@keyframes motesDrift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-3%, 4%, 0); }
}

.loader-scene {
  position: relative;
  width: min(560px, 88vw);
  padding: 56px 56px 44px;
  text-align: center;
  color: var(--bone);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 219, 161, 0.07), transparent 60%),
    linear-gradient(180deg, rgba(36, 29, 21, 0.46), rgba(14, 10, 7, 0.66));
  border: 1px solid rgba(230, 201, 138, 0.20);
  border-radius: 18px;
  box-shadow:
    0 60px 140px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(245, 219, 161, 0.10);
  transform: translateY(10px) scale(0.98);
  transition: transform 480ms cubic-bezier(.2, .8, .2, 1);
}
.atelier-loader.show .loader-scene {
  transform: translateY(0) scale(1);
}

.loader-eyebrow {
  display: inline-block;
  margin-bottom: 28px;
  padding: 6px 14px;
  border: 1px solid rgba(230, 201, 138, 0.32);
  border-radius: 999px;
  color: var(--vein);
  background: rgba(0, 0, 0, 0.32);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

/* Armillary mark */
.loader-mark {
  position: relative;
  width: 196px;
  height: 196px;
  margin: 0 auto 28px;
}
.loader-armillary {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.loader-armillary .ring {
  transform-origin: 120px 120px;
}
.loader-armillary .ring-outer  { animation: armRotate 18s linear infinite; }
.loader-armillary .ring-middle { animation: armRotate  9s linear infinite reverse; }
.loader-armillary .ring-inner  { animation: armRotate  5s linear infinite; }
@keyframes armRotate { to { transform: rotate(360deg); } }

.loader-armillary .loader-veins path {
  fill: none;
  stroke: rgba(245, 219, 161, 0.78);
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-dasharray: 3 280;
  filter: drop-shadow(0 0 5px rgba(245, 219, 161, 0.85));
  animation: veinFlow 4.4s ease-in-out infinite;
}
@keyframes veinFlow {
  0%   { stroke-dashoffset:    0; opacity: 0; }
  18%  { opacity: 1; }
  88%  { stroke-dashoffset: -283; opacity: 1; }
  100% { stroke-dashoffset: -283; opacity: 0; }
}

.loader-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 36%, #fce7b3 0, var(--brass) 62%, var(--brass-deep) 100%);
  box-shadow:
    0 0 0 1px rgba(58, 42, 22, 0.7),
    0 0 18px rgba(245, 219, 161, 0.55),
    inset 0 1px 0 rgba(255, 248, 239, 0.7);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 800;
  font-size: 17px;
  color: var(--char);
  user-select: none;
  animation: sealPulse 2.6s ease-in-out infinite;
}
@keyframes sealPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(58, 42, 22, 0.7),
      0 0 14px rgba(245, 219, 161, 0.45),
      inset 0 1px 0 rgba(255, 248, 239, 0.7);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(58, 42, 22, 0.7),
      0 0 30px rgba(245, 219, 161, 0.85),
      0 0 56px rgba(245, 219, 161, 0.34),
      inset 0 1px 0 rgba(255, 248, 239, 0.85);
  }
}

.loader-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 42px);
  letter-spacing: -0.012em;
  color: var(--bone);
  font-variation-settings: "opsz" 144, "SOFT" 30;
}
.loader-status {
  position: relative;
  display: inline-block;
  margin: 0 0 30px;
  padding-right: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(230, 201, 138, 0.86);
  min-height: 14px;
}
/* Blinking brass cursor — the typewriter waiting for the next strike. */
.loader-status::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 1.5px;
  height: 11px;
  background: var(--brass-light);
  box-shadow: 0 0 6px rgba(245, 219, 161, 0.7);
  transform: translateY(-50%);
  animation: caretBlink 1.05s steps(2, end) infinite;
}
@keyframes caretBlink {
  0%, 50%   { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* The three movements */
.loader-stages {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(230, 201, 138, 0.42);
}
.loader-stages .stage {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  transition: color 0.42s ease;
}
.loader-stages .stage::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(230, 201, 138, 0.16);
  box-shadow: 0 0 0 1px rgba(230, 201, 138, 0.18);
  transition: background 0.42s ease, box-shadow 0.42s ease, transform 0.42s ease;
}
.loader-stages .stage.active {
  color: var(--brass-light);
}
.loader-stages .stage.active::before {
  background: var(--brass-light);
  box-shadow:
    0 0 0 1px rgba(245, 219, 161, 0.55),
    0 0 12px rgba(245, 219, 161, 0.7);
  animation: stagePulse 1.6s ease-in-out infinite;
}
.loader-stages .stage.complete {
  color: rgba(230, 201, 138, 0.72);
}
.loader-stages .stage.complete::before {
  background: var(--brass);
  box-shadow: 0 0 0 1px rgba(201, 161, 74, 0.42);
}
@keyframes stagePulse {
  0%, 100% { transform: scale(1);   }
  50%      { transform: scale(1.5); }
}

/* Engraving sweep: a brass spark crossing a hairline */
.loader-engrave {
  position: relative;
  width: 76%;
  height: 1px;
  margin: 28px auto 0;
  background: linear-gradient(90deg, transparent, rgba(230, 201, 138, 0.22), transparent);
  overflow: hidden;
}
.loader-engrave::after {
  content: "";
  position: absolute;
  top: -1px;
  left: -40%;
  width: 40%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(255, 240, 198, 1), transparent);
  filter: blur(1px);
  animation: engraveSweep 2.6s cubic-bezier(.45, 0, .55, 1) infinite;
}
@keyframes engraveSweep {
  0%   { left: -40%; opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Cinematographer's framing brackets */
.loader-corners { position: absolute; inset: 0; pointer-events: none; }
.loader-corners .c {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(230, 201, 138, 0.36);
  opacity: 0;
  animation: cornerEnter 600ms cubic-bezier(.2, .8, .2, 1) 200ms forwards;
}
.loader-corners .tl { top: 14px; left: 14px;    border-right: 0; border-bottom: 0; }
.loader-corners .tr { top: 14px; right: 14px;   border-left: 0;  border-bottom: 0; animation-delay: 260ms; }
.loader-corners .bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0;    animation-delay: 320ms; }
.loader-corners .br { bottom: 14px; right: 14px;border-left: 0;  border-top: 0;    animation-delay: 380ms; }
@keyframes cornerEnter {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 0.72; transform: scale(1); }
}

@media (max-width: 600px) {
  .loader-scene { padding: 40px 28px 32px; }
  .loader-mark { width: 156px; height: 156px; margin-bottom: 22px; }
  .loader-stages { gap: 14px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-armillary .ring-outer,
  .loader-armillary .ring-middle,
  .loader-armillary .ring-inner,
  .loader-armillary .loader-veins path,
  .loader-engrave::after,
  .loader-seal,
  .loader-stages .stage.active::before,
  .loader-status::after,
  .loader-backdrop::before,
  .loader-backdrop::after,
  .loader-corners .c {
    animation: none !important;
  }
  .loader-corners .c { opacity: 0.72; }
}
