@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* ---------- Tokens ---------- */

:root {
  --bg: #0b0b0d;
  --surface: #121216;
  --surface-raised: #17171c;
  --border: #22222a;
  --border-strong: #32323d;
  --text: #ededf0;
  --text-muted: #9a9aa6;
  --text-faint: #5f5f6b;
  --accent: #ff4d55;
  --accent-hover: #ff6a70;
  --warn: #e8b23a;
  --warn-soft: rgba(232, 178, 58, 0.12);
  --ok: #6fcf8f;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* A single, still glow near the top. No animation, no haze. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(60% 40% at 50% -8%, rgba(255, 77, 85, 0.1), transparent 70%);
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

/* ---------- Cursor glow (added by cursor.js on fine pointers) ---------- */

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 77, 85, 0.5);
  background: rgba(255, 77, 85, 0.06);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, width 0.2s var(--ease), height 0.2s var(--ease), background-color 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.cursor-glow.visible {
  opacity: 1;
}

.cursor-glow.hot {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  background: rgba(255, 77, 85, 0.1);
  border-color: rgba(255, 77, 85, 0.8);
}

/* ---------- Layout ---------- */

/* The swappable content fills the page width, so short pages are not squeezed into their content. */
#app {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: 88px 20px 48px;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 50;
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  background: var(--accent);
}

.topbar {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 10;
  transform: translateX(-50%);
  width: min(600px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(18, 18, 22, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 11px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.back:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.back svg {
  width: 16px;
  height: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.header {
  margin: 0 0 32px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.title {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.footer {
  margin-top: auto;
  padding-top: 56px;
  display: flex;
  justify-content: center;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ---------- Section labels ---------- */

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.label-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

.label-row .section-label {
  flex: 1;
  margin: 0;
}

.list + .section-label,
.cmd-stack + .section-label,
.list + .label-row,
.cmd-stack + .label-row {
  margin-top: 36px;
}

.cmd-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------- Search ---------- */

.search {
  position: relative;
  margin-bottom: 18px;
}

.search input {
  width: 100%;
  height: 50px;
  padding: 0 54px 0 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: 500 0.95rem var(--font-sans);
  transition: border-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--text-faint);
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search input:focus {
  outline: none;
  border-color: var(--border-strong);
}

.search > svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.search kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: 600 0.75rem var(--font-mono);
  color: var(--text-faint);
  transition: opacity 0.2s ease;
}

.search input:focus ~ kbd {
  opacity: 0;
}

.empty {
  display: none;
  margin: 8px 0 0;
  padding: 26px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}

.empty.show {
  display: block;
}

/* ---------- Link rows ---------- */

.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s var(--ease);
}

.row:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.row-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* Download and link buttons share one size: 40px, on both link rows and mod cards. */
.row-icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-faint);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease);
}

.row-icon svg {
  width: 16px;
  height: 16px;
}

.row:hover .row-icon {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateX(2px);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  margin-left: 9px;
  padding: 2px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  vertical-align: 2px;
}

.badge-soon {
  color: var(--warn);
  border-color: rgba(232, 178, 58, 0.35);
  background: var(--warn-soft);
}

/* ---------- Cards (mod menus) ---------- */

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card-info {
  min-width: 0;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.card-desc {
  margin: 2px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* ---------- Command snippets ---------- */

.cmd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #0c0c0f;
}

.cmd code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #d2d2da;
  scrollbar-width: thin;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  font: 600 0.875rem/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s var(--ease);
}

.btn:hover {
  background: #1f1f26;
  border-color: #40404d;
}

.btn:active {
  scale: 0.97;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-raised);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-icon {
  width: 40px;
  padding: 0;
}

.btn-copy {
  height: 34px;
  padding: 0 12px;
  font-size: 0.8125rem;
}

.btn-copy.is-done {
  color: var(--ok);
  border-color: rgba(111, 207, 143, 0.4);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
  height: 46px;
  font-size: 0.95rem;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  box-shadow: 0 16px 40px -16px #000;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%, 160%);
  transition: transform 0.35s var(--ease);
}

.toast.show {
  transform: translate(-50%, 0);
}

.toast .tick {
  width: 18px;
  height: 18px;
  color: var(--ok);
}

/* ---------- Home: hero, avatar, intro gate ---------- */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 11, 13, 0.94);
  cursor: pointer;
  transition: opacity 0.6s ease, visibility 0.6s;
}

.intro-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.intro-cta {
  padding: 18px 36px;
  border: 1px solid rgba(255, 77, 85, 0.55);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  animation: gate-pulse 2.4s ease-in-out infinite;
  transition: border-color 0.25s ease, color 0.25s ease;
}

@keyframes gate-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 85, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(255, 77, 85, 0); }
}

.intro-overlay:hover .intro-cta {
  border-color: var(--accent);
  color: #fff;
}

#lightning-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

.enter-link {
  display: contents;
}

.main-content {
  width: 100%;
  display: flex;
  justify-content: center;
  filter: blur(14px);
  transition: filter 1s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.main-content.active {
  filter: none;
  pointer-events: auto;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 0 40px;
}

.avatar-wrap {
  position: relative;
  width: 104px;
  height: 104px;
  margin-bottom: 20px;
}

.avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  box-shadow: 0 0 calc(20px + var(--beat-glow, 0px)) rgba(255, 77, 85, 0.25);
}

.hero-title {
  margin: 0;
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.sub-locker {
  display: none;
  width: 100%;
  margin-bottom: 36px;
  padding: 24px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.sub-locker h3 {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.sub-locker p {
  margin: 0 0 20px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.sub-locker .btn-block {
  margin-bottom: 10px;
}

.error-msg {
  display: none;
  margin: -2px 0 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #ff7b7b;
}

/* ---------- Motion ---------- */

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

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  .page {
    padding: 80px 16px 36px;
  }

  .topbar {
    top: 12px;
    width: calc(100% - 24px);
  }

  .topbar .brand {
    display: none;
  }
}

/* ---------- Custom cursor (fine pointers only; set by cursor.js) ---------- */

.custom-cursor,
.custom-cursor * {
  cursor: none !important;
}

/* Text fields keep the text cursor so selecting and editing still work. */
.custom-cursor input:not([type="button"]):not([type="submit"]):not([type="checkbox"]):not([type="range"]),
.custom-cursor textarea {
  cursor: text !important;
}

/* ---------- Cursor trail canvas ---------- */

.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
}

/* Rows rendered as buttons (copy-text rows) look like links. */
button.row {
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

/* ---------- 3D hover ----------
   site.js sets --tx and --ty (-1 to 1) from the pointer position over each element.
   Without a mouse these stay 0 and the elements sit flat. */

.row,
.card,
.btn {
  --tx: 0;
  --ty: 0;
  --lift: 0px;
  transform-style: preserve-3d;
  transform: perspective(800px) translateY(var(--lift)) rotateX(calc(var(--ty) * -10deg)) rotateY(calc(var(--tx) * 10deg));
  box-shadow: calc(var(--tx) * -16px) calc(var(--ty) * -16px + 16px) 32px -14px rgba(0, 0, 0, 0.75);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.row:hover,
.card:hover,
.btn:hover {
  --lift: -3px;
}

@media (prefers-reduced-motion: reduce) {
  .row,
  .card,
  .btn {
    transform: none;
    transition: none;
  }
}

/* ---------- Bottom-left dock: music toggle and view counter ---------- */

.dock {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock > * {
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(18, 18, 22, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px -14px rgba(0, 0, 0, 0.8);
}

.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 14px;
  color: var(--text-muted);
  font: 600 0.8rem/1 var(--font-sans);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.music-toggle:hover {
  color: var(--text);
  border-color: #40404d;
}

.music-toggle[aria-pressed="true"] {
  color: var(--text);
}

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 14px;
  height: 12px;
}

.eq i {
  display: block;
  width: 3px;
  height: 4px;
  border-radius: 1px;
  background: var(--accent);
}

.music-toggle[aria-pressed="true"] .eq i {
  animation: eq 0.9s ease-in-out infinite;
}

.music-toggle[aria-pressed="true"] .eq i:nth-child(2) {
  animation-delay: -0.3s;
}

.music-toggle[aria-pressed="true"] .eq i:nth-child(3) {
  animation-delay: -0.6s;
}

@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 12px; }
}

