/* ============================================================
   Yercadia — vanilla anarchy, 1.21.4
   Night-indigo tint over a blurred voxel scene; Montserrat for
   voice, JetBrains Mono for anything the server itself "says".
   ============================================================ */

:root {
  --night:        #12101d;   /* base — near-black indigo        */
  --night-soft:   #1a1730;   /* raised surfaces                 */
  --tint:         #4c3f8f;   /* violet wash over the backdrop   */
  --ink:          #f2f0fa;   /* primary text                    */
  --ink-dim:      #dcd8ec;   /* secondary text                  */
  --ember:        #e8a13c;   /* torchlight — status + accents   */
  --line:         rgba(242, 240, 250, 0.28);
  --line-faint:   rgba(242, 240, 250, 0.12);

  /* solid raised panels */
  --panel:        #1a1732;
  --panel-bright: #242044;
  --panel-border: rgba(242, 240, 250, 0.16);

  --tag-announcement: #e8a13c;
  --tag-update:       #57d98a;
  --tag-event:        #a78bfa;
  --tag-maintenance:  #f07589;

  --font-display: "Montserrat", sans-serif;
  --font-apple:   -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--ink);
  background: var(--night);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--tint); color: var(--ink); }

a { color: var(--ember); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

/* ---------- backdrop ---------- */

/* blur is baked into bg-blur.webp (from bg.webp) to keep rendering cheap */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--night) url("../assets/bg-blur.webp") center / cover no-repeat;
}

/* ---------- icon rail ---------- */

.rail {
  position: fixed;
  z-index: 10;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px;
}

.rail-link {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink-dim);
  transition: color 160ms ease;
}

.rail-link svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 5px rgba(10, 8, 20, 0.8));
}

.rail-link:hover,
.rail-link.is-active { color: var(--ink); text-decoration: none; }

.rail-link.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  width: 2px;
  height: 22px;
  background: var(--ember);
}

.rail-tip {
  position: absolute;
  left: calc(100% + 10px);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--ink);
  background: var(--night-soft);
  border: 1px solid var(--line-faint);
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
  pointer-events: none;
}

.rail-link:hover .rail-tip,
.rail-link:focus-visible .rail-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* ---------- panels ---------- */

.panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 24px;
}

.panel-inner {
  width: 100%;
  max-width: 640px;
  text-align: center;
  /* untinted backdrop — a soft halo keeps text readable over bright sky */
  text-shadow: 0 1px 4px rgba(10, 8, 20, 0.75), 0 2px 24px rgba(10, 8, 20, 0.65);
}

.panel-inner-wide { max-width: 880px; }

/* scroll-reveal (JS adds .revealed; no-JS stays visible) */
.js .panel-inner {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.js .panel-inner.revealed {
  opacity: 1;
  transform: none;
}

/* ---------- hero ---------- */

.eyebrow {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.55em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 18px;
}

.wordmark {
  font-family: var(--font-apple);
  font-size: clamp(1.9rem, 5.5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 22px;
  color: var(--ink);
}

.lede {
  color: var(--ink);
  text-shadow: 0 1px 3px rgba(10, 8, 20, 0.9), 0 2px 14px rgba(10, 8, 20, 0.8);
  margin-bottom: 40px;
}

.lede strong { color: var(--ink); font-weight: 500; }

/* the server line — address chip + live status */

.server-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 44px;
}

/* bare address: just the text and a copy icon, no box */
.ip-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(10, 8, 20, 0.9), 0 2px 14px rgba(10, 8, 20, 0.8);
}

.ip-chip:hover .ip-text { text-decoration: underline; text-underline-offset: 4px; }

.ip-copy-icon { width: 16px; height: 16px; color: var(--ink-dim); }

.ip-chip:hover .ip-copy-icon { color: var(--ink); }

.ip-copied {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ember);
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* pinned to the bottom of the first screen so it's seen right away;
   fades out as soon as you start scrolling (JS toggles .is-hidden) */
.hero-disclaimer {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  text-align: center;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  opacity: 0.45;
  transition: opacity 300ms ease;
}

.hero-disclaimer.is-hidden { opacity: 0; }

/* ---------- buttons ---------- */

/* square, transparent ghost buttons — one look everywhere */
.btn {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  transition: background 160ms ease, border-color 160ms ease;
}

.btn:hover {
  background: transparent;
  border-color: #ffffff;
  color: #ffffff;
  text-decoration: none;
}

/* .btn-quiet intentionally matches .btn; every button shares one look */

/* disabled — slashed out and unclickable */
.btn-disabled {
  pointer-events: none;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  opacity: 0.55;
  cursor: default;
}

/* ---------- sections ---------- */

.section-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 22px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.section-mark svg { width: 26px; height: 26px; }

.section-title {
  font-size: 1.7rem;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-indent: 0.3em;
  margin-bottom: 14px;
}

.section-sub {
  color: var(--ink);
  font-size: 1.02rem;
  max-width: 46ch;
  margin: 0 auto 38px;
}

.section-sub strong { color: var(--ink); font-weight: 500; }

/* news */

.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
  text-align: left;
}

.news-item {
  padding: 18px 22px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.news-tag {
  --tag-color: var(--tag-announcement);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tag-color);
  border: 1px solid color-mix(in srgb, var(--tag-color) 55%, transparent);
  background: color-mix(in srgb, var(--tag-color) 14%, transparent);
  padding: 3px 10px;
  border-radius: 999px;
}

.news-tag[data-tag="update"]      { --tag-color: var(--tag-update); }
.news-tag[data-tag="event"]       { --tag-color: var(--tag-event); }
.news-tag[data-tag="maintenance"] { --tag-color: var(--tag-maintenance); }

.news-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}

.news-item h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.news-item p { color: var(--ink-dim); font-size: 0.92rem; }

.news-empty { color: var(--ink-dim); text-align: center; }

.aside { color: var(--ink-dim); font-size: 0.9rem; }

/* info stats */

/* no fill anywhere — the backdrop IS the background; only outlines drawn */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: transparent;
  border: 1px solid var(--line-faint);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}

.stat {
  background: transparent;
  padding: 26px 12px;
}

.stat + .stat { border-left: 1px solid var(--line-faint); }

.stat dt {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 10px;
}

.stat dd {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
}

.stats-note {
  font-size: 0.75rem;
  color: var(--ink-dim);
  margin-bottom: 38px;
}

.link-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* connect */

.link-row + .contact-mail { margin-top: 36px; }

.contact-mail a {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}

.contact-mail a:hover {
  color: var(--ember);
  border-color: var(--ember);
  text-decoration: none;
}

/* support */

.motd-card {
  padding: 24px 28px;
  background: rgba(26, 23, 50, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: 0;
  margin-bottom: 38px;
}

.motd-card h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 10px;
}

.motd-card p { color: var(--ink-dim); font-size: 0.95rem; }

/* ---------- gallery ---------- */

.gallery-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--panel-border);
}

.gallery-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 600ms ease;
}

.gallery-slide.is-active { opacity: 1; }

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-faint);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}

.gallery-arrow:hover {
  border-color: var(--line);
  color: #ffffff;
}

.gallery-arrow svg { filter: drop-shadow(0 1px 4px rgba(10, 8, 20, 0.9)); }

.gallery-arrow svg { width: 20px; height: 20px; }

.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }

.gallery-count {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: rgba(18, 16, 29, 0.65);
  border: 1px solid var(--line-faint);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.gallery-dot:hover { border-color: var(--ink); }

.gallery-dot.is-active {
  background: #ffffff;
  border-color: #ffffff;
  transform: scale(1.2);
}

/* ---------- footer ---------- */

.footer {
  padding: 46px 24px 60px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-dim);
  opacity: 0.75;
}

.footer p + p { margin-top: 6px; }

.footer-credit a {
  color: #ffffff;
  font-weight: 600;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .rail {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    transform: none;
    flex-direction: row;
    justify-content: center;
    gap: 4px;
    padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
    background: var(--night);
    border-bottom: 1px solid var(--line-faint);
  }

  .rail-link.is-active::before {
    left: 50%;
    top: auto;
    bottom: -9px;
    transform: translateX(-50%);
    width: 22px;
    height: 2px;
  }

  .rail-tip { display: none; }

  .panel { padding: 120px 20px 80px; }

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

  .stat + .stat { border-left: none; border-top: 1px solid var(--line-faint); }

  .gallery-arrow { width: 36px; height: 36px; }
  .gallery-prev { left: 8px; }
  .gallery-next { right: 8px; }

  .hero-disclaimer { bottom: 18px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js .panel-inner {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .gallery-slide { transition: none; }
}
