/* ============================================
   Hybrid Hub — Landing Page Styles
   Three-Direction Gateway
   ============================================ */

/* ============================================
   1. CSS VARIABLES / DESIGN TOKENS
   ============================================ */
:root {
  --bg-page: #0a0a0a;
  --bg-panel: #050505;
  --color-warm-paper: #d8d3cd;
  --color-soft-text: #e6e2dc;
  --color-muted-text: #8c8781;
  --color-border-grey: rgba(255, 255, 255, 0.10);
  --color-oxblood: #7d1d24;
  --color-oxblood-hover: #a1252e;
  --color-signal-red: #ff2a2a;
  --color-signal-red-dim: rgba(255, 42, 42, 0.15);
  --color-off-white: #f5f2ee;
  --color-white: #ffffff;
  --color-black: #000000;

  --color-border-soft: rgba(255, 255, 255, 0.06);
  --color-border-med: rgba(255, 255, 255, 0.14);
  --color-border-strong: rgba(255, 255, 255, 0.22);
  --color-grid-line: rgba(255, 255, 255, 0.035);
  --color-scanline: rgba(255, 42, 42, 0.04);

  --font-serif: 'Vazirmatn', system-ui, -apple-system, Tahoma, sans-serif;
  --font-sans: 'Vazirmatn', system-ui, -apple-system, Tahoma, sans-serif;
  --font-mono: 'Vazirmatn', system-ui, -apple-system, Tahoma, sans-serif;

  --text-hero: clamp(3.6rem, 8vw, 7.5rem);
  --text-body: clamp(0.95rem, 1.06vw, 1.05rem);
  --text-utility: clamp(0.68rem, 0.78vw, 0.8rem);
  --text-panel-title: clamp(1.5rem, 2.8vw, 2.6rem);
  --text-panel-desc: clamp(0.88rem, 1vw, 1rem);

  --space-outer: clamp(16px, 3vw, 44px);
  --space-section: clamp(64px, 10vw, 160px);
  --space-gap: clamp(16px, 2vw, 28px);

  --panel-height: clamp(420px, 55vh, 62vh);

  --ease-premium: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-precise: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-scan: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --z-content: 10;
  --z-ambient: 1;
  --z-overlay: 50;
  --hub-admin-offset: 0px;
}

/* ============================================
   2. RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--color-soft-text);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.admin-bar {
  --hub-admin-offset: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar {
    --hub-admin-offset: 46px;
  }
}

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

button {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

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

/* ============================================
   3. UTILITY CLASSES
   ============================================ */
.utility-label {
  font-family: var(--font-mono);
  font-size: var(--text-utility);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.4;
}

.accent-chip {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--color-oxblood);
  border-radius: 1px;
  margin-inline-end: 10px;
  vertical-align: middle;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-signal-red);
  margin-inline-end: 6px;
  vertical-align: middle;
}

.status-dot--active {
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================
   4. AMBIENT LAYERS
   ============================================ */
.ambient-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-ambient);
  background-image:
    linear-gradient(var(--color-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.35;
}

.ambient-haze {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: calc(var(--z-ambient) + 1);
  background: radial-gradient(ellipse at 30% 20%, rgba(125, 29, 36, 0.04) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(245, 242, 238, 0.02) 0%, transparent 50%);
}

.ambient-scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: calc(var(--z-ambient) + 2);
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--color-scanline) 2px,
    var(--color-scanline) 4px
  );
  opacity: 0.5;
}

/* ============================================
   5. PAGE WRAPPER
   ============================================ */
.page-wrapper {
  position: relative;
  z-index: var(--z-content);
  min-height: calc(100vh - var(--hub-admin-offset));
  padding-top: var(--hub-admin-offset);
}

/* ============================================
   6. TOP UTILITY RAIL
   ============================================ */
.rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-outer);
  height: clamp(36px, 4.5vw, 52px);
  border-bottom: 1px solid var(--color-border-grey);
  color: var(--color-muted-text);
  font-size: var(--text-utility);
}

.rail__left,
.rail__center,
.rail__right {
  display: flex;
  align-items: center;
}

.rail__left {
  justify-content: flex-start;
}

.rail__center {
  justify-content: center;
}

.rail__right {
  justify-content: flex-end;
}

/* ============================================
   7. HERO SECTION
   ============================================ */
.hero {
  padding: clamp(48px, 8vw, 100px) var(--space-outer) clamp(32px, 5vw, 60px);
  text-align: center;
  position: relative;
}

.hero__container {
  max-width: 900px;
  margin: 0 auto;
}

.hero__overline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted-text);
  margin-bottom: clamp(20px, 3vw, 36px);
  opacity: 0;
  transform: translateY(10px);
}

.hero__headline {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--color-off-white);
  margin-bottom: clamp(16px, 2.5vw, 28px);
}

.hero__headline em {
  font-style: italic;
  color: var(--color-oxblood);
}

.hero__line {
  display: block;
  padding-block: 0.06em 0.12em;
  opacity: 0;
  transform: translateY(30px);
}

.hero__support {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--color-muted-text);
  max-width: 520px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(14px);
}

.hero__divider {
  width: 60px;
  height: 1px;
  background: var(--color-border-med);
  margin: clamp(24px, 4vw, 48px) auto 0;
  opacity: 0;
}

/* ============================================
   8. PORTAL STAGE
   ============================================ */
.stage {
  padding: 0 var(--space-outer) clamp(60px, 8vw, 120px);
}

.stage__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-gap);
}

/* ============================================
   9. PORTAL PANELS — SHARED
   ============================================ */
.portal {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: var(--panel-height);
  padding: clamp(24px, 3vw, 40px);
  background-color: var(--bg-panel);
  border: 1px solid var(--color-border-grey);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.45s var(--ease-smooth),
              background-color 0.45s var(--ease-smooth);
}

.portal:focus-visible {
  outline: 2px solid var(--color-off-white);
  outline-offset: 4px;
}

.portal__content {
  position: relative;
  z-index: 5;
}

.portal__label {
  display: inline-flex;
  align-items: center;
  color: var(--color-muted-text);
  margin-bottom: clamp(12px, 1.5vw, 20px);
  transition: color 0.4s var(--ease-smooth);
}

.portal__title {
  font-family: var(--font-serif);
  font-size: var(--text-panel-title);
  font-weight: 500;
  line-height: 1.18;
  color: var(--color-off-white);
  margin-bottom: clamp(8px, 1vw, 14px);
  transition: color 0.4s var(--ease-smooth);
}

.portal__descriptor {
  font-family: var(--font-sans);
  font-size: var(--text-panel-desc);
  line-height: 1.6;
  color: var(--color-muted-text);
  max-width: 280px;
  margin-bottom: clamp(10px, 1.2vw, 18px);
  transition: color 0.4s var(--ease-smooth);
}

.portal__meta {
  display: block;
  color: var(--color-muted-text);
  opacity: 0.6;
  transition: opacity 0.4s var(--ease-smooth);
}

/* Hover accent overlay - shared base */
.portal__hover-accent {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s var(--ease-smooth);
  pointer-events: none;
}

/* Base background wash */
.portal__bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.45;
  transition: opacity 0.5s var(--ease-smooth);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  filter: saturate(0.9) contrast(1.02);
}

/* ============================================
   10. PANEL 1 — EDITORIAL
   ============================================ */
.portal--editorial {
  background: linear-gradient(165deg, #0e0c0c 0%, #050505 100%);
}

.portal--editorial .portal__bg {
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(125, 29, 36, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(14, 12, 12, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, rgba(5, 5, 5, 0.25) 0%, rgba(5, 5, 5, 0.15) 100%),
    var(--portal-image, url('../images/hub/r-k.png'));
}

.portal--editorial .portal__mask {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45%;
  background: linear-gradient(0deg, rgba(125, 29, 36, 0.08) 0%, transparent 100%);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.6s var(--ease-premium);
  pointer-events: none;
}

.portal--editorial .portal__line {
  position: absolute;
  bottom: clamp(24px, 3vw, 40px);
  left: clamp(24px, 3vw, 40px);
  width: 40px;
  height: 1px;
  background: var(--color-oxblood);
  z-index: 6;
  opacity: 0.5;
  transition: width 0.5s var(--ease-premium), opacity 0.5s var(--ease-smooth);
}

.portal--editorial:hover .portal__mask {
  opacity: 1;
}

.portal--editorial:hover .portal__line {
  width: 80px;
  opacity: 0.9;
}

.portal--editorial:hover {
  border-color: rgba(125, 29, 36, 0.30);
}

.portal--editorial:hover .portal__bg {
  opacity: 0.85;
}

.portal--editorial:hover .portal__label {
  color: var(--color-oxblood-hover);
}

.portal--editorial:hover .portal__title {
  color: var(--color-off-white);
}

.portal--editorial:hover .portal__descriptor {
  color: var(--color-warm-paper);
}

.portal--editorial:hover .portal__meta {
  opacity: 0.85;
}

/* ============================================
   11. PANEL 2 — GRAPHIC STUDIO
   ============================================ */
.portal--graphic {
  background: #050505;
}

.portal--graphic .portal__bg {
  background-image:
    linear-gradient(180deg, rgba(245, 242, 238, 0.25) 0%, rgba(245, 242, 238, 0.12) 100%),
    var(--portal-image, url('../images/hub/namma.png'));
}

.portal--graphic .portal__graphic-block {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(60px, 8vw, 100px);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(12px, 1.5vw, 20px) 0;
  z-index: 4;
  opacity: 0.3;
  transition: opacity 0.4s var(--ease-smooth), transform 0.4s var(--ease-premium);
}

.portal--graphic .portal__graphic-line {
  width: 100%;
  height: 1px;
  background: var(--color-border-med);
}

.portal--graphic .portal__rail {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: clamp(10px, 1.2vw, 14px) clamp(12px, 1.5vw, 20px);
  border-top: 1px solid var(--color-border-soft);
  z-index: 4;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s var(--ease-smooth), transform 0.4s var(--ease-premium);
}

.portal--graphic:hover {
  border-color: var(--color-border-strong);
}

.portal--graphic:hover .portal__bg {
  opacity: 0.85;
}

.portal--graphic:hover .portal__graphic-block {
  opacity: 0.7;
  transform: translateY(-4px);
}

.portal--graphic:hover .portal__rail {
  opacity: 0.7;
  transform: translateY(0);
}

.portal--graphic:hover .portal__label {
  color: var(--color-off-white);
}

.portal--graphic:hover .portal__title {
  color: var(--color-white);
}

.portal--graphic:hover .portal__descriptor {
  color: var(--color-soft-text);
}

.portal--graphic:hover .portal__meta {
  opacity: 0.8;
}

/* ============================================
   12. PANEL 3 — DOSSIER
   ============================================ */
.portal--dossier {
  background: linear-gradient(175deg, #080808 0%, #050505 100%);
}

.portal--dossier .portal__bg {
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(255, 42, 42, 0.22) 0%, transparent 55%),
    linear-gradient(180deg, rgba(10, 10, 10, 0.35) 0%, rgba(10, 10, 10, 0.2) 100%),
    var(--portal-image, url('../images/hub/killian.png'));
}

.portal--dossier .portal__scanline {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-signal-red);
  box-shadow: 0 0 12px var(--color-signal-red), 0 0 30px rgba(255, 42, 42, 0.2);
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-smooth);
}

.portal--dossier .portal__grid-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  background-image:
    linear-gradient(rgba(255, 42, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 42, 42, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  transition: opacity 0.5s var(--ease-smooth);
  pointer-events: none;
}

.portal--dossier .portal__hover-accent {
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 42, 42, 0.06) 0%, transparent 70%);
}

.portal--dossier:hover {
  border-color: rgba(255, 42, 42, 0.35);
}

.portal--dossier:hover .portal__bg {
  opacity: 0.85;
}

.portal--dossier:hover .portal__scanline {
  opacity: 1;
  animation: scanPass 1.8s var(--ease-scan) forwards;
}

.portal--dossier:hover .portal__grid-overlay {
  opacity: 1;
}

.portal--dossier:hover .portal__hover-accent {
  opacity: 1;
}

.portal--dossier:hover .portal__label {
  color: var(--color-signal-red);
}

.portal--dossier:hover .portal__title {
  color: var(--color-off-white);
  text-shadow: 0 0 30px rgba(255, 42, 42, 0.15);
}

.portal--dossier:hover .portal__descriptor {
  color: var(--color-soft-text);
}

.portal--dossier:hover .portal__meta {
  opacity: 1;
  color: var(--color-signal-red);
}

@keyframes scanPass {
  0% {
    top: -10%;
  }
  100% {
    top: 110%;
  }
}

/* Status dot pulse for dossier panel */
.portal--dossier .status-dot {
  animation: statusPulse 2s ease-in-out infinite;
}

/* ============================================
   13. FOOTER STRIP
   ============================================ */
.footer-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-outer);
  height: clamp(36px, 4.5vw, 52px);
  border-top: 1px solid var(--color-border-grey);
  color: var(--color-muted-text);
  font-size: var(--text-utility);
  margin-top: auto;
}

.footer-strip__left,
.footer-strip__center,
.footer-strip__right {
  display: flex;
  align-items: center;
}

.footer-strip__left {
  justify-content: flex-start;
}

.footer-strip__center {
  justify-content: center;
}

.footer-strip__right {
  justify-content: flex-end;
}

/* ============================================
   14. ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Reveal states for JS */
.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s var(--ease-premium), transform 0.7s var(--ease-premium);
}

/* Stagger for panels */
.portal {
  opacity: 0;
  transform: translateY(30px);
}

.portal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s var(--ease-premium),
              transform 0.8s var(--ease-premium),
              border-color 0.45s var(--ease-smooth),
              background-color 0.45s var(--ease-smooth);
}

body.volten-elementor-editor-preview .rail,
body.volten-elementor-editor-preview .hero__overline,
body.volten-elementor-editor-preview .hero__line,
body.volten-elementor-editor-preview .hero__support,
body.volten-elementor-editor-preview .hero__divider,
body.volten-elementor-editor-preview .reveal,
body.volten-elementor-editor-preview .portal {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

body.volten-elementor-editor-preview .hero__divider {
  transform: scaleX(1) !important;
}

/* ============================================
   15. RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .stage__grid {
    grid-template-columns: 1fr 1fr;
  }

  .portal--dossier {
    grid-column: 1 / -1;
  }

  :root {
    --panel-height: clamp(340px, 45vh, 52vh);
  }
}

/* Mobile */
@media (max-width: 640px) {
  .stage__grid {
    grid-template-columns: 1fr;
  }

  .portal--dossier {
    grid-column: auto;
  }

  :root {
    --panel-height: clamp(280px, 55vh, 420px);
  }

  .hero__headline {
    font-size: clamp(2.4rem, 10vw, 4rem);
  }

  .rail,
  .footer-strip {
    padding: 0 clamp(12px, 4vw, 20px);
  }

  .rail__center {
    display: none;
  }

  .footer-strip__center {
    display: none;
  }

  .ambient-grid {
    opacity: 0.18;
  }

  .ambient-scanline {
    opacity: 0.25;
  }

  .portal__descriptor {
    max-width: 100%;
  }

  .portal--graphic .portal__graphic-block {
    width: clamp(40px, 12vw, 60px);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .portal--dossier:hover .portal__scanline {
    animation: none;
    opacity: 0.5;
    top: 50%;
  }

  .status-dot--active {
    animation: none;
  }

  .portal {
    opacity: 1;
    transform: none;
  }

  .hero__overline,
  .hero__line,
  .hero__support,
  .hero__divider {
    opacity: 1;
    transform: none;
  }
}
