/* ÉCLAT · Design System styles */

:root {
  /* Brand */
  --gold: #C9A86A;
  --gold-soft: #E5D4A8;
  --bordeaux: #5B1E2C;
  --champagne: #EFE3C8;
  /* Neutrals (light) */
  --cream: #F8F6F0;
  --ivory: #FFFCF5;
  --stone: #E8E3D6;
  --ink: #1A1A1A;
  /* Semantic */
  --success: #4F7A5C;
  --warning: #B8873E;
  --error: #A33A3A;
  --info: #3D5A7A;

  /* Surfaces + text tokens */
  --bg:        var(--cream);
  --bg-elev-1: #FFFFFF;
  --bg-elev-2: #FFFFFF;
  --bg-soft:   #F1EDE1;
  --text:      var(--ink);
  --text-muted:#6B6560;
  --text-faint:#9A938B;
  --hairline:  rgba(26,26,26,0.10);
  --hairline-strong: rgba(26,26,26,0.22);
  --accent:    var(--gold);
  --ring:      rgba(201,168,106,0.35);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 2px rgba(26,26,26,0.04), 0 1px 1px rgba(26,26,26,0.03);
  --shadow-md: 0 6px 18px rgba(26,26,26,0.06), 0 1px 3px rgba(26,26,26,0.04);
  --shadow-lg: 0 20px 48px rgba(26,26,26,0.10), 0 2px 6px rgba(26,26,26,0.05);

  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, Menlo, monospace;

  --t: .3s ease;
}

[data-theme="dark"] {
  --bg:        #0F0F0F;
  --bg-elev-1: #1A1A1A;
  --bg-elev-2: #1F1F1F;
  --bg-soft:   #181817;
  --text:      var(--cream);
  --text-muted:#9A948B;
  --text-faint:#66605A;
  --hairline:  rgba(248,246,240,0.10);
  --hairline-strong: rgba(248,246,240,0.22);
  --ring:      rgba(201,168,106,0.45);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 20px 48px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
  transition: background-color var(--t), color var(--t);
}

::selection { background: var(--gold); color: var(--ink); }
.muted { color: var(--text-muted); }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
  transition: background-color var(--t), border-color var(--t);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: var(--cream);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 18px; font-weight: 500;
  letter-spacing: .02em;
}
[data-theme="dark"] .brand-mark { background: var(--cream); color: var(--ink); }
.brand-mark.small { width: 28px; height: 28px; font-size: 15px; }
.brand-word {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  letter-spacing: .22em;
}
.brand-sub {
  padding-left: 14px; margin-left: 6px;
  border-left: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search {
  position: relative; display: flex; align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 6px 14px 6px 36px;
  min-width: 320px;
  transition: border-color var(--t), background-color var(--t);
}
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 4px var(--ring); }
.search-icon { position: absolute; left: 14px; color: var(--text-muted); }
.search input {
  flex: 1; border: 0; background: transparent; outline: none;
  font: inherit; color: var(--text); padding: 4px 6px;
}
.search input::placeholder { color: var(--text-faint); }
.kbd {
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  background: var(--bg-elev-1); border: 1px solid var(--hairline);
  border-radius: 4px; padding: 2px 6px;
}

.icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%;
  background: transparent; border: 1px solid var(--hairline);
  color: var(--text);
  display: grid; place-items: center; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--hairline-strong); }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn .moon { display: none; }
[data-theme="dark"] .icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .moon { display: block; }

.dot-indicator {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--bordeaux); color: #fff;
  font-size: 9px; font-weight: 600; display: grid; place-items: center;
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1440px; margin: 0 auto;
  display: grid; grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 0 32px;
}
.sidebar {
  position: sticky; top: 80px;
  align-self: start;
  height: calc(100vh - 96px);
  padding: 40px 0;
}
.sidebar-inner { display: flex; flex-direction: column; gap: 6px; }
.side-label {
  font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-faint);
  margin: 18px 0 8px;
}
.side-label:first-child { margin-top: 0; }
.side-nav { display: flex; flex-direction: column; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
  text-decoration: none; color: var(--text-muted);
  font-size: 14px; font-weight: 400;
  border-bottom: 1px solid transparent;
  transition: color .15s;
}
.side-link:hover { color: var(--text); }
.side-link.active {
  color: var(--text);
  font-weight: 500;
}
.side-link.active .side-num { color: var(--gold); }
.side-num {
  font-family: var(--mono); font-size: 10px; color: var(--text-faint);
  width: 20px;
}
.side-meta {
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 6px;
}
.side-meta-row {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
  letter-spacing: .04em;
}
.side-meta-row span:last-child { font-family: var(--mono); color: var(--text); }

.mobile-nav { display: none; }

.main { min-width: 0; padding: 24px 0 96px; }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 88px;
  border-bottom: 1px solid var(--hairline);
}
.hero-kicker {
  font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold); font-weight: 500;
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(56px, 7vw, 96px);
  font-weight: 400; line-height: 1.02; letter-spacing: -0.02em;
  margin: 0 0 28px; color: var(--text);
}
.hero-title em { font-style: italic; font-weight: 300; color: var(--gold); }
.hero-lede {
  max-width: 620px; margin: 0 0 40px;
  font-size: 17px; line-height: 1.6; color: var(--text-muted);
}
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 32px; max-width: 720px;
  padding-top: 28px; border-top: 1px solid var(--hairline);
}
.hero-stat-n {
  display: block; font-family: var(--serif);
  font-size: 36px; font-weight: 400; line-height: 1;
  margin-bottom: 6px;
}
.hero-stat-l {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Sections ---------- */
.section {
  padding: 88px 0;
  border-bottom: 1px solid var(--hairline);
}
.section:last-of-type { border-bottom: 0; }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-index {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  color: var(--gold); margin-bottom: 16px; text-transform: uppercase;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 400; line-height: 1.05; letter-spacing: -0.01em;
  margin: 0 0 16px;
}
.section-lede {
  font-size: 16px; color: var(--text-muted); max-width: 620px; margin: 0;
}

/* ---------- Code block ---------- */
.code-toggle-wrap { margin-top: 32px; }
.code-toggle {
  font-family: var(--sans); font-size: 12px;
  letter-spacing: .08em; text-transform: uppercase;
  background: transparent; border: 1px solid var(--hairline);
  color: var(--text); padding: 8px 16px; border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.code-toggle:hover { border-color: var(--hairline-strong); background: var(--bg-soft); }
.code-block {
  position: relative;
  margin: 16px 0 0; padding: 20px 24px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline); border-radius: var(--radius-md);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
}
.code-block code { font: inherit; color: inherit; white-space: pre; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: var(--bg-elev-1); border: 1px solid var(--hairline);
  color: var(--text); padding: 4px 10px; border-radius: 4px;
  font: 500 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; transition: border-color .15s;
}
.copy-btn:hover { border-color: var(--gold); }

/* ---------- 01 Colors ---------- */
.swatch-group-label {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-muted); margin: 0 0 16px; font-weight: 500;
}
.swatch-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 36px;
}
.swatch {
  cursor: pointer;
  background: var(--bg-elev-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.swatch:hover { border-color: var(--hairline-strong); transform: translateY(-2px); }
.swatch-block { height: 120px; position: relative; }
.swatch-block::after {
  content: 'Click to copy';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.9); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(0,0,0,0.25);
  opacity: 0; transition: opacity .2s;
}
.swatch:hover .swatch-block::after { opacity: 1; }
.swatch.light .swatch-block::after { color: rgba(0,0,0,0.7); background: rgba(255,255,255,0.4); }
.swatch-info { padding: 12px 14px; display: flex; justify-content: space-between; align-items: baseline; }
.swatch-name { font-size: 13px; font-weight: 500; }
.swatch-hex { font-family: var(--mono); font-size: 11px; color: var(--text-muted); }

/* ---------- 02 Typography ---------- */
.type-list { display: flex; flex-direction: column; }
.type-row {
  display: grid; grid-template-columns: 1fr 260px;
  gap: 32px; align-items: baseline;
  padding: 28px 0; border-top: 1px solid var(--hairline);
}
.type-row:first-child { border-top: 0; padding-top: 0; }
.type-sample { color: var(--text); }
.type-sample.serif { font-family: var(--serif); }
.type-sample.sans  { font-family: var(--sans); }
.type-meta { font-family: var(--mono); font-size: 12px; color: var(--text-muted); line-height: 1.8; }
.type-meta strong { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text); margin-bottom: 6px; font-weight: 500; }

/* ---------- 03 Buttons ---------- */
.btn {
  font-family: var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; cursor: pointer;
  position: relative; overflow: hidden;
  transition: background-color .15s, color .15s, border-color .15s, transform .05s;
  font-weight: 500; letter-spacing: .02em;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}
.btn-sm { font-size: 12px; padding: 6px 14px; }
.btn-md { font-size: 13px; padding: 10px 20px; }
.btn-lg { font-size: 14px; padding: 14px 28px; letter-spacing: .06em; }
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

.btn-primary   { background: var(--ink); color: var(--cream); }
.btn-primary:hover:not([disabled]) { background: #2a2a2a; }
[data-theme="dark"] .btn-primary   { background: var(--cream); color: var(--ink); }
[data-theme="dark"] .btn-primary:hover:not([disabled]) { background: #e5dfc8; }

.btn-secondary { background: transparent; color: var(--text); border-color: var(--hairline-strong); }
.btn-secondary:hover:not([disabled]) { border-color: var(--text); background: var(--bg-soft); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not([disabled]) { background: var(--bg-soft); }

.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover:not([disabled]) { background: #8c2f2f; }

.btn.forced-hover.btn-primary { background: #2a2a2a; }
[data-theme="dark"] .btn.forced-hover.btn-primary { background: #e5dfc8; }
.btn.forced-hover.btn-secondary { border-color: var(--text); background: var(--bg-soft); }
.btn.forced-hover.btn-ghost { background: var(--bg-soft); }
.btn.forced-hover.btn-danger { background: #8c2f2f; }

/* ripple */
.ripple {
  position: absolute; border-radius: 50%;
  transform: scale(0);
  animation: ripple .55s ease-out forwards;
  background: rgba(255,255,255,0.4);
  pointer-events: none;
}
.btn-secondary .ripple, .btn-ghost .ripple { background: rgba(26,26,26,0.12); }
[data-theme="dark"] .btn-secondary .ripple, [data-theme="dark"] .btn-ghost .ripple { background: rgba(248,246,240,0.14); }
@keyframes ripple {
  to { transform: scale(3.2); opacity: 0; }
}

.button-matrix {
  display: grid;
  grid-template-columns: 140px repeat(3, 1fr);
  gap: 20px 28px;
  align-items: center;
}
.bm-head {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-faint); font-weight: 500;
  padding-bottom: 10px; border-bottom: 1px solid var(--hairline);
}
.bm-row-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted);
}
.bm-cell { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- 04 Forms ---------- */
.form-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 28px 32px;
}
.form-grid.compact { gap: 20px; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text); font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.field-badge {
  font-size: 9px; letter-spacing: .1em; padding: 2px 6px;
  background: var(--gold); color: var(--ink); border-radius: 3px;
  font-weight: 600;
}
.field-help { font-size: 12px; color: var(--text-muted); }
.field-error { font-size: 12px; color: var(--error); }

.input {
  font: inherit; color: var(--text);
  background: var(--bg-elev-1);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px; width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus, .input.is-focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--ring);
}
.input.is-error { border-color: var(--error); }
.input.is-error:focus { box-shadow: 0 0 0 4px rgba(163,58,58,0.2); }
.input[disabled] { background: var(--bg-soft); color: var(--text-muted); cursor: not-allowed; }

.textarea { resize: vertical; min-height: 100px; font-family: var(--sans); }

.input-affix { position: relative; display: flex; }
.input-affix .input { padding-right: 40px; }
.affix-btn {
  position: absolute; right: 2px; top: 2px; bottom: 2px;
  width: 36px; background: transparent; border: 0;
  color: var(--text-muted); cursor: pointer; display: grid; place-items: center;
  border-radius: var(--radius-sm);
}
.affix-btn:hover { color: var(--text); background: var(--bg-soft); }

.select { appearance: none; padding-right: 40px; cursor: pointer; }
.select-chev {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

.choice-group { display: flex; flex-direction: column; gap: 12px; }
.choice-row { flex-direction: row; gap: 24px; }
.choice {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 14px; color: var(--text);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box, .radio-box {
  width: 16px; height: 16px; flex: none;
  border: 1.5px solid var(--hairline-strong); background: var(--bg-elev-1);
  transition: border-color .15s, background-color .15s;
  display: grid; place-items: center;
}
.choice-box { border-radius: 3px; }
.radio-box { border-radius: 50%; }
.choice input[type="checkbox"]:checked ~ .choice-box {
  background: var(--ink); border-color: var(--ink);
}
[data-theme="dark"] .choice input[type="checkbox"]:checked ~ .choice-box {
  background: var(--cream); border-color: var(--cream);
}
.choice input[type="checkbox"]:checked ~ .choice-box::after {
  content: ''; width: 8px; height: 4px;
  border-left: 1.5px solid var(--cream);
  border-bottom: 1.5px solid var(--cream);
  transform: rotate(-45deg) translate(1px, -1px);
}
[data-theme="dark"] .choice input[type="checkbox"]:checked ~ .choice-box::after {
  border-color: var(--ink);
}
.choice input[type="radio"]:checked ~ .radio-box {
  border-color: var(--ink);
}
[data-theme="dark"] .choice input[type="radio"]:checked ~ .radio-box { border-color: var(--cream); }
.choice input[type="radio"]:checked ~ .radio-box::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink);
}
[data-theme="dark"] .choice input[type="radio"]:checked ~ .radio-box::after { background: var(--cream); }
.choice input[disabled] ~ .choice-box,
.choice input[disabled] ~ .radio-box { opacity: .5; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
  font-size: 14px;
}
.switch-row:last-child { border-bottom: 0; }
.switch { position: relative; display: inline-block; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  display: inline-block; width: 36px; height: 20px;
  background: var(--hairline-strong);
  border-radius: 999px; position: relative;
  transition: background-color .2s;
  cursor: pointer;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .2s;
}
.switch input:checked ~ .switch-track { background: var(--gold); }
.switch input:checked ~ .switch-track .switch-thumb { transform: translateX(16px); }
.switch input[disabled] ~ .switch-track { opacity: .5; cursor: not-allowed; }

/* ---------- 05 Cards ---------- */
.cards-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.card {
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--bg-elev-1); display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card-elevated { box-shadow: var(--shadow-md); }
.card-elevated:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-outlined { border: 1px solid var(--hairline-strong); }
.card-outlined:hover { border-color: var(--text); }
.card-filled { background: var(--bg-soft); }
[data-theme="dark"] .card-filled { background: #1c1c1b; }

.card-media { aspect-ratio: 4 / 3; width: 100%; }
.card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title {
  font-family: var(--serif); font-size: 24px; font-weight: 500;
  margin: 4px 0 0; letter-spacing: -.01em; line-height: 1.1;
}
.card-sub { font-size: 12px; color: var(--text-muted); letter-spacing: .04em; }
.card-desc { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin: 4px 0 0; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 16px;
}
.card-footer.subtle { font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--hairline); margin-top: 12px; }
.price { font-family: var(--serif); font-size: 22px; }
.profile-body { align-items: flex-start; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }

.overline {
  font-size: 10px; font-weight: 500; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold);
}

.stat-value {
  font-family: var(--serif); font-size: 44px; font-weight: 400;
  line-height: 1; margin: 8px 0 6px; letter-spacing: -.01em;
}
.stat-trend { font-size: 13px; color: var(--success); font-weight: 500; }
.stat-trend.up { color: var(--success); }
.spark { color: var(--gold); margin-top: 14px; height: 48px; }
.spark svg { width: 100%; height: 100%; }

/* ---------- 06 Navigation ---------- */
.demo-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 500; margin: 32px 0 12px;
}
.demo-label:first-of-type { margin-top: 0; }
.demo-frame {
  background: var(--bg-elev-1);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 24px;
}
.demo-frame.stacked { display: flex; flex-direction: column; gap: 20px; }
.demo-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 8px; }

.topnav-demo {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px;
  gap: 16px;
}
.topnav-brand { font-family: var(--serif); font-size: 20px; letter-spacing: .22em; font-weight: 500; }
.topnav-links { display: flex; gap: 28px; }
.topnav-links a {
  text-decoration: none; color: var(--text-muted);
  font-size: 13px; font-weight: 400;
  padding: 6px 0;
  position: relative;
}
.topnav-links a.active { color: var(--text); font-weight: 500; }
.topnav-links a.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -8px;
  height: 1px; background: var(--gold);
}
.topnav-links a:hover { color: var(--text); }
.topnav-right, .topnav-left { display: flex; align-items: center; gap: 8px; }
.topnav-demo--b { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 12px 4px; }
.breadcrumb-compact { font-size: 12px; color: var(--text-muted); letter-spacing: .04em; }
.breadcrumb-compact strong { color: var(--text); font-weight: 500; }

.demo-sidebar-frame { padding: 16px; }
.sidebar-demo {
  width: 260px;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
}
.sidebar-section + .sidebar-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.sidebar-heading {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-faint); padding: 0 12px; margin-bottom: 6px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-muted); font-size: 13px;
  transition: background-color .12s, color .12s;
}
.sidebar-item:hover { background: var(--bg-elev-1); color: var(--text); }
.sidebar-item.active { background: var(--bg-elev-1); color: var(--text); font-weight: 500; }
.sidebar-item.active svg { color: var(--gold); }
.badge.badge-dot {
  margin-left: auto; font-size: 10px; padding: 2px 6px;
  background: var(--gold); color: var(--ink);
}

.breadcrumbs {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 500; }
.bc-sep { color: var(--text-faint); }

.tabs { display: flex; }
.tab {
  font: 500 13px var(--sans); color: var(--text-muted);
  background: transparent; border: 0; cursor: pointer;
  padding: 10px 0;
  transition: color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }

.tabs-underline { gap: 28px; border-bottom: 1px solid var(--hairline); }
.tabs-underline .tab { padding: 12px 0; position: relative; }
.tabs-underline .tab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--gold);
}

.tabs-pills { gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 999px; width: fit-content; }
.tabs-pills .tab { padding: 8px 18px; border-radius: 999px; }
.tabs-pills .tab.active { background: var(--bg-elev-1); color: var(--text); box-shadow: var(--shadow-sm); }

.tabs-enclosed { gap: 0; border-bottom: 1px solid var(--hairline); }
.tabs-enclosed .tab {
  padding: 10px 20px;
  border: 1px solid transparent; border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
}
.tabs-enclosed .tab.active {
  background: var(--bg-elev-1);
  border-color: var(--hairline);
  border-bottom-color: var(--bg-elev-1);
}

.pagination { display: flex; align-items: center; gap: 6px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  background: transparent; border: 1px solid var(--hairline);
  color: var(--text); font: inherit; font-size: 13px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.page-btn:hover { border-color: var(--hairline-strong); }
.page-btn.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
[data-theme="dark"] .page-btn.active { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.page-ellipsis { color: var(--text-faint); padding: 0 4px; }

.pagination-minimal { justify-content: space-between; width: 100%; }
.page-info { font-size: 13px; color: var(--text-muted); }
.page-info strong { color: var(--text); font-weight: 500; }

/* ---------- 07 Feedback ---------- */
.alert {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev-1);
  font-size: 14px;
}
.alert-icon {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: #fff;
  font-family: var(--sans);
}
.alert-info    { border-left-color: var(--info); }
.alert-info    .alert-icon { background: var(--info); font-style: italic; font-family: var(--serif); font-size: 14px; }
.alert-success { border-left-color: var(--success); }
.alert-success .alert-icon { background: var(--success); }
.alert-warning { border-left-color: var(--warning); }
.alert-warning .alert-icon { background: var(--warning); }
.alert-error   { border-left-color: var(--error); }
.alert-error   .alert-icon { background: var(--error); }

.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tooltip-row { gap: 28px; }

.has-tooltip {
  position: relative; cursor: default;
  padding-bottom: 2px; border-bottom: 1px dashed var(--hairline-strong);
  font-size: 14px;
}
.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink); color: var(--cream);
  font-size: 12px; padding: 6px 10px; border-radius: var(--radius-sm);
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s;
}
[data-theme="dark"] .has-tooltip::after { background: var(--cream); color: var(--ink); }
.has-tooltip:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 3px;
  background: var(--ink); color: var(--cream);
}
[data-theme="dark"] .badge { background: var(--cream); color: var(--ink); }
.badge-gold    { background: var(--gold); color: var(--ink); }
.badge-success { background: var(--success); color: #fff; }
.badge-warning { background: var(--warning); color: #fff; }
.badge-error   { background: var(--error);   color: #fff; }
.badge-outline { background: transparent; color: var(--text); border: 1px solid var(--hairline-strong); }
[data-theme="dark"] .badge-outline { color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 12px;
}
.chip button {
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: 14px; line-height: 1;
  padding: 0; width: 14px; height: 14px;
}
.chip button:hover { color: var(--text); }
.chip-add { color: var(--text-muted); cursor: pointer; }
.chip-add:hover { color: var(--text); border-color: var(--hairline-strong); }

.progress {
  width: 100%; height: 4px;
  background: var(--bg-soft);
  border-radius: 999px; overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%; background: var(--gold);
  border-radius: 999px;
  transition: width .4s;
}
.progress-indeterminate .progress-fill {
  width: 35% !important; position: absolute;
  animation: indeterm 1.4s infinite cubic-bezier(.4,0,.2,1);
}
@keyframes indeterm {
  0%   { left: -35%; }
  100% { left: 100%; }
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--hairline-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
.spinner-lg { width: 28px; height: 28px; border-width: 2.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 08 Data display ---------- */
.table-frame { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; padding: 14px 20px;
  font-size: 10px; font-weight: 500; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--hairline);
  cursor: pointer; user-select: none;
  background: var(--bg-soft);
}
.table thead th:hover { color: var(--text); }
.table thead th.sorted { color: var(--text); }
.sort-arrow { display: inline-block; width: 10px; margin-left: 6px; color: var(--gold); }
.table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-soft); }
.cell-client { display: flex; align-items: center; gap: 12px; }
.cell-client strong { font-weight: 500; display: block; }
.cell-client .muted { font-size: 11px; letter-spacing: .04em; }
.cell-value { font-family: var(--mono); font-size: 12.5px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--hairline);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.status-active   .status-dot { background: var(--success); }
.status-pending  .status-dot { background: var(--warning); }
.status-archived .status-dot { background: var(--text-faint); }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions button {
  background: transparent; border: 0; padding: 4px 8px;
  color: var(--text-muted); cursor: pointer; font-size: 14px;
  border-radius: var(--radius-sm);
}
.cell-actions button:hover { color: var(--text); background: var(--bg-elev-1); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 500; letter-spacing: .04em;
  color: #fff;
  border: 2px solid var(--bg-elev-1);
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 52px; height: 52px; font-size: 16px; }
.avatar-group { display: inline-flex; }
.avatar-group .avatar + .avatar { margin-left: -10px; }
.avatar-initial { text-transform: uppercase; }
.avatar-more { background: var(--bg-soft); color: var(--text-muted); font-size: 11px; }
[data-theme="dark"] .avatar-more { background: #2a2a28; }
.avatar-stack-label { font-size: 13px; color: var(--text-muted); margin-top: 10px; }

.tree { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.tree li { padding: 6px 0; display: flex; align-items: center; gap: 8px; cursor: default; }
.tree .tree-children { padding-left: 22px; display: none; border-left: 1px solid var(--hairline); margin-left: 8px; }
.tree li.open > .tree-children { display: block; }
.tree .tree-toggle {
  width: 14px; display: inline-grid; place-items: center;
  color: var(--text-muted); font-size: 9px; transition: transform .15s;
}
.tree li.open > .tree-row .tree-toggle { transform: rotate(90deg); }
.tree .tree-row { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 0; }
.tree .tree-row:hover { color: var(--text); }
.tree .tree-leaf { color: var(--text-muted); }
.tree .tree-count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.timeline { list-style: none; padding: 0; margin: 0; }
.t-item {
  position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 16px;
  padding: 14px 0 14px 0;
}
.t-item::before {
  content: ''; position: absolute; left: 5px; top: 30px; bottom: -4px;
  width: 1px; background: var(--hairline);
}
.t-item:last-child::before { display: none; }
.t-dot {
  width: 10px; height: 10px; margin-top: 8px; margin-left: 1px;
  border-radius: 50%; background: var(--gold);
}
.t-dot-hollow { background: transparent; border: 1.5px solid var(--text-faint); }
.t-time { font-size: 11px; letter-spacing: .08em; color: var(--text-muted); font-family: var(--mono); margin-bottom: 3px; }
.t-title { font-size: 14px; font-weight: 500; }
.t-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.empty-frame { display: grid; place-items: center; min-height: 260px; }
.empty { text-align: center; max-width: 300px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-ill { width: 88px; height: 88px; color: var(--gold); margin-bottom: 4px; }
.empty-title { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.empty-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

.skeleton { background: var(--bg-soft); border-radius: 4px; position: relative; overflow: hidden; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: shimmer 1.6s infinite;
  transform: translateX(-100%);
}
[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 12px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.skeleton-row { display: flex; gap: 14px; align-items: center; margin-top: 6px; }

/* ---------- 09 Icons ---------- */
.icon-grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.icon-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 12px;
  border: 1px solid var(--hairline); border-radius: var(--radius-md);
  background: var(--bg-elev-1);
  cursor: pointer; color: var(--text);
  transition: border-color .15s, transform .15s, color .15s;
}
.icon-tile:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }
.icon-tile svg { width: 24px; height: 24px; }
.icon-label { font-size: 11px; letter-spacing: .04em; color: var(--text-muted); }
.icon-tile:hover .icon-label { color: var(--text); }

/* ---------- Modal ---------- */
.modal-overlay[hidden] { display: none !important; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,15,15,0.5);
  display: grid; place-items: center;
  padding: 24px;
  animation: fade-in .2s ease-out;
}
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.65); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-elev-1); color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px;
  animation: rise .25s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-head {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-title {
  font-family: var(--serif); font-size: 28px; font-weight: 500;
  margin: 8px 0 0; letter-spacing: -.01em;
}
.modal-body { padding: 20px 28px; }
.modal-lede { color: var(--text-muted); margin: 0 0 20px; font-size: 14px; }
.modal-foot {
  padding: 16px 28px 22px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--hairline);
}

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--cream);
  padding: 12px 18px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  min-width: 260px; max-width: 380px;
  animation: toast-in .3s cubic-bezier(.2,.8,.2,1);
  border-left: 3px solid var(--gold);
}
[data-theme="dark"] .toast { background: var(--cream); color: var(--ink); }
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
.toast.info    { border-left-color: var(--info); }
.toast.leaving { animation: toast-out .25s forwards; }
@keyframes toast-in  { from { opacity: 0; transform: translateX(16px); } }
@keyframes toast-out { to   { opacity: 0; transform: translateX(16px); } }

/* ---------- Footer ---------- */
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 40px 0 0; margin-top: 40px;
  border-top: 1px solid var(--hairline);
  font-size: 12px; color: var(--text-muted);
}
.footer-left { display: flex; align-items: center; gap: 12px; }
.footer-title { font-family: var(--serif); font-size: 16px; letter-spacing: .2em; color: var(--text); }
.footer-sub { font-size: 11px; color: var(--text-muted); letter-spacing: .04em; }
.footer-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .swatch-grid { grid-template-columns: repeat(3, 1fr); }
  .icon-grid { grid-template-columns: repeat(5, 1fr); }
  .cards-row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 0 20px; }
  .sidebar { display: none; }
  .mobile-nav {
    display: block; position: sticky; top: 64px; z-index: 40;
    background: var(--bg); padding: 10px 0;
    border-bottom: 1px solid var(--hairline);
    margin: 0 -20px; padding: 10px 20px;
  }
  #mobile-section {
    width: 100%; padding: 10px 14px;
    background: var(--bg-elev-1); color: var(--text);
    border: 1px solid var(--hairline-strong); border-radius: var(--radius-sm);
    font: inherit;
  }
  .topbar-inner { padding: 12px 20px; gap: 12px; }
  .brand-sub { display: none; }
  .search { min-width: 0; display: none; }
  .hero-title { font-size: 52px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .section { padding: 56px 0; }
  .swatch-grid { grid-template-columns: repeat(2, 1fr); }
  .icon-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; gap: 12px; }
  .button-matrix { grid-template-columns: 100px 1fr; }
  .bm-head:not(:first-child) { display: none; }
  .demo-grid-2 { grid-template-columns: 1fr; }
  .footer { flex-direction: column; align-items: flex-start; }
  .footer-right { align-items: flex-start; }
}
