/* ============================================================
   Tom's Astro Photos — design tokens from the original site
   ============================================================ */
:root {
  --bg: #000;
  --fg: #fff;
  --text: #999;
  --primary: #7d6043;      /* "Astro Photos" label, links hover */
  --tertiary: #c3d9e7;     /* hero quote */
  --cyan-bluish: #5c7a94;  /* quote attribution */
  --panel-bg: #111;         /* secondary bg — section bands (gallery intro, journey) */
  --caption: #ededed;

  --font-body: 'Poppins', sans-serif;
  --font-head: 'Roboto', sans-serif;

  --fs-extra-large: clamp(22px, 2.5vw, 28px);
  --fs-h2: clamp(28px, 2.6vw, 32px);
  --fs-h1: clamp(36px, 3vw, 45px);
  --fs-small: 15px;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image: url('../assets/stars.png');
  background-repeat: repeat;
  background-size: auto;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.35s ease;
}

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--fg);
  font-weight: 700;
  line-height: 1.2;
}

.container { max-width: 1160px; margin: 0 auto; }

.skip-link {
  position: absolute; left: -9999px;
  background: #fff; color: #000; padding: 8px 16px; z-index: 99;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
/* Same banded treatment as the section intros/journey. Sits flush at the
   top of the page, but keeps both gold hairlines for symmetry with the
   other bands. */
.site-header {
  position: relative; /* keeps the 1px top margin from collapsing through body */
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 30px;
  /* Off by one pixel from the document edge: Chrome clips content in row
     [0,1) when scrollY is exactly 0, which would hide the top hairline. */
  margin-top: 1px;
  margin-bottom: 50px; /* starfield buffer between the header and hero */
  background: linear-gradient(180deg, var(--panel-bg) 0%, #1e1812 100%);
  border-top: 1px solid var(--primary);
  border-bottom: 1px solid var(--primary);
}
.site-title { font-size: 28px; font-weight: 700; }
.instag-header img {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: block;
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.instag-header:hover img { opacity: 1; transform: scale(1.08); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 15% 30px 5%;
  min-height: 420px;
  display: flex;
  align-items: center;
  background: url('../assets/hero.jpg') 52% 53% / cover no-repeat;
}
.hero-inner { max-width: 1300px; width: 100%; margin: 0 auto; }
.quote {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  background: #111;
  border-left: 7px solid var(--primary);
  border-radius: 14px;
  padding: 18px 34px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.55);
}
.quote p { color: #f2f5f8; font-size: var(--fs-extra-large); font-weight: 500; }
.quote-attr {
  font-size: 17px;
  letter-spacing: 1px;
  line-height: 1.5;
  margin-top: 12px;
  color: #c6cfd8;
  font-weight: 500;
  font-style: normal;
}
.quote-attr em { font-style: normal; }

/* ---------- Gallery section ---------- */
/* The intro text sits on a banded panel with gold hairlines above and
   below (same treatment as the journey section); the images below stay
   on the open starfield. */
.section-intro {
  margin-top: 50px;
  /* previewing a tighter band — was 50px */
  padding: 25px 30px;
  background: linear-gradient(180deg, var(--panel-bg) 0%, #1e1812 100%);
  border-top: 1px solid var(--primary);
  border-bottom: 1px solid var(--primary);
}
/* The band's own padding provides the breathing room; keep the heading
   margin from stacking on top of it. */
.section-intro .section-heading { margin-bottom: 0; }

.gallery-wrap { padding: 70px 30px 50px; }
.label {
  text-align: center;
  letter-spacing: 4px;
  color: var(--primary) !important;
  /* 3pt larger than the small size token */
  font-size: calc(var(--fs-small) + 3pt);
  text-transform: none;
}
.section-heading {
  text-align: center;
  font-size: var(--fs-h2);
  margin: 14px 0 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.section-heading .star { width: 46px; height: auto; opacity: 0.9; }

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 18px;
}

.gallery-item {
  overflow: hidden; /* clips the hover zoom at the box edge, like the live site */
  border-radius: 2px;
}

.gallery-item a > img {
  display: block;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1; /* square crop, same as the live site's cropped gallery */
  filter: grayscale(100%) saturate(0%);
  transform: scale(1);
  transition: transform 1s ease, filter 1s ease;
  will-change: transform;
  background: #111;
}
.gallery-item a:hover > img,
.gallery-item a:focus-visible > img {
  filter: grayscale(0%) saturate(100%);
  transform: scale(1.1);
}
.gallery-item figcaption {
  margin-top: 10px;
  text-align: center;
}
.gallery-item figcaption a {
  font-size: calc(14.5px + 2pt); /* +2pts over the caption base */
  color: var(--caption);
  opacity: 0.75;
}
.gallery-item figcaption a:hover { color: var(--primary); opacity: 1; }

/* ---------- Journey ---------- */
.journey {
  background: linear-gradient(180deg, var(--panel-bg) 0%, #1e1812 100%);
  border-top: 1px solid var(--primary);
  border-bottom: 1px solid var(--primary);
  padding: 50px 30px;
}
.journey .section-heading { margin: 0 0 24px; }
.starry-spacer { height: 50px; }
.journey .star { opacity: 0.7; }

.journey-cols {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 980px;
  margin: 0 auto;
}
.journey-photo { flex: 0 0 35%; }
.journey-photo img {
  width: 100%;
  border-radius: 50px;
  display: block;
}
.journey-text { flex: 1; }
.journey-text p { margin-bottom: 22px; }

.journey-sign {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}
.journey-sign img {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: block;
}
.journey-sign p {
  color: var(--fg);
  font-family: var(--font-head);
  font-weight: 500;
  margin: 0;
  font-size: 18px;
}

/* ---------- Animations ---------- */
.animated { opacity: 0; }
.animated.visible { opacity: 1; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translate3d(0, 40px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translate3d(-40px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.animated-fadeInUp.visible    { animation: fadeInUp 1.2s ease both; }
.animated-fadeInRight.visible { animation: fadeInRight 1.2s ease both; }

@media (prefers-reduced-motion: reduce) {
  .animated { opacity: 1; }
  .animated.visible { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .journey-cols { flex-direction: column; }
  .journey-photo { flex: none; width: 70%; }
  .hero { padding-top: 18%; }
}
@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }
  .site-header { padding: 20px 18px; }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px;
  border: none;
  background: transparent;
}
.lightbox::backdrop {
  background: rgba(3, 3, 5, 0.9);
  backdrop-filter: blur(3px);
}
body.lb-open { overflow: hidden; }

/* the gold frame */
.lb-frame {
  position: relative;
  display: flex;
  width: min(1280px, 100%);
  height: 100%;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--panel-bg) 0%, #1e1812 100%);
  border: 1px solid var(--primary);
}

/* image area — full-size, uncropped */
.lb-media {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  padding: 24px;
}
.lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lb-img.loaded { opacity: 1; }

/* back / forward / close */
.lb-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--primary);
  background: rgba(17, 17, 17, 0.85);
  color: #ccc;
  font-family: var(--font-body);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.lb-btn:hover { color: #fff; border-color: #a98457; background: rgba(30, 24, 18, 0.9); }
.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  font-size: 30px;
  line-height: 1;
}
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
.lb-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  font-size: 20px;
}

/* target info panel */
.lb-info {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--primary);
  padding: 58px 26px 26px; /* top pad keeps the title clear of the close button */
  overflow-y: auto;
}
.lb-title {
  font-family: var(--font-head);
  font-size: 20px;
  color: var(--fg);
  margin-bottom: 14px;
}
.lb-blurb {
  font-size: var(--fs-small);
  line-height: 1.7;
  color: var(--caption);
  margin-bottom: 22px;
}
.lb-details { display: grid; gap: 12px; margin-bottom: 26px; /* floor for the gap to the full-res link */ }
.lb-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; font-size: var(--fs-small); line-height: 1.55; }
.lb-row dt {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  color: #8d7452;
}
.lb-row dd { color: #cfcfcf; }

/* full-resolution action — pinned to the bottom of the info panel */
.lb-full {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 13px 14px;
  border: 1px solid var(--primary);
  background: rgba(255, 255, 255, 0.02);
  color: #cfcfcf;
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.lb-full:hover {
  border-color: #a98457;
  color: #fff;
  background: rgba(169, 132, 87, 0.12);
}
.lb-full-arrow { font-size: 13px; line-height: 1; transition: transform 0.2s ease; }
.lb-full:hover .lb-full-arrow { transform: translate(2px, -2px); }

@media (max-width: 760px) {
  .lightbox { padding: 12px; }
  .lb-frame { flex-direction: column; }
  .lb-media { min-height: 0; }
  .lb-info {
    flex: 0 0 auto;
    max-height: 45%;
    border-left: none;
    border-top: 1px solid var(--primary);
    padding: 16px 20px 20px;
  }
}
