/* =========================================================
   NEURORDER FOUNDATION — FINAL CLEAN STYLESHEET
   Desktop: gallery cards side by side
   Mobile: gallery cards stacked
========================================================= */

:root {
  --foundation-bg: #02050a;
  --foundation-bg-soft: #07111c;
  --foundation-primary: #8fdfff;
  --foundation-text: #ffffff;
  --foundation-text-soft: rgba(235, 242, 250, 0.72);
  --foundation-border: rgba(143, 223, 255, 0.24);
  --foundation-card: rgba(255, 255, 255, 0.05);
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--foundation-bg);
}

.foundation-page,
.foundation-page *,
.foundation-page *::before,
.foundation-page *::after {
  box-sizing: border-box;
}

/* =========================================================
   HERO
========================================================= */

.foundation-hero {
  width: 100%;
  min-height: 100vh;
  padding: 150px 8% 100px;

  display: flex;
  align-items: center;

  background:
    radial-gradient(circle at top right, rgba(143, 223, 255, 0.15), transparent 34%),
    linear-gradient(to bottom, var(--foundation-bg), var(--foundation-bg-soft));
}

.foundation-copy {
  width: 100%;
  max-width: 900px;
}

.foundation-copy h1 {
  margin: 20px 0 28px;

  color: var(--foundation-text);

  font-size: clamp(56px, 7vw, 100px);
  line-height: 0.95;
  letter-spacing: -3px;
}

.foundation-copy > p:last-child {
  max-width: 720px;
  margin: 0;

  color: var(--foundation-text-soft);

  font-size: 20px;
  line-height: 1.8;
}

/* =========================================================
   IMAGE GALLERY BELOW HERO
========================================================= */

.foundation-gallery-section {
  width: 100%;
  padding: 72px 8% 95px;

  background:
    radial-gradient(circle at center, rgba(143, 223, 255, 0.07), transparent 55%),
    var(--foundation-bg-soft);
}

.foundation-gallery {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.foundation-gallery-card {
  position: relative;
  display: block;

  width: 100%;
  aspect-ratio: 4 / 3;

  overflow: hidden;

  text-decoration: none;

  background: #07111c;

  border: 1px solid var(--foundation-border);
  border-radius: 22px;

  box-shadow:
    0 0 18px rgba(143, 223, 255, 0.12),
    0 0 40px rgba(143, 223, 255, 0.06),
    0 22px 50px rgba(0, 0, 0, 0.38);

  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.foundation-gallery-card::before {
  content: "";

  position: absolute;
  inset: -1px;
  z-index: 3;

  pointer-events: none;

  border-radius: inherit;

  box-shadow:
    inset 0 0 18px rgba(143, 223, 255, 0.08),
    0 0 18px rgba(143, 223, 255, 0.12);
}

.foundation-gallery-card img {
  position: absolute;
  inset: 0;

  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  opacity: 1;
  visibility: visible;

  transition: transform 0.55s ease;
}

.foundation-gallery-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  padding: 22px;

  background:
    linear-gradient(
      to bottom,
      rgba(2, 5, 10, 0.02) 20%,
      rgba(2, 5, 10, 0.88) 100%
    );
}

.foundation-gallery-overlay h3 {
  margin: 0 0 6px;

  color: var(--foundation-text);

  font-size: 25px;
  line-height: 1.08;
}

.foundation-gallery-overlay p {
  margin: 0;

  color: var(--foundation-primary);

  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.4px;
}

.foundation-gallery-card:hover {
  transform: translateY(-6px);

  border-color: rgba(143, 223, 255, 0.55);

  box-shadow:
    0 0 24px rgba(143, 223, 255, 0.22),
    0 0 52px rgba(143, 223, 255, 0.10),
    0 26px 58px rgba(0, 0, 0, 0.44);
}

.foundation-gallery-card:hover img {
  transform: scale(1.045);
}

/* =========================================================
   QUANTUM STRIP
========================================================= */

.quantum-strip {
  position: relative;

  width: 100%;
  height: 140px;

  overflow: hidden;

  background:
    radial-gradient(circle, rgba(143, 223, 255, 0.18), transparent 42%),
    var(--foundation-bg);
}

.quantum-strip::before {
  content: "01001110 01000101 01010101 01010010 01001111 01010010 01000100 01000101 01010010";

  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;

  white-space: nowrap;

  color: rgba(143, 223, 255, 0.16);

  font-family: monospace;
  font-size: 20px;
  letter-spacing: 9px;

  animation: binaryMove 20s linear infinite;
}

@keyframes binaryMove {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-35%);
  }
}

.node-field {
  position: absolute;
  inset: 0;
}

.node-field span {
  position: absolute;

  width: 10px;
  height: 10px;

  background: var(--foundation-primary);
  border-radius: 50%;

  box-shadow: 0 0 28px rgba(143, 223, 255, 0.8);

  animation: nodeFloat 5s ease-in-out infinite;
}

.node-field span:nth-child(1) { left: 10%; top: 40%; }
.node-field span:nth-child(2) { left: 30%; top: 65%; animation-delay: 0.6s; }
.node-field span:nth-child(3) { left: 50%; top: 35%; animation-delay: 1.2s; }
.node-field span:nth-child(4) { left: 70%; top: 70%; animation-delay: 1.8s; }
.node-field span:nth-child(5) { left: 88%; top: 38%; animation-delay: 2.4s; }

@keyframes nodeFloat {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.55;
  }

  50% {
    transform: translateY(-16px);
    opacity: 1;
  }
}

/* =========================================================
   SHARED SECTIONS
========================================================= */

.province-section,
.impact-section {
  width: 100%;
  padding: 100px 8%;
}

.province-section {
  background: var(--foundation-bg-soft);
}

.impact-section {
  background: var(--foundation-bg);
}

.section-title {
  max-width: 880px;
  margin: 0;

  color: var(--foundation-text);

  font-size: clamp(42px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -2px;
}

.section-text {
  max-width: 850px;
  margin: 24px 0 0;

  color: var(--foundation-text-soft);

  font-size: 18px;
  line-height: 1.8;
}

/* =========================================================
   PROVINCES
========================================================= */

.province-grid {
  width: 100%;
  margin-top: 48px;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.province-card {
  width: 100%;
  min-width: 0;

  padding: 28px;

  text-align: left;
  color: var(--foundation-text);

  background: var(--foundation-card);

  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;

  cursor: pointer;

  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.province-card:hover {
  transform: translateY(-6px);

  border-color: var(--foundation-primary);

  box-shadow: 0 0 34px rgba(143, 223, 255, 0.12);
}

.province-card i {
  display: block;

  margin-bottom: 20px;

  color: var(--foundation-primary);

  font-size: 28px;
}

.province-card h3 {
  margin: 0 0 10px;

  font-size: 23px;
  line-height: 1.2;
}

.province-card p {
  margin: 0;

  color: var(--foundation-text-soft);

  line-height: 1.6;
}

.province-display {
  width: 100%;
  margin-top: 34px;
}

.province-display h3 {
  margin: 0 0 12px;

  color: var(--foundation-primary);

  font-size: 28px;
}

.province-display p {
  margin: 0;

  color: var(--foundation-text-soft);

  line-height: 1.8;
}

/* =========================================================
   LANGUAGE ROTATOR
========================================================= */

.province-card-rotator {
  position: relative;

  width: 100%;
  min-height: 185px;

  margin-bottom: 26px;

  overflow: hidden;

  border-radius: 26px;
}

.language-card {
  position: absolute;
  inset: 0;

  padding: 30px;

  display: flex;
  flex-direction: column;
  justify-content: center;

  color: var(--foundation-text);

  background:
    radial-gradient(circle at top right, rgba(143, 223, 255, 0.18), transparent 40%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));

  border: 1px solid rgba(143, 223, 255, 0.22);
  border-radius: 26px;

  opacity: 0;

  animation: rotateLanguageCards 15s infinite;
}

.language-card:nth-child(1) { animation-delay: 0s; }
.language-card:nth-child(2) { animation-delay: 3s; }
.language-card:nth-child(3) { animation-delay: 6s; }
.language-card:nth-child(4) { animation-delay: 9s; }
.language-card:nth-child(5) { animation-delay: 12s; }

.language-card span {
  margin-bottom: 12px;

  color: var(--foundation-primary);

  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.language-card h3 {
  margin: 0;

  font-size: clamp(30px, 4vw, 50px);
  line-height: 1;
}

.province-message {
  margin: 0;

  color: var(--foundation-text-soft);

  font-size: 18px;
  line-height: 1.8;
}

@keyframes rotateLanguageCards {
  0%,
  100% {
    opacity: 0;
    transform: translateY(24px);
  }

  6%,
  18% {
    opacity: 1;
    transform: translateY(0);
  }

  24% {
    opacity: 0;
    transform: translateY(-24px);
  }
}

/* =========================================================
   IMPACT
========================================================= */

.impact-grid {
  width: 100%;
  margin-top: 48px;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.impact-card {
  min-width: 0;

  padding: 30px 20px;

  text-align: center;
}

.impact-card i {
  display: block;

  margin-bottom: 20px;

  color: var(--foundation-primary);

  font-size: 32px;
}

.impact-card h3 {
  margin: 0 0 12px;

  color: var(--foundation-text);

  font-size: 22px;
}

.impact-card p {
  margin: 0;

  color: var(--foundation-text-soft);

  line-height: 1.65;
}

/* =========================================================
   HOPE SECTION
========================================================= */

.hope-section {
  min-height: 500px;
  padding: 100px 8%;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(circle at center, rgba(143, 223, 255, 0.11), transparent 55%),
    linear-gradient(to bottom, var(--foundation-bg-soft), var(--foundation-bg));
}

.hope-message {
  width: 100%;
  max-width: 850px;

  text-align: center;
}

.hope-message h2 {
  margin: 18px 0 24px;

  color: var(--foundation-text);

  font-size: clamp(42px, 6vw, 80px);
  line-height: 1;
}

.hope-message p:last-child {
  margin: 0;

  color: var(--foundation-text-soft);

  font-size: 20px;
  line-height: 1.8;
}

/* =========================================================
   TABLET
========================================================= */

@media screen and (max-width: 1050px) {
  .province-grid,
  .impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   MOBILE
========================================================= */

@media screen and (max-width: 768px) {
  .foundation-hero {
    min-height: auto;
    padding: 130px 18px 76px;

    display: block;
  }

  .foundation-copy h1 {
    font-size: clamp(46px, 14vw, 62px);
    line-height: 0.98;
    letter-spacing: -2px;
  }

  .foundation-copy > p:last-child {
    font-size: 17px;
    line-height: 1.7;
  }

  .foundation-gallery-section {
    padding: 58px 18px 78px;
  }

  .foundation-gallery {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .foundation-gallery-card {
    width: min(100%, 420px);
    margin: 0 auto;

    aspect-ratio: 4 / 3;

    border-radius: 20px;
  }

  .foundation-gallery-overlay {
    padding: 20px;
  }

  .foundation-gallery-overlay h3 {
    font-size: 25px;
  }

  .quantum-strip {
    height: 110px;
  }

  .province-section,
  .impact-section {
    padding: 72px 18px;
  }

  .section-title {
    font-size: clamp(38px, 12vw, 54px);
  }

  .section-text {
    font-size: 16px;
    line-height: 1.7;
  }

  .province-grid,
  .impact-grid {
    display: flex;
    flex-wrap: nowrap;

    width: calc(100% + 36px);

    margin-left: -18px;

    padding: 8px 18px 22px;

    gap: 16px;

    overflow-x: auto;
    overflow-y: hidden;

    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: none;
  }

  .province-grid::-webkit-scrollbar,
  .impact-grid::-webkit-scrollbar {
    display: none;
  }

  .province-card,
  .impact-card {
    flex: 0 0 84%;

    min-width: 84%;
    max-width: 84%;

    scroll-snap-align: start;
  }

  .province-card {
    padding: 25px;
  }

  .impact-card {
    padding: 28px 22px;

    background: rgba(255, 255, 255, 0.045);

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
  }

  .province-card-rotator {
    min-height: 215px;
  }

  .language-card {
    padding: 24px 20px;

    align-items: center;

    text-align: center;
  }

  .province-message {
    font-size: 16px;
  }

  .hope-section {
    min-height: auto;
    padding: 82px 18px;
  }

  .hope-message h2 {
    font-size: clamp(42px, 12vw, 58px);
  }

  .hope-message p:last-child {
    font-size: 17px;
    line-height: 1.7;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .quantum-strip::before,
  .node-field span,
  .language-card {
    animation: none;
  }

  .language-card:first-child {
    opacity: 1;
    transform: none;
  }

  .foundation-gallery-card,
  .foundation-gallery-card img,
  .province-card {
    transition: none;
  }
}