:root {
  --accent: #ffd54f;
  --bg: #03030a;
  --muted: #9aa3b2;
  --card: #0b1220;
  --glass: rgba(255, 255, 255, 0.04);
}

* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
}

body {
  margin: 0;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial;
  background: var(--bg);
  background-attachment: fixed;
  background-size: cover;
  color: #e6eef8;
  line-height: 1.45;
}
a {
  color: var(--accent);
  text-decoration: none;
}

header {
  position: relative;
  z-index: 3;
  padding: 2rem 1rem;
  display: flex;
  align-items: left;
  justify-content: space-between;
}

.brand {
  display: flex;
  gap: 5rem;
  align-items: left;
}

.logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(
    90deg,
    #e0a524 10%,
    #c7801d 5%,
    #ffd54f 50%,
    #c7801d 100%,
    #e0a524 100%
  );
  border-radius: 5px;
  clip-path: polygon(
    50% 0%,
    93.3% 25%,
    93.3% 75%,
    50% 100%,
    6.7% 75%,
    6.7% 25%
  );
  display: grid;
  place-items: center;
  color: #061025;
  font-weight: 700;
}
h1 {
  margin: 0;
  font-size: 1.25rem;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}
.btns {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* Hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 100vh;
  max-width: 100%;
  background: black;
  color: var(--fg);
}

.hero-left {
  padding: 2rem;
}

.hero-right {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding: 4rem 1rem;
}
.main .card {
  background: linear-gradient(180deg, #061025, transparent);
  padding: 1.6rem;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}
.eyebrow {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.lead {
  font-size: 1.05rem;
  color: #dceeff;
}

/* starfield background */
.hero {
  position: relative;
  overflow: hidden;
  background: black;
}

.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  background: transparent;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

/* shooting stars */
.shooting-star {
  position: absolute;
  width: 100px;
  height: 2px;
  background: linear-gradient(90deg, white, transparent);
  top: -20px;
  left: 50%;
  transform: rotate(-45deg);
  opacity: 0;
  animation: shooting 6s linear infinite;
}

@keyframes shooting {
  0% {
    transform: translateX(0) translateY(0) rotate(-45deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateX(-600px) translateY(600px) rotate(-45deg);
    opacity: 0;
  }
}

/* Hexagon Mirror Animation Grid */
.hex {
  width: 85px;
  height: 74px;
  clip-path: polygon(
    50% 0%,
    93.3% 25%,
    93.3% 75%,
    50% 100%,
    6.7% 75%,
    6.7% 25%
  );
  background: linear-gradient(
    90deg,
    #e0a524 10%,
    #c7801d 5%,
    #ffe233 50%,
    #c7801d 100%,
    #e0a524 100%
  );
  border: 1.5px solid #775707;
  box-shadow: 0 0 8px rgba(255, 215, 79, 0.8);
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

.hex::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0) 60%
  );
  transform: rotate(25deg);
  animation: shine 4s infinite;
}

@keyframes shine {
  0% {
    transform: translateX(-100%) rotate(25deg);
  }
  100% {
    transform: translateX(100%) rotate(25deg);
  }
}

.jwst-wrapper {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  animation: rotate 15s linear infinite;
}

.jwst-mirror-back {
  width: 300px;
  height: 370px;
  clip-path: polygon(
    50% 0%,
    93.3% 25%,
    93.3% 75%,
    50% 100%,
    6.7% 75%,
    6.7% 25%
  );
  background: #2e2101d8;
  z-index: -1;
  inset: 0;
  position: absolute;
  transform: rotate(90deg);
  left: -18px;
  top: -52px;
}

.jwst-mirror {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  inset: 0;
  position: absolute;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.jwst-mirror {
  animation: rotate 15s linear infinite;
}

.hex-row {
  display: flex;
  gap: 0px;
  justify-content: center;
  margin-top: -15px;
}

.hex-row:first-child {
  margin-top: 0;
  margin-right: 0;
  margin-bottom: -4px;
}

.hex-row:nth-child(even) {
  margin-left: 0;
  margin-right: 0;
  margin-bottom: -4px;
}

.hex-row:nth-child(odd) {
  margin-top: 150;
  margin-right: 0;
  margin-bottom: -4px;
}

.hex.center {
  background: #000;
  border: 1.5px solid #222;
  box-shadow: none;
}

/* Telescope Base */
.jwst-wrapper {
  --mirror-w: 280px;
  --rod-thick: 10px;
  --rod-len: 140px;
  --base-w: 240px;
  --base-h: 760px;
  --base-offset-y: 140px;
}

.jwst-mirror-back {
  z-index: 0;
}
.jwst-base {
  z-index: 1;
  position: absolute;
}
.jwst-mirror {
  z-index: 2;
}
.rod {
  z-index: 3;
  position: absolute;
}

.jwst-base {
  left: 50%;
  top: 50%;
  transform: translate(-50%, calc(-50% + var(--base-offset-y)));
  width: var(--base-w);
  height: var(--base-h);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  background: linear-gradient(135deg, #e5e5e5, #a9a9a9 55%, #f7f7f7);
  border: 2px solid #8b8b8b;
  box-shadow:
    inset -8px -10px 18px rgba(0, 0, 0, 0.35),
    inset 8px 10px 18px rgba(255, 255, 255, 0.28);
}

.rod {
  width: var(--rod-thick);
  height: var(--rod-len);
  background: linear-gradient(90deg, #f0f0f0, #bfbfbf 45%, #d9d9d9);
  border-radius: calc(var(--rod-thick) / 2);
  box-shadow:
    inset 0 0 6px rgba(255, 255, 255, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.45);
  transform-origin: 50% 100%;
}

.rod-left {
  left: calc(50% - var(--mirror-w) * 0.28);
  top: calc(50% + var(--mirror-w) * 0.13);
  transform: translate(-50%, -100%);
  rotate: calc(-28deg);
  height: calc(var(--base-offset-y) - var(--mirror-w) * 0.13 + 30px);
}

.rod-right {
  left: calc(50% + var(--mirror-w) * 0.28);
  top: calc(50% + var(--mirror-w) * 0.13);
  transform: translate(-50%, -100%);
  rotate: calc(28deg);
  height: calc(var(--base-offset-y) - var(--mirror-w) * 0.13 + 30px);
}

.rod-top {
  left: 50%;
  top: calc(50% - var(--mirror-w) * 0.38);
  transform: translate(-50%, -100%);
  rotate: calc(0deg);
  height: calc(
    var(--base-offset-y) + var(--base-h) * 0.5 - var(--mirror-w) * 0.38
  );
}

.jwst {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
  animation: spin 20s linear infinite;
  transform-style: preserve-3d;
}

@keyframes spin {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

/* Hexagon Image Gallery */
.hex-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  max-width: 900px;
  margin: 2rem auto;
  text-align: center;
}

.hex-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hex-img {
  width: 320px;
  max-width: 90%;
  aspect-ratio: 1 / 1.1547;
  clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0 50%);
  overflow: hidden;
  margin: 0 auto;
}

.hex-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hex-caption {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: var(--muted);
}

/* Sections */
section {
  padding: 3rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
h2 {
  margin: 0 0 0.5rem 0;
  color: var(--accent);
}
p.lead-2 {
  color: var(--muted);
  margin: 0 0 1rem 0;
}

/* define scroll animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1s ease forwards;
}

/* Cards for facts/discoveries */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.fact {
  background: linear-gradient(180deg, #061025, transparent);
  padding: 1.6rem;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}
.fact h3 {
  margin: 0.25rem 0;
}

/* Carousel */
.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.carousel-header p {
  flex: 1;
  margin: 0;
}

/* Button Styling */
.controls {
  display: flex;
  gap: 0.5rem;
}

.controls .btn {
  background: var(--fg);
  color: var(--bg);
  padding: 0.4rem 0.8rem;
  border-radius: 0.4rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.controls .btn:hover {
  background: var(--neon-blue);
  color: var(--fg);
}

.carousel {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.carousel .slides img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  display: block;
}

.carousel {
  position: relative;
  overflow: hidden;
  width: min(100%, 1200px);
  max-width: 900px;
  margin: 2rem auto;
}

.slides {
  display: flex;
  width: 300%;
  transform: translateX(0);
  transition: transform 0.6s ease;
}

.slide {
  flex: 0 0 100%;
  padding: 1rem;
  text-align: center;
  box-sizing: border-box;
}

.slide img {
  display: block;
  min-width: 100%;
  max-height: 500px;
  height: clamp(300px, 55vh, 560px);
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 1rem;
}

.slide h3 {
  margin: 0.5rem 0 0.25rem;
}
.slide .caption {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0.5rem;
}

/* slide positions */
#c1:checked ~ .slides {
  transform: translateX(0%);
}
#c2:checked ~ .slides {
  transform: translateX(-100%);
}
#c3:checked ~ .slides {
  transform: translateX(-200%);
}

.controls {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.control-set {
  display: none;
  gap: 0.75rem;
}
.controls .btn {
  pointer-events: auto;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  font-size: 1.1rem;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}
.controls .btn:hover {
  transform: translateY(-1px);
  color: #fff;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.7);
}

#c1:checked ~ .controls .set1 {
  display: flex;
}
#c2:checked ~ .controls .set2 {
  display: flex;
}
#c3:checked ~ .controls .set3 {
  display: flex;
}

/* Learn More */
.learn-more {
  text-align: center;
  font-weight: bold;
}

/* Footer */
footer {
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1;
}

/* Responsive */
@media (max-width: 1000px) {
  .hero {
    transform: translateY(-150px);
  }
  .hero-left {
    transform: translateX(-50px);
  }
  .hero-right {
    transform: translateX(-100px);
  }
  .jwst {
    scale: 1.2;
  }
  .hex-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .slide {
    grid-template-columns: 1fr;
  }
  .main {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 470px) {
  .hex-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* small utilities */
.muted {
  color: var(--muted);
}
.accent {
  color: var(--accent);
}
.btn-primary {
  background: var(--accent);
  color: #061025 !important;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
}
.btn-primary:hover {
  background: #ffea80;
  color: #000 !important;
}
a:hover,
.btn:hover {
  background: linear-gradient(135deg, var(--accent), #ffea80);
  box-shadow: 0 0 12px var(--accent);
  transition: all 0.3s ease;
}
.link-plain {
  color: var(--accent);
  background: none !important;
  box-shadow: none !important;
  padding: 0;
}
.link-plain:hover {
  text-decoration: underline;
  background: none;
  color: #ffea80;
}
