
/* =============================================================================
   Aurum designer portal — styles
   ============================================================================= */

:root {
  /* Brand */
  --brand:        #7029CC;
  --brand-ink:    #FFFFFF;
  --brand-soft:   #F3EAFF;

  /* Light theme */
  --bg:           #FAFAF9;
  --bg-elev:      #FFFFFF;
  --bg-subtle:    #F2F2EF;
  --bg-sunken:    #ECECE8;
  --fg:           #121212;
  --fg-subtle:    #4A4F5C;
  --fg-muted:    #7C818E;
  --fg-faint:    #B6BAC4;
  --border:       #E5E5E1;
  --border-strong:#D1D1CB;
  --ring:         0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
  --shadow-sm:    0 1px 2px rgba(10,10,12,0.04);
  --shadow:       0 2px 6px rgba(10,10,12,0.04), 0 16px 32px -12px rgba(10,10,12,0.08);
  --shadow-lg:    0 4px 12px rgba(10,10,12,0.06), 0 32px 56px -16px rgba(10,10,12,0.12);

  /* Typography */
  --font-display: "Frank Ruhl Libre", Georgia, "Times New Roman", serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Fluid type scale */
  --t-hero:       clamp(2.5rem, 1.1rem + 5.6vw, 5.25rem);
  --t-display-l:  clamp(2rem, 1rem + 3.5vw, 3.5rem);
  --t-h1:         clamp(1.75rem, 1rem + 2.4vw, 2.75rem);
  --t-h2:         clamp(1.25rem, 0.9rem + 1.1vw, 1.625rem);
  --t-h3:         1.0625rem;
  --t-body:       1rem;
  --t-small:      0.875rem;
  --t-xs:         0.75rem;

  /* Space scale (internal) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-7: 32px; --s-8: 48px; --s-9: 64px; --s-10: 96px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px;

  /* Motion */
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 140ms;
  --t-base: 220ms;

  /* Max widths */
  --w-narrow: 760px;
  --w-wide:   1280px;
}

/* Dark theme — explicit override wins regardless of OS preference. */
html[data-theme="dark"] {
  --bg:           #0E0E10;
  --bg-elev:      #17171A;
  --bg-subtle:    #1E1E22;
  --bg-sunken:    #141417;
  --fg:           #F6F6F4;
  --fg-subtle:    #BEBEBB;
  --fg-muted:     #8E8E92;
  --fg-faint:     #5A5A5F;
  --border:       #2A2A2E;
  --border-strong:#3A3A3F;
  --brand:        #B48AFF;
  --brand-soft:   #2A1A4D;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.3);
  --shadow:       0 2px 6px rgba(0,0,0,0.3), 0 16px 32px -12px rgba(0,0,0,0.5);
  --shadow-lg:    0 4px 12px rgba(0,0,0,0.4), 0 32px 56px -16px rgba(0,0,0,0.6);
}

/* Dark theme — auto follows OS preference only if user hasn't chosen. */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg:           #0E0E10;
    --bg-elev:      #17171A;
    --bg-subtle:    #1E1E22;
    --bg-sunken:    #141417;
    --fg:           #F6F6F4;
    --fg-subtle:    #BEBEBB;
    --fg-muted:     #8E8E92;
    --fg-faint:     #5A5A5F;
    --border:       #2A2A2E;
    --border-strong:#3A3A3F;
    --brand:        #B48AFF;
    --brand-soft:   #2A1A4D;
    --shadow-sm:    0 1px 2px rgba(0,0,0,0.3);
    --shadow:       0 2px 6px rgba(0,0,0,0.3), 0 16px 32px -12px rgba(0,0,0,0.5);
    --shadow-lg:    0 4px 12px rgba(0,0,0,0.4), 0 32px 56px -16px rgba(0,0,0,0.6);
  }
}

/* =============================================================================
   Base
   ============================================================================= */

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  accent-color: var(--brand);
}

::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); color: inherit; }

a { color: var(--brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 2px; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.88em;
}
code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--fg-subtle);
  border: 1px solid var(--border);
}
kbd {
  font-size: 0.78em;
  padding: 2px 7px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--fg-subtle);
}

button { font: inherit; cursor: pointer; }

.skip-link {
  position: absolute; inset-block-start: -100px; inset-inline-start: 12px;
  background: var(--brand); color: var(--brand-ink); padding: 10px 16px;
  border-radius: var(--r-sm); z-index: 100; transition: inset-block-start var(--t-fast);
}
.skip-link:focus-visible { inset-block-start: 12px; outline: none; }

.container {
  max-width: var(--w-wide); margin: 0 auto;
  padding-inline: clamp(16px, 3.2vw, 32px);
}

/* =============================================================================
   Nav
   ============================================================================= */

.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-block-end: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--w-wide); margin: 0 auto;
  padding: 12px clamp(16px, 3.2vw, 32px);
  display: flex; align-items: center; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--fg); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 8%, transparent),
              0 2px 6px rgba(10, 10, 12, 0.10);
  transition: transform var(--t-base) var(--ease-emphasized);
}
.brand:hover .brand-mark { transform: rotate(-3deg) scale(1.04); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.72rem; color: var(--fg-muted); letter-spacing: 0.02em; }

.nav-links { display: flex; gap: 4px; margin-inline-start: auto; }
.nav-links a {
  color: var(--fg-subtle);
  font-size: 0.92rem;
  padding: 8px 12px; border-radius: 8px;
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-links a:hover { color: var(--fg); background: var(--bg-subtle); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--fg); background: var(--bg-subtle); }
.nav-link-apk {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand) !important;
}
.dl-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  font-size: 10px; line-height: 1;
}

.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-external, .theme-toggle {
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--fg-subtle);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.nav-external:hover, .theme-toggle:hover {
  color: var(--fg); border-color: var(--border-strong); background: var(--bg-subtle);
  text-decoration: none;
}

.nav-hamburger {
  display: none;
  width: 40px; height: 36px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  position: relative; color: var(--fg);
}
.nav-hamburger span {
  display: block; width: 18px; height: 2px; background: currentColor;
  position: absolute; inset-inline-start: 11px;
  transition: transform var(--t-base) var(--ease-emphasized), opacity var(--t-fast);
}
.nav-hamburger span:nth-child(1) { inset-block-start: 11px; }
.nav-hamburger span:nth-child(2) { inset-block-start: 17px; }
.nav-hamburger span:nth-child(3) { inset-block-start: 23px; }
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile nav: links become a drawer under the bar */
@media (max-width: 820px) {
  .nav-links {
    position: absolute; inset: 100% 0 auto 0;
    background: var(--bg-elev); border-block-end: 1px solid var(--border);
    padding: 12px 16px 16px; flex-direction: column; gap: 2px;
    box-shadow: var(--shadow);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform var(--t-base) var(--ease-emphasized), opacity var(--t-base);
  }
  .nav-links.is-open {
    transform: none; opacity: 1; pointer-events: auto;
  }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .nav-hamburger { display: inline-flex; align-items: center; justify-content: center; }
}

/* =============================================================================
   Hero / landing
   ============================================================================= */

.hero {
  padding: clamp(56px, 10vw, 120px) 0 clamp(40px, 6vw, 72px);
  border-block-end: 1px solid var(--border);
  background: radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 40%),
              radial-gradient(circle at 88% 70%, color-mix(in srgb, var(--brand) 6%, transparent), transparent 50%),
              var(--bg);
}
.hero-inner {
  max-width: var(--w-wide); margin: 0 auto;
  padding-inline: clamp(16px, 3.2vw, 32px);
}
.eyebrow {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--brand); font-weight: 600; margin: 0 0 16px;
}
.hero-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--t-hero); line-height: 0.98; letter-spacing: -0.02em;
  margin: 0 0 24px; max-width: 14ch;
}
.hero-lede {
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  color: var(--fg-subtle); max-width: 56ch; margin: 0 0 32px; line-height: 1.5;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--fg); font-weight: 500;
  transition: background var(--t-fast), border-color var(--t-fast), transform 100ms, box-shadow var(--t-fast);
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--border-strong); text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 90%, black); border-color: transparent; color: var(--brand-ink); }
.btn-ghost { background: transparent; }

/* Stats */
.stats {
  max-width: var(--w-wide); margin: 0 auto;
  padding: clamp(40px, 5vw, 72px) clamp(16px, 3.2vw, 32px) 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.stat {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 24px 20px;
}
.stat strong {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 1rem + 3vw, 3rem); line-height: 1;
  color: var(--fg); letter-spacing: -0.02em;
}
.stat span { display: block; margin-top: 8px; color: var(--fg-muted); font-size: 0.82rem; }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Panel grid — landing cards */
.panel-grid {
  max-width: var(--w-wide); margin: clamp(56px, 7vw, 96px) auto 0;
  padding-inline: clamp(16px, 3.2vw, 32px);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.panel {
  position: relative;
  display: block; padding: 28px 24px 32px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-xl); color: var(--fg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  overflow: hidden;
}
.panel::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 6%, transparent), transparent 50%);
  opacity: 0; transition: opacity var(--t-base);
  pointer-events: none;
}
.panel:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}
.panel:hover::before { opacity: 1; }
.panel h2 {
  font-family: var(--font-display); font-size: var(--t-h2);
  margin: 0 0 8px; letter-spacing: -0.01em;
}
.panel p { margin: 0; color: var(--fg-subtle); font-size: 0.95rem; }
.panel-arrow {
  position: absolute; inset-block-start: 28px; inset-inline-end: 24px;
  color: var(--fg-muted); transition: color var(--t-fast), transform var(--t-base);
}
.panel:hover .panel-arrow { color: var(--brand); transform: translateX(2px); }
.panel-apk { background: linear-gradient(135deg, var(--brand-soft), transparent 70%), var(--bg-elev); }
.dl-inline { color: var(--brand); }

@media (max-width: 720px) { .panel-grid { grid-template-columns: 1fr; } }

/* How-it-works */
.how {
  max-width: var(--w-wide); margin: clamp(64px, 9vw, 120px) auto clamp(48px, 6vw, 96px);
  padding-inline: clamp(16px, 3.2vw, 32px);
}
.how h2 { font-family: var(--font-display); font-size: var(--t-h1); margin: 0 0 32px; letter-spacing: -0.01em; }
.how-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  counter-reset: step;
}
.how-list li {
  counter-increment: step; position: relative;
  padding: 24px 24px 28px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-lg);
}
.how-list li::before {
  content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink);
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  margin-bottom: 16px;
}
.how-list strong { display: block; margin-bottom: 4px; font-size: 1.02rem; }
.how-list p { margin: 0; color: var(--fg-subtle); font-size: 0.9rem; }

@media (max-width: 820px) { .how-list { grid-template-columns: 1fr; } }

/* =============================================================================
   Page head / typography
   ============================================================================= */

.page-head {
  border-block-end: 1px solid var(--border);
  background: var(--bg);
}
.page-head-inner {
  max-width: var(--w-wide); margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) clamp(16px, 3.2vw, 32px) clamp(32px, 4vw, 48px);
}
.page-head h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--t-display-l); line-height: 1.05; letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.page-head .lede {
  color: var(--fg-subtle); font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.12rem);
  max-width: 68ch; margin: 0;
}

.crumbs {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 0 0 16px; font-size: var(--t-small); color: var(--fg-muted);
}
.crumbs a { color: var(--fg-subtle); }
.crumbs strong { color: var(--fg); font-weight: 500; }

.search-row { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 14px; min-width: min(100%, 420px); flex: 1;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.search:focus-within {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--border));
  box-shadow: var(--ring);
}
.search svg { color: var(--fg-muted); flex-shrink: 0; }
.search input {
  flex: 1; border: none; outline: none; background: transparent;
  font: inherit; color: var(--fg); min-width: 0;
}
.search input::placeholder { color: var(--fg-muted); }
.search-kbd { flex-shrink: 0; }
.result-count { margin: 0; font-size: var(--t-small); color: var(--fg-muted); }

/* =============================================================================
   Two-column layout (page rail on desktop)
   ============================================================================= */

.layout-two-col {
  max-width: var(--w-wide); margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 3.2vw, 32px) clamp(48px, 8vw, 96px);
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px;
  align-items: start;
}
.page-rail {
  position: sticky; inset-block-start: 80px;
  align-self: start;
  max-height: calc(100vh - 96px); overflow-y: auto;
  padding-inline-end: 8px;
}
.page-rail nav ul { list-style: none; margin: 0; padding: 0; }
.page-rail li { margin: 2px 0; }
.page-rail a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; border-radius: 8px;
  color: var(--fg-subtle); font-size: 0.9rem; line-height: 1.3;
  transition: color var(--t-fast), background var(--t-fast);
}
.page-rail a:hover { color: var(--fg); background: var(--bg-subtle); text-decoration: none; }
.rail-count {
  font-size: 0.72rem; color: var(--fg-muted);
  padding: 2px 7px; border-radius: 999px; background: var(--bg-subtle);
  border: 1px solid var(--border);
}

@media (max-width: 920px) {
  .layout-two-col { grid-template-columns: 1fr; gap: 24px; }
  .page-rail { display: none; }
}

/* =============================================================================
   Components
   ============================================================================= */

.family { margin-block: clamp(32px, 4vw, 48px); scroll-margin-top: 88px; }
.family:first-child { margin-block-start: 0; }
.family-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 20px;
  padding-block-end: 12px; border-block-end: 1px solid var(--border);
}
.family-head h2 {
  font-family: var(--font-display); font-size: var(--t-h2);
  margin: 0; letter-spacing: -0.01em;
}
.chip-count {
  font-size: var(--t-xs);
  padding: 2px 9px; border-radius: 999px;
  background: var(--bg-subtle); color: var(--fg-muted);
  border: 1px solid var(--border);
}

.component-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.component-card {
  display: block; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; color: var(--fg);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.component-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  transform: translateY(-2px); box-shadow: var(--shadow);
  text-decoration: none;
}
.component-thumb {
  aspect-ratio: 4 / 3;
  background: #FFFFFF; /* baselines are white-background previews */
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 12px;
  border-block-end: 1px solid var(--border);
}
.component-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.component-meta {
  padding: 12px 14px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.component-title { font-size: 0.95rem; }
.component-count { color: var(--fg-muted); font-size: 0.78rem; }

.empty-state {
  padding: 48px 24px; text-align: center;
  color: var(--fg-muted); font-size: 0.95rem;
}
.empty-state strong { color: var(--fg); }

/* =============================================================================
   Icons gallery
   ============================================================================= */

.icon-section { margin-block-end: 48px; }

.icon-set-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.icon-card {
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
  color: var(--fg);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.icon-card:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  transform: translateY(-1px); box-shadow: var(--shadow);
}

/* Two-up glyph row. Use a 1px gap on a border-coloured background so the
   card's own border bleeds through as a clean vertical divider — no extra
   element, no double-border artifacts in either theme. */
.icon-glyphs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; background: var(--border);
}
.icon-glyph {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 18px 12px 14px;
  background: var(--bg-base);
}
.icon-glyph-canvas {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  color: var(--fg);
}
.icon-glyph-canvas svg { width: 28px; height: 28px; display: block; }
.icon-glyph-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.icon-meta {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 8px;
  border-block-start: 1px solid var(--border);
  min-width: 0;
}
.icon-name {
  font-size: 0.94rem; font-weight: 600; line-height: 1.2;
  color: var(--fg);
}

/* Copy chip — must read as an interactive control, not display text.
   Box-styled with a copy icon, distinct hover/focus/active states. */
.icon-copy {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--bg-base);
  border: 1px solid var(--border); border-radius: var(--r-md);
  color: var(--fg-muted);
  font: inherit; cursor: pointer; text-align: start;
  min-width: 0;
  transition: border-color var(--t-fast), color var(--t-fast),
              background var(--t-fast), transform var(--t-fast);
}
.icon-copy:hover {
  border-color: color-mix(in srgb, var(--brand) 50%, var(--border));
  color: var(--fg);
}
.icon-copy:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--brand) 60%, var(--border));
  box-shadow: var(--ring);
  color: var(--fg);
}
.icon-copy:active { transform: translateY(1px); }
.icon-copy-text {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 0.74rem;
  line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: inherit;
  padding: 0 !important; background: none !important; border: none !important;
}
.icon-copy-icon {
  flex-shrink: 0;
  width: 14px; height: 14px;
  opacity: 0.7;
  transition: opacity var(--t-fast);
}
.icon-copy:hover .icon-copy-icon,
.icon-copy:focus-visible .icon-copy-icon { opacity: 1; }

/* =============================================================================
   Component detail
   ============================================================================= */

.preview-block { margin-block: clamp(32px, 4vw, 56px); scroll-margin-top: 88px; }
.preview-block:first-of-type { margin-block-start: 0; }
.preview-head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 16px; padding-block-end: 10px;
  border-block-end: 1px solid var(--border);
}
.preview-head h2 { margin: 0; font-size: 1.1rem; font-weight: 600; letter-spacing: -0.005em; }
.anchor-link {
  color: var(--fg-faint); opacity: 0; font-family: var(--font-mono);
  transition: opacity var(--t-fast), color var(--t-fast);
}
.preview-block:hover .anchor-link,
.anchor-link:focus-visible { opacity: 1; }
.anchor-link:hover { color: var(--brand); }

.tile-row {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.tile {
  margin: 0; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-md);
  overflow: hidden;
}
.tile a { display: block; }
.tile img { display: block; width: 100%; height: auto; background: #FFFFFF; }
.tile figcaption {
  padding: 9px 13px; font-size: 0.8rem; color: var(--fg-muted);
  border-block-start: 1px solid var(--border); background: var(--bg-subtle);
}

/* =============================================================================
   Tokens
   ============================================================================= */

.tok-root { display: flex; flex-direction: column; gap: clamp(48px, 6vw, 80px); }
.tok-section { scroll-margin-top: 88px; }
.tok-head { margin-bottom: 28px; }
.tok-head h2 {
  font-family: var(--font-display); font-size: var(--t-h1);
  margin: 0 0 8px; letter-spacing: -0.01em;
}
.tok-sub { margin: 0; color: var(--fg-subtle); max-width: 70ch; font-size: 0.95rem; }

.tok-subsection { margin-block-start: 32px; }
.tok-subsection:first-of-type { margin-block-start: 0; }
.tok-subhead { margin-bottom: 16px; }
.tok-subhead h3 { font-size: 1.0625rem; margin: 0 0 4px; font-weight: 600; }
.tok-subhead p { margin: 0; color: var(--fg-muted); font-size: 0.88rem; }

/* Swatches */
.swatch-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.swatch {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast);
}
.swatch:hover { border-color: var(--border-strong); }
.swatch-chip {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 8px;
  background: var(--c);
  /* Checkerboard shows through for transparent colors */
  background-image:
    linear-gradient(var(--c), var(--c)),
    linear-gradient(45deg, rgba(0,0,0,0.08) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.08) 75%),
    linear-gradient(45deg, rgba(0,0,0,0.08) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.08) 75%);
  background-size: 100% 100%, 10px 10px, 10px 10px;
  background-position: 0 0, 0 0, 5px 5px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
  cursor: pointer;
}
.swatch-meta { display: flex; flex-direction: column; min-width: 0; }
.swatch-meta strong {
  font-size: 0.88rem; font-weight: 500; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.swatch-hex { font-size: 0.72rem !important; padding: 0 !important; background: none !important; border: none !important; color: var(--fg-muted); }

/* Visual ramp */
.visual-head { display: flex; align-items: center; gap: 10px; }
.visual-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }
.ramp {
  display: grid; gap: 2px;
  grid-template-columns: repeat(11, 1fr);
  border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--border);
}
.ramp-step {
  background: var(--c);
  padding: 20px 6px 10px;
  display: flex; flex-direction: column; gap: 2px;
  min-height: 96px;
  text-align: center; cursor: pointer;
  transition: transform var(--t-fast);
  /* Auto-contrast label using relative luminance heuristic via background-color */
  color: color-mix(in srgb, var(--c) 100%, black 75%);
}
.ramp-step:hover { transform: translateY(-2px); z-index: 2; }
.ramp-name { font-size: 0.7rem; font-weight: 600; opacity: 0.65; }
.ramp-hex { font-size: 0.68rem; font-family: var(--font-mono); opacity: 0.55; }

/* When ramp-step background is dark, flip text to white. We can't detect JS-free
   so we rely on enough shades that the trade-off is acceptable. The CSS
   `color-mix` fallback above gives usable contrast most of the time; for the
   darkest shades we override: */
.ramp-step[data-copy$="00"], .ramp-step[data-copy$="000"] { color: rgba(255,255,255,0.7); }

@media (max-width: 720px) {
  .ramp { grid-template-columns: repeat(6, 1fr); }
}

/* Typography */
.type-list { display: flex; flex-direction: column; gap: 8px; }
.type-row {
  display: grid; grid-template-columns: 96px 220px 1fr; gap: 24px; align-items: center;
  padding: 20px 24px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.type-specimen {
  color: var(--fg);
  letter-spacing: -0.02em; line-height: 1;
  text-align: center;
}
.type-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.type-meta strong { font-size: 0.95rem; }
.type-sub { font-size: 0.78rem; color: var(--fg-muted); font-family: var(--font-mono); }
.type-sample {
  margin: 0; color: var(--fg-subtle);
  overflow: hidden;
  /* Cap visible height for huge display sizes */
  max-height: 2.2em;
}
@media (max-width: 820px) {
  .type-row { grid-template-columns: 64px 1fr; gap: 12px; padding: 16px; }
  .type-sample { display: none; }
}

/* Scales (spacing) */
.scale-list { display: flex; flex-direction: column; gap: 6px; }
.scale-row {
  display: grid; grid-template-columns: 64px 80px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 16px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.scale-name { font-size: 0.9rem; font-weight: 500; }
.scale-val { font-family: var(--font-mono); color: var(--fg-muted); font-size: 0.8rem; }
.scale-bar {
  height: 18px; border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 30%, transparent), color-mix(in srgb, var(--brand) 70%, transparent));
  width: var(--w); min-width: 2px;
}
.scale-note { font-size: 0.75rem; color: var(--fg-muted); font-style: italic; }

/* Radius */
.radius-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.radius-card {
  padding: 16px; text-align: center;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.radius-shape {
  width: 72px; height: 72px; margin: 4px auto 12px;
  background: color-mix(in srgb, var(--brand) 18%, var(--bg-subtle));
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
}
.radius-card strong { display: block; margin-bottom: 2px; font-size: 0.9rem; }
.radius-card code { font-size: 0.75rem !important; padding: 0 !important; background: none !important; border: none !important; color: var(--fg-muted); }

/* Border width */
.bw-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.bw-card {
  padding: 20px 16px 16px; text-align: center;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.bw-sample {
  width: 72px; height: 40px; margin: 0 auto 14px;
  border-style: solid; border-color: var(--brand); border-radius: 6px;
}
.bw-card strong { display: block; margin-bottom: 2px; font-size: 0.9rem; }
.bw-card code { font-size: 0.75rem !important; padding: 0 !important; background: none !important; border: none !important; color: var(--fg-muted); }

/* Icon size */
.icon-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.icon-card {
  padding: 16px; text-align: center;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.icon-box {
  height: 40px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.icon-dot { background: var(--brand); border-radius: 4px; }
.icon-card strong { display: block; margin-bottom: 2px; font-size: 0.9rem; }
.icon-card code { font-size: 0.75rem !important; padding: 0 !important; background: none !important; border: none !important; color: var(--fg-muted); }

/* Elevation */
.elev-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.elev-card {
  padding: 32px 20px 20px; text-align: center;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.elev-sample {
  width: 80px; height: 60px; margin: 0 auto 24px;
  background: var(--bg-elev);
  border-radius: 10px;
}
.elev-card strong { display: block; margin-bottom: 2px; font-size: 0.9rem; }
.elev-card code { display: inline-block; font-size: 0.72rem !important; padding: 0 !important; background: none !important; border: none !important; color: var(--fg-muted); }
.elev-tint { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--fg-muted); }

/* =============================================================================
   Prose (changelog)
   ============================================================================= */

.prose { max-width: var(--w-narrow); padding-block: clamp(32px, 4vw, 48px) clamp(48px, 6vw, 80px); }
.prose h1 { font-family: var(--font-display); font-size: var(--t-display-l); margin: 32px 0 16px; letter-spacing: -0.02em; }
.prose h2 {
  font-family: var(--font-display); font-size: var(--t-h1);
  margin: 40px 0 12px; padding-block-end: 10px;
  border-block-end: 1px solid var(--border); letter-spacing: -0.01em;
}
.prose h3 { font-size: 1.125rem; color: var(--fg); margin: 28px 0 8px; font-weight: 600; }
.prose p { margin: 0 0 14px; color: var(--fg-subtle); }
.prose ul { padding-inline-start: 22px; color: var(--fg-subtle); }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--brand); }

/* =============================================================================
   Toast (clipboard feedback)
   ============================================================================= */

.toast {
  position: fixed; inset-block-end: 24px; inset-inline-end: 24px;
  padding: 10px 16px;
  background: var(--fg); color: var(--bg);
  border-radius: var(--r-md); font-size: 0.88rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px); opacity: 0;
  transition: transform var(--t-base) var(--ease-emphasized), opacity var(--t-base);
  pointer-events: none;
}
.toast.is-visible { transform: none; opacity: 1; }

/* =============================================================================
   Footer
   ============================================================================= */

.footer {
  border-block-start: 1px solid var(--border);
  padding: 32px 0; margin-block-start: 96px;
  color: var(--fg-muted); font-size: 0.85rem;
  background: var(--bg-sunken);
}
.footer-inner {
  max-width: var(--w-wide); margin: 0 auto;
  padding-inline: clamp(16px, 3.2vw, 32px);
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
}
.footer strong { color: var(--fg-subtle); }
.footer-meta { color: var(--fg-muted); }
.footer-by { margin: 6px 0 0; color: var(--fg-muted); font-size: 0.82rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--fg-subtle); }
.footer-links a:hover { color: var(--brand); }

/* =============================================================================
   "What's new" release card (landing)
   ============================================================================= */

.release-card {
  max-width: var(--w-wide);
  margin: clamp(48px, 6vw, 72px) auto 0;
  padding-inline: clamp(16px, 3.2vw, 32px);
}
.release-inner {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--brand) 12%, transparent),
      transparent 60%),
    var(--bg-elev);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--border));
  border-radius: var(--r-xl);
  padding: clamp(20px, 3vw, 32px) clamp(20px, 3vw, 36px);
}
.release-inner .eyebrow { margin: 0 0 8px; }
.release-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1rem + 1.4vw, 2rem);
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  font-weight: 600;
  line-height: 1.15;
}
.release-date {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.88rem;
  color: var(--fg-muted);
  letter-spacing: 0;
}
.release-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.release-bullets li {
  color: var(--fg-subtle);
  line-height: 1.55;
  position: relative;
  padding-inline-start: 22px;
}
.release-bullets li::before {
  content: "";
  position: absolute;
  left: 4px; top: 0.62em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.release-bullets code {
  font-size: 0.86em;
}
.release-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
  color: var(--brand);
  transition: gap var(--t-fast);
}
.release-cta:hover { gap: 10px; text-decoration: none; }

/* =============================================================================
   Figma plugins — the tooling that bridges Figma and Compose
   ============================================================================= */

.plugins {
  max-width: var(--w-wide);
  margin: clamp(64px, 9vw, 120px) auto 0;
  padding-inline: clamp(16px, 3.2vw, 32px);
}
.plugins h2 {
  font-family: var(--font-display);
  font-size: var(--t-h1);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.plugins-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.plugin-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 26px 24px 28px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  color: var(--fg);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  overflow: hidden;
}
.plugin-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 6%, transparent), transparent 55%);
  opacity: 0; transition: opacity var(--t-base);
  pointer-events: none;
}
.plugin-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  text-decoration: none;
}
.plugin-card:hover::before { opacity: 1; }
.plugin-card-primary {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent 60%),
    var(--bg-elev);
  border-color: color-mix(in srgb, var(--brand) 22%, var(--border));
}
.plugin-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.plugin-eyebrow {
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  font-weight: 600;
}
.plugin-card-primary .plugin-eyebrow { color: var(--brand); }
.plugin-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  color: var(--fg-subtle);
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.02em;
}
.plugin-badge-arrow {
  font-size: 0.9em; opacity: 0.75;
}
.plugin-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--t-h2);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.plugin-card p {
  margin: 0 0 20px;
  color: var(--fg-subtle);
  font-size: 0.95rem;
  line-height: 1.55;
}
.plugin-card code { font-size: 0.86em; }
.plugin-cta {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: auto;
  font-weight: 500;
  color: var(--brand);
  transition: gap var(--t-fast);
}
.plugin-card:hover .plugin-cta { gap: 10px; }

@media (max-width: 820px) {
  .plugins-grid { grid-template-columns: 1fr; }
}

/* =============================================================================
   Section lede (sub-headline under section h2)
   ============================================================================= */

.section-lede {
  color: var(--fg-subtle);
  font-size: 1.0625rem;
  max-width: 66ch;
  margin: -16px 0 28px;
}
