/*
 * EnviousRP landing page
 * Palette and type match the in-game UI and the loading screen.
 * Modern browsers only (this page is not opened by GMod's in-game browser).
 */

@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Rajdhani";
  src: url("../fonts/Rajdhani-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("../fonts/Barlow-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --void: #000000;
  --panel: rgba(6, 12, 8, 0.84);
  --line: #14261b;
  --moss: #0b411d;
  --ember: #2bfd70;
  --flare: #76ff7c;
  --text: #e4f0e7;
  --dim: #7a9482;
  --chamfer: 14px;
  --display: "Rajdhani", "Segoe UI", system-ui, sans-serif;
  --body: "Barlow", "Segoe UI", system-ui, sans-serif;
}

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

html { background: var(--void); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.35) 100%),
    linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 45%),
    url("../img/backdrop-1920.jpg") center / cover no-repeat;
  animation: backdrop-in 1.4s ease-out both;
}
@media (min-width: 1921px), (min-width: 1200px) and (min-resolution: 1.5dppx) {
  .backdrop {
    background:
      linear-gradient(90deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.35) 100%),
      linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 45%),
      url("../img/backdrop-2560.jpg") center / cover no-repeat;
  }
}

/* ------------------------------------------------------------ layout */

.page {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(2rem, 7vh, 6rem) clamp(1.25rem, 5vw, 4rem) 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

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

.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.75rem, 10.5vw, 9.5rem);
  line-height: 0.82;
  letter-spacing: -0.015em;
  color: var(--text);
}
.wordmark::after {
  content: "";
  display: block;
  width: 0.62em;
  height: 0.055em;
  min-height: 4px;
  margin-top: 0.16em;
  background: var(--ember);
  box-shadow: 0 0 18px rgba(43, 253, 112, 0.45);
}

.lede {
  max-width: 34rem;
  margin: 1.75rem 0 2.25rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
  color: #c3d4c8;
}

.join {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: stretch;
}

.btn-join {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.6rem;
  background: var(--ember);
  color: var(--void);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
  transition: background-color 0.15s ease;
}
.btn-join:hover { background: var(--flare); }

.address {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--panel);
}
.address code {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-family: var(--body);
  font-weight: 500;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.btn-copy {
  border: 0;
  border-left: 1px solid var(--line);
  padding: 0 1rem;
  background: transparent;
  color: var(--ember);
  font-family: var(--body);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 8.5rem;
}
.btn-copy:hover { background: rgba(43, 253, 112, 0.08); }
.btn-copy.is-done { color: var(--flare); }

.join-note {
  max-width: 34rem;
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  color: var(--dim);
}
.join-note code {
  font-family: var(--body);
  font-weight: 500;
  color: var(--text);
}

/* ------------------------------------------------------------ directory */

.directory {
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.dest {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  grid-template-areas:
    "icon name"
    "icon desc"
    "icon host";
  column-gap: 1rem;
  padding: 1.35rem 1.6rem 1.35rem 1.4rem;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--line);
  transition: background-color 0.15s ease;
}
.dest:first-child { border-top: 0; }
.dest::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ember);
  transform: scaleY(0);
  transition: transform 0.18s ease;
}
.dest:hover { background: rgba(43, 253, 112, 0.05); }
.dest:hover::before,
.dest:focus-visible::before { transform: scaleY(1); }

.dest-icon {
  grid-area: icon;
  width: 2.1rem;
  height: 2.1rem;
  margin-top: 0.15rem;
  fill: none;
  stroke: var(--ember);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dest-name {
  grid-area: name;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.15;
}
.dest-desc {
  grid-area: desc;
  margin-top: 0.15rem;
  color: #b3c6b9;
  font-size: 0.98rem;
}
.dest-host {
  grid-area: host;
  margin-top: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--dim);
  font-size: 0.85rem;
}
.ext {
  width: 0.85rem;
  height: 0.85rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.footer {
  padding: 1.25rem clamp(1.25rem, 5vw, 4rem) 1.75rem;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}
.footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--dim);
}

/* ------------------------------------------------------------ focus + a11y */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--flare);
  outline-offset: 3px;
}
.dest:focus-visible { outline-offset: -3px; }

.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;
}

/* ------------------------------------------------------------ load moment
 * One orchestrated entrance: the city fades up, then the name and the
 * directory settle in together.
 */
.hero, .directory { animation: settle 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero { animation-delay: 0.25s; }
.directory { animation-delay: 0.4s; }

@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes settle {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop, .hero, .directory { animation: none; }
  .dest::before, .dest, .btn-join { transition: none; }
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 900px) {
  .page {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 2.5rem;
  }
  .backdrop {
    background-position: 62% center;
  }
}
@media (max-width: 480px) {
  .join { flex-direction: column; }
  .btn-join { justify-content: center; }
  .address code { flex: 1; padding: 0.8rem 1rem; }
  .dest { padding: 1.15rem 1.1rem; grid-template-columns: 2.25rem 1fr; }
  .dest-icon { width: 1.8rem; height: 1.8rem; }
}

/* 404 page: single column */
.page-single { grid-template-columns: 1fr; }
