/* ==========================================================================
   xdfkenny modules — Soft Cryo design system
   Icy pastel, pure frost with a warm heart. Zero sharp corners.
   ========================================================================== */

:root {
  --bg: #F0F7FF;
  --bg-warm: #F8FBFF;
  --fg: #2C3E50;
  --fg-muted: #5A6D7E;
  --accent: #7EC8E3;
  --accent-light: #B8E3F5;
  --accent-dark: #4A9ECF;
  --accent-glow: #D6F0FF;
  --crystal: #A8D8EA;
  --frost: #E1F5FE;
  --rose-ice: #E8D5E0;
  --rose-soft: #E8A5A5;
  --mint: #A5D8C5;
  --border: #C5E3F5;
  --border-strong: #7EC8E3;

  --status-ok: #4A9ECF;
  --status-warn: #9AA8E8;
  --status-fail: #C96F8E;

  --shadow-sm: 0 2px 8px rgba(126, 200, 227, 0.12);
  --shadow-md: 0 4px 16px rgba(126, 200, 227, 0.15);
  --shadow-lg: 0 8px 32px rgba(126, 200, 227, 0.2);
  --shadow-glow: 0 0 20px rgba(126, 200, 227, 0.25), 0 0 40px rgba(126, 200, 227, 0.1);
  --shadow-inner: inset 0 2px 4px rgba(126, 200, 227, 0.08);
  --ring: 0 0 0 3px rgba(126, 200, 227, 0.2);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-full: 9999px;

  --font-display: "Nunito", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}



* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
  user-select: none;
}

.material-symbols-outlined.icon-sm {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 460px at 50% -80px, rgba(182, 225, 246, 0.55), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, #F4FAFF 100%);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* global frost noise overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background-image: var(--noise);
  opacity: 0.035;
}

::selection {
  background: var(--accent-light);
  color: var(--fg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(126, 200, 227, 0.3);
  border-radius: 6px;
}

/* ---------- skip link ---------- */

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1100;
  padding: 10px 20px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: top 0.3s var(--ease-out);
}

.skip-link:focus {
  top: 14px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240, 247, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px clamp(16px, 4vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(126, 200, 227, 0.6);
  animation: statusPulse 2.4s ease-in-out infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--r-full);
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-bounce);
}

.nav-link:hover {
  background: var(--frost);
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.nav-link-ext {
  border: 1.5px solid var(--border);
}

.nav-link-ext:hover {
  border-color: var(--border-strong);
}

.nav-link[aria-current="page"] {
  background: var(--frost);
  color: var(--accent-dark);
}

.nav-toggle {
  display: none;
  appearance: none;
  background: var(--bg-warm);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--fg-muted);
  transition: transform 0.25s var(--ease-out), opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

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

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(72px, 12vh, 128px) clamp(20px, 6vw, 48px) clamp(64px, 10vh, 104px);
  background:
    radial-gradient(circle at 50% 35%, rgba(214, 240, 255, 0.9), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, #F0F7FF 70%, var(--bg) 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(126, 200, 227, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(184, 227, 245, 0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(126, 200, 227, 0.25), transparent);
  background-size: 120px 120px, 80px 80px, 100px 100px;
  pointer-events: none;
}

.hero-snow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.snowflake {
  position: absolute;
  top: -12px;
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--crystal);
  opacity: 0.18;
  animation: snowDrift linear infinite;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 768px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(44px, 9vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.hero-title span {
  background: linear-gradient(120deg, var(--accent-dark), var(--crystal));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin: 22px auto 12px;
  font-size: clamp(17px, 2.4vw, 20px);
  font-style: italic;
  color: var(--fg-muted);
  max-width: 46ch;
}

.hero-desc {
  margin: 0 auto 30px;
  font-size: 15px;
  color: var(--fg-muted);
  max-width: 54ch;
}

.hero-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-cta .arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease-bounce);
}

.btn-primary:hover .arrow {
  transform: translateX(4px);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 8px 20px;
  border-radius: var(--r-full);
  background: var(--frost);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-inner);
}

.status-text {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}

.status-text b {
  color: var(--accent-dark);
  font-weight: 500;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: var(--r-full);
  flex: none;
}

.dot.pulse {
  background: var(--accent);
  animation: statusPulse 2.4s ease-in-out infinite;
}

/* decorative hexagons */

.hero-hex {
  position: absolute;
  width: 56px;
  height: 56px;
  z-index: 1;
  opacity: 0.5;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-glow));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: floaty 9s ease-in-out infinite;
}

.hex-1 { top: 18%; left: 9%; width: 44px; height: 44px; }
.hex-2 { top: 62%; left: 78%; width: 68px; height: 68px; animation-delay: -3s; opacity: 0.38; }
.hex-3 { top: 12%; right: 12%; width: 30px; height: 30px; animation-delay: -6s; opacity: 0.45; }

/* ==========================================================================
   Sections
   ========================================================================== */

main {
  display: block;
}

.section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(56px, 9vh, 88px) clamp(16px, 4vw, 32px);
  scroll-margin-top: 76px;
}

#top {
  scroll-margin-top: 0;
}

.section-head {
  margin-bottom: 40px;
}

.section-head h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.02em;
  color: var(--fg);
  display: inline-block;
  position: relative;
  padding-bottom: 14px;
}

.section-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 88px;
  height: 3px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--accent), transparent);
}

.section-intro {
  margin: 10px 0 0;
  font-size: 16px;
  color: var(--fg-muted);
  max-width: 56ch;
}
.section-sub {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--fg-muted);
  max-width: 56ch;
}
.section-sub a {
  color: var(--accent-dark);
  text-decoration: none;
  transition: opacity 0.2s;
}
.section-sub a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.section-head.is-centered {
  text-align: center;
}

.section-head.is-centered h2::after {
  left: 50%;
  transform: translateX(-50%);
}

.section-head.is-centered .section-intro {
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.2;
  padding: 13px 26px;
  border-radius: var(--r-full);
  text-decoration: none;
  transition: transform 0.25s var(--ease-bounce), box-shadow 0.25s var(--ease-out), background 0.2s, border-color 0.2s, color 0.2s;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Primary ice pill */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:disabled:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

/* Secondary frost outline */
.btn-secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 1.5px solid var(--accent);
}

.btn-secondary:hover {
  transform: scale(1.03);
  background: var(--frost);
  box-shadow: var(--shadow-md);
}

/* Ghost soft link */
.btn-ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  transform: scale(1.03);
  background: var(--frost);
  border-color: var(--border-strong);
}

.btn-ghost-pill {
  background: var(--bg-warm);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 9px 18px;
  font-size: 12.5px;
}

.btn-ghost-pill:hover {
  color: var(--accent-dark);
  background: var(--frost);
  border-color: var(--border-strong);
}

/* Soft solid (dashboard actions) */
.btn-soft {
  background: var(--bg-warm);
  color: var(--accent-dark);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-soft:hover {
  background: var(--frost);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-tiny {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 13px;
}

.btn-clear {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.btn-clear:hover {
  background: var(--bg-warm);
  color: var(--accent-dark);
  border-color: var(--border-strong);
}

.icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.icon-play {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Summary bar (dashboard)
   ========================================================================== */

/* ==========================================================================
   Library Controls (Search & Category Filters)
   ========================================================================== */

.library-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 18px;
  width: 18px;
  height: 18px;
  color: var(--accent-dark);
  pointer-events: none;
}

.search-input {
  width: 100%;
  appearance: none;
  background: var(--bg-warm);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl);
  padding: 14px 44px 14px 48px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.2s;
}

.search-input::placeholder {
  color: var(--fg-muted);
  opacity: 0.75;
}

.search-input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: var(--shadow-glow), var(--ring);
}

.search-clear {
  position: absolute;
  right: 14px;
  appearance: none;
  border: none;
  background: var(--frost);
  color: var(--fg-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
}

.search-clear:hover {
  background: var(--accent);
  color: #fff;
}

.filter-pills-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-group-apps { margin-left: auto; }
.filter-group-authors { width: 100%; }
.filter-pill-clear { background: var(--status-fail); color: #fff; border-color: var(--status-fail); margin-left: 8px; }
.filter-pill-clear:hover { filter: brightness(1.1); }

/* Donation banner to the right of library title */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.section-head-main {
  flex: 1;
  min-width: 0;
}
.donate-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  max-width: 260px;
}
.donate-qr {
  width: 200px;
  height: 200px;
  border-radius: var(--r-lg);
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-warm);
  box-shadow: var(--shadow-md);
  flex: none;
}
.donate-text {
  margin: 0;
  font-size: 12px;
  color: var(--fg-muted);
  line-height: 1.5;
  text-align: center;
}

/* Mobile: hide the inline donate QR, only show modal */
@media (max-width: 768px) {
  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .donate-side {
    display: none;
  }
  .section-head-main {
    width: 100%;
  }
  .section-intro {
    font-size: 15px;
    line-height: 1.5;
  }
  .section-sub {
    margin-top: 14px;
  }
}

/* Donation modal */
.donate-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donate-modal-backdrop {
  position: absolute;
  inset: 0;
  min-height: 100dvh; /* covers mobile viewport including address bar */
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.donate-modal-box {
  position: relative;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 24px 22px;
  max-width: 340px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: modalPop 0.25s var(--ease-bounce);
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.donate-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--frost);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
}
.donate-modal-close:hover {
  background: var(--accent);
  color: #fff;
}
.donate-modal-qr {
  width: 200px;
  height: 200px;
  border-radius: var(--r-lg);
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow-md);
}
.donate-modal-text {
  margin: 0;
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.55;
  text-align: center;
}

.filter-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-pill {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-warm);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all 0.2s var(--ease-bounce);
  box-shadow: var(--shadow-sm);
}

.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--accent-dark);
  background: var(--frost);
  transform: translateY(-1px);
}

.filter-pill.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-color: var(--accent-dark);
  box-shadow: 0 4px 12px rgba(74, 158, 207, 0.35);
}

.filter-pill-app {
  padding: 5px 12px;
  font-size: 12px;
}

/* Card badges & compatibility tags */
.card-tags-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.badge-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  background: var(--frost);
  color: var(--accent-dark);
  border: 1px solid var(--border);
}

.badge-cat.cat-anime { background: rgba(126, 200, 227, 0.15); color: #2B7A9E; border-color: rgba(126, 200, 227, 0.35); }
.badge-cat.cat-manga { background: rgba(165, 216, 197, 0.2); color: #2D7A5E; border-color: rgba(165, 216, 197, 0.4); }
.badge-cat.cat-torrent { background: rgba(232, 165, 165, 0.15); color: #A84B4B; border-color: rgba(232, 165, 165, 0.35); }

.badge-compat {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-full);
  background: rgba(74, 158, 207, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(74, 158, 207, 0.25);
}

/* Quick Card Actions - full width */
.links {
  width: 100%;
  margin-top: auto;
}

.card-quick-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.btn-card-action {
  flex: 1 1 0;
  min-width: 0;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-bounce);
  white-space: nowrap;
}

.btn-card-action:hover {
  background: var(--frost);
  border-color: var(--border-strong);
  color: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-card-action.btn-play {
  background: var(--frost);
  color: var(--accent-dark);
  border-color: var(--border-strong);
}

.btn-card-action.btn-play:hover {
  background: var(--accent);
  color: #fff;
}

a.btn-card-action.btn-card-sora,
.btn-card-action.btn-card-sora {
  background: linear-gradient(135deg, hsl(220, 85%, 55%) 0%, hsl(200, 90%, 45%) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(50, 120, 220, 0.3);
  text-decoration: none;
}

a.btn-card-action.btn-card-sora:hover,
.btn-card-action.btn-card-sora:hover {
  background: linear-gradient(135deg, hsl(220, 85%, 48%) 0%, hsl(200, 90%, 38%) 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(50, 120, 220, 0.45);
}

/* ===== Cufiy-style card meta & split button (no owner) ===== */
.cufiy-head-info {
  flex: 1;
  min-width: 0;
}

.cufiy-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 2px;
  font-size: 14px;
  color: var(--fg-muted);
}

.cufiy-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.cufiy-flag .flag {
  width: 20px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  background: var(--frost);
  border: 1px solid var(--border);
  flex: none;
}

.cufiy-globe {
  color: var(--accent-dark);
  opacity: 0.85;
  font-size: 18px !important;
}

.cufiy-lang {
  font-weight: 600;
  color: var(--fg);
  font-size: 14px;
}

.cufiy-type,
.cufiy-dl {
  color: var(--accent-dark);
  opacity: 0.85;
  font-size: 16px !important;
}

.cufiy-actions {
  display: flex;
  width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
  height: 46px;
}

.cufiy-add {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 2px 8px rgba(74, 158, 207, 0.25);
}

.cufiy-add:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(74, 158, 207, 0.35);
  color: #fff;
}

.cufiy-copy {
  width: 58px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--frost);
  border: none;
  border-left: 1px solid rgba(0,0,0,0.06);
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cufiy-copy:hover {
  background: var(--border);
  color: var(--accent-dark);
}


.library-summary {
  margin-bottom: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg-muted);
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
}

.pill b {
  color: var(--fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Module cards grid
   ========================================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
}

.card {
  position: relative;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s var(--ease-out), border-color 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* ---------- discontinued modules ---------- */

.card-discontinued {
  filter: grayscale(0.85);
}

.card-discontinued:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* gray veil over the whole card */
.card-discontinued::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(105, 118, 136, 0.42);
  border-radius: inherit;
  pointer-events: none;
}

.card-discontinued .card-head,
.card-discontinued .card-body {
  pointer-events: none;
}

.discontinued-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--r-full);
  background: var(--fg-muted);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.discontinued-bar {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  color: var(--fg-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.card-icon {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 14px;
  background: var(--frost);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent-dark);
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ver {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-dark);
  background: var(--frost);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

.card-branch {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-muted);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

.card-body {
  padding: 14px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.meta { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--r-full);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  font-weight: 400;
}

.chip b {
  color: var(--accent-dark);
  font-weight: 500;
}

/* "Recently Updated" card stamp — sits between the meta row and the links */
.card-updated {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: -2px 0 2px;
  color: var(--fg-muted);
  font-size: 12px;
}

.card-updated .icon-sm {
  font-size: 14px;
  color: var(--accent-dark);
  opacity: 0.8;
}

.chip-updated {
  color: var(--accent-dark);
  background: var(--frost);
  border-color: var(--border);
  text-transform: none;
  letter-spacing: 0;
}

/* Sort row (its own scroll row so it never reflows the app filters) */
.filter-pills-row-sort {
  margin-top: -2px;
}

.desc {
  font-size: 12.5px;
  color: var(--fg-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.links { display: flex; flex-direction: column; align-items: stretch; gap: 10px; flex-wrap: nowrap; }

.links > * { width: 100%; }

.link {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-dark);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.2s, background 0.2s;
}

.link:hover {
  border-color: var(--border-strong);
  background: var(--frost);
}

/* ---------- states ---------- */

.state-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
  font-size: 13.5px;
}

.state-box .spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.footer {
  margin-top: clamp(24px, 6vw, 48px);
  background: linear-gradient(180deg, var(--bg) 0%, var(--frost) 100%);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(40px, 7vh, 56px) clamp(16px, 4vw, 32px) 28px;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.footer-tagline {
  margin: 6px 0 20px;
  font-style: italic;
  font-size: 14px;
  color: var(--fg-muted);
}

.footer-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--bg-warm);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  transition: transform 0.25s var(--ease-bounce), background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.25s var(--ease-out);
}

.icon-btn .icon {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  transform: scale(1.05);
  background: var(--frost);
  color: var(--accent-dark);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.footer-mail {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s;
}

.footer-mail:hover {
  border-bottom-color: var(--accent-dark);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  background: var(--bg-warm);
  padding: 14px 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}
.footer-bottom a {
  color: var(--accent-dark);
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-bottom a:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(126, 200, 227, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(126, 200, 227, 0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}

@keyframes snowDrift {
  0% { transform: translateY(-24px) translateX(0); opacity: 0; }
  10% { opacity: 0.18; }
  90% { opacity: 0.14; }
  100% { transform: translateY(calc(100vh + 24px)) translateX(24px); opacity: 0; }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes glowPulse {
  0%, 100% { box-shadow: var(--shadow-glow); }
  50% { box-shadow: 0 0 28px rgba(126, 200, 227, 0.35), 0 0 56px rgba(126, 200, 227, 0.12); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 820px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 12px clamp(16px, 4vw, 32px) 16px;
    background: rgba(240, 247, 255, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 13px 16px;
    text-align: center;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 14px;
  }

  .filter-pills-row {
    justify-content: flex-start;
  }

  .filter-group-apps {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .hero-hex {
    display: none;
  }

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

  .card-quick-actions {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .btn-card-action {
    flex: 1 1 0;
    min-width: 0;
    padding: 11px 12px;
    font-size: 12.5px;
  }

  .filter-pills-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    justify-content: flex-start;
  }

  .search-input {
    font-size: 16px; /* avoid iOS zoom-on-focus */
  }
}

@media (max-width: 400px) {
  .btn-card-action {
    flex: 1 1 0;
    min-width: 0;
    font-size: 12px;
    padding: 10px 10px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .snowflake,
  .hero-hex {
    display: none;
  }
}

/* ==========================================================================
   icon-heading utility
   ========================================================================== */

.icon-heading {
  font-size: 1.3rem;
  vertical-align: middle;
  margin-right: 0.35rem;
  color: var(--accent-dark);
}

/* ==========================================================================
   Manifest Creator section
   ========================================================================== */

.section-creator {
  background: linear-gradient(160deg, hsl(215, 55%, 96%) 0%, hsl(225, 45%, 95%) 100%);
}

.creator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

.creator-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.creator-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.creator-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.creator-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.02em;
}

.req { color: var(--status-fail); }
.opt { color: var(--fg-muted); font-weight: 400; }

.creator-input {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}

.creator-input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.creator-input select { appearance: auto; }

.creator-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.creator-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83rem;
  color: var(--fg);
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--bg);
  transition: border-color 0.2s, background 0.2s;
}

.creator-check:has(input:checked) {
  border-color: var(--accent);
  background: var(--frost);
}

.creator-check input {
  accent-color: var(--accent-dark);
}

.creator-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.creator-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

.creator-status {
  margin: 4px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 1.2em;
}

.creator-status.ok { color: var(--status-ok); }
.creator-status.err { color: var(--status-fail); }

.creator-preview {
  background: hsl(225, 35%, 12%);
  border: 1px solid rgba(126, 200, 227, 0.15);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 116px;
}

.creator-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(126, 200, 227, 0.12);
  background: hsl(225, 35%, 14%);
}

.creator-preview-header .card-label {
  color: rgba(255,255,255,0.7);
}

.creator-output {
  margin: 0;
  padding: 1.25rem;
  min-height: 320px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: hsl(120, 60%, 80%);
  background: transparent;
  white-space: pre;
}

.creator-output code {
  color: hsl(120, 60%, 80%);
}

/* ==========================================================================
   FAQ section
   ========================================================================== */

.section-faq {
  background: var(--bg-warm);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.faq-item:hover {
  box-shadow: var(--shadow-md);
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg);
  text-align: left;
  transition: background 0.2s;
}

.faq-q:hover { background: var(--frost); }

.faq-chevron {
  flex-shrink: 0;
  font-size: 22px;
  color: var(--accent-dark);
  transition: transform 0.3s var(--ease-out);
}

.faq-q[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease-out), padding 0.25s;
  padding: 0 1.25rem;
}

.faq-a.open {
  max-height: 300px;
  padding: 0 1.25rem 1.1rem;
}

.faq-a p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

.faq-a a {
  color: var(--accent-dark);
  text-decoration: underline;
}

.faq-a code {
  background: var(--frost);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.83em;
}

/* ==========================================================================
   Theme — manual toggle only via data-theme attribute.
   JS reads the OS default once at load and saves the choice; thereafter
   the data attribute drives everything.
   ========================================================================== */

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0F1E;
  --bg-warm: #141E32;
  --fg: #E6EDF3;
  --fg-muted: #8A9AB3;
  --accent: #7EC8E3;
  --accent-light: #1E344B;
  --accent-dark: #8ED0F0;
  --accent-glow: rgba(126, 200, 227, 0.12);
  --crystal: #5A7FA0;
  --frost: #1E2D45;
  --rose-ice: #2A3545;
  --rose-soft: #9AA8C8;
  --mint: #6BA8A0;
  --border: #2A3A52;
  --border-strong: #3A5575;
  --status-ok: #7EC8E3;
  --status-warn: #9AA8E8;
  --status-fail: #E8A5A5;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 20px rgba(126, 200, 227, 0.12), 0 0 40px rgba(126, 200, 227, 0.06);
  --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.25);
  --ring: 0 0 0 3px rgba(126, 200, 227, 0.25);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(900px 460px at 50% -80px, rgba(30, 52, 75, 0.5), transparent 60%),
    linear-gradient(180deg, #0A0F1E 0%, #0F1A2E 100%);
}
html[data-theme="dark"] body::after { opacity: 0.02; }
html[data-theme="dark"] .nav { background: rgba(10, 15, 30, 0.88); border-bottom-color: #2A3A52; backdrop-filter: blur(14px); }
html[data-theme="dark"] .nav-link { color: #8A9AB3; }
html[data-theme="dark"] .nav-link:hover { background: #1E2D45; color: #E6EDF3; }
html[data-theme="dark"] .nav-link[aria-current="page"] { background: #1E2D45; color: #8ED0F0; }
html[data-theme="dark"] .nav-link-ext { border-color: #2A3A52; }
html[data-theme="dark"] .brand-name { color: #E6EDF3; }
html[data-theme="dark"] .hero {
  background:
    radial-gradient(700px 380px at 50% 0%, rgba(30, 58, 85, 0.55), transparent 65%),
    linear-gradient(180deg, #0A0F1E 0%, #0F1729 100%);
}
html[data-theme="dark"] .hero::before {
  opacity: 0.12;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(126, 200, 227, 0.18), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(126, 200, 227, 0.12), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(126, 200, 227, 0.14), transparent);
}
html[data-theme="dark"] .hero-snow .snowflake { background: #3A5575; opacity: 0.22; }
html[data-theme="dark"] .hero-hex { background: linear-gradient(135deg, #1E344B, #2A4A65); opacity: 0.35; }
html[data-theme="dark"] .eyebrow { color: #8A9AB3; }
html[data-theme="dark"] .hero-title { color: #E6EDF3; }
html[data-theme="dark"] .hero-title span { background: linear-gradient(120deg, #8ED0F0, #5A9AC5); -webkit-background-clip: text; background-clip: text; }
html[data-theme="dark"] .hero-sub, html[data-theme="dark"] .hero-desc { color: #8A9AB3; }
html[data-theme="dark"] .card { background: #141E32; }
html[data-theme="dark"] .card-head { border-bottom-color: #2A3A52; }
html[data-theme="dark"] .card-icon { background: #1E2D45; border-color: #2A3A52; color: #8ED0F0; }
html[data-theme="dark"] .card-title { color: #E6EDF3; }
html[data-theme="dark"] .ver { background: #1E2D45; border-color: #2A3A52; color: #8ED0F0; }
html[data-theme="dark"] .card-branch { color: #6B7E9A; }
html[data-theme="dark"] .chip { background: #0F1729; border-color: #2A3A52; color: #8A9AB3; }
html[data-theme="dark"] .chip-updated { background: #141E32; border-color: #2A3A52; color: #8ED0F0; }
html[data-theme="dark"] .card-updated { color: #8A9AB3; }
html[data-theme="dark"] .card-updated .icon-sm { color: #8ED0F0; }
html[data-theme="dark"] .desc { color: #8A9AB3; }
html[data-theme="dark"] .link { background: #0F1729; border-color: #2A3A52; color: #8ED0F0; }
html[data-theme="dark"] .link:hover { background: #1E2D45; border-color: #3A5575; }
html[data-theme="dark"] .cufiy-flag { color: #E6EDF3; }
html[data-theme="dark"] .cufiy-lang { color: #E6EDF3; }
html[data-theme="dark"] .cufiy-type, html[data-theme="dark"] .cufiy-dl { color: #8ED0F0; }
html[data-theme="dark"] .status-pill, html[data-theme="dark"] .pill, html[data-theme="dark"] .filter-pill, html[data-theme="dark"] .search-input, html[data-theme="dark"] .card, html[data-theme="dark"] .footer { border-color: #2A3A52; }
html[data-theme="dark"] .search-input { background: #141E32; color: #E6EDF3; }
html[data-theme="dark"] .search-input::placeholder { color: #6B7E9A; }
html[data-theme="dark"] .search-input:focus { background: #1A2335; border-color: #3A5575; }
html[data-theme="dark"] .filter-pill { background: #141E32; color: #8A9AB3; }
html[data-theme="dark"] .filter-pill:hover { background: #1E2D45; color: #E6EDF3; }
html[data-theme="dark"] .filter-pill.active { background: linear-gradient(135deg, #4A9ECF, #3A7AA5); color: #fff; border-color: #4A9ECF; }
html[data-theme="dark"] .stat, html[data-theme="dark"] .feature { background: #141E32; border-color: #2A3A52; }
html[data-theme="dark"] .footer { background: linear-gradient(180deg, #0A0F1E 0%, #141E32 100%); border-top-color: #2A3A52; }
html[data-theme="dark"] .footer-bottom { background: #0F1729; }
html[data-theme="dark"] .icon-btn { background: #141E32; border-color: #2A3A52; color: #8A9AB3; }
html[data-theme="dark"] .icon-btn:hover { background: #1E2D45; border-color: #3A5575; color: #E6EDF3; }

html[data-theme="light"] { color-scheme: light; }

/* ==========================================================================
   SPA additions — adapted from anime-module-library reference
   (theme toggle, lang switch, stats, features, chips scroll, toast,
   skeleton, split button)
   ========================================================================== */

/* Nav right cluster */
.nav-right { display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; background: var(--bg-warm); border: 1px solid var(--border); border-radius: var(--r-full); padding: 3px; }
.lang-btn { border: none; background: transparent; padding: 6px 12px; border-radius: var(--r-full); font-size: 12px; font-weight: 700; color: var(--fg-muted); cursor: pointer; font-family: var(--font-body); }
.lang-btn.active { background: var(--frost); color: var(--accent-dark); box-shadow: var(--shadow-sm); }

/* Stats + features (reference layout, cryo skin) */
.stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.stat { background: var(--bg-warm); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 18px 30px; min-width: 140px; box-shadow: var(--shadow-sm); }
.stat-num { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.03em; background: linear-gradient(120deg, var(--accent-dark), var(--crystal)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-variant-numeric: tabular-nums; }
.stat-lbl { color: var(--fg-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 4px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.feature { background: var(--bg-warm); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow-sm); }
.feature .material-symbols-outlined { font-size: 26px; color: var(--accent-dark); background: var(--frost); padding: 10px; border-radius: 12px; margin-bottom: 14px; }
.feature h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 16px; }
.feature p { margin: 0; color: var(--fg-muted); font-size: 14px; line-height: 1.55; }

/* Chips: horizontal scroll + drag affordance (reference pattern).
   NOTE: .filter-group sets flex-wrap:wrap, so the scroll row must opt back
   into nowrap here — otherwise items wrap and nothing scrolls. */
.filter-group.chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 4px 2px; cursor: grab; user-select: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
.chips { scrollbar-width: none; cursor: grab; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar, .filter-group.chips::-webkit-scrollbar { display: none; }
.chips.dragging, .filter-group.chips.dragging { cursor: grabbing; }
.chips .filter-pill, .filter-group.chips .filter-pill { flex: 0 0 auto; white-space: nowrap; }
.chips iconify-icon, .filter-group.chips iconify-icon { font-size: 18px; flex: none; }
.filter-pill { display: inline-flex; align-items: center; gap: 6px; }
.filter-group-apps .filter-pill-app[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Library summary */
.library-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-ghost { background: transparent; }

/* Card entrance + skeleton + toast (reference patterns) */
.card { animation: cardPop 0.3s ease both; }
@keyframes cardPop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.skeleton { height: 190px; border-radius: var(--r-xl); border: 1px solid var(--border); background: linear-gradient(90deg, var(--bg-warm) 25%, var(--frost) 50%, var(--bg-warm) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--fg); color: var(--bg); padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; transition: opacity 0.25s, transform 0.25s; z-index: 200; display: flex; gap: 8px; align-items: center; pointer-events: none; box-shadow: var(--shadow-lg); font-family: var(--font-body); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Empty state (reference pattern) */
.empty { text-align: center; padding: 60px 20px; color: var(--fg-muted); grid-column: 1 / -1; }
.empty .material-symbols-outlined { font-size: 56px; opacity: 0.5; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; font-family: var(--font-display); color: var(--fg); }
.empty p { margin: 0; font-size: 14px; }

/* Card content-type icons (Iconify, reference set) */
.card-types { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--frost); color: var(--accent-dark); border: 1px solid var(--border); flex: none; }
.card-types iconify-icon { font-size: 18px; }

/* Search focus tint (icon sits before the input, so use :focus-within) */
.search-box:focus-within .search-icon { color: var(--accent-dark); }

/* Split add/copy button (reference UX, cryo gradient) */
.split { display: flex; width: 100%; border-radius: var(--r-md); overflow: hidden; margin-top: 12px; box-shadow: var(--shadow-sm); }
.split .add { flex: 1; padding: 12px; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #fff; text-decoration: none; transition: filter 0.2s, transform 0.2s; }
.split .add:hover { filter: brightness(1.06); }
.split .copy { width: 58px; flex: none; display: grid; place-items: center; border: none; border-left: 1px solid rgba(0, 0, 0, 0.08); background: var(--frost); color: var(--fg-muted); cursor: pointer; transition: background 0.2s, color 0.2s; }
.split .copy:hover { background: var(--border); color: var(--accent-dark); }
.split .copy.copied { background: #16a34a; color: #fff; }

.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--frost); }
.author a { color: var(--fg); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.author a:hover { color: var(--accent-dark); }
.apps { display: flex; gap: 4px; flex-wrap: wrap; }
.apps span { font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 3px 7px; border-radius: 6px; background: var(--bg); color: var(--fg-muted); border: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.04em; }
.apps span.on { background: var(--frost); color: var(--accent-dark); border-color: transparent; }

@media (max-width: 820px) {
  .nav-right .nav-links { display: none; }
  .nav-right .nav-links.open { display: flex; }
}
@media (max-width: 640px) {
  .stats { gap: 10px; }
  .stat { flex: 1 1 calc(50% - 10px); min-width: 0; padding: 14px 18px; }
  .stat-num { font-size: 28px; }
}

