@font-face {
  font-family: 'fi-Iconoir-Thin';
  src: url('./fonts/iconoir/fi-Iconoir-Thin.woff2') format('woff2'),
    url('./fonts/iconoir/fi-Iconoir-Thin.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Iconoir-Light';
  src: url('./fonts/iconoir/fi-Iconoir-Light.woff2') format('woff2'),
    url('./fonts/iconoir/fi-Iconoir-Light.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Iconoir-Regular';
  src: url('./fonts/iconoir/fi-Iconoir-Regular.woff2') format('woff2'),
    url('./fonts/iconoir/fi-Iconoir-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Iconoir-Solid';
  src: url('./fonts/iconoir/fi-Iconoir-Solid.woff2') format('woff2'),
    url('./fonts/iconoir/fi-Iconoir-Solid.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Solar-Thin';
  src: url('./fonts/solar/fi-Solar-Thin.woff2') format('woff2'),
    url('./fonts/solar/fi-Solar-Thin.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Solar-Light';
  src: url('./fonts/solar/fi-Solar-Light.woff2') format('woff2'),
    url('./fonts/solar/fi-Solar-Light.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Solar-Regular';
  src: url('./fonts/solar/fi-Solar-Regular.woff2') format('woff2'),
    url('./fonts/solar/fi-Solar-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Solar-Bold';
  src: url('./fonts/solar/fi-Solar-Bold.woff2') format('woff2'),
    url('./fonts/solar/fi-Solar-Bold.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Solar-Broken';
  src: url('./fonts/solar/fi-Solar-Broken.woff2') format('woff2'),
    url('./fonts/solar/fi-Solar-Broken.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Ionicons-Filled';
  src: url('./fonts/ionicons/fi-Ionicons-Filled.woff2') format('woff2'),
    url('./fonts/ionicons/fi-Ionicons-Filled.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Ionicons-Outline';
  src: url('./fonts/ionicons/fi-Ionicons-Outline.woff2') format('woff2'),
    url('./fonts/ionicons/fi-Ionicons-Outline.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Ionicons-Sharp';
  src: url('./fonts/ionicons/fi-Ionicons-Sharp.woff2') format('woff2'),
    url('./fonts/ionicons/fi-Ionicons-Sharp.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Phosphor-Thin';
  src: url('./fonts/phosphor/fi-Phosphor-Thin.woff2') format('woff2'),
    url('./fonts/phosphor/fi-Phosphor-Thin.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Phosphor-Light';
  src: url('./fonts/phosphor/fi-Phosphor-Light.woff2') format('woff2'),
    url('./fonts/phosphor/fi-Phosphor-Light.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Phosphor-Regular';
  src: url('./fonts/phosphor/fi-Phosphor-Regular.woff2') format('woff2'),
    url('./fonts/phosphor/fi-Phosphor-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Phosphor-Fill';
  src: url('./fonts/phosphor/fi-Phosphor-Fill.woff2') format('woff2'),
    url('./fonts/phosphor/fi-Phosphor-Fill.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Reicon-Outline';
  src: url('./fonts/reicon/fi-Reicon-Outline.woff2') format('woff2'),
    url('./fonts/reicon/fi-Reicon-Outline.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'fi-Reicon-Filled';
  src: url('./fonts/reicon/fi-Reicon-Filled.woff2') format('woff2'),
    url('./fonts/reicon/fi-Reicon-Filled.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/*
  Theming: each theme is a named [data-theme="..."] block that defines
  the full set of tokens below. The active theme is chosen by the
  `data-theme` attribute on <html> (see the <html> tag itself).
  To add a new theme, copy this block, change the selector to
  [data-theme="your-theme-name"], and adjust the values — no other
  CSS needs to change since every rule in this file reads colors
  through these variables.
*/
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-color: #242021;
  --header-bg: rgba(36, 32, 33, 0.88);
  --card-bg: #2F2A2C;
  --card-hover: #393335;
  --border-color: rgba(250, 244, 236, 0.1);
  --border-strong: #4F4749;
  --accent-color: #EB5D38;
  --accent-hover: #F27351;
  --accent-subtle: rgba(235, 93, 56, 0.22);
  --accent-ring: rgba(235, 93, 56, 0.35);
  --hover-tint: rgba(250, 244, 236, 0.06);
  --text-main: #FAF4EC;
  --text-muted: #A09B93;
  --text-on-accent: #FFFFFF;
  --logo-badge-bg: #181516;
  --card-shadow-hover: 0 8px 22px rgba(0, 0, 0, 0.45);
  --btn-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --btn-shadow-hover: 0 4px 14px rgba(235, 93, 56, 0.35);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg-color: #FAF4EC;
  --header-bg: rgba(250, 244, 236, 0.88);
  --card-bg: #FFFFFF;
  --card-hover: #FFFDF9;
  --border-color: rgba(72, 64, 65, 0.12);
  --border-strong: #9E9B90;
  --accent-color: #EB5D38;
  --accent-hover: #D64F2C;
  --accent-subtle: rgba(235, 93, 56, 0.14);
  --accent-ring: rgba(235, 93, 56, 0.28);
  --hover-tint: rgba(72, 64, 65, 0.05);
  --text-main: #484041;
  --text-muted: #747067;
  --text-on-accent: #FFFFFF;
  --logo-badge-bg: #484041;
  --card-shadow-hover: 0 8px 22px rgba(72, 64, 65, 0.12);
  --btn-shadow: 0 2px 8px rgba(235, 93, 56, 0.22);
  --btn-shadow-hover: 0 4px 14px rgba(235, 93, 56, 0.32);
}

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

body, input, button, select, textarea {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 60px;
  transition: background-color 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-inner {
  width: 100%;
  max-width: 1440px;
  padding: 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.site-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 52px;
  flex-shrink: 0;
}

.site-logo-go {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: -4px;
}

.site-logo-key {
  background: var(--logo-badge-bg);
  color: var(--text-on-accent);
  font-size: 16px;
  line-height: 1.3;
  padding: 1px 7px;
  border-radius: 6px;
}

.header-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-spacer {
  flex: 1;
}

.controls-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background-color: var(--card-bg);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.search-clear-btn.visible {
  display: flex;
}

.search-clear-btn svg {
  width: 100%;
  height: 100%;
}

.weight-selector {
  display: flex;
  background: var(--card-bg);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.weight-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.weight-btn:hover {
  color: var(--text-main);
  background: var(--hover-tint);
}

.weight-btn.active {
  background: var(--accent-color);
  color: var(--text-on-accent);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.icon-size-select-wrapper {
  position: relative;
  flex-shrink: 0;
}

.icon-size-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 14px;
  font-family: inherit;
  height: 40px;
  padding: 0 30px 0 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.icon-size-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.icon-size-select option {
  background: var(--card-bg);
  color: var(--text-main);
}

.icon-size-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-main);
  pointer-events: none;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px;
}

.status-bar {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 12px;
}

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

.icon-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.icon-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  background: var(--card-hover);
}

/* Not available in the active weight — not clickable (see the onclick
   guard in copyLigature's caller), so no hover affordance either. */
.icon-card.unavailable {
  cursor: default;
  opacity: 0.5;
}

.icon-card.unavailable:hover {
  border-color: var(--border-color);
  transform: none;
  box-shadow: none;
  background: var(--card-bg);
}

.icon-glyph {
  position: relative;
  width: var(--icon-preview-size, 24px);
  font-size: var(--icon-preview-size, 24px);
  /* Transparent (not hidden) until font-ready, so the raw ligature text
     never flashes on screen while the font is still downloading, while
     the skeleton pulse (::before, below) stays visible underneath. */
  color: transparent;
  margin-bottom: 8px;
  height: var(--icon-preview-size, 24px);
  line-height: var(--icon-preview-size, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-feature-settings: "liga" 1, "dlig" 1;
  transition: font-family 0.15s ease, font-size 0.15s ease, height 0.15s ease, width 0.15s ease, color 0.3s ease, opacity 0.3s ease;
}

.icon-glyph::before {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 5px;
  background: var(--border-strong);
  animation: icon-skeleton-pulse 1.3s ease-in-out infinite;
}

.icon-glyph.font-ready,
.icon-glyph.icon-missing {
  color: var(--text-main);
}

.icon-glyph.font-ready::before,
.icon-glyph.icon-missing::before {
  content: none;
  animation: none;
}

@keyframes icon-skeleton-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.icon-glyph.copied {
  color: var(--accent-color);
  transition: color 0.1s ease;
}

/* Icon has no glyph in the currently selected weight/style (see
   missingIconsByWeight) — shown as a muted "not available" mark instead
   of the ligature text, and never gets the loading skeleton since there's
   nothing to wait for. */
.icon-glyph.icon-missing {
  color: var(--text-muted);
  font-size: 20px;
  opacity: 0.55;
}

.icon-name {
  position: relative;
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  line-height: 1.3;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.5s ease;
  width: 100%;
}

.icon-name.copied {
  color: var(--accent-color);
  font-weight: 700;
  transition: color 0.1s ease;
}

/* Copy-SVG / download-SVG buttons — hidden until the card is hovered or
   keyboard-focused, so they don't compete with the primary click-to-copy-
   ligature action for attention in the dense grid. */
.icon-card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.icon-card:hover .icon-card-actions,
.icon-card:focus-within .icon-card-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Same "not available in this weight" guard as the card's own click
   handler (see copyLigature's caller in index.html) — no point offering
   to copy/download a glyph that isn't there. */
.icon-card.unavailable .icon-card-actions {
  display: none;
}

.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.icon-action-btn svg {
  width: 12px;
  height: 12px;
}

.icon-action-btn:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
  background: var(--card-hover);
}

.icon-action-btn.done {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 16px;
}

.package-tabs {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.package-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  font-family: inherit;
}

.package-tab:hover {
  color: var(--text-main);
}

.package-tab.active {
  background: var(--accent-color);
  color: var(--text-on-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.package-tab-name {
  font-size: 15px;
  font-weight: 600;
}

.package-tab-meta {
  font-size: 11px;
  opacity: 0.8;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-color);
  color: var(--text-on-accent);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--btn-shadow);
  border: 1px solid var(--border-color);
}

.download-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
  color: var(--text-on-accent);
}

.download-btn:active {
  transform: translateY(0);
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: var(--btn-shadow);
  align-self: flex-start;
}

.theme-toggle-btn:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
  color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow-hover);
}

.theme-toggle-btn:active {
  transform: translateY(0);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.theme-toggle-btn:hover svg {
  transform: rotate(15deg);
}

:root[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

:root[data-theme="light"] .theme-toggle-btn .sun-icon {
  display: none;
}

:root[data-theme="light"] .theme-toggle-btn .moon-icon {
  display: block;
}

.site-footer {
  margin-top: 40px;
  background: var(--card-bg);
  display: flex;
  justify-content: center;
  transition: background-color 0.25s ease;
}

.footer-inner {
  width: 100%;
  max-width: 1440px;
  padding: 20px 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.footer-brand p {
  font-size: 12.5px;
  color: var(--text-muted);
}

.footer-licenses h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.footer-license-row {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.7;
  flex-wrap: wrap;
}

.footer-license-row .license-name {
  color: var(--text-muted);
  min-width: 130px;
}

.footer-license-row a {
  color: var(--accent-color);
  text-decoration: none;
}

.footer-license-row a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.download-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.build-label {
  font-size: 11px;
  color: var(--text-muted);
}
