:root {
  --bg: #000000;
  --surface: #0a0a0c;
  --surface-elevated: #121216;
  --surface-active: #1c1c22;
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.24);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #8e8e99;
  --accent-green: #34d399;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: clip;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

a, button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 4px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  background: #ffffff;
  color: #000000;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}

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

/* Top Header & Centered Switcher */
.top-bar {
  position: relative;
  z-index: 20;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  overflow-x: clip;
}

.top-bar-left {
  display: flex;
  align-items: center;
  justify-self: start;
}

.top-bar-center {
  display: flex;
  justify-content: center;
  justify-self: center;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px 0 13px;
  border-radius: 9999px;
  background: rgba(12, 12, 12, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 22px 44px -20px rgba(0, 0, 0, 0.85), 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #f4f4f5;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}

.nav-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* On Hub page with a fine pointer, Back reveals only when cursor enters navbar row */
@media (hover: hover) and (pointer: fine) {
  body[data-page="hub"] .nav-link {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, color 0.15s ease, border-color 0.15s ease;
  }

  body[data-page="hub"] .nav-link.is-visible,
  body[data-page="hub"] .nav-link:focus-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* Top-Center GooeyNav Switcher */
.gooey-nav {
  --gn-frame: rgba(12, 12, 12, 0.94);
  --gn-frame-edge: rgba(255, 255, 255, 0.09);
  --gn-frame-highlight: rgba(255, 255, 255, 0.06);
  --gn-frame-shadow: 0 22px 44px -20px rgba(0, 0, 0, 0.85), 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  --gn-ink: #f4f4f5;
  --gn-muted: rgba(244, 244, 245, 0.62);
  --gn-pill: #f4f4f5;
  --gn-active-ink: #0a0a0a;
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.gooey-nav[hidden] {
  display: none !important;
}

.gooey-nav--framed {
  padding: 4px;
  border-radius: 9999px;
  background: var(--gn-frame);
  border: 1px solid var(--gn-frame-edge);
  box-shadow: var(--gn-frame-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.gooey-nav__rim {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 0 var(--gn-frame-highlight);
}

.gooey-nav__stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  isolation: isolate;
}

.gooey-nav__canvas {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.gooey-nav__fallback {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 9999px;
  background: var(--gn-pill);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1), height 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.15s ease;
}

.gooey-nav__list {
  position: relative;
  z-index: 2;
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.gooey-nav__list--active {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  visibility: hidden;
}

/* Crisp active pill before WebGL2 GooeyNav settles so initial paint never doubles dark text */
.gooey-nav:not([data-gooey-ready="1"]) .gooey-nav__list:not(.gooey-nav__list--active) .gooey-nav__item[data-active] .gooey-nav__link {
  background: var(--gn-pill);
  color: var(--gn-active-ink);
}

.gooey-nav__item {
  position: relative;
}

.gooey-nav__link {
  appearance: none;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9999px;
  color: var(--gn-muted);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s ease;
}

.gooey-nav--md .gooey-nav__link {
  height: 32px;
  min-height: 32px;
  padding: 0 16px;
  font-size: 0.8125rem;
}

.gooey-nav__link:hover,
.gooey-nav__link:focus-visible {
  color: var(--gn-ink);
}

.gooey-nav__list--active .gooey-nav__link {
  color: var(--gn-active-ink);
  font-weight: 500;
}

/* Main Stage */
.main-stage {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  min-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

body[data-page="guide"] .main-stage {
  justify-content: flex-start;
  padding-top: 28px;
}

/* Hub View */
.hub-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hub-header {
  max-width: 780px;
  margin-bottom: 52px;
}

.hub-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 12px;
}

.hub-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Pure Logo Grid */
.logo-grid {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.logo-grid[data-count="3"] {
  max-width: 600px;
}

.logo-grid[data-count="6"] {
  max-width: 680px;
}

.logo-item {
  appearance: none;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 12px 8px;
  width: 164px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  border-radius: 12px;
  transition: opacity 0.18s ease;
}

.logo-mark {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.logo-mark svg,
.logo-mark img {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
}

.logo-mark img[src*="profile-02.png"],
.guide-hero-logo img[src*="profile-02.png"] {
  border-radius: 10px;
}

.logo-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
  transition: color 0.15s ease;
}

.logo-item:hover .logo-name,
.logo-item:focus-visible .logo-name {
  color: #ffffff;
}

.logo-meta {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Tool Detail Guide View */
.guide-view {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  text-align: left;
}

.guide-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.guide-hero-main {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.guide-hero-logo {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-hero-logo svg,
.guide-hero-logo img {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: contain;
}

.guide-hero-text {
  min-width: 0;
}

.guide-hero-text h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin-bottom: 4px;
}

.guide-hero-text p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-scope-pill {
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: rgba(12, 12, 12, 0.88);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Guide Sub-tabs (Install / Update / Remove / Details) */
.guide-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.guide-subtab {
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: rgba(10, 10, 12, 0.9);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.guide-subtab:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.guide-subtab[aria-selected="true"] {
  background-color: #ffffff;
  color: #000000;
  border-color: #ffffff;
  font-weight: 600;
}

/* Step List inside Guide */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.guide-step {
  padding: 20px 22px;
  border-radius: 12px;
  background-color: rgba(10, 10, 12, 0.9);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.guide-step-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.guide-step-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.guide-step-title {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.guide-step-body {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.guide-step-body code {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #e4e4e7;
  background-color: var(--surface-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Copyable Command Button */
.cmd-block {
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 8px;
  background-color: #050507;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cmd-block:hover {
  border-color: var(--border-strong);
  background-color: #0d0d12;
}

.cmd-code {
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
  color: #f4f4f5;
}

.cmd-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  background-color: var(--surface-elevated);
  border: 1px solid var(--border);
}

.cmd-block[data-copied="true"] {
  border-color: var(--accent-green);
}

.cmd-block[data-copied="true"] .cmd-action {
  color: #000000;
  background-color: var(--accent-green);
  border-color: var(--accent-green);
}

/* Responsive adjustments */
@media (max-width: 820px) {
  /* Unify Back + middot + category tabs into a single centered floating capsule */
  .top-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: max(18px, env(safe-area-inset-top)) auto 0;
    padding: 4px;
    border-radius: 9999px;
    background: rgba(12, 12, 12, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.06), 0 22px 44px -20px rgba(0, 0, 0, 0.85), 0 6px 16px -8px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
  }

  .top-bar-left {
    display: inline-flex;
    align-items: center;
    width: auto;
    flex-shrink: 0;
  }

  .top-bar-left::after {
    content: "\2022";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(244, 244, 245, 0.34);
    font-size: 11px;
    line-height: 1;
    margin: 0 5px 0 3px;
    user-select: none;
    pointer-events: none;
    flex-shrink: 0;
  }

  /* Match unified dark pill surface & keep Back visible at <= 820px */
  .nav-link,
  body[data-page="hub"] .nav-link {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    justify-content: center;
    height: 36px;
    min-height: 36px;
    min-width: 0;
    padding: 0 7px 0 11px;
    gap: 5px;
    border-radius: 9999px;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(244, 244, 245, 0.72);
    text-shadow: none;
    white-space: nowrap;
  }

  .nav-link svg {
    width: 13px;
    height: 13px;
  }

  .nav-link:hover,
  .nav-link:focus-visible,
  body[data-page="hub"] .nav-link:hover,
  body[data-page="hub"] .nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    border-color: transparent;
    color: #ffffff;
  }

  .top-bar-center {
    width: auto;
    flex: 0 1 auto;
    min-width: 0;
    justify-content: center;
  }

  .gooey-nav--framed {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .gooey-nav__rim {
    display: none;
  }

  .gooey-nav--md .gooey-nav__link {
    height: 36px;
    min-height: 36px;
  }

  .guide-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .top-bar {
    max-width: calc(100% - 12px);
    margin: max(14px, env(safe-area-inset-top)) auto 0;
    padding: 4px;
    gap: 0;
  }

  .top-bar-left::after {
    font-size: 11px;
    margin: 0 3px 0 2px;
  }

  .nav-link,
  body[data-page="hub"] .nav-link {
    height: 36px;
    min-height: 36px;
    padding: 0 4px 0 8px;
    gap: 4px;
    font-size: 0.78125rem;
  }

  .nav-link svg {
    width: 13px;
    height: 13px;
  }

  .gooey-nav--framed {
    padding: 0;
    max-width: 100%;
  }

  .gooey-nav__list {
    gap: 0;
  }

  .gooey-nav--md .gooey-nav__link {
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.78125rem;
  }

  .main-stage {
    padding: 24px 16px 64px;
  }

  body[data-page="guide"] .main-stage {
    padding-top: 16px;
  }

  .logo-grid,
  .logo-grid[data-count="3"],
  .logo-grid[data-count="6"] {
    gap: 24px 12px;
  }

  .logo-item {
    width: 148px;
  }

  .guide-hero-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* Aurora Background Layer */
.aurora-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Immediate ambient gradient matching Aurora stops until WebGL2 draws Frame 0 */
.aurora-container::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(64% 52% at 10% -2%, rgba(124, 255, 103, 0.48) 0%, rgba(124, 255, 103, 0) 74%),
    radial-gradient(54% 46% at 48% -4%, rgba(180, 151, 207, 0.34) 0%, rgba(180, 151, 207, 0) 72%),
    radial-gradient(66% 56% at 92% 0%, rgba(82, 39, 255, 0.58) 0%, rgba(82, 39, 255, 0) 76%);
}

.aurora-container[data-aurora-ready="1"]::before {
  display: none;
}

.aurora-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* TargetCursor Stage & Reticle (active below navbar) */
.cursor-stage {
  position: relative;
  z-index: 10;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.target-cursor {
  --target-cursor-color: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  opacity: 0;
  will-change: opacity;
}

.target-cursor__corner {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-color: var(--target-cursor-color);
  border-style: solid;
  border-width: 3px 0 0 3px;
  transform-origin: 0 0;
  pointer-events: none;
  will-change: transform, width, height, border-radius;
}

.target-cursor__dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--target-cursor-color);
  pointer-events: none;
  will-change: transform;
}

.target-cursor__label {
  position: fixed;
  top: 0;
  left: 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  color: var(--target-cursor-color);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
