/* ============================================
   Hazerim — Portals Design
   ============================================ */

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

:root {
  --void: #020208;
  --deep: #080818;
  --glow-core: #e0c0ff;
  --glow-mid: rgba(192, 132, 252, 0.3);
  --glow-outer: rgba(123, 31, 162, 0.05);
  --text: #e8e0f0;
  --text-muted: rgba(255, 255, 255, 0.45);
  --accent: #c084fc;
  --accent-dim: rgba(192, 132, 252, 0.15);
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --card-radius: 12px;
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 200;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   Ambient layers
   ============================================ */

.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  background: radial-gradient(circle at 50% 30%, #1a1040 0%, var(--void) 60%);
  transition: background-position 0.3s ease;
}

.dust-motes {
  position: fixed;
  top: 0;
  left: 0;
  width: 110%;
  height: 110%;
  z-index: -2;
  background-image:
    radial-gradient(#fff 1px, transparent 1px),
    radial-gradient(#fff 1px, transparent 1px);
  background-size: 500px 500px, 300px 300px;
  background-position: 0 0, 40px 60px;
  opacity: 0.03;
  animation: drift 80s linear infinite;
  pointer-events: none;
}

@keyframes drift {
  from { margin-top: 0; }
  to { margin-top: -500px; }
}


/* ============================================
   Nav
   ============================================ */

.nav {
  width: 100%;
  max-width: 1600px;
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(to bottom, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-left: 2rem;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

/* ============================================
   Hero
   ============================================ */

.hero {
  text-align: center;
  padding: 6rem 2rem 4rem;
  max-width: 800px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero.visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  display: block;
  margin-bottom: 1.5rem;
  opacity: 0.8;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-muted);
  font-weight: 300;
  max-width: 500px;
  margin: 0 auto;
}

/* ============================================
   Portal Grid
   ============================================ */

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3.5rem;
  padding: 4rem;
  width: 100%;
  max-width: 800px;
}

.portal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.portal-container.visible {
  opacity: 1;
  transform: translateY(0);
}

.portal-container:nth-child(2).visible {
  transition-delay: 0.15s;
}

.portal-container:nth-child(3).visible {
  transition-delay: 0.3s;
}

.portal-container:nth-child(4).visible {
  transition-delay: 0.45s;
}

/* ============================================
   Archway (portal frame)
   ============================================ */

.archway {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4.5;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: var(--card-radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: all 0.6s var(--ease-smooth);
  animation: subtlePulse 5s infinite ease-in-out;
}

.portal-container:nth-child(2) .archway { animation-delay: 1.5s; }
.portal-container:nth-child(3) .archway { animation-delay: 3s; }

@keyframes subtlePulse {
  0%, 100% { border-color: rgba(255, 255, 255, 0.08); }
  50% { border-color: rgba(255, 255, 255, 0.15); }
}

/* Portal image (muted by default, vivid on hover) */
.portal-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  filter: grayscale(60%) contrast(1.1);
  transition: opacity 0.6s ease, transform 0.8s ease, filter 0.6s ease;
}

/* Light source (central point that blooms on hover) */
.portal-light-source {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.8s var(--ease-bounce), opacity 0.5s ease;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}

/* Cross-shaped light rays */
.light-ray {
  position: absolute;
  top: 50%;
  left: 50%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform-origin: center;
  opacity: 0.8;
}
.ray-h { width: 150px; height: 1px; transform: translate(-50%, -50%); }
.ray-v { width: 1px; height: 150px; transform: translate(-50%, -50%); }
.ray-x1 { width: 100px; height: 0.5px; transform: translate(-50%, -50%) rotate(45deg); }
.ray-x2 { width: 100px; height: 0.5px; transform: translate(-50%, -50%) rotate(-45deg); }

/* Radial halo glow */
.light-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--glow-mid) 0%, var(--glow-outer) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  mix-blend-mode: screen;
}

/* Hover states */
.portal-container:hover .archway {
  border-color: rgba(192, 132, 252, 0.35);
  box-shadow:
    0 0 30px rgba(123, 31, 162, 0.08),
    inset 0 0 20px rgba(123, 31, 162, 0.05);
  transform: translateY(-8px);
}

.portal-container:hover .portal-light-source {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.portal-container:hover .portal-image {
  opacity: 0.85;
  transform: scale(1.05);
  filter: grayscale(0%) contrast(1);
}

.portal-container:hover .portal-label {
  opacity: 1;
  transform: translateY(4px);
}

/* ============================================
   Portal Labels
   ============================================ */

.portal-label {
  margin-top: 1.5rem;
  text-align: center;
  opacity: 0.6;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.portal-title {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 0.3rem;
  font-weight: 400;
}

.portal-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* ============================================
   Contact
   ============================================ */

.contact {
  text-align: center;
  padding: 6rem 2rem 4rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.contact.visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-text {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.02em;
  padding: 12px 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  transition: all 0.3s ease;
  display: inline-block;
}

.contact-email:hover {
  border-color: rgba(192, 132, 252, 0.4);
  box-shadow: 0 0 20px rgba(123, 31, 162, 0.1);
  transform: translateY(-2px);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  margin-top: auto;
  padding: 3rem 4rem;
  width: 100%;
  max-width: 1600px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}

.footer a {
  color: rgba(255, 255, 255, 0.2);
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--text-muted);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .nav {
    padding: 1.5rem 2rem;
  }

  .hero {
    padding: 4rem 2rem 3rem;
  }

  .portal-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2rem;
    max-width: 400px;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .nav-links a {
    margin-left: 1rem;
    font-size: 0.8rem;
  }

  :root {
    --card-radius: 10px;
  }
}

/* Touch devices — no hover, show images fully */
@media (hover: none) {
  .portal-image {
    opacity: 0.7;
    filter: grayscale(0%) contrast(1);
  }

  .portal-label {
    opacity: 1;
  }

  .portal-light-source {
    display: none;
  }
}
