/* ==========================================================================
   PROJECT ATMOS | ATMOS OASIS — ATMOSPHERIC EXPERIENCES
   Find sections quickly using Cmd+F:
   01. PHASE IMAGE PATHS & COLORS
   02. IMPACT & CONTACT VARIABLES
   03. SHARED BACKGROUND AND MATRIX ANIMATION
   04. PHASE COLOR PALETTES
   05. PHASE 1 FOUNDATION PAGE DESIGN
   06. PHASE 1 IMAGE OVERRIDE / POSITION
   ========================================================================== */

/* ===== 01. PHASE IMAGE PATHS & COLORS ===== */

body.theme-phase-1 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-1-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-01.png");
  --atmos-highlight: #ddb66a;
}

body.theme-phase-2 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-2-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-02.png");
  --atmos-highlight: #48ae85;
}

body.theme-phase-3 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-3-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-03.png");
  --atmos-highlight: #de62bc;
}

body.theme-phase-4 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-4-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-04.png");
  --atmos-highlight: #b38ce8;
}

body.theme-phase-5 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-5-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-05.png");
  --atmos-highlight: #52c9bf;
}

body.theme-phase-6 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-6-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-06.png");
  --atmos-highlight: #78aae8;
}

body.theme-phase-7 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-7-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-07.png");
  --atmos-highlight: #ffffff;
}

body.theme-phase-8 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-8-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-08.png");
  --atmos-highlight: #e8797f;
}

body.theme-phase-9 {
  --atmos-scene: url("assets/phase-atmospheres/project_atmos_phase_backgrounds/phase-9-background.png");
  --atmos-rain: url("assets/phase-atmospheres/matrix-09.png");
  --atmos-highlight: #ff9738;
}

/* ===== 02. IMPACT & CONTACT VARIABLES ===== */

body.impact-page {
  --atmos-scene: url("assets/phase-atmospheres/atmosphere-impact.webp");
  --atmos-rain: url("assets/phase-atmospheres/matrix-impact.png");
  --atmos-highlight: #afff56;
}

body.contact-page {
  --atmos-scene: url("assets/phase-atmospheres/atmosphere-contact.webp");
  --atmos-rain: url("assets/phase-atmospheres/matrix-contact.png");
  --atmos-highlight: #5ebeff;
}

/* ===== 03. SHARED BACKGROUND AND MOVING MATRIX ===== */

body.research-detail[class*="theme-phase-"],
body.phase1-overview,
body.impact-page,
body.contact-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  color: #ede8dc;
  background-color: #05090c;
  background-image:
    linear-gradient(
      180deg,
      rgba(4, 8, 11, 0.34) 0%,
      rgba(5, 10, 13, 0.62) 43%,
      rgba(2, 5, 8, 0.87) 100%
    ),
    var(--atmos-scene);
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
}

/* Moving Matrix layer */

body.research-detail[class*="theme-phase-"]::before,
body.phase1-overview::before,
body.impact-page::before,
body.contact-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--atmos-rain);
  background-repeat: repeat;
  background-size: 900px 1300px;
  background-position: center top;
  opacity: 0.79;
  animation: atmos-matrix-fall 42s linear infinite;
}

/* Dark overlay for readability */

body.research-detail[class*="theme-phase-"]::after,
body.phase1-overview::after,
body.impact-page::after,
body.contact-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.34) 0%,
    rgba(0, 0, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.32) 100%
  );
}

/* Keep HTML content above atmospheric effects */

body.research-detail .detail-shell,
body.phase1-overview > *,
body.impact-page .impact-shell,
body.contact-page .contact-shell {
  position: relative;
  z-index: 1;
}

/* Research panel readability */

body.research-detail .content-panel,
body.research-detail .data-metric {
  background-color: rgba(8, 13, 17, 0.95);
  backdrop-filter: blur(4px);
}

/* Matrix animation */

@keyframes atmos-matrix-fall {
  from {
    background-position: center 0;
  }

  to {
    background-position: center 1300px;
  }
}

/* Accessibility: reduced motion */

@media (prefers-reduced-motion: reduce) {
  body.research-detail[class*="theme-phase-"]::before,
  body.phase1-overview::before,
  body.impact-page::before,
  body.contact-page::before {
    animation: none;
  }
}

/* Mobile background adjustments */

@media (max-width: 740px) {
  body.research-detail[class*="theme-phase-"],
  body.phase1-overview,
  body.impact-page,
  body.contact-page {
    background-attachment: scroll, scroll;
    background-position:
      center,
      55% top;
  }
}

/* ===== 04. OFFICIAL PHASE COLOR PALETTES ===== */

body.theme-phase-1,
.library-card.theme-phase-1 {
  --detail-accent: #ddb66a;
  --detail-line: rgba(221, 182, 106, 0.4);
  --detail-fog: rgba(221, 182, 106, 0.09);
}

body.theme-phase-2,
.library-card.theme-phase-2 {
  --detail-accent: #48ae85;
  --detail-line: rgba(72, 174, 133, 0.4);
  --detail-fog: rgba(72, 174, 133, 0.09);
}

body.theme-phase-3,
.library-card.theme-phase-3 {
  --detail-accent: #de62bc;
  --detail-line: rgba(222, 98, 188, 0.4);
  --detail-fog: rgba(222, 98, 188, 0.09);
}

body.theme-phase-4,
.library-card.theme-phase-4 {
  --detail-accent: #b38ce8;
  --detail-line: rgba(179, 140, 232, 0.4);
  --detail-fog: rgba(179, 140, 232, 0.09);
}

body.theme-phase-5,
.library-card.theme-phase-5 {
  --detail-accent: #52c9bf;
  --detail-line: rgba(82, 201, 191, 0.4);
  --detail-fog: rgba(82, 201, 191, 0.09);
}

body.theme-phase-6,
.library-card.theme-phase-6 {
  --detail-accent: #78aae8;
  --detail-line: rgba(120, 170, 232, 0.4);
  --detail-fog: rgba(120, 170, 232, 0.09);
}

body.theme-phase-7,
.library-card.theme-phase-7 {
  --detail-accent: #ffffff;
  --detail-line: rgba(255, 255, 255, 0.4);
  --detail-fog: rgba(255, 255, 255, 0.09);
}

body.theme-phase-8,
.library-card.theme-phase-8 {
  --detail-accent: #e8797f;
  --detail-line: rgba(232, 121, 127, 0.4);
  --detail-fog: rgba(232, 121, 127, 0.09);
}

body.theme-phase-9,
.library-card.theme-phase-9 {
  --detail-accent: #ff9738;
  --detail-line: rgba(255, 151, 56, 0.4);
  --detail-fog: rgba(255, 151, 56, 0.09);
}

/* Phase 9 — neon orange glow */

body.theme-phase-9 .detail-hero h1,
body.theme-phase-9 .detail-brand strong {
  text-shadow: 0 0 13px rgba(255, 151, 56, 0.2);
}

/* ===== 05. PHASE 1 — FOUNDATION PAGE DESIGN ===== */

body.phase1-overview.theme-phase-1 {
  --phase-gold: #e6bb75;
  --phase-glow: rgba(235, 177, 86, 0.42);
  --phase-glass: rgba(6, 13, 17, 0.72);

  background-image:
    linear-gradient(
      180deg,
      rgba(2, 5, 9, 0.16),
      rgba(2, 5, 9, 0.34) 48%,
      rgba(2, 5, 9, 0.68)
    ),
    var(--atmos-scene);

  background-size: cover, cover;
  background-position:
    center top,
    center top;
  background-repeat: no-repeat;
  background-attachment: fixed, fixed;
  color: #f6ecda;
}

/* 05A. Main wrapper */

body.phase1-overview.theme-phase-1 > .wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* 05B. Header */

body.phase1-overview.theme-phase-1 .page-top {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  min-height: min(92vh, 950px);
  padding: 130px max(24px, calc((100vw - 1200px) / 2)) 105px;
  text-align: center;

  background: linear-gradient(
    180deg,
    rgba(1, 5, 9, 0.45),
    transparent 32%,
    rgba(1, 5, 9, 0.25) 100%
  );
}

/* 05C. Navigation and branding */

body.phase1-overview.theme-phase-1 .atmos-header-row {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  width: 100%;
  box-sizing: border-box;
  padding: 22px clamp(20px, 5vw, 80px);
  background: rgba(3, 8, 13, 0.4);
  border-bottom: 1px solid rgba(232, 182, 102, 0.27);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.phase1-overview.theme-phase-1 .atmos-mini-brand,
body.phase1-overview.theme-phase-1 .mini-nav {
  position: relative;
  z-index: 2;
}

body.phase1-overview.theme-phase-1 .mini-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

body.phase1-overview.theme-phase-1 .outline-button {
  border: 1px solid rgba(241, 196, 117, 0.62);
  border-radius: 7px;
  background: rgba(5, 11, 15, 0.65);
  color: #ffe6b4;
  box-shadow:
    inset 0 0 12px rgba(241, 196, 117, 0.07),
    0 0 12px rgba(241, 196, 117, 0.09);
  text-decoration: none;
}

/* 05D. Phase 1 logo */

body.phase1-overview.theme-phase-1 .page-logo {
  width: clamp(110px, 15vw, 210px);
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 24px rgba(234, 170, 74, 0.46));
}

/* 05E. Phase 1 title */

body.phase1-overview.theme-phase-1 .page-top h1 {
  max-width: 1100px;
  margin: 22px auto 10px;
  color: #ffe1a0;
  font-size: clamp(3rem, 7.5vw, 7.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  text-shadow:
    0 0 24px rgba(239, 169, 63, 0.52),
    0 5px 28px rgba(0, 0, 0, 0.78);
}

body.phase1-overview.theme-phase-1 .gold-rule {
  width: min(300px, 65vw);
  height: 2px;
  margin: 24px auto;
  background: linear-gradient(90deg, transparent, #ffe4a5, transparent);
  box-shadow: 0 0 16px rgba(239, 169, 63, 0.65);
}

body.phase1-overview.theme-phase-1 .tagline {
  max-width: 760px;
  margin: 0 auto;
  color: #fff1d4;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  letter-spacing: 0.09em;
  text-shadow: 0 2px 14px #000;
}

/* 05F. Main research content */

body.phase1-overview.theme-phase-1 main {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 45px 0 100px;
  background: transparent;
}

/* 05G. Research cards and glass panels */

body.phase1-overview.theme-phase-1 .overview,
body.phase1-overview.theme-phase-1 .research-card,
body.phase1-overview.theme-phase-1 .research-roadmap-header,
body.phase1-overview.theme-phase-1 .research-progress {
  background: var(--phase-glass);
  border: 1px solid rgba(234, 185, 107, 0.48);
  border-radius: 15px;
  box-shadow:
    0 0 24px rgba(234, 170, 74, 0.11),
    inset 0 0 28px rgba(234, 170, 74, 0.045);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f6ecda;
}

/* 05H. Research overview */

body.phase1-overview.theme-phase-1 .overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
  align-items: center;
  gap: 30px;
  padding: clamp(22px, 4vw, 42px);
  margin-bottom: 30px;
}

body.phase1-overview.theme-phase-1 .overview img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 330px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(234, 185, 107, 0.35);
}

/* 05I. Research grid */

body.phase1-overview.theme-phase-1 .research-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

body.phase1-overview.theme-phase-1 .research-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(20px, 3vw, 30px);
  margin: 0;
  overflow: hidden;
}

body.phase1-overview.theme-phase-1 .research-heading {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 18px;
}

body.phase1-overview.theme-phase-1 .research-heading > div {
  flex: 1;
  min-width: 0;
}

body.phase1-overview.theme-phase-1 .research-card h3 {
  margin: 5px 0;
  color: #ffe0a4;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  line-height: 1.2;
}

/* 05J. Headings and research labels */

body.phase1-overview.theme-phase-1 .overview h2,
body.phase1-overview.theme-phase-1 .research-roadmap-header h2,
body.phase1-overview.theme-phase-1 .research-progress h2 {
  color: #ffe0a4;
  text-shadow: 0 0 14px rgba(234, 170, 74, 0.25);
}

body.phase1-overview.theme-phase-1 .id,
body.phase1-overview.theme-phase-1 .kicker,
body.phase1-overview.theme-phase-1 .roadmap-kicker {
  color: #edbc72;
  letter-spacing: 0.15em;
}

body.phase1-overview.theme-phase-1 .card-details {
  flex: 1;
}

body.phase1-overview.theme-phase-1 .card-details h4 {
  color: #edbc72;
  margin: 19px 0 7px;
}

body.phase1-overview.theme-phase-1 .card-details p,
body.phase1-overview.theme-phase-1 .overview p,
body.phase1-overview.theme-phase-1 .research-progress p {
  color: #e8e2d8;
  line-height: 1.7;
}

/* 05K. Icons and arrows */

body.phase1-overview.theme-phase-1 .boxed-icon,
body.phase1-overview.theme-phase-1 .round-arrow,
body.phase1-overview.theme-phase-1 .roadmap-index {
  color: #ffe0a4;
  border-color: rgba(234, 185, 107, 0.55);
  text-shadow: 0 0 12px rgba(234, 170, 74, 0.4);
}

/* 05L. Research images */

body.phase1-overview.theme-phase-1 .card-photo {
  width: 100%;
  max-height: 270px;
  margin-top: 20px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid rgba(234, 185, 107, 0.25);
}

/* 05M. Research roadmap */

body.phase1-overview.theme-phase-1 .research-roadmap-header {
  grid-column: 1 / -1;
  padding: 30px;
  text-align: center;
}

body.phase1-overview.theme-phase-1 .research-card--centered {
  grid-column: auto;
}

body.phase1-overview.theme-phase-1 .research-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 15px;
  border-top: 1px solid rgba(234, 185, 107, 0.3);
  color: #e9bc79;
}

/* 05N. Research progress */

body.phase1-overview.theme-phase-1 .research-progress {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 25px;
  margin-top: 30px;
  padding: 30px;
}

body.phase1-overview.theme-phase-1 .progress-bar {
  overflow: hidden;
  border: 1px solid rgba(234, 185, 107, 0.45);
}

body.phase1-overview.theme-phase-1 .progress-bar > span {
  display: block;
  width: 40%;
  background: linear-gradient(90deg, #a66a29, #f5d49b);
}

/* 05O. Footer */

body.phase1-overview.theme-phase-1 .site-footer,
body.phase1-overview.theme-phase-1 + .site-footer {
  background: rgba(2, 6, 10, 0.8);
}

/* 05P. Mobile layout */

@media (max-width: 800px) {
  body.phase1-overview.theme-phase-1 {
    background-attachment: scroll, scroll;
  }

  body.phase1-overview.theme-phase-1 .page-top {
    min-height: 75vh;
    padding: 170px 20px 75px;
  }

  body.phase1-overview.theme-phase-1 .atmos-header-row {
    flex-direction: column;
    padding: 15px;
  }

  body.phase1-overview.theme-phase-1 .mini-nav {
    justify-content: center;
  }

  body.phase1-overview.theme-phase-1 .overview,
  body.phase1-overview.theme-phase-1 .research-progress {
    grid-template-columns: 1fr;
  }

  body.phase1-overview.theme-phase-1 .research-grid {
    grid-template-columns: 1fr;
  }
}
