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

:root {
  /* Paper surfaces */
  --bg:    #f7f4ee;
  --s1:    #ffffff;
  --s2:    #fef6e1;
  --s3:    #f1ebe0;

  /* Borders — warm, low-contrast */
  --b1:    rgba(60, 45, 25, 0.07);
  --b2:    rgba(60, 45, 25, 0.12);
  --b3:    rgba(60, 45, 25, 0.20);

  /* Text — warm ink */
  --tx:    #26201a;
  --tx2:   rgba(38, 32, 26, 0.62);
  --tx3:   #d9631a;

  /* Accent — orange */
  --ac:      #e8621a;
  --ac-lo:   rgba(232, 98, 26, 0.07);
  --ac-mid:  rgba(232, 98, 26, 0.16);
  --ac-hi:   #ff8a42;

  /* Glass */
  --glass-bg:     rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.70);
  --glass-blur:   16px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(38, 32, 26, 0.04);
  --shadow-md: 0 4px 16px rgba(38, 32, 26, 0.06);
  --shadow-lg: 0 12px 32px rgba(38, 32, 26, 0.08);

  --r:     14px;
  --r-sm:  9px;

  --card-hover: #ffffff;
}

/* ── DARK MODE ────────── */
[data-theme="dark"] {

  --card-hover: #2e2e2e;

  --bg:    #030303;
  --s1:    #0f0f13;
  --s2:    #141418;
  --s3:    #1a1a1f;

  --b1:    rgba(255,255,255,0.06);
  --b2:    rgba(255,255,255,0.10);
  --b3:    rgba(255,255,255,0.18);

  --tx:    #ebebf0;
  --tx2:   rgba(247, 246, 247, 0.65);
  --tx3:   #ff8a42;

  --ac:      #e8621a;
  --ac-lo:   rgba(232, 98, 26, 0.10);
  --ac-mid:  rgba(232, 98, 26, 0.713);
  --ac-hi:   #ff8a42;

  --glass-bg:     rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-blur:   16px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}



/* Smooth cross-fade whenever the theme attribute flips */
body,
.card,
.tab,
.search-wrap input,
.float-top,
.footer-inner,
.author-area {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
}

/* ── BASE ─────────────── */
html { height:110vh; }
body {
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  min-height: 110vh;
}

/* ── GLOW ─────────────── */
#glow {
  position: fixed;
  top: -280px;
  left: 50%;
  translate: -50% 0;
  width: 900px;
  height: 100vh;
  background:
  radial-gradient(
    ellipse 60% 50% at 50% 40%,
    rgba(232, 98, 26, 0.08) 0%,
    transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── PAGE ─────────────── */
.page {
  position: relative;
  z-index: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 32px 200px;
}

/* ── NAV ──────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  margin: 24px 0 52px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--ac);
  box-shadow: var(--shadow-sm);
}

.brand-mark span {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.wordmark {
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--tx);
  text-decoration: none;
  transition: color .15s ease;
}

.wordmark:hover {
  color: var(--ac);
}

.nav-pipe {
  width: 1px;
  height: 16px;
  background: var(--b2);
  flex-shrink: 0;
}

.nav-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tx2);
  white-space: nowrap;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--b2);
}

.nav-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--ac);
  border: 1px solid var(--ac-mid);
  background: var(--ac-lo);
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-badge-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--ac);
  box-shadow: 0 0 0 3px var(--ac-lo);
}

/* ── SEARCH ───────────── */
.search-wrap {
  position: relative;
  margin-bottom: 24px;
}

.search-wrap input {
  width: 100%;
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--tx);
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  padding: 12px 38px 12px 38px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.search-wrap input:focus {
  border-color: var(--ac-mid);
  background: var(--s1);
  box-shadow: 0 0 0 4px var(--ac-lo);
}

.search-wrap input::placeholder {
  color: rgb(161, 161, 161);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  translate: 0 -50%;
  width: 20px;
  height: 20px;
  color: var(--tx2);
  cursor: pointer;
  transition: color .15s;
}

.search-icon:hover {
  color: var(--ac);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  color: var(--tx2);
  font-size: 26px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease-in-out;
}

.search-clear:hover {
  color: #d9481a;
  font-weight: 800;
}

/* ── FILTER ROW ───────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 52px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--tx2);
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  padding: 5px 13px;
  cursor: pointer;
  user-select: none;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
  transition: color .15s, border-color .15s, background .15s;
}

.tab:hover {
  color: var(--tx);
  border-color: var(--b2);
  background: var(--s2);
}

.tab.on {
  color: var(--ac);
  background: var(--ac-lo);
  border-color: var(--ac-mid);
}

.tab-n {
  font-family: 'Geist Mono', monospace;
  font-size: 9px;
  font-weight: 500;
  color: var(--tx2);
  letter-spacing: 0.04em;
}

.tab.on .tab-n { color: var(--ac); }

/* ── SECTION BAR ──────── */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-name {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ac);
}

.section-tally {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--tx2);
  letter-spacing: 0.04em;
}

.section-tally em {
  font-style: normal;
  color: var(--ac);
}

.section-line {
  height: 1px;
  background: var(--b1);
  margin-bottom: 28px;
}

/* ── GRID ─────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

/* ── CARD (glass) ─────── */
.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  padding: 14px 15px 12px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: border-color .18s, box-shadow .18s, transform .18s, background .18s;
}

.card:hover {
  background: var(--card-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── CARD HEAD ────────── */
.ch {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.c-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.c-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  border-radius: 3px;
}

.c-icon .fallback {
  font-size: 13px;
  line-height: 1;
}

.c-title {
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--tx);
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c-arrow {
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity .15s, transform .15s;
  flex-shrink: 0;
}

.c-arrow svg {
  width: 10px; height: 10px;
  stroke: var(--ac);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card:hover .c-arrow {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* ── CARD BODY ────────── */
.c-desc {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--tx2);
  line-height: 1.6;
  margin-bottom: 11px;
  display: -webkit-box;
  -line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── CARD FOOT ────────── */
.cf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
}

.c-type {
  font-family: 'Geist Mono', monospace;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ac);
  background: var(--ac-lo);
  border: 1px solid var(--ac-mid);
  padding: 2px 6px;
  border-radius: 6px;
}

.c-url {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--tx2);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── EMPTY ────────────── */
.empty {
  grid-column: 1/-1;
  padding: 80px 0;
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--tx2);
  letter-spacing: 0.06em;
}

/* ── MOBILE ───────────── */
@media (max-width: 600px) {
  .page { padding: 0 18px 80px; }
  nav { padding: 10px 14px; margin: 14px 0 36px; }
  .nav-pipe, .nav-tag { display: none; }
  .nav-right { gap: 12px; }
  .nav-divider { display: none; }
  .grid { grid-template-columns: 1fr; }
}

/* ── FLOATING BACK TO TOP ─────────────────────── */
.float-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--tx2);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
  z-index: 50;
}

.float-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.float-top:hover {
  color: var(--ac);
  border-color: var(--ac-mid);
  background: rgba(255, 255, 255, 0.85);
}

.float-top svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 600px) {
  .float-top { bottom: 18px; right: 18px; }
}

/* ── FOOTER (glass) ───── */
.minimal-footer {
  position: relative;
  overflow: hidden;
  z-index: 1;
  padding: 80px 24px 40px 24px;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  margin-bottom: 15px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 40px 20px;
  box-shadow: var(--shadow-lg);
}

/* Main Layout */
.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--b1);
}

/* Brand Column */
.footer-brand-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 360px;
}

.brand-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tx);
  text-decoration: none;
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.brand-logo:hover {
  color: var(--ac);
}

.brand-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--tx2);
  margin-bottom: 32px;
}

/* Author  */
.author-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.author-area:hover {
  background: var(--ac-lo);
  border-color: var(--ac-mid);
}

.author-avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--s3);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tx2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.author-link:hover {
  color: var(--tx);
}

.arrow-icon {
  width: 12px;
  height: 12px;
  color: var(--ac);
  transition: transform 0.2s ease, color 0.2s ease;
}

.author-area:hover .arrow-icon {
  transform: translate(1px, -1px);
  color: var(--ac-hi);
}

/* Right-Sided Navigation */
.footer-nav {
  display: flex;
  justify-content: flex-end;
  min-width: 160px;
}

.nav-group h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--tx);
  margin-bottom: 24px;
}

.nav-group ul {
  list-style: none;
}

.nav-group li {
  margin-bottom: 14px;
}

.nav-group a {
  font-size: 0.95rem;
  color: var(--tx2);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-group a:hover {
  color: var(--ac);
}

/* Bottom Row */
.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
}

.copyright {
  font-size: .95rem;
  color: var(--tx2);
  margin-top: 20px;
}

/* Responsive Design */

@media (max-width: 768px) {
  .minimal-footer {
    padding: 80px 24px 40px 24px;
  }

  .footer-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }

  .footer-brand-col {
    max-width: 100%;
  }

  .brand-description {
    margin-bottom: 24px;
  }

  .footer-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .nav-group h5 {
    margin-bottom: 16px;
  }
  .footer-bottom {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 20px;
    padding-top: 24px;
  }
}

@media (max-width: 600px) {
  .minimal-footer {
    border-radius: 20px;
    margin: 0 10px 10px;
  }
  .footer-inner {
    padding: 28px 20px;
    border-radius: 16px;
  }
}

/* ── THEME TOGGLE SWITCH  */
.switch {
  font-size: 17px;
  position: relative;
  display: inline-block;
  width: 60px;
  height: 32px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--s3);
  border: 1px solid var(--b2);
  transition: background-color .3s ease, border-color .3s ease;
  border-radius: 30px;
  box-shadow: var(--shadow-sm);
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  border-radius: 50%;
  left: 2px;
  bottom: 2px;
  z-index: 2;
  background-color: var(--s1);
  box-shadow: var(--shadow-sm);
  transition: transform .3s ease, background-color .3s ease;
}
.sun svg {
  position: absolute;
  top: 6px;
  left: 34px;
  z-index: 1;
  width: 20px;
  height: 20px;
}

.sun svg g {
  fill: var(--ac);
}

.moon svg {
  fill: var(--tx2);
  position: absolute;
  top: 7px;
  left: 6px;
  z-index: 1;
  width: 18px;
  height: 18px;
}
.sun svg {
  animation: rotate 15s linear infinite;
}
@keyframes rotate {
  0%   { transform: rotate(0); }
  100% { transform: rotate(360deg); }
}
.moon svg {
  animation: tilt 5s linear infinite;
}
@keyframes tilt {
  0%   { transform: rotate(0deg); }
  25%  { transform: rotate(-10deg); }
  75%  { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}
.switch .input:checked + .slider {
  background-color: var(--s1);
  border-color: var(--ac-mid);
}
.switch .input:focus-visible + .slider {
  box-shadow: 0 0 0 4px var(--ac-lo);
}
.switch .input:checked + .slider:before {
  transform: translateX(28px);
  background-color: var(--s2);
}
/* :has() reaches "backward" to style the sun/moon icons, which sit
   BEFORE the checkbox in this markup, so a ~ sibling selector can't reach them */
.switch:has(.input:checked) .moon svg {
  fill: var(--ac-hi);
}
.switch:has(.input:checked) .sun svg g {
  fill: var(--tx2);
}

/* Custom Styled Version Select */
.version-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 24px 4px 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tx);
  cursor: pointer;
  /* SVG Chevron Arrow Icon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 14px;
  transition: all 0.2s ease;
}

.version-select:hover {
  border-color: var(--bg);
}

.version-select:focus {
  outline: 2px solid transparent;
  outline-offset: 1px;
}

/* Accessibility helper class */
.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;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    transition: all ease 0.6s;
}

::-webkit-scrollbar-thumb {
    background: var(--ac-hi);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}