:root {
  color-scheme: light;
  --paper: #f5f4f0;
  --surface: #ffffff;
  --surface-soft: #ecebe6;
  --ink: #181714;
  --muted: #737067;
  --faint: #98958b;
  --line: rgba(24, 23, 20, 0.12);
  --line-strong: rgba(24, 23, 20, 0.2);
  --accent: #ff5b35;
  --accent-ink: #9c270e;
  --focus: #1769ff;
  --shadow: 0 22px 70px rgba(31, 27, 19, 0.1);
  --radius-lg: 28px;
  --radius-md: 20px;
  --shell: 1360px;
  --preview-size: 44px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #11110f;
  --surface: #1b1a17;
  --surface-soft: #24231f;
  --ink: #f6f4ed;
  --muted: #aaa69a;
  --faint: #7e7b72;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --accent: #ff7657;
  --accent-ink: #ffb5a3;
  --focus: #70a2ff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions a,
.theme-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.header-actions a:hover,
.theme-toggle:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.intro {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
  padding-block: 72px 66px;
}

.intro-copy {
  max-width: 760px;
}

.collection-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 24px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.875rem;
  line-height: 1.5;
}

#collection-count {
  min-width: 2ch;
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.section-kicker {
  margin: 0 0 20px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 24px;
  font-size: clamp(3.35rem, 6.8vw, 6.9rem);
  line-height: 0.91;
  letter-spacing: -0.067em;
  text-wrap: balance;
}

.lede {
  max-width: 620px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.55;
  letter-spacing: -0.018em;
}

.install-row {
  width: min(100%, 480px);
  min-height: 58px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 8px 9px 8px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(27, 23, 16, 0.05);
}

.install-row .prompt {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.install-row code {
  overflow: hidden;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-copy,
.primary-action,
.secondary-action,
.empty-state button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.install-copy,
.primary-action {
  background: var(--ink);
  color: var(--paper);
}

.hero-icons {
  position: relative;
  min-height: 300px;
}

.hero-icon {
  --tilt: -5deg;
  --lift: -20px;
  --drift: 5px;
  position: absolute;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: hero-float 3.8s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(var(--tilt));
  }
  50% {
    transform: translate3d(var(--drift), var(--lift), 0) rotate(calc(var(--tilt) + 1.5deg));
  }
}

.hero-icon svg {
  width: 50%;
  height: 50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-icon:nth-child(1) {
  width: 174px;
  height: 174px;
  top: 12px;
  left: 16%;
  transform: rotate(-5deg);
}

.hero-icon:nth-child(2) {
  --tilt: 7deg;
  --lift: -16px;
  --drift: -5px;
  animation-duration: 4.4s;
  animation-delay: -1.5s;
  width: 128px;
  height: 128px;
  top: 118px;
  right: 4%;
  transform: rotate(7deg);
}

.hero-icon:nth-child(3) {
  --tilt: 3deg;
  --lift: -20px;
  --drift: 4px;
  animation-duration: 3.4s;
  animation-delay: -2s;
  width: 106px;
  height: 106px;
  bottom: 0;
  left: 2%;
  transform: rotate(3deg);
}

@media (min-width: 861px) {
  .hero-icons {
    width: 360px;
    max-width: 100%;
    min-height: 320px;
    margin-inline: auto;
  }

  .hero-icon:nth-child(1) { left: 0; }
  .hero-icon:nth-child(2) { top: 60px; right: 0; }
  .hero-icon:nth-child(3) { left: 38%; }
}

.library {
  padding-block: 72px 96px;
  border-top: 1px solid var(--line);
}

.library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.library-heading .section-kicker {
  margin-bottom: 10px;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.result-count {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px 220px;
  gap: 12px;
  margin-bottom: 18px;
}

.search-field,
.control-group {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.search-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.search-field svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.search-field input {
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
}

.search-field input::placeholder {
  color: var(--faint);
}

kbd {
  min-width: 26px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.75rem;
  text-align: center;
}

.control-group {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
}

.control-group label {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 650;
}

.control-group output {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

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

.filters {
  display: flex;
  gap: 8px;
  padding-bottom: 30px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  min-height: 40px;
  flex: 0 0 auto;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}

.filter-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filter-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

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

.icon-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1.03;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.icon-card:hover,
.icon-card:focus-within {
  z-index: 1;
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: 0 18px 50px rgba(26, 22, 15, 0.09);
}

.copy-card {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 22px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: copy;
}

.icon-art {
  display: grid;
  place-items: center;
  color: var(--ink);
}

.icon-art svg {
  width: var(--preview-size);
  height: var(--preview-size);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: width 140ms ease, height 140ms ease;
}

.icon-meta {
  min-width: 0;
  padding-right: 34px;
}

.icon-label {
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-name {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-note {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}

.icon-card:hover .copy-note,
.copy-card:focus-visible .copy-note {
  opacity: 1;
  transform: translateY(0);
}

.details-button {
  position: absolute;
  right: 14px;
  bottom: 15px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  cursor: pointer;
}

.details-button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.empty-state {
  padding: 90px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.empty-state button,
.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.origin {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding-block: 54px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.origin p {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: -0.025em;
}

.origin a {
  color: var(--ink);
  font-weight: 650;
  text-underline-offset: 4px;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner p {
  margin: 0;
}

.icon-dialog {
  width: min(840px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.icon-dialog::backdrop {
  background: rgba(12, 11, 9, 0.56);
  backdrop-filter: blur(8px);
}

.dialog-panel {
  position: relative;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  min-height: 470px;
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-preview {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.dialog-preview svg {
  width: 126px;
  height: 126px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dialog-content {
  min-width: 0;
  align-self: center;
  padding: 72px 48px 48px;
}

.dialog-content .section-kicker {
  margin-bottom: 12px;
}

.dialog-content h2 {
  margin-bottom: 10px;
  font-size: clamp(2.25rem, 5vw, 4rem);
}

.dialog-name {
  color: var(--muted);
  font-size: 0.875rem;
}

.code-preview {
  margin-top: 28px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.code-preview code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.export-spec { color: var(--muted); font-size: 0.875rem; margin: 12px 0 0; }
.examples { padding-block: 72px 96px; border-top: 1px solid var(--line); }
.examples-heading { max-width: 720px; margin-bottom: 40px; }
.examples-heading h2 { font-size: clamp(2rem, 4vw, 3.8rem); line-height: 1.08; }
.examples-heading > p:last-child { color: var(--muted); margin: 18px 0 0; font-size: 1.125rem; }
.examples-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.example-card { min-width: 0; padding: 32px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.example-caption { color: var(--muted); font: 0.75rem ui-monospace, monospace; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 36px; }
.example-card h3 { font-size: 1.65rem; line-height: 1.15; letter-spacing: -0.035em; margin: 0 0 10px; }
.example-description { color: var(--muted); margin-bottom: 24px; }
.spec-list { margin: 0 0 20px; }
.spec-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 66px; border-bottom: 1px solid var(--line); }
.spec-list dt { display: flex; gap: 12px; align-items: center; }
.spec-list dd { margin: 0; color: var(--muted); font-size: 0.875rem; }
[data-example-icon] { display: inline-flex; flex: 0 0 auto; }
.example-footnote { color: var(--muted); font-size: 0.75rem; }
.example-menu { display: grid; gap: 8px; }
.example-menu button { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.example-menu button > span:last-child { margin-left: auto; color: var(--muted); }
.example-menu button:hover { background: var(--surface-soft); border-color: var(--line-strong); }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin: 0 0 20px; }
.comparison-table th { font-weight: 500; text-align: left; }
.comparison-table td, .comparison-table th { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.comparison-table td { color: var(--muted); }
.comparison-table thead th { padding-top: 0; }
.comparison-table thead [data-example-icon] { display: flex; margin-bottom: 10px; }
.icon-label, .icon-name { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1100px) {
  .example-card { padding: 24px; }
}
@media (max-width: 860px) {
  .examples-grid { grid-template-columns: 1fr; }
  .example-card { padding: 28px; }
  .examples { padding-block: 54px 72px; }
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
  font-weight: 650;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 72%, transparent);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .icon-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .toolbar {
    grid-template-columns: 1fr 190px 190px;
  }
}

@media (max-width: 860px) {
  .intro {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 46px;
    padding-block: 68px 74px;
  }

  .hero-icons {
    min-height: 210px;
  }

  .hero-icon:nth-child(1) {
    left: 9%;
  }

  .hero-icon:nth-child(2) {
    top: 48px;
    right: 11%;
  }

  .hero-icon:nth-child(3) {
    bottom: -10px;
    left: 45%;
  }

  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

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

  .dialog-panel {
    grid-template-columns: 1fr;
  }

  .dialog-preview {
    min-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dialog-content {
    padding: 42px 28px 30px;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(calc(100% - 28px), var(--shell));
  }

  .site-header {
    position: relative;
  }

  .header-inner {
    min-height: 64px;
  }

  .header-actions a {
    display: none;
  }

  .theme-label {
    display: none;
  }

  .theme-toggle {
    width: 40px;
    justify-content: center;
    padding: 0;
    border-color: var(--line);
  }

  .intro {
    padding-block: 54px 60px;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 4.7rem);
  }

  .hero-icons {
    min-height: 172px;
  }

  .hero-icon:nth-child(1) {
    width: 128px;
    height: 128px;
    left: 2%;
  }

  .hero-icon:nth-child(2) {
    width: 98px;
    height: 98px;
    top: 54px;
    right: 2%;
  }

  .hero-icon:nth-child(3) {
    width: 82px;
    height: 82px;
    bottom: 0;
    left: 43%;
  }

  .library {
    padding-block: 54px 72px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .control-group {
    grid-template-columns: 100px 1fr;
  }

  .icon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .icon-card {
    border-radius: 16px;
  }

  .copy-card {
    padding: 17px;
  }

  .copy-note {
    display: none;
  }

  .origin,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .origin {
    min-height: 250px;
  }

  .footer-inner {
    min-height: 120px;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-icon {
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
