/* ==========================================================================
   Voik & Matewish — Single-Viewport Atmospheric Gateway
   Theme: Contemplative Serenity, Tactile Artifact, Sacred Stillness
   ========================================================================== */

:root {
  /* Color Palette - Drawn from Voik's Amethyst & Twilight Horizon */
  --bg-deep: #0a0c13;
  --bg-twilight: #12141c;
  --bg-surface: rgba(22, 25, 37, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.28);

  /* Accents */
  --accent-gold: #d4a359;
  --accent-terracotta: #e6744c;
  --accent-cyan: #6ef0c2; /* Mint/cyan glow matching in-game glyphs */
  --accent-cyan-dim: rgba(110, 240, 194, 0.15);
  --accent-sky: #38bdf8;

  /* Typography Colors */
  --text-main: #f5f2eb;
  --text-muted: #9ba5b7;
  --text-dim: #5c687e;

  /* Font */
  --font-sans: 'Josefin Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Easing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.35s var(--ease-spring);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  block-size: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  block-size: 100%;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 50% 10%, #1e1b29 0%, #12141c 45%, #08090e 100%);
  line-height: 1.6;
}

/* Accessible focus styling */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Background Atmosphere */
.ambient-canvas {
  position: fixed;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  display: block;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

.glow-primary {
  inline-size: 600px;
  block-size: 600px;
  background: radial-gradient(circle, #5b3d68 0%, transparent 70%);
  inset-block-start: -100px;
  inset-inline-start: 10%;
}

.glow-secondary {
  inline-size: 550px;
  block-size: 550px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  inset-block-end: -100px;
  inset-inline-end: 15%;
  opacity: 0.12;
}

/* Main Viewport Shell: Strictly 100dvb */
.viewport-shell {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-block-size: 100dvb;
  max-block-size: 100dvb;
  max-inline-size: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  padding-block: clamp(1rem, 2.5vh, 1.75rem);
}

/* ==========================================================================
   Header Bar
   ========================================================================== */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block-end: 1rem;
  border-block-end: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  transition: opacity var(--transition-normal);
}

.brand-link:hover {
  opacity: 0.85;
}

.brand-icon {
  inline-size: 26px;
  block-size: 26px;
  color: var(--accent-gold);
  display: block;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--text-main);
}

.header-portal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  padding-inline: 0.85rem;
  padding-block: 0.4rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  transition: all var(--transition-normal);
}

.header-portal-link .link-arrow {
  inline-size: 14px;
  block-size: 14px;
  transition: transform 0.2s ease;
}

.header-portal-link:hover {
  color: var(--accent-cyan);
  border-color: rgba(110, 240, 194, 0.35);
  background: var(--accent-cyan-dim);
}

.header-portal-link:hover .link-arrow {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   Portal Main Section (Split Composition)
   ========================================================================== */
.portal-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: clamp(1rem, 2vh, 2.5rem);
  overflow: hidden;
}

.split-gateway {
  inline-size: 100%;
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

/* Left Column: Atmospheric Typography */
.gateway-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gateway-eyebrow {
  font-size: clamp(0.72rem, 1.2vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--accent-gold);
  margin-block-end: 0.85rem;
  text-transform: uppercase;
}

.gateway-title {
  font-size: clamp(3.2rem, 7vw, 5.4rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  line-height: 1;
  margin-block-end: 1.4rem;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cryptic-whisper {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-muted);
  max-inline-size: 38ch;
  margin-block-end: 1.75rem;
  letter-spacing: 0.02em;
}

.realms-horizon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(0.8rem, 1.1vw, 0.92rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-block-end: 2.25rem;
}

.realm-name {
  color: #c9d2e2;
  transition: color var(--transition-normal);
}

.realm-divider {
  color: var(--accent-gold);
  opacity: 0.5;
}

.realms-horizon:hover .realm-name {
  color: var(--accent-cyan);
}

.gateway-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.awaken-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  background: linear-gradient(135deg, #6ef0c2 0%, #20b2aa 100%);
  color: #051614;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  letter-spacing: 0.06em;
  padding-inline: 1.85rem;
  padding-block: 0.9rem;
  border-radius: 9999px;
  box-shadow: 0 10px 30px -5px rgba(110, 240, 194, 0.4), 0 0 1px 1px rgba(255, 255, 255, 0.4) inset;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.awaken-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 36px -6px rgba(110, 240, 194, 0.6), 0 0 2px 1px rgba(255, 255, 255, 0.6) inset;
}

.awaken-btn:active {
  transform: translateY(0) scale(0.99);
}

.awaken-btn .btn-arrow {
  inline-size: 18px;
  block-size: 18px;
  transition: transform 0.2s ease;
}

.awaken-btn:hover .btn-arrow {
  transform: translateX(3px);
}

.portal-domain-note {
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.portal-domain-note a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(110, 240, 194, 0.4);
  transition: color var(--transition-normal);
}

.portal-domain-note a:hover {
  color: #ffffff;
  text-decoration-color: #ffffff;
}

/* ==========================================================================
   Right Column: Framed In-Game Diagnostic Stele
   ========================================================================== */
.gateway-artifact {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.artifact-halo {
  position: absolute;
  inline-size: 85%;
  block-size: 85%;
  background: radial-gradient(circle, rgba(110, 240, 194, 0.16) 0%, rgba(91, 61, 104, 0.3) 50%, transparent 75%);
  filter: blur(50px);
  border-radius: 50%;
  pointer-events: none;
  animation: pulse-halo 7s ease-in-out infinite alternate;
}

@keyframes pulse-halo {
  0% { transform: scale(0.95); opacity: 0.15; }
  100% { transform: scale(1.06); opacity: 0.3; }
}

.artifact-stele {
  display: block;
  text-decoration: none;
  position: relative;
  max-block-size: min(65vh, 560px);
  aspect-ratio: 496 / 847;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 17, 26, 0.8);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.8), 0 0 45px -10px rgba(110, 240, 194, 0.25);
  animation: float-stele 7s ease-in-out infinite alternate;
  cursor: pointer;
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out, border-color 0.25s ease-out;
}

.artifact-stele:hover {
  border-color: rgba(110, 240, 194, 0.45);
  box-shadow: 0 30px 70px -12px rgba(0, 0, 0, 0.9), 0 0 55px -8px rgba(110, 240, 194, 0.4);
}

@keyframes float-stele {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.stele-image {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
}

.stele-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 20px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Footer Colophon Bar
   ========================================================================== */
.portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--border-subtle);
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.footer-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.colophon-role {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.colophon-sep {
  opacity: 0.4;
}

.author-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-normal);
}

.author-link:hover {
  color: var(--accent-cyan);
}

.github-icon {
  inline-size: 16px;
  block-size: 16px;
  display: block;
}

.privacy-note {
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

.domain-tag {
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 900px) {
  body {
    overflow-y: auto;
  }

  .viewport-shell {
    max-block-size: none;
    block-size: auto;
    padding-block: 1.5rem;
  }

  .portal-main {
    padding-block: 2rem;
  }

  .split-gateway {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .gateway-text {
    align-items: center;
  }

  .cryptic-whisper {
    margin-inline: auto;
  }

  .realms-horizon {
    justify-content: center;
  }

  .gateway-actions {
    align-items: center;
  }

  .artifact-stele {
    max-block-size: min(50vh, 440px);
    margin-inline: auto;
  }

  .portal-footer {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    padding-block-start: 1.5rem;
  }
}

@media (max-height: 700px) and (min-width: 901px) {
  .gateway-title {
    font-size: 3rem;
    margin-block-end: 0.75rem;
  }

  .cryptic-whisper {
    font-size: 1rem;
    margin-block-end: 1rem;
  }

  .realms-horizon {
    margin-block-end: 1.25rem;
  }

  .artifact-stele {
    max-block-size: 55vh;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .artifact-stele {
    animation: none;
  }

  .artifact-halo {
    animation: none;
  }
}
