@import url("fonts/fonts.css");

/* ---------------------------------------------------------------- tokens
   AnotherLife: a survival server inside a neon future city. The palette is the
   logo's — deep indigo night, violet bevels, a blue core glow. One family for
   signage (Unbounded, wide and geometric like the beveled letters) and one for
   reading (Manrope). */
:root {
  --night: #0c0a22;
  --deep: #14113a;
  --deeper: #0f0c2c;
  --violet: #7c3aed;
  --purple: #a855f7;
  --blue: #3b82f6;
  --glow: #8b5cf6;
  --ink: #efeaff;
  --dim: #aca4d8;
  --line: rgba(168, 85, 247, 0.28);
  --grad: linear-gradient(90deg, var(--blue), var(--purple));
  --grad-soft: linear-gradient(90deg, #5b8cf9, #b47cf8);
  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --measure: 62ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.12; letter-spacing: -0.01em; }
h1, h2 { font-family: var(--display); font-weight: 700; }
h1 { font-size: clamp(2.1rem, 5.6vw, 4.6rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 3vw, 2.4rem); }
h3 { font-family: var(--body); font-weight: 700; font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
p.lead { font-size: 1.2rem; color: var(--ink); }
.muted { color: var(--dim); }
code, kbd { font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-size: 0.95em; }
kbd { background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 6px; padding: 0.1em 0.45em; white-space: nowrap; }
:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--purple); color: #fff; padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* gradient text used for the wordmark and section signs */
.sign {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.7rem var(--gutter);
  background: rgba(12, 10, 34, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(168, 85, 247, 0.14);
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand img { width: 38px; height: 38px; }
.nav { margin-left: auto; display: flex; gap: 0.25rem; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--dim); padding: 0.45rem 0.7rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: rgba(139, 92, 246, 0.14); }
.top .join { margin-left: 0.5rem; }

/* the join address: a neon sign you can copy */
.join {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.02em;
  color: #fff; text-decoration: none; cursor: pointer; border: 0;
  padding: 0.6rem 1rem; border-radius: 999px;
  background: var(--grad);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 8px 30px rgba(124, 58, 237, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.join:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset, 0 12px 40px rgba(124, 58, 237, 0.55); }
.join:active { transform: translateY(0); }
.join.big { font-size: clamp(1.1rem, 2.6vw, 1.6rem); padding: 0.9rem 1.5rem; }
.join .hint { font-family: var(--body); font-weight: 600; font-size: 0.8em; opacity: 0.85; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; isolation: isolate;
  min-height: min(92vh, 900px);
  display: grid; align-items: end;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  background: var(--deeper);
}
.hero .art {
  position: absolute; inset: -12% 0 0 0; z-index: -3;
  background: var(--deeper) url("img/hero-city.webp") center 40% / cover no-repeat;
  will-change: transform;
}
.hero .scrim {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(180deg, rgba(12,10,34,0.15) 0%, rgba(12,10,34,0.35) 45%, rgba(12,10,34,0.92) 85%, var(--night) 100%),
    radial-gradient(60% 50% at 20% 100%, rgba(124,58,237,0.35), transparent 70%);
}
/* one orchestrated moment: a searchlight sweeps the skyline once after load */
.hero .sweep {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, transparent 40%, rgba(196, 181, 253, 0.28) 50%, transparent 60%);
  background-size: 250% 100%;
}
html.js .hero .sweep { animation: sweep 2.6s cubic-bezier(.4,0,.2,1) 0.6s 1 both; }
@keyframes sweep {
  0% { opacity: 0; background-position: 110% 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; background-position: -30% 0; }
}
.hero canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.hero .content { max-width: 60rem; }
.hero .mark { width: clamp(120px, 18vw, 220px); margin-bottom: 0.75rem; filter: drop-shadow(0 12px 40px rgba(124,58,237,0.55)); }
.hero h1 { max-width: 14ch; }
.hero .lead { max-width: 46ch; color: #dcd6f7; }
.hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-top: 1.5rem; }
.status { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 600; color: var(--dim); }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: #6b7280; box-shadow: 0 0 0 3px rgba(107,114,128,0.2); }
.status.on .dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,0.22), 0 0 14px rgba(52,211,153,0.6); }
.status.off .dot { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,0.2); }
.bedrock { color: var(--dim); font-size: 0.95rem; }
.bedrock kbd { color: var(--ink); }

/* a compact hero for inner pages */
.hero.small { min-height: 46vh; align-items: end; }
.hero.small .art { background-image: url("img/city-alt.webp"); background-position: center 45%; }
.hero.small.spawn .art { background-image: url("img/spawn.webp"); }
.hero.small h1 { font-size: clamp(1.9rem, 4.4vw, 3.4rem); }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(3rem, 7vw, 6rem) var(--gutter); }
.section.tight { padding-top: clamp(2rem, 4vw, 3.5rem); }
.wrap { max-width: 72rem; margin: 0 auto; }
.section h2 { margin-bottom: 0.9rem; }
.rule { height: 2px; width: 4.5rem; background: var(--grad); border-radius: 2px; margin: 0 0 1.4rem; }
.cols { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.cols p { max-width: 40ch; }

/* district strips: art on one side, words on the other, alternating */
.strip {
  display: grid; gap: 1.5rem 3rem; align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  padding: clamp(1.5rem, 4vw, 3rem) 0;
  border-top: 1px solid rgba(168,85,247,0.14);
}
.strip:first-of-type { border-top: 0; }
.strip .frame {
  position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10;
  background: var(--deep);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45), 0 0 0 1px var(--line);
}
.strip .frame img { width: 100%; height: 100%; object-fit: cover; }
.strip .frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(12,10,34,0.55)); }
.strip.flip .frame { order: 2; }
.strip h2 { font-size: clamp(1.3rem, 2.4vw, 1.9rem); }

/* directory: a plain list of what you can do, no cards */
.directory { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.25rem 3rem; margin: 0; padding: 0; list-style: none; }
.directory li { padding: 1rem 0; border-bottom: 1px solid rgba(168,85,247,0.14); }
.directory b { display: block; font-family: var(--display); font-weight: 600; font-size: 0.98rem; margin-bottom: 0.25rem; }
.directory span { color: var(--dim); }
.directory .cmd { display: inline-block; margin-top: 0.35rem; }

/* steps really are a sequence, so they may be numbered */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.steps li { position: relative; padding: 0.9rem 0 0.9rem 3.4rem; border-bottom: 1px solid rgba(168,85,247,0.14); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0.9rem;
  width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; color: #fff;
  border-radius: 50%; background: var(--grad);
  box-shadow: 0 6px 18px rgba(124,58,237,0.35);
}
.steps b { display: block; margin-bottom: 0.15rem; }

/* tables of commands */
table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1.5rem; font-size: 0.98rem; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid rgba(168,85,247,0.14); vertical-align: top; }
th { color: var(--dim); font-weight: 600; }
td kbd { font-size: 0.92em; }
.table-wrap { overflow-x: auto; }

/* notes and callouts */
.note {
  border-left: 3px solid; border-image: var(--grad) 1;
  padding: 0.75rem 1rem; margin: 1.5rem 0; background: rgba(139,92,246,0.08); max-width: var(--measure);
}
.pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; background: rgba(59,130,246,0.18); color: #c7d7ff; font-size: 0.85rem; font-weight: 600; }

/* rules */
.rules { list-style: none; padding: 0; margin: 0; max-width: 48rem; }
.rules li { padding: 1rem 0 1rem 1.2rem; border-left: 2px solid transparent; border-image: var(--grad) 1; margin-bottom: 0.5rem; }
.rules b { display: block; font-family: var(--display); font-weight: 600; font-size: 1rem; margin-bottom: 0.25rem; }

/* community */
.discord {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1.3rem; border-radius: 12px; text-decoration: none; font-weight: 700; color: #fff;
  background: #5865f2; box-shadow: 0 10px 30px rgba(88,101,242,0.35);
}
.discord:hover { filter: brightness(1.08); }

/* ---------------------------------------------------------------- reveal (JS only, motion allowed only) */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms ease, transform 700ms ease; }
  html.js .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.js .hero .sweep { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------------- footer */
footer { padding: 3rem var(--gutter) 4rem; border-top: 1px solid rgba(168,85,247,0.14); color: var(--dim); font-size: 0.95rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 3rem; justify-content: space-between; align-items: flex-start; }
footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.2rem; }
footer a { color: var(--dim); }
footer a:hover { color: var(--ink); }
footer p { max-width: 52ch; margin: 0.4rem 0 0; }

/* toast for "copied" */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px);
  background: var(--deep); color: var(--ink); border: 1px solid var(--line);
  padding: 0.7rem 1.1rem; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease; z-index: 50; font-weight: 600;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: 0.4rem 0.6rem; padding-bottom: 0.4rem; }
  .brand { font-size: 0.95rem; }
  .brand img { width: 32px; height: 32px; }
  .nav { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 0.35rem 0.6rem; }
  .top .join { margin-left: auto; padding: 0.45rem 0.75rem; font-size: 0.8rem; }
  .hero { min-height: 78vh; }
  .hero.small { min-height: 36vh; }
  .hero .mark { width: 120px; }
  .strip.flip .frame { order: 0; }
}
