:root {
  --bg-canvas: #F7F7F5;
  --bg-surface: #FFFFFF;
  --bg-muted: #EFEFEA;
  --border-hairline: #E5E5E0;
  --ink-primary: #141413;
  --ink-secondary: #5C5C58;
  --ink-muted: #6B6B66;
  --accent-ink: #141413;

  /* Motion tokens */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 140ms;
  --dur-2: 220ms;
  --dur-3: 320ms;
  --dur-4: 420ms;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  -webkit-font-smoothing: antialiased;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Header & Search Pill */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 247, 245, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-hairline);
}

.search-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.search-shell:focus-within {
  border-color: #141413;
  box-shadow: 0 0 0 3px rgba(20, 20, 19, 0.06);
}

.filter-chip {
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.filter-chip:hover {
  border-color: #B8B8B0;
  color: var(--ink-primary);
}
.filter-chip.active {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #FFFFFF;
}

/* Template Card */
.style-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
@media (hover: hover) {
  .style-card:hover {
    transform: translateY(-2px);
    border-color: #CECEC6;
    box-shadow: 0 12px 28px rgba(20, 20, 19, 0.06);
  }
}
.style-card:active {
  transform: scale(0.985);
  transition-duration: 90ms;
}

.preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #ECECE7;
  border-bottom: 1px solid var(--border-hairline);
  overflow: hidden;
}

.preview-iframe {
  width: 1280px;
  height: 800px;
  border: 0;
  transform-origin: top left;
  transform: scale(0.305);
  pointer-events: none;
  background: #FFFFFF;
}

@media (min-width: 1280px) {
  .preview-iframe {
    transform: scale(0.32);
  }
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  flex: none;
}

/* Card footer: swatches left, actions right, one row */
.card-foot {
  padding-top: 12px;
  border-top: 1px solid #E5E5E0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
}
.card-swatches { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.card-actions { display: flex; align-items: center; gap: 6px; flex: none; }

/* Tokens tab */
.tokens-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 768px) { .tokens-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; } }
.tk-title { font-size: 13px; font-weight: 600; color: #141413; }
.tk-hint { font-size: 12px; color: #5C5C58; margin: 2px 0 12px; }
.palette-list { display: grid; gap: 6px; }
.palette-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 48px; padding: 6px 12px 6px 6px;
  border: 1px solid #E5E5E0; border-radius: 12px; background: #fff;
  cursor: pointer; text-align: left; transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.palette-row:hover { background: #FAFAF8; border-color: #D6D6D0; }
.palette-row:focus-visible { outline: 2px solid #141413; outline-offset: 2px; }
.palette-chip { width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(0,0,0,.1); flex: none; }
.palette-copy { margin-left: auto; font-size: 12px; color: #5C5C58; }
.palette-row:hover .palette-copy { color: #141413; }
.specimen { padding: 16px; border: 1px solid #E5E5E0; border-radius: 12px; background: #FAFAF8; }
.specimen-sample { font-size: 34px; line-height: 1.1; letter-spacing: -0.01em; color: #141413; font-weight: 600; }
.specimen-line { font-size: 15px; line-height: 1.45; color: #2A2A28; margin-top: 8px; overflow-wrap: anywhere; }
.specimen-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #E5E5E0; font-size: 12px; color: #5C5C58; }
.specimen-meta a { margin-left: auto; color: #5C5C58; text-decoration: underline; text-underline-offset: 2px; }
.specimen-meta a:hover { color: #141413; }

/* Frosted Login Gate */
.gate-section {
  position: relative;
  margin-top: 28px;
}

.gate-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 24px 0 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-hairline);
}

/* Locked card thumbnail: the template's own palette and type as a spec sheet */
.locked-thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  background: #EFEFEA;
}
.locked-thumb .lt-strip {
  display: flex;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(20, 20, 19, 0.08);
}
.locked-thumb .lt-strip span { flex: 1; }
.locked-thumb .lt-name {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink-primary);
}
.locked-thumb .lt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--ink-secondary);
}
.lock-badge {
  display: inline-flex;
  margin-bottom: 10px;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ink-primary);
  color: #FFFFFF;
  font-size: 11.5px;
  font-weight: 500;
}
.lock-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }


.btn-primary {
  background: #141413;
  color: #FFFFFF;
  border: 1px solid #141413;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--dur-1) var(--ease-out), transform 90ms var(--ease-out);
}
.btn-primary:hover {
  opacity: 0.88;
}

.btn-secondary {
  background: #FFFFFF;
  color: #141413;
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), transform 90ms var(--ease-out);
}
.btn-secondary:hover {
  background: #F2F2EE;
  border-color: #C8C8C0;
}

/* Modal & Markdown Viewer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(20, 20, 19, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.hidden {
  display: none;
}

.modal-panel {
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.design-md-pre {
  background: #F4F4F0;
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #1F1F1D;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Hero copy */
.hero-lede {
  max-width: 62ch;
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-secondary);
}
.hero-access {
  max-width: 62ch;
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
}
.hero-access .font-mono { font-size: 12.5px; color: var(--ink-primary); }

/* Dev resources: curated external sites */
.resources-section {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--border-hairline);
}
.resources-head { margin-bottom: 20px; }
.resources-eyebrow {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 6px;
}
.resources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.resource-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 18px 18px 16px;
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  background: var(--bg-surface);
  color: var(--ink-primary);
  text-decoration: none;
  transition: border-color var(--dur-1) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.resource-card:hover { border-color: var(--ink-primary); transform: translateY(-2px); }
.resource-card:focus-visible { outline: 2px solid var(--ink-primary); outline-offset: 3px; }
.resource-top { display: flex; align-items: center; justify-content: space-between; }
.resource-kind {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--ink-secondary);
}
.resource-arrow {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: transform var(--dur-2) var(--ease-out);
}
.resource-card:hover .resource-arrow { transform: translate(2px, -2px); }
.resource-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.resource-desc { font-size: 13px; line-height: 1.55; color: var(--ink-secondary); flex: 1; }
.resource-host { font-size: 11.5px; color: var(--ink-muted); }
@media (prefers-reduced-motion: reduce) {
  .resource-card, .resource-arrow { transition: none; }
  .resource-card:hover, .resource-card:hover .resource-arrow { transform: none; }
}

/* Brand Footer */
.site-footer {
  border-top: 1px solid var(--border-hairline);
  padding: 56px 0 28px;
  overflow: hidden;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.footer-purpose {
  max-width: 48ch;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-secondary);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  background: var(--bg-surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-primary);
  text-decoration: none;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
.footer-links a:hover { border-color: var(--ink-primary); }
.footer-links a:focus-visible { outline: 2px solid var(--ink-primary); outline-offset: 3px; }
.footer-links svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--dur-2) var(--ease-out);
}
.footer-links a:hover svg { transform: translate(2px, -2px); }
.footer-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.18em;
  margin: 48px 0 28px;
  font-size: clamp(28px, 8.8vw, 140px);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--ink-primary);
  white-space: nowrap;
}
.footer-mark {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 0.42em;
  letter-spacing: 0;
  color: var(--ink-secondary);
  transform: translateY(-0.12em);
}
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-hairline);
  font-size: 12px;
  color: var(--ink-secondary);
}
.footer-meta span:empty { display: none; }

::selection { background: #141413; color: #F7F7F5; }

/* Keyboard focus */
:where(a, button, input, [role="tab"], [tabindex]):focus-visible {
  outline: 2px solid var(--ink-primary);
  outline-offset: 2px;
}
.search-shell:focus-within { box-shadow: 0 0 0 3px rgba(20, 20, 19, 0.14); }
.modal-panel:focus { outline: none; }

/* Card title opens the detail; the whole card stays clickable by mouse */
.card-open {
  all: unset;
  cursor: pointer;
  border-radius: 4px;
}
.card-open:focus-visible { outline: 2px solid var(--ink-primary); outline-offset: 3px; }

/* Static grid thumbnail */
.preview-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
}
.preview-thumb.is-loaded { opacity: 1; }

/* Touch devices: no keyboard shortcut hint */
@media (pointer: coarse) {
  .search-kbd { display: none; }
}

/* Phones: chips scroll sideways, detail modal goes full screen */
@media (max-width: 639px) {
  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px 2px;
    scrollbar-width: none;
  }
  .chip-row::-webkit-scrollbar { display: none; }
  .chip-row .filter-chip { flex: none; min-height: 40px; }

  #detailModal { padding: 0; }
  #detailModal .modal-panel {
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  #detailModal .det-head { flex-wrap: nowrap; align-items: flex-start; padding: 14px 16px; }
  #detailModal .det-title { min-width: 0; flex: 1; }
  #detailModal .det-title > div { flex-wrap: wrap; row-gap: 4px; }
  #detailModal .det-tabs { padding: 10px 16px 0; gap: 20px; overflow-x: auto; white-space: nowrap; }
  #detailModal .det-body { padding: 16px 16px 92px; }
  #detailModal .det-body iframe { height: 60dvh; }
  #detailModal .det-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #FFFFFF;
    border-top: 1px solid var(--border-hairline);
  }
  #detailModal .det-actions > * { min-height: 44px; justify-content: center; white-space: nowrap; }
  #detailModal .det-actions #detDownloadBtn { grid-column: 1 / -1; order: -1; }
  #detailModal .det-actions .det-close {
    position: fixed;
    top: 14px;
    right: 16px;
    width: 40px;
    height: 40px;
    min-height: 0;
  }
  #detailModal .det-head { padding-right: 68px; }
}

/* Loading */
.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 320px;
  font-size: 13.5px;
  color: var(--ink-secondary);
}
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-hairline);
  border-top-color: var(--ink-primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
button:disabled { opacity: 0.6; cursor: progress; }

/* DESIGN.md tab */
.agent-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: #FAFAF8;
}
.md-toolbar {
  position: sticky;
  top: -24px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -24px 8px;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}
.md-toc {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.md-toc::-webkit-scrollbar { display: none; }
.md-toc a {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-secondary);
  text-decoration: none;
  white-space: nowrap;
}
.md-toc a:hover { background: var(--bg-muted); color: var(--ink-primary); }
.md-view-toggle {
  flex: none;
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-muted);
}
.md-view-toggle button {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
}
.md-view-toggle button[aria-pressed="true"] { background: #FFFFFF; color: var(--ink-primary); box-shadow: 0 1px 2px rgba(20,20,19,.08); }

.md-doc { max-width: 76ch; font-size: 14.5px; line-height: 1.65; color: #2A2A28; }
.md-doc h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink-primary); margin: 0 0 12px; line-height: 1.25; }
.md-doc h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-primary); margin: 36px 0 10px; scroll-margin-top: 64px; }
.md-doc h4, .md-doc h5 { font-size: 15px; font-weight: 600; color: var(--ink-primary); margin: 22px 0 8px; }
.md-doc p { margin: 0 0 12px; }
.md-doc ul, .md-doc ol { margin: 0 0 14px; padding-left: 22px; }
.md-doc ul { list-style: disc; }
.md-doc ol { list-style: decimal; }
.md-doc li { margin: 4px 0; }
.md-doc li.md-sub { margin-left: 18px; list-style: circle; }
.md-doc code { font-family: 'JetBrains Mono', monospace; font-size: 0.86em; padding: 1px 5px; border-radius: 5px; background: #F2F2EE; border: 1px solid var(--border-hairline); }
.md-doc pre { margin: 0 0 14px; padding: 14px; border-radius: 10px; background: #F4F4F0; border: 1px solid var(--border-hairline); overflow-x: auto; }
.md-doc pre code { padding: 0; border: 0; background: none; }
.md-doc hr { border: 0; border-top: 1px solid var(--border-hairline); margin: 28px 0; }
.md-doc strong { color: var(--ink-primary); font-weight: 600; }
.md-table { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border-hairline); border-radius: 10px; }
.md-doc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-doc th, .md-doc td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border-hairline); vertical-align: top; }
.md-doc th { background: #FAFAF8; font-weight: 600; color: var(--ink-primary); }
.md-doc tr:last-child td { border-bottom: 0; }
.md-doc-preview { position: relative; max-height: 360px; overflow: hidden; }
.md-doc-preview::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(transparent, #FFFFFF); }

@media (max-width: 639px) {
  .md-toolbar { top: -16px; margin: 0 -16px 8px; padding: 8px 16px; }
}

/* Featured marker sits beside the name, never over the preview */
.featured-pill {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #141413;
  color: #F7F7F5;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Browser surfaces */
html { scrollbar-color: #C9C9C3 transparent; }
input, textarea { caret-color: #141413; }
#catalogCounter, #footerCount { font-variant-numeric: tabular-nums; }

/* ========================================================================
   Motion
   ======================================================================== */

/* Press feedback on buttons */
.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled) { transform: scale(0.97); }

/* Modals: backdrop fades, panel rises; exits ~20% faster */
.modal-backdrop { animation: fade-in var(--dur-2) var(--ease-out); }
.modal-backdrop .modal-panel { animation: panel-in var(--dur-3) var(--ease-out); }
.modal-backdrop.is-closing { animation: fade-out 180ms var(--ease-in) forwards; pointer-events: none; }
.modal-backdrop.is-closing .modal-panel { animation: panel-out 180ms var(--ease-in) forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes panel-out { to { opacity: 0; transform: translateY(4px) scale(0.985); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(16px); } }
@media (max-width: 639px) {
  #detailModal .modal-panel { animation-name: sheet-in; }
  #detailModal.is-closing .modal-panel { animation-name: sheet-out; }
}

/* Toast: rises in; a replaced message cross-fades */
#toast { animation: toast-in var(--dur-2) var(--ease-out); }
#toast.is-leaving { animation: toast-out 180ms var(--ease-in) forwards; }
#toastMsg.is-swapping { animation: fade-in 150ms var(--ease-out); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* Detail tabs: one indicator glides between tabs, the panel cross-fades */
.det-tabs { position: relative; }
.dtab-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100px;
  height: 2px;
  background: var(--ink-primary);
  transform-origin: left center;
  transition: transform var(--dur-3) var(--ease-in-out);
  pointer-events: none;
}
.dtab-indicator.no-anim { transition: none; }
#detailBody.is-swapping { animation: fade-in 150ms var(--ease-out); }

/* Copy feedback: label rolls up, the check draws itself */
.copy-label { display: inline-flex; align-items: center; gap: 6px; }
.copy-label.label-swap { animation: label-in var(--dur-2) var(--ease-out); }
.copy-check { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy-check path { stroke-dasharray: 16; stroke-dashoffset: 16; animation: draw-check 200ms var(--ease-out) 60ms forwards; }
.palette-row.is-copied { border-color: var(--ink-primary); }
.palette-row.is-copied .palette-copy { color: var(--ink-primary); }
@keyframes label-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes draw-check { to { stroke-dashoffset: 0; } }

/* Unlock moment: right after login, each spec card gives way to its real preview */
.unlock-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  animation: veil-out var(--dur-4) var(--ease-out) forwards;
  animation-delay: calc(120ms + var(--i, 0) * 40ms);
}
.is-unlocking .preview-thumb { animation: thumb-settle 600ms var(--ease-out) both; animation-delay: calc(120ms + var(--i, 0) * 40ms); }
@keyframes veil-out {
  from { opacity: 1; clip-path: inset(0 0 0 0); }
  to { opacity: 0; clip-path: inset(0 0 100% 0); }
}
@keyframes thumb-settle { from { transform: scale(1.04); } }

/* Close icon */
.close-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* Reduced motion: keep meaning, drop movement */
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop .modal-panel,
  #detailModal .modal-panel,
  #toast { animation: fade-in 150ms linear; }
  .modal-backdrop.is-closing .modal-panel,
  #detailModal.is-closing .modal-panel,
  #toast.is-leaving { animation: fade-out 120ms linear forwards; }
  .dtab-indicator { transition: none; }
  .copy-label.label-swap { animation: fade-in 120ms linear; }
  .copy-check path { animation: none; stroke-dashoffset: 0; }
  .unlock-veil { animation: fade-out 150ms linear forwards; animation-delay: 0ms; }
  .is-unlocking .preview-thumb { animation: none; }
  .style-card:active,
  .btn-primary:active:not(:disabled),
  .btn-secondary:active:not(:disabled) { transform: none; }
  @media (hover: hover) { .style-card:hover { transform: none; } }
  .footer-links a:hover svg { transform: none; }
}
