/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
  --algorithm-blue: #3E8FD9;
  --algorithm-light: #BFE6FF;
  --oasis-green: #A8D93B;
  --oasis-light: #E8F27A;
  --oasis-dark: #5C8F1E;
  --obsidian: #0B0F14;
  --realm-dark: #10161D;
  --realm-elevated: #171F29;
  --stone: #8A8F98;
  --text-primary: #F4F6F8;
  --text-muted: #A7AFBA;
  --status-red: #E5484D;

  --surface-1: var(--realm-dark);
  --surface-2: var(--realm-elevated);
  --surface-3: #1D2733;
  --border-subtle: rgba(244, 246, 248, 0.1);
  --border-strong: rgba(244, 246, 248, 0.18);
  --shadow-elevated: 0 8px 30px rgba(0, 0, 0, 0.35);

  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 600ms ease;

  --z-background: 0;
  --z-content: 10;
  --z-nav: 50;
  --z-loader: 100;
}

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  color: var(--text-primary);
  font-size: 1em;
  line-height: 1.4;
  scroll-behavior: smooth;
  /* Keeps in-page anchor targets (nav links, hero scroll indicator) from
     landing underneath the sticky navbar. */
  scroll-padding-top: 4.5rem;
}

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

body {
  margin: 0;
  background: var(--obsidian);
  font-family: var(--font-body);
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/*
 * Gateway — the entrance splash on index.html. Full-viewport, layered
 * background/fog/particles with a single CTA that hands off to the
 * realm-loader transition before navigating into the main site.
 */

.gateway {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
  text-align: center;
}

.gateway-background,
.gateway-fog,
.gateway-particles,
.gateway-vignette {
  position: absolute;
  inset: 0;
  z-index: var(--z-background);
}

.gateway-background {
  background-position: center;
  background-size: cover;
  transform: scale(1.03);
}

.gateway-fog {
  background-repeat: repeat;
  background-size: 900px;
  opacity: 0.35;
  mix-blend-mode: screen;
  animation: gateway-drift 40s linear infinite;
}

.gateway-particles {
  background-repeat: repeat;
  background-size: 700px;
  opacity: 0.5;
  animation: gateway-drift-reverse 55s linear infinite;
}

.gateway-vignette {
  background:
    radial-gradient(ellipse at center, transparent 35%, rgba(11, 15, 20, 0.85) 100%),
    linear-gradient(180deg, rgba(11, 15, 20, 0.55) 0%, rgba(11, 15, 20, 0.35) 40%, rgba(11, 15, 20, 0.75) 100%);
}

@keyframes gateway-drift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -900px -450px;
  }
}

@keyframes gateway-drift-reverse {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 700px -700px;
  }
}

.gateway-content {
  position: relative;
  z-index: var(--z-content);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  max-width: 40rem;
}

.gateway-badge {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oasis-light);
  border: 1px solid rgba(168, 217, 59, 0.4);
  background: rgba(168, 217, 59, 0.08);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
}

.gateway-logo {
  width: min(90vw, 30rem);
  height: auto;
  filter: drop-shadow(0 0 32px rgba(62, 143, 217, 0.35));
}

.gateway-tagline {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.realm-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.realm-features li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(244, 246, 248, 0.15);
  background: rgba(23, 31, 41, 0.6);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
}

/*
 * The gateway CTA is a .btn .btn-primary .btn-lg (see
 * css/components/buttons.css) with a small top margin to separate it
 * from the feature chips above.
 */

.enter-button {
  margin-top: 0.5rem;
}

/*
 * Realm loader — full-screen transition shown between the gateway CTA
 * and navigation into pages/home.html.
 */

.realm-loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-loader);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, var(--realm-dark) 0%, var(--obsidian) 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-slow);
}

.realm-loader.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.loader-eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--algorithm-light);
}

/* Blocky title-screen lettering — this transition is the site's one real
   "loading screen" moment, so it's a fitting, self-contained spot for the
   game's own splash-text face (css/fonts.css) rather than the site's
   normal Space Grotesk. Sized up from the old 1.5rem: pixel faces read
   thinner at the same declared size. */
.loader-content h2 {
  font-family: var(--font-minecraft-large);
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0;
}

.loader-bar {
  width: 16rem;
  max-width: 70vw;
  height: 4px;
  border-radius: 999px;
  background: rgba(244, 246, 248, 0.12);
  overflow: hidden;
  margin-top: 0.5rem;
}

.loader-progress {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--algorithm-blue), var(--oasis-green));
  transition: width 1.4s ease;
}

@media (prefers-reduced-motion: reduce) {

  .gateway-fog,
  .gateway-particles {
    animation: none;
  }

  .realm-loader,
  .loader-progress {
    transition: none;
  }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

