/* ==========================================================================
   RiftMC — Landing page styles
   ========================================================================== */

:root {
  /* Palette */
  --bg: #07060f;
  --bg-elev: #0e0c1d;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eceaf6;
  --text-muted: #a19dbb;
  --text-dim: #6f6b89;

  --cyan: #22d3ee;
  --cyan-bright: #7df9ff;
  --purple: #8b5cf6;
  --purple-bright: #c4b5fd;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;

  --gradient: linear-gradient(120deg, var(--cyan-bright) 0%, var(--cyan) 30%, var(--purple) 100%);
  --glow-cyan: 0 0 24px rgba(34, 211, 238, 0.35);
  --glow-purple: 0 0 32px rgba(139, 92, 246, 0.35);

  /* Type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* Layout */
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
code { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.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;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 16px; border-radius: 10px; background: var(--cyan); color: #000; font-weight: 600;
}
.skip-link:focus { top: 16px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Glass ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 40px -12px rgba(0, 0, 0, 0.6);
}

/* ---------- Background ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg__orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  will-change: transform;
}
.bg__orb--cyan {
  width: 520px; height: 520px; top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.55), transparent 70%);
  animation: drift 18s var(--ease) infinite alternate;
}
.bg__orb--purple {
  width: 620px; height: 620px; top: 10%; right: -200px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.6), transparent 70%);
  animation: drift 22s var(--ease) infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(80px, 60px, 0) scale(1.15); }
}

/* ---------- Buttons ---------- */
.btn {
  --btn-h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--btn-h); padding-inline: 20px;
  border-radius: 12px; font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s, border-color 0.25s;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn--sm { --btn-h: 38px; padding-inline: 16px; font-size: 0.9rem; }
.btn--lg { --btn-h: 52px; padding-inline: 26px; font-size: 1rem; }
.btn--primary {
  background: var(--gradient); color: #07060f;
  box-shadow: 0 6px 24px -6px rgba(34, 211, 238, 0.55), 0 6px 30px -8px rgba(139, 92, 246, 0.6);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px -6px rgba(34, 211, 238, 0.7), 0 10px 40px -8px rgba(139, 92, 246, 0.75);
}
/* Discord links with no invite configured yet */
.btn.is-disabled { cursor: default; opacity: 0.55; filter: saturate(0.6); box-shadow: none; pointer-events: none; }
.btn--ghost { background: var(--surface); border: 1px solid var(--border-strong); }
.btn--ghost:hover { background: var(--surface-hover); border-color: rgba(34, 211, 238, 0.5); }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; width: 20px; height: 20px; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(7, 6, 15, 0.7);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom-color: var(--border);
}
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.brand__logo { width: 40px; height: 40px; overflow: visible; filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.45)); transition: transform 0.5s var(--ease), filter 0.5s; }
.brand:hover .brand__logo { transform: rotate(-8deg) scale(1.08); filter: drop-shadow(0 0 16px rgba(139, 92, 246, 0.7)); }
.brand__rift { stroke-dasharray: 60; animation: rift-flicker 4s ease-in-out infinite; }
.brand__shard { animation: float 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.brand__shard--2 { animation-delay: -1.6s; }
@keyframes rift-flicker {
  0%, 100% { opacity: 1; }
  45% { opacity: 1; }
  50% { opacity: 0.35; }
  55% { opacity: 1; }
}
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

.nav__list { display: flex; align-items: center; gap: 8px; }
.nav__link {
  display: inline-block; padding: 8px 14px; border-radius: 10px;
  color: var(--text-muted); font-weight: 500; font-size: 0.95rem;
  transition: color 0.2s, background 0.2s;
}
.nav__link:hover { color: var(--text); background: var(--surface); }
.nav__list .btn { margin-left: 8px; }

.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; position: relative; }
.nav-toggle__bar {
  position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--text);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease);
}
.nav-toggle__bar:nth-child(2) { top: 18px; }
.nav-toggle__bar:nth-child(3) { top: 25px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding-block: calc(var(--header-h) + 48px) 80px;
}
.hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }

.status-pill {
  --dot: var(--text-dim);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 12px; margin-bottom: 28px;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.status-pill__dot {
  position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--dot);
  box-shadow: 0 0 10px var(--dot);
}
.status-pill__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--dot);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.status-pill[data-state="online"] { --dot: var(--green); color: #b7f5dc; border-color: rgba(52, 211, 153, 0.35); }
.status-pill[data-state="dev"] { --dot: var(--amber); color: #fde7a8; border-color: rgba(251, 191, 36, 0.35); }
.status-pill[data-state="checking"] .status-pill__dot::after { animation-duration: 1s; }
@keyframes ping { 75%, 100% { transform: scale(2.4); opacity: 0; } }

.hero__title {
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: 1.02; letter-spacing: -0.045em; font-weight: 850;
  max-width: 14ch;
}
.hero__title .text-gradient { filter: drop-shadow(0 0 28px rgba(34, 211, 238, 0.3)); }
.hero__lead {
  margin-top: 22px; max-width: 58ch;
  font-size: clamp(1rem, 2.2vw, 1.2rem); color: var(--text-muted);
}

.ip-box {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; max-width: 440px; margin-top: 40px;
  padding: 10px 10px 10px 22px; border-radius: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ip-box::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: var(--gradient); opacity: 0.45;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none; transition: opacity 0.3s;
}
.ip-box:hover::before { opacity: 0.9; }
.ip-box.is-copied { box-shadow: var(--glow-cyan); }
.ip-box.is-copied::before { opacity: 1; }
.ip-box__text { display: flex; flex-direction: column; align-items: flex-start; text-align: left; min-width: 0; }
.ip-box__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); font-weight: 700; }
.ip-box__ip { font-size: clamp(1rem, 3.6vw, 1.25rem); font-weight: 700; color: var(--cyan-bright); overflow-wrap: anywhere; }
.ip-box__btn { flex-shrink: 0; min-width: 118px; }
.ip-box.is-copied .ip-box__btn { background: rgba(52, 211, 153, 0.15); border-color: rgba(52, 211, 153, 0.6); color: #b7f5dc; }

.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 24px; }

.hero__stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  width: 100%; max-width: 520px; margin-top: 56px;
}
.stat { padding: 16px 12px; border-radius: var(--radius-sm); }
.stat dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); font-weight: 700; }
.stat dd { margin-top: 4px; font-size: 1.25rem; font-weight: 750; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(72px, 12vw, 128px); }
.section__head { max-width: 680px; margin: 0 auto clamp(40px, 6vw, 64px); text-align: center; }
.eyebrow {
  display: inline-block; margin-bottom: 14px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; color: var(--cyan);
}
.section__title { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -0.035em; font-weight: 800; }
.section__lead { margin-top: 16px; color: var(--text-muted); font-size: 1.08rem; }

/* ---------- Feature cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative; padding: 28px; border-radius: var(--radius); overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s, background 0.4s;
}
.card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), rgba(34, 211, 238, 0.12), transparent 45%);
  opacity: 0; transition: opacity 0.4s;
}
.card:hover { transform: translateY(-6px); border-color: rgba(139, 92, 246, 0.45); }
.card:hover::after { opacity: 1; }
.card__icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(139, 92, 246, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 18px rgba(34, 211, 238, 0.15);
}
.card__icon svg { width: 24px; height: 24px; fill: none; stroke: var(--cyan-bright); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card__title { margin-top: 10px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.card__text { margin-top: 8px; color: var(--text-muted); font-size: 0.97rem; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--cyan-bright); background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.25);
}
.tag--purple { color: var(--purple-bright); background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.3); }
.tag--green { color: #a7f3d0; background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.28); }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 940px; margin-inline: auto; }
.timeline::before {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: 50%; width: 2px; translate: -50% 0;
  background: linear-gradient(180deg, var(--green) 0%, var(--cyan) 30%, var(--purple) 55%, rgba(255, 255, 255, 0.08) 75%);
  border-radius: 2px;
}
.timeline__item { position: relative; display: grid; grid-template-columns: 1fr 64px 1fr; align-items: start; }
.timeline__item + .timeline__item { margin-top: 32px; }
.timeline__card { grid-column: 1; padding: 24px 26px; border-radius: var(--radius); }
.timeline__item:nth-child(even) .timeline__card { grid-column: 3; }
.timeline__node {
  grid-column: 2; grid-row: 1; justify-self: center; margin-top: 22px;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-elev); border: 2px solid var(--border-strong);
  font-weight: 800; font-size: 0.9rem; color: var(--text-dim); z-index: 1;
}
.timeline__item .timeline__card { grid-row: 1; }
.timeline__node svg { width: 18px; height: 18px; fill: none; stroke: #07060f; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.is-done .timeline__node { background: var(--green); border-color: var(--green); box-shadow: 0 0 18px rgba(52, 211, 153, 0.55); }
.is-active .timeline__node { border-color: var(--cyan); box-shadow: var(--glow-cyan); }
.timeline__pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); position: relative; }
.timeline__pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--cyan);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.is-active .timeline__card { border-color: rgba(34, 211, 238, 0.4); box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12), 0 20px 50px -20px rgba(34, 211, 238, 0.35); }

.timeline__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.timeline__phase { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.16em; color: var(--text-dim); }
.timeline__title { margin-top: 8px; font-size: 1.3rem; font-weight: 750; letter-spacing: -0.015em; }
.timeline__text { margin-top: 6px; color: var(--text-muted); font-size: 0.97rem; }

.badge {
  padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border-strong);
}
.badge--done { color: #a7f3d0; background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); }
.badge--progress { color: var(--cyan-bright); background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.4); }

.progress { margin-top: 18px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.progress span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: var(--gradient); box-shadow: var(--glow-cyan);
  transition: width 1.4s var(--ease) 0.2s;
}
.is-done .progress span { background: var(--green); box-shadow: 0 0 12px rgba(52, 211, 153, 0.5); }
.is-visible .progress span { width: var(--p); }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
  padding: clamp(28px, 5vw, 56px); border-radius: 24px;
}
.cta::before {
  content: ""; position: absolute; inset: auto -20% -60% auto; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 65%); pointer-events: none;
}
.cta__content, .cta__actions { position: relative; }
.cta__actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.cta__note { color: var(--text-muted); font-size: 0.92rem; }
.steps { margin-top: 24px; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 14px; color: var(--text-muted); }
.steps strong { color: var(--text); font-weight: 600; }
.steps__num {
  flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  font-weight: 800; font-size: 0.85rem; color: var(--cyan-bright);
  background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.3);
}
.inline-code {
  padding: 2px 8px; border-radius: 6px; font-size: 0.92em;
  color: var(--cyan-bright); background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.2);
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding-block: 32px; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.footer__brand { font-weight: 800; }
.footer__brand a { color: var(--text-muted); font-weight: 500; }
.footer__brand a:hover { color: var(--cyan-bright); }
.footer__legal { color: var(--text-dim); font-size: 0.85rem; max-width: 60ch; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.cards .reveal:nth-child(3n + 2) { transition-delay: 0.08s; }
.cards .reveal:nth-child(3n + 3) { transition-delay: 0.16s; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cta { grid-template-columns: 1fr; }
  .btn.is-disabled { white-space: normal; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }

  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    padding: 12px var(--gutter) 20px;
    background: rgba(7, 6, 15, 0.92);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav__link { display: block; padding: 12px 14px; }
  .nav__list .btn { margin: 8px 0 0; width: 100%; }
  .header:has(.nav.is-open) { background: rgba(7, 6, 15, 0.92); border-bottom-color: var(--border); }

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

  /* Timeline collapses to a single left rail */
  .timeline::before { left: 18px; translate: 0; }
  .timeline__item { grid-template-columns: 36px 1fr; column-gap: 16px; }
  .timeline__node { grid-column: 1; margin-top: 22px; }
  .timeline__card,
  .timeline__item:nth-child(even) .timeline__card { grid-column: 2; }
}

@media (max-width: 480px) {
  .ip-box { flex-direction: column; align-items: stretch; padding: 16px; gap: 12px; }
  .ip-box__text { align-items: center; text-align: center; }
  .ip-box__btn { width: 100%; }
  .hero__actions { width: 100%; flex-direction: column; }
  .hero__actions .btn { width: 100%; }
  .hero__stats { gap: 8px; }
  .stat dd { font-size: 1.05rem; }
  .card { padding: 22px; }
}

@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; }
  .js .reveal { opacity: 1; transform: none; }
}
