/* Avatart Editorial Exhibition Design System — Archival Cotton Paper & Iron-Gall Ink */
:root {
  --paper: #f6efe5;
  --paper-elev: #fcf9f3;
  --paper-soft: #efe6d8;
  --ink: #201c21;
  --ink-muted: #5b524f;
  --ink-faint: #847974;
  --rule: rgba(32, 28, 33, 0.13);
  --rule-strong: rgba(32, 28, 33, 0.24);
  --teal: #1d3839;
  --teal-mid: #2b5c5d;
  --vermilion: #c85842;
  --vermilion-bright: #d85f48;
  --ochre: #d49e46;
  --ochre-soft: rgba(212, 158, 70, 0.16);
  --dark-ui: #11151d;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 10px 30px rgba(29, 56, 57, 0.07), 0 1px 2px rgba(32, 28, 33, 0.06);
  --shadow-lift: 0 18px 42px rgba(29, 56, 57, 0.12), 0 2px 6px rgba(32, 28, 33, 0.08);
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Noto Serif TC", "Songti TC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 680px at 14% -8%, rgba(212, 158, 70, 0.11), transparent 62%),
    radial-gradient(960px 620px at 90% 10%, rgba(43, 92, 93, 0.08), transparent 60%),
    var(--paper);
  color: var(--ink);
  line-height: 1.58;
  position: relative;
  overflow-x: clip;
}

/* Subtle tactile cotton-rag paper texture overlay */
.paper-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, header, footer {
  position: relative;
  z-index: 1;
}

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

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.shell {
  width: min(1200px, calc(100% - 32px));
  margin-inline: auto;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(246, 239, 229, 0.86);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.16s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--teal);
}

.lang-toggle {
  appearance: none;
  border: 1px solid var(--rule-strong);
  background: var(--paper-elev);
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.lang-toggle:hover {
  background: var(--teal);
  color: var(--paper-elev);
  border-color: var(--teal);
}

/* HERO */
.hero {
  padding: 26px 0 58px;
}

.hero-intro {
  max-width: 780px;
  margin-bottom: 20px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-mid);
  margin-bottom: 9px;
}

.seal-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--vermilion);
  box-shadow: 0 0 0 2px rgba(200, 88, 66, 0.22);
}

.hero-title {
  margin: 0 0 11px;
  font-family: var(--font-serif);
  font-size: clamp(2.05rem, 3.7vw, 3.1rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-lead {
  margin: 0;
  font-size: 0.96rem;
  color: var(--ink-muted);
  max-width: 70ch;
}

/* EDITION SELECTOR RIBBON */
.edition-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.edition-pill {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  background: rgba(252, 249, 243, 0.8);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.edition-pill:hover {
  transform: translateY(-1px);
  border-color: var(--rule-strong);
  background: var(--paper-elev);
}

.edition-pill.is-active {
  border-color: var(--teal);
  background: var(--paper-elev);
  box-shadow: 0 0 0 1px var(--teal), var(--shadow-card);
}

.edition-pill img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.edition-pill-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.edition-pill-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
}

.edition-pill-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* STAGE GRID */
.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 28px;
  align-items: start;
}

.stage-canvas-card {
  background: var(--paper-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-btn {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.tool-btn.is-active,
.tool-btn[aria-pressed="true"] {
  background: var(--teal);
  color: var(--paper-elev);
  border-color: var(--teal);
}

.stage-frame {
  position: relative;
  background: var(--paper-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  padding: 12px;
}

.stage-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  user-select: none;
  touch-action: none;
  background: var(--paper);
  box-shadow: 0 8px 26px rgba(29, 56, 57, 0.12);
  transition: border-radius 0.25s ease;
}

.stage-viewport.is-circle {
  border-radius: 50%;
}

.stage-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.stage-before-wrap {
  position: absolute;
  inset: 0;
  clip-path: inset(0 76% 0 0);
  pointer-events: none;
}

.stage-frame[data-mode="loupe"] .stage-before-wrap,
.stage-frame[data-mode="loupe"] .compare-divider,
.stage-frame[data-mode="loupe"] .pill-before,
.stage-frame[data-mode="full"] .stage-before-wrap,
.stage-frame[data-mode="full"] .compare-divider,
.stage-frame[data-mode="full"] .pill-before {
  display: none;
}

.stage-frame[data-mode="loupe"] .stage-viewport {
  cursor: crosshair;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 24%;
  width: 36px;
  transform: translateX(-50%);
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  outline: none;
}

.compare-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(252, 249, 243, 0.94);
  box-shadow: 0 0 0 1px rgba(32, 28, 33, 0.35);
}

.compare-knob {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper-elev);
  color: var(--teal);
  border: 2px solid var(--teal);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.compare-divider:focus-visible .compare-knob {
  box-shadow: 0 0 0 3px rgba(200, 88, 66, 0.55);
}

.stage-pill {
  position: absolute;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: rgba(32, 28, 33, 0.74);
  color: #fcf9f3;
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 3;
}

.pill-before { left: 12px; }
.pill-after { right: 12px; }

/* MAGNIFIER LOUPE */
.loupe-lens {
  position: absolute;
  width: 196px;
  height: 196px;
  border-radius: 50%;
  border: 3px solid var(--paper-elev);
  box-shadow: 0 0 0 1.5px var(--teal), 0 14px 36px rgba(0, 0, 0, 0.38);
  background-repeat: no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
  z-index: 6;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.loupe-crosshair {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent calc(50% - 0.5px), rgba(200, 88, 66, 0.45) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(200, 88, 66, 0.45) 50%, transparent calc(50% + 0.5px));
}

.loupe-readout {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  background: rgba(29, 56, 57, 0.86);
  color: #fcf9f3;
  white-space: nowrap;
}

.stage-hint {
  margin: 11px 4px 2px;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* FOLIO SIDEBAR */
.stage-folio {
  background: var(--paper-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.folio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.folio-index {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--vermilion);
  font-weight: 700;
}

.folio-atlas {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--teal);
  background: rgba(43, 92, 93, 0.1);
  padding: 3px 10px;
  border-radius: 999px;
}

.folio-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.65rem;
  line-height: 1.2;
  color: var(--ink);
}

.folio-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

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

.swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 5px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.spec-grid dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.spec-grid dd {
  margin: 2px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

/* DPID DISPLAY SIZE CARD */
.dpid-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dpid-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.dpid-head h3 {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink);
}

.dpid-head p {
  margin: 2px 0 0;
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.contrast-badges {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
}

.badge-light {
  background: #ffffff;
  color: var(--teal);
  border: 1px solid var(--rule);
}

.badge-dark {
  background: var(--dark-ui);
  color: #f6efe5;
}

.dpid-surface {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
}

.dpid-light {
  background: #ffffff;
  border: 1px solid rgba(32, 28, 33, 0.09);
  color: #6b6460;
}

.dpid-dark {
  background: var(--dark-ui);
  color: #9ba4b5;
}

.surface-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  width: 42px;
  flex-shrink: 0;
}

.dpid-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.dpid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dpid-item img {
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.dpid-item span {
  font-family: var(--font-mono);
  font-size: 0.64rem;
}

.folio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.14s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--teal);
  color: var(--paper-elev);
}

.btn-primary:hover {
  background: var(--teal-mid);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule-strong);
}

.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

/* SECTIONS */
.section {
  padding: 72px 0;
  border-top: 1px solid var(--rule);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 34px;
}

.section-eyebrow {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--vermilion);
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 2.8vw, 2.35rem);
  line-height: 1.15;
}

.section-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.94rem;
}

/* SALON GALLERY */
.salon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.salon-card {
  background: var(--paper-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.salon-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--rule-strong);
}

.salon-media {
  position: relative;
  padding: 14px 14px 0;
  background: linear-gradient(180deg, var(--paper-soft) 0%, var(--paper-elev) 100%);
}

.salon-media-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(29, 56, 57, 0.14);
}

.salon-media-btn img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.salon-card:hover .salon-media-btn img {
  transform: scale(1.02);
}

.salon-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.salon-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
}

.salon-body h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 1.25;
}

.salon-body p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-muted);
  flex: 1;
}

.salon-clawd-note {
  font-size: 0.78rem;
  color: var(--teal);
  background: rgba(43, 92, 93, 0.08);
  padding: 6px 9px;
  border-radius: 8px;
}

.salon-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  text-decoration: none;
}

.link-btn:hover {
  color: var(--vermilion);
  text-decoration: underline;
}

/* CRAFT TABS */
.craft-tabs,
.studio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.craft-tab,
.studio-tab {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper-elev);
  color: var(--ink-muted);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.craft-tab:hover,
.studio-tab:hover {
  border-color: var(--rule-strong);
  color: var(--ink);
}

.craft-tab.is-active,
.studio-tab.is-active {
  background: var(--teal);
  color: var(--paper-elev);
  border-color: var(--teal);
}

.craft-panel {
  background: var(--paper-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.proof-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: start;
}

.media-zoom-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--paper);
  overflow: hidden;
  cursor: zoom-in;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.media-zoom-trigger:hover {
  border-color: var(--teal);
  box-shadow: var(--shadow-card);
}

.media-caption {
  display: block;
  padding: 9px 13px;
  font-size: 0.78rem;
  color: var(--ink-muted);
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.proof-copy h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.42rem;
  line-height: 1.24;
}

.proof-copy p {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.fact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fact-list li {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fact-list strong {
  font-size: 0.86rem;
  color: var(--teal);
}

.fact-list span {
  font-size: 0.83rem;
  color: var(--ink-muted);
}

/* KUBELKA-MUNK LIVE LAB */
.km-lab {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  align-items: start;
}

.km-copy h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 1.45rem;
}

.km-copy p {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.km-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.chip {
  appearance: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.chip.is-active,
.chip:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(43, 92, 93, 0.08);
}

.km-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.color-field,
.slider-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.color-field input[type="color"] {
  width: 100%;
  height: 36px;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}

.slider-field {
  grid-column: 1 / -1;
}

.slider-field input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

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

.km-band-group {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.km-band-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
}

.km-gradient {
  height: 64px;
  border-radius: 10px;
  border: 1px solid rgba(32, 28, 33, 0.14);
}

.km-big-chip {
  height: 54px;
  border-radius: 10px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
  border: 1px solid rgba(32, 28, 33, 0.14);
}

/* ARCHIVE MINI GRID */
.archive-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.archive-mini-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.archive-tile {
  appearance: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--paper);
  padding: 8px;
  text-align: left;
  cursor: zoom-in;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.archive-tile:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
}

.archive-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  margin-bottom: 6px;
}

.archive-tile strong {
  display: block;
  font-size: 0.74rem;
  color: var(--ink);
  line-height: 1.25;
}

.archive-tile span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--ink-faint);
}

/* STUDIO & INVARIANTS */
.studio-showcase {
  margin-bottom: 28px;
}

.studio-frame {
  background: var(--paper-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.invariants-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.inv-card {
  background: var(--paper-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.inv-metric {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1.1;
  margin-bottom: 8px;
}

.inv-card h3 {
  margin: 0 0 6px;
  font-size: 0.96rem;
}

.inv-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 42px;
  background: rgba(239, 230, 216, 0.55);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.footer-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* LIGHTBOX */
.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 21, 29, 0.82);
  backdrop-filter: blur(8px);
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  width: min(1040px, 100%);
  max-height: calc(100vh - 40px);
  background: var(--paper-elev);
  border-radius: var(--radius-lg);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.lightbox-titles h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.08rem;
}

.lightbox-titles span {
  font-size: 0.74rem;
  color: var(--ink-faint);
}

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

.icon-close {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--paper-elev);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.icon-close:hover {
  background: var(--teal);
  color: var(--paper-elev);
  border-color: var(--teal);
}

.lightbox-body {
  padding: 16px;
  overflow: auto;
  display: flex;
  justify-content: center;
  background: var(--paper-soft);
}

.lightbox-body img {
  max-height: calc(100vh - 140px);
  width: auto;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
}

/* RESPONSIVE */
@media (max-width: 1040px) {
  .edition-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stage-grid,
  .proof-layout,
  .km-lab,
  .section-head {
    grid-template-columns: 1fr;
  }
  .salon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .archive-mini-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .invariants-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .header-inner {
    min-height: 56px;
    gap: 8px;
  }
  .brand-sub {
    display: none;
  }
  .site-nav {
    gap: 10px;
  }
  .site-nav a {
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .site-nav a[href="#stage"],
  .site-nav a[href="#studio"] {
    display: none;
  }
  .lang-toggle {
    flex-shrink: 0;
    padding: 4px 10px;
  }
  .hero {
    padding: 20px 0 42px;
  }
  .edition-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .edition-pill {
    padding: 7px 9px;
    gap: 8px;
  }
  .edition-pill img {
    width: 32px;
    height: 32px;
  }
  .edition-pill-name {
    font-size: 0.76rem;
  }
  .salon-grid,
  .invariants-grid {
    grid-template-columns: 1fr;
  }
  .archive-mini-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stage-folio,
  .craft-panel {
    padding: 16px;
  }
  .dpid-surface {
    flex-direction: column;
    align-items: flex-start;
  }
  .dpid-row {
    gap: 10px;
  }
  .loupe-lens {
    width: 148px;
    height: 148px;
  }
}
