:root {
  color-scheme: dark;
  --night: #101019;
  --deep: #171622;
  --panel: rgba(239, 238, 232, 0.07);
  --line: rgba(239, 238, 232, 0.16);
  --text: #f4f1ea;
  --muted: #c8c1d1;
  --silver: #d8dbe4;
  --pearl: #f0e7ca;
  --violet: #6c5d9a;
  --red: #8f3f4a;
  --green: #4e7469;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(108, 93, 154, 0.18), transparent 34%),
    linear-gradient(260deg, rgba(78, 116, 105, 0.14), transparent 42%),
    var(--night);
  font-family: Georgia, "Times New Roman", serif;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px clamp(18px, 5vw, 72px);
  background: rgba(16, 16, 25, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(216, 219, 228, 0.66);
  border-radius: 50%;
  color: var(--pearl);
  font-size: 0.76rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
}

.nav-links a {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  border-color: var(--line);
  color: var(--text);
  outline: none;
}

.hero {
  position: relative;
  display: grid;
  min-height: 86vh;
  overflow: hidden;
  isolation: isolate;
}

.hero-image,
.hero-overlay,
.hero-content {
  grid-area: 1 / 1;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: contrast(1.02) saturate(0.72);
}

.hero-overlay {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(16, 16, 25, 0.94) 0%, rgba(16, 16, 25, 0.68) 47%, rgba(16, 16, 25, 0.1) 100%),
    linear-gradient(0deg, rgba(16, 16, 25, 0.92) 0%, transparent 45%);
}

.hero-content {
  z-index: 2;
  align-self: center;
  width: min(760px, calc(100% - 36px));
  margin-left: clamp(18px, 7vw, 92px);
  padding: 86px 0 112px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--pearl);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.7rem, 11vw, 8.4rem);
  line-height: 0.88;
  font-weight: 600;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 6vw, 4.1rem);
  line-height: 0.98;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.34rem;
}

p {
  line-height: 1.68;
}

.hero-copy {
  width: min(650px, 100%);
  margin-bottom: 26px;
  color: #e8e2ec;
  font-size: 1.18rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: Arial, sans-serif;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  padding: 14px 18px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  color: #16131d;
  background: var(--silver);
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--text);
}

.section {
  padding: clamp(64px, 9vw, 116px) clamp(18px, 5vw, 72px);
}

.section-heading {
  width: min(980px, 100%);
  margin-bottom: 34px;
}

.section-heading p {
  max-width: 840px;
  color: var(--muted);
  font-size: 1.06rem;
}

.section-heading.narrow {
  width: min(880px, 100%);
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-heading.narrow p {
  margin-right: auto;
  margin-left: auto;
}

.lunar-lab {
  background: #12121d;
}

.moon-dashboard {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.moon-oracle,
.stats-grid article,
.phase-strip article,
.calendar-tools,
.month-card,
.truth-grid article,
.timeline article,
.memory-grid article,
.sources-grid a {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.moon-oracle {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.moon-orb {
  --shadow-width: 50%;
  position: relative;
  width: 150px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, #ffffff, #d9dee9 52%, #8f95a4 100%);
  box-shadow:
    0 0 34px rgba(216, 219, 228, 0.3),
    inset -12px -16px 32px rgba(0, 0, 0, 0.28);
}

.moon-orb::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--shadow-width);
  background: rgba(16, 16, 25, 0.88);
  content: "";
}

.moon-orb.waxing::after {
  left: 0;
}

.moon-orb.waning::after {
  right: 0;
}

.moon-orb.full::after {
  width: 0;
}

.moon-orb.new::after {
  left: 0;
  width: 100%;
}

.moon-oracle h3 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

.moon-oracle p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stats-grid article {
  min-height: 132px;
  padding: 20px;
}

.stats-grid span,
.phase-strip span,
.calendar-tools span,
.month-meta {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-grid strong,
.phase-strip strong,
.calendar-tools strong {
  display: block;
  color: var(--text);
  font-size: 1.22rem;
  line-height: 1.25;
}

.phase-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.phase-strip article {
  min-height: 104px;
  padding: 18px;
}

.calendar-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 16px;
  padding: 16px;
  text-align: center;
}

button {
  min-height: 42px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(239, 238, 232, 0.06);
  cursor: pointer;
}

button:hover,
button:focus-visible {
  border-color: rgba(240, 231, 202, 0.7);
  outline: none;
}

.months-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.month-card {
  min-height: 264px;
  padding: 18px;
}

.month-card.current {
  border-color: rgba(240, 231, 202, 0.72);
  background: rgba(108, 93, 154, 0.25);
}

.month-card h3 {
  margin-bottom: 8px;
}

.day-line {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  gap: 4px;
  margin-top: 18px;
}

.lunar-dot {
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(216, 219, 228, 0.2);
}

.lunar-dot.active {
  background: var(--pearl);
  box-shadow: 0 0 16px rgba(240, 231, 202, 0.58);
}

.month-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.explanation-section {
  background: #181622;
}

.truth-grid,
.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.truth-grid article,
.memory-grid article {
  min-height: 160px;
  padding: 24px;
}

.truth-grid p,
.timeline p,
.memory-grid p,
.text-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.history-section {
  background: #11131c;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.timeline article {
  min-height: 250px;
  padding: 24px;
}

.timeline article.featured {
  border-color: rgba(240, 231, 202, 0.5);
  background: rgba(78, 116, 105, 0.23);
}

.date {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--pearl);
  font-family: Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: clamp(26px, 5vw, 64px);
  align-items: center;
  background: #171620;
}

.image-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.image-panel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.image-panel p {
  margin: 0;
  padding: 14px 16px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.32);
}

.gallery-section {
  background: #101019;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

figure {
  margin: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

figure img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

figure:nth-child(1) img {
  object-position: center top;
}

figcaption {
  min-height: 86px;
  padding: 14px 16px;
  color: var(--muted);
  line-height: 1.45;
}

.memory-section {
  background: #18151b;
}

.sources-section {
  background: #10151a;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sources-grid a {
  min-height: 58px;
  padding: 17px 18px;
  color: var(--muted);
  text-decoration: none;
}

.sources-grid a:hover,
.sources-grid a:focus-visible {
  border-color: rgba(240, 231, 202, 0.55);
  color: var(--text);
  outline: none;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  background: #08080c;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1120px) {
  .months-grid,
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .moon-dashboard,
  .split-section {
    grid-template-columns: 1fr;
  }

  .phase-strip,
  .truth-grid,
  .memory-grid,
  .sources-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .hero {
    min-height: 82vh;
  }

  .hero-overlay {
    background:
      linear-gradient(0deg, rgba(16, 16, 25, 0.96) 0%, rgba(16, 16, 25, 0.7) 66%, rgba(16, 16, 25, 0.18) 100%);
  }

  .hero-content {
    align-self: end;
    margin-right: 18px;
    margin-left: 18px;
  }

  h1 {
    font-size: 3.8rem;
  }

  .moon-oracle {
    grid-template-columns: 1fr;
  }

  .months-grid,
  .gallery-grid,
  .timeline,
  .phase-strip,
  .truth-grid,
  .memory-grid,
  .sources-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .calendar-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
