
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-rail);
  width: var(--rail-collapsed);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  background: var(--surface-base);
  border-right: 1px solid var(--border-subtle);
  overflow: visible;
  transition: width 0.35s var(--ease-out-expo);
}

.rail:hover,
.rail:has(:focus-visible) {
  width: var(--rail-expanded);
}

.rail .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0;
  font: 700 1.1rem var(--font-display);
  white-space: nowrap;
}

.logo-dot {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font: 800 1.5rem var(--font-display);
  color: var(--text-primary);
}

.logo-dot::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  box-shadow: var(--shadow-glow);
  animation: bulbGlowDot 2.4s ease-in-out infinite;
}

@keyframes bulbGlowDot {
  50% {
    opacity: 0.65;
    transform: scale(0.94);
  }
}

.rail .logo span:last-child span {
  color: var(--color-primary);
}

.rail svg {
  width: 22px;
  height: 22px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail a,
.rail button.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  white-space: nowrap;
}

.rail .lbl {
  opacity: 0;
  transition: opacity 0.2s ease;
  font-weight: 600;
}

.rail:hover .lbl,
.rail:has(:focus-visible) .lbl {
  opacity: 1;
}

.rail a[aria-current="page"] {
  border: 1px solid var(--border-glow-active);
  background: var(--border-glow);
  color: var(--color-primary);
}

.rail .tip {
  position: absolute;
  left: calc(100% + 12px);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: var(--z-dropdown);
}

.rail:not(:hover):not(:has(:focus-visible)) a:hover .tip,
.rail:not(:hover):not(:has(:focus-visible)) button.nav:hover .tip,
.rail:not(:hover):not(:has(:focus-visible)) a:focus-visible .tip,
.rail:not(:hover):not(:has(:focus-visible)) button.nav:focus-visible .tip {
  opacity: 1;
  transform: none;
}

.dock {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-dock);
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(640px, calc(100vw - var(--rail-collapsed) - 32px));
  padding: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--surface-glass-border);
  box-shadow: var(--shadow-card);
}

.dock .search-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--border-subtle);
  color: var(--text-muted);
  text-align: left;
}

.dock .search-pill kbd {
  margin-left: auto;
}

.dock kbd {
  font: 0.75rem var(--font-mono);
  padding: 2px 6px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
}

.chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.chip[aria-pressed="true"] {
  background: var(--color-primary);
  color: var(--on-primary);
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: var(--radius-pill);
  flex: none;
}

.hamburger svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

main {
  padding-bottom: 64px;
}

body:has(.rail) main,
body:has(.rail) footer {
  margin-left: var(--rail-collapsed);
}

.channels {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 32px;
  scrollbar-width: none;
}

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

.channel {
  flex: none;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.channel[aria-pressed="true"] {
  border-color: var(--border-glow-active);
  color: var(--color-primary);
}

.filter-note {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px) 0;
  color: var(--text-secondary);
}

.filter-note[hidden] {
  display: none;
}

.view-all {
  min-height: 44px;
  padding: 0 4px;
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
}

footer {
  padding: 32px var(--page-gutter);
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 32px;
  align-items: center;
  max-width: 1200px;
  margin-inline: auto;
  text-align: left;
}

.footer__brand {
  font: 800 1.25rem var(--font-display);
  color: var(--text-primary);
}

.footer__brand span {
  color: var(--color-primary);
}

.footer__tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: flex-end;
}

.footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer__nav a:hover {
  color: var(--color-primary);
}

.footer__legal {
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.back-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: var(--z-back-top);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  color: var(--color-primary);
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.back-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
