/* ============================================================
   RICH'S ASTROPHOTOGRAPHY — shared "Observatory" theme
   Used across default.html, category pages, and object pages.
   ============================================================ */

:root {
  --deep-space: #0a0a12;
  --nebula-blue: #1a1a2e;
  --star-white: #f0ece2;
  --warm-gold: #c9a96e;
  --soft-gold: #d4b883;
  --muted-silver: #8a8a9a;
  --cosmic-purple: #2d1b4e;
  --faint-blue: #16213e;
  --accent-copper: #b87333;
  --text-body: #c8c4bb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--deep-space);
}

body {
  font-family: 'Libre Franklin', sans-serif;
  color: var(--star-white);
  background: var(--deep-space);
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; }

/* ===== STARFIELD BACKGROUND ===== */
.starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.starfield canvas {
  width: 100%;
  height: 100%;
}

/* ===== NAVIGATION ===== */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

nav.site-nav.scrolled {
  background: rgba(10, 10, 18, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201, 169, 110, 0.1);
}

.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--warm-gold);
  text-transform: uppercase;
  text-decoration: none;
}

.nav-logo span { font-weight: 600; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.8rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted-silver);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--warm-gold);
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--star-white);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--star-white);
}

@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 240px;
    background: rgba(10, 10, 18, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    gap: 1.6rem;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    border-left: 1px solid rgba(201, 169, 110, 0.15);
  }
  .nav-links.open { transform: translateX(0); }
}

/* ===== PAGE HERO (for interior pages) ===== */
.page-hero {
  position: relative;
  z-index: 1;
  min-height: 22vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4.5rem 2rem 2rem;
  background: linear-gradient(rgba(10,10,18,0.55), rgba(10,10,18,0.85)), var(--hero-image, none) center/cover no-repeat;
}

.page-hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--warm-gold);
  margin-bottom: 1.2rem;
}

.page-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--star-white);
}

.page-hero h1 em {
  font-style: italic;
  color: var(--soft-gold);
}

.page-hero-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 300;
  font-style: italic;
  color: var(--muted-silver);
  max-width: 560px;
  margin-top: 1rem;
  line-height: 1.6;
}

/* ===== SECTIONS ===== */
main { position: relative; z-index: 1; }

section {
  position: relative;
  z-index: 1;
  padding: 5rem 3rem;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--warm-gold);
  margin-bottom: 1rem;
  text-align: center;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  text-align: center;
}

.section-title em {
  font-style: italic;
  color: var(--soft-gold);
}

.section-body {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-body);
  max-width: 700px;
  margin: 0 auto;
}

.section-divider {
  height: 1px;
  max-width: 1200px;
  margin: 0 auto;
  background: linear-gradient(to right, transparent, rgba(201,169,110,0.3), transparent);
}

/* ===== STORY / ABOUT SECTION ===== */
.story-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.story-wrap p {
  margin-bottom: 1.2rem;
}

.gear-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 3rem auto 0;
}

@media (max-width: 900px) {
  .gear-gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .gear-gallery { grid-template-columns: 1fr; }
}

.gear-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(201,169,110,0.15);
  height: 340px;
  background: #000;
}

.gear-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.5s ease;
}

.gear-item:hover img { transform: scale(1.06); }

.gear-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.9rem 1rem 0.7rem;
  background: linear-gradient(to top, rgba(10,10,18,0.92), transparent);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft-gold);
}

/* ===== GALLERY GRID (category pages) ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
  max-width: 1200px;
  margin: 3rem auto 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(201,169,110,0.12);
  aspect-ratio: 4 / 3;
  text-decoration: none;
  display: block;
  background: var(--nebula-blue);
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.gallery-item:hover .gallery-thumb { transform: scale(1.08); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  background: linear-gradient(to top, rgba(10,10,18,0.92) 15%, rgba(10,10,18,0.1) 70%);
}

.gallery-overlay h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--star-white);
}

.gallery-overlay p {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--muted-silver);
  margin-top: 0.2rem;
}

/* ===== OBJECT DETAIL PAGE ===== */
.object-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3.5rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

@media (max-width: 900px) {
  .object-layout { grid-template-columns: 1fr; }
}

.object-image-frame {
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(201,169,110,0.15);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.object-image-frame img {
  width: 100%;
  display: block;
}

.specs-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,169,110,0.15);
  border-radius: 4px;
  padding: 2rem;
}

.specs-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: var(--star-white);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.specs-table tr {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.specs-table tr:last-child { border-bottom: none; }

.specs-table td {
  padding: 0.65rem 0;
  vertical-align: top;
}

.specs-table td:first-child {
  color: var(--warm-gold);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  width: 40%;
  padding-right: 1rem;
}

.specs-table td:last-child {
  color: var(--text-body);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-silver);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.3s ease;
}

.back-link:hover { color: var(--warm-gold); }

/* ===== LIST-STYLE CATEGORY LINKS (fallback, unused once gallery grid is applied) ===== */
.simple-list {
  max-width: 700px;
  margin: 2rem auto 0;
  list-style: none;
}

.simple-list li {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.simple-list a {
  display: block;
  padding: 0.4rem 0.5rem;
  color: var(--text-body);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.3s ease, padding-left 0.3s ease;
}

.simple-list a:hover {
  color: var(--soft-gold);
  padding-left: 1rem;
}

/* ===== FOOTER ===== */
footer.site-footer {
  position: relative;
  z-index: 1;
  padding: 3rem 3rem 2.5rem;
  border-top: 1px solid rgba(201,169,110,0.1);
  text-align: center;
}

.footer-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--warm-gold);
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 1.2rem;
}

.footer-links a {
  color: var(--muted-silver);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links a:hover { color: var(--warm-gold); }

.footer-meta {
  color: var(--muted-silver);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  margin-bottom: 1.2rem;
}

.footer-social img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
  filter: grayscale(1) brightness(1.4);
  transition: opacity 0.3s ease;
}

.footer-social a:hover img { opacity: 1; }

.footer-copy {
  color: #55555f;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.page-hero-compact {
  min-height: auto;
  padding: 7.5rem 2rem 2.5rem;
  background: radial-gradient(ellipse at top, rgba(45,27,78,0.45), var(--deep-space) 70%);
}

.back-link-wrap {
  max-width: 1200px;
  margin: 0 auto 1.5rem;
}

.object-group-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--soft-gold);
  max-width: 1200px;
  margin: 0.5rem auto 1.5rem;
}

/* ===== ABOUT PAGE ===== */
.about-story p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-body);
  margin-bottom: 1.2rem;
}

.pill-link {
  display: inline-block;
  margin: 0.4rem 0.5rem;
  padding: 0.7rem 1.6rem;
  border: 1px solid rgba(201,169,110,0.3);
  border-radius: 30px;
  color: var(--soft-gold);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease;
}

.pill-link:hover {
  background: rgba(201,169,110,0.12);
  color: var(--star-white);
}

/* nine nav items: tighten spacing on mid-width screens so they stay on one row */
@media (min-width: 981px) and (max-width: 1240px) {
  nav.site-nav { padding: 1.25rem 1.5rem; }
  .nav-logo { font-size: 1.15rem; white-space: nowrap; }
  .nav-links { gap: 1.1rem; flex-wrap: nowrap; }
  .nav-links a { font-size: 0.7rem; letter-spacing: 0.06em; white-space: nowrap; }
}

/* ===== SCROLL REVEAL (fails safe: only hides content once JS confirms it's running) ===== */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
