/* FederAstro, direction C: "One night" — the Gallery and About pages.
   Loaded after style.css; everything here is scoped to .page-gallery / .page-about or uses gal- / ab- names. */

/* ================================================================== the two moments
   gallery: 22:30, astronomical night, the Wizard on the meridian (script.js draws the sky for that time).
   about: 09:30 the next morning at the desk: no stars, the house lit, the scope parked. */
.page-gallery { --rail: 0px; --sky-top: #040508; --sky-mid: #06070c; --sky-glow: #090a12; --sky-low: #0c0d18; --stars: 1; --redlight: 1; }
.page-about { --rail: 0px; --sky-top: #12305a; --sky-mid: #1d477c; --sky-glow: #295689; --sky-low: #3a6a9c; --stars: 0; --redlight: 0; --window: #E9A15F; }
.page-gallery .top .wordmark, .page-about .top .wordmark { display: inline-flex; }

/* ================================================================== gallery: head + index */
.gal-head {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 36px);
  padding: clamp(28px, 6vh, 64px) 0 0; align-items: start;
}
.gal-head .crumbs { grid-column: 1 / -1; }
.gal-head__stamp { grid-column: 1 / span 6; margin-top: 1.4rem; }
.gal-head h1 { grid-column: 1 / span 6; font-size: clamp(2.6rem, 5.2vw, 4.9rem); line-height: .93; margin-top: 1rem; max-width: 11ch; }
.gal-head .sub { grid-column: 1 / span 5; margin: 1.4rem 0 0; color: var(--ink-2); max-width: 31rem; }

.gal-index { grid-column: 8 / span 5; grid-row: 2 / span 3; align-self: end; text-shadow: none; }
.gal-index__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-bottom: .6rem; }
.gal-index__head h2 { font: 400 .66rem/1.5 var(--f-mono); font-stretch: 82%; text-transform: uppercase; letter-spacing: .14em; color: var(--ink); }
.gal-index__head p { margin: 0; font: 400 .66rem/1.5 var(--f-mono); font-stretch: 82%; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gal-rows { list-style: none; margin: 0; padding: 0; }
.gal-rows li { background: linear-gradient(rgba(237, 230, 217, .32), rgba(237, 230, 217, .32)) 0 0 / 100% 1px no-repeat; }
.gal-rows li:last-child { box-shadow: inset 0 -1px 0 rgba(237, 230, 217, .16); }
.gal-row {
  display: grid; grid-template-columns: 1.9rem 84px minmax(0, 1fr) auto; grid-template-rows: auto auto;
  column-gap: .9rem; row-gap: .45rem; align-items: center; padding: .85rem .1rem .9rem 0; text-decoration: none; color: var(--ink);
}
.gal-row__no { grid-row: 1 / span 2; align-self: start; padding-top: .15rem; font: 400 .72rem/1 var(--f-mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.gal-row__thumb { grid-row: 1 / span 2; width: 84px; aspect-ratio: 3 / 2; object-fit: cover; background: #0b0a09; outline: 1px solid rgba(237, 230, 217, .18); }
.gal-row__name { grid-column: 3; min-width: 0; margin: 0; }
.gal-row__name b { display: block; font: 800 1.2rem/1.05 var(--f-display); letter-spacing: -.005em; }
.gal-row__name > span { display: block; margin-top: .25rem; font: 400 .64rem/1.4 var(--f-mono); font-stretch: 82%; color: var(--ink-2); letter-spacing: .02em; }
.gal-row__name > span span { white-space: nowrap; }
.gal-row__total { grid-column: 4; grid-row: 1; justify-self: end; margin: 0; font: 800 1.2rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
/* integration per filter, on one fixed scale (50 h = full width) so later targets compare at a glance */
.gal-row__bands { grid-column: 3 / span 2; grid-row: 2; display: flex; gap: 2px; height: 5px; }
.gal-row__bands i { width: calc(var(--h) / 50 * 100%); height: 100%; border-radius: 1px; }
.gal-row__bands .ha { background: var(--ha-ink); } .gal-row__bands .oiii { background: var(--oiii-ink); } .gal-row__bands .sii { background: var(--sii-ink); }
.gal-row:hover b { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
.gal-row:hover .gal-row__thumb { outline-color: var(--accent); }
.gal-index__note { margin-top: 1.1rem; font-size: 1.5rem; line-height: 1.02; color: #F1DDB8; transform: rotate(-1.6deg); }

/* ================================================================== gallery: an entry */
.gal-entry {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 36px);
  grid-template-rows: auto 1fr; margin-top: clamp(64px, 13vh, 140px); padding-top: 1.2rem; align-items: start; scroll-margin-top: 20px;
}
.gal-entry__head { grid-column: 1 / span 4; grid-row: 1; }
.gal-entry__data { grid-column: 1 / span 4; grid-row: 2; }
.gal-fig { grid-column: 5 / span 8; grid-row: 1 / span 2; margin: 2.6rem 0 0; }
.gal-entry h2 { font-size: clamp(2.2rem, 3.9vw, 3.7rem); line-height: .95; margin-top: 1.1rem; }
.gal-entry__no { display: block; font: 200 .9rem/1 var(--f-mono); font-stretch: 75%; color: var(--ink-3); letter-spacing: .04em; margin-bottom: .5rem; }
.gal-entry__desc { margin: 1.1rem 0 0; font-size: 1.06rem; line-height: 1.5; color: var(--ink); max-width: 28rem; }

.gal-data { margin: 1.4rem 0 0; display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); text-shadow: none; max-width: 28rem; }
.gal-data dt, .gal-data dd { margin: 0; padding: .42rem 0 .4rem; border-top: 1px solid rgba(237, 230, 217, .17); }
.gal-data dt { font: 400 .62rem/1.9 var(--f-mono); font-stretch: 82%; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); }
.gal-data dt.ha { color: var(--ha-ink); } .gal-data dt.oiii { color: var(--oiii-ink); } .gal-data dt.sii { color: var(--sii-ink); }
.gal-data dt.ha, .gal-data dt.oiii, .gal-data dt.sii { font: 800 .98rem/1.3 var(--f-display); letter-spacing: 0; text-transform: none; }
.gal-data dd { font-size: .9rem; line-height: 1.4; color: var(--ink); }
.gal-data dd span { font: 400 .68rem/1 var(--f-mono); font-stretch: 82%; color: var(--ink-2); margin-left: .5rem; white-space: nowrap; }
.gal-data dd b { font-weight: 600; }
.gal-data dt:nth-of-type(4), .gal-data dt:nth-of-type(4) + dd { border-top-color: rgba(237, 230, 217, .45); }

.gal-entry__links { margin: 1.6rem 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .7rem 1.6rem; font-size: .9rem; }
.gal-go { font: 700 clamp(1.25rem, 1.9vw, 1.55rem)/1.1 var(--f-display); text-decoration: none; }
.gal-go span { color: var(--accent); display: inline-block; transition: transform .25s; }
.gal-go:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.gal-go:hover span { transform: translateX(4px); }

/* ------------------------------------------------------------------ the signature: three masters → one picture
   Each plate is a real stretched master (grey). Apart, they lie in a row inside the crop marks of the finished
   frame, like prints on the desk. Together, each takes on its filter's colour and they add up (screen); then the
   finished picture develops over them. The colours are the site's filter colours, not a palette claim. */
.gal-open { display: block; text-decoration: none; color: inherit; }
.gal-open:focus-visible { outline-offset: 4px; }
.gal-stage { position: relative; aspect-ratio: 759 / 507; overflow: hidden; background: #070708; }   /* dark under the prints: the sky stays outside the frame */
.gal-stack { position: absolute; inset: 0; isolation: isolate; }
.gal-plate {
  position: absolute; inset: 0; transform-origin: 0 0; mix-blend-mode: screen;
  transition: transform 1.3s cubic-bezier(.6, 0, .18, 1) var(--d, 0s);
}
.gal-plate img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.7) brightness(.92); transition: filter .8s ease calc(.12s + var(--d, 0s)); }   /* together: the grey pedestal drops out so the three add up cleanly */
.gal-plate i { position: absolute; inset: 0; mix-blend-mode: multiply; opacity: 1; background: var(--tint); transition: opacity .8s ease calc(.12s + var(--d, 0s)); }
.gal-plate--ha { --tint: var(--ha-ink); --d: 0s; --x: 1%; --y: 27%; --r: -1.4deg; }
.gal-plate--oiii { --tint: var(--oiii-ink); --d: .07s; --x: 34.6%; --y: 29.5%; --r: .7deg; }
.gal-plate--sii { --tint: var(--sii-ink); --d: .14s; --x: 68%; --y: 27.8%; --r: -.5deg; }
.gal-final { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity 1.2s ease 1.35s; }
.gal-lab, .gal-stage__note { position: absolute; opacity: 0; pointer-events: none; transition: opacity .3s ease; text-shadow: none; }
.gal-lab { top: 61.5%; font: 400 .62rem/1.3 var(--f-mono); font-stretch: 82%; letter-spacing: .06em; color: var(--ink-2); }
.gal-lab b { display: block; font: 800 1.15rem/1 var(--f-display); letter-spacing: 0; margin-bottom: .2rem; }
.gal-lab--ha { left: 1.4%; } .gal-lab--ha b { color: var(--ha-ink); }
.gal-lab--oiii { left: 35%; top: 64%; } .gal-lab--oiii b { color: var(--oiii-ink); }
.gal-lab--sii { left: 68.4%; top: 62.3%; } .gal-lab--sii b { color: var(--sii-ink); }
.gal-stage__note { left: 2%; top: 7%; font: 400 1.6rem/1 var(--f-hand); color: #F1DDB8; transform: rotate(-2deg); transform-origin: 0 50%; }

/* apart (pages.js sets it; without JS the stage simply shows the finished picture) */
.gal-stage.is-apart .gal-plate {
  transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(.31);
  transition: transform 1s cubic-bezier(.5, 0, .2, 1) calc(.25s + var(--d, 0s));
}
.gal-stage.is-apart .gal-plate i { opacity: 0; transition: opacity .4s ease; }
.gal-stage.is-apart .gal-plate img { filter: none; transition: filter .4s ease; }   /* apart: the masters exactly as stretched */
.gal-stage.is-apart .gal-final { opacity: 0; transition: opacity .35s ease; }
.gal-stage.is-apart .gal-lab, .gal-stage.is-apart .gal-stage__note { opacity: 1; transition: opacity .5s ease .95s; }
.gal-stage.no-anim *, .gal-stage.no-anim { transition: none !important; }
.gal-open:hover .gal-final { filter: brightness(1.06); }

.gal-cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.4rem; margin-top: .9rem; }
.gal-cap > span { flex: 1 1 22rem; max-width: 40rem; }
.gal-toggle { flex: none; font-family: var(--f-body); }

/* ================================================================== about */
.ab-head { padding: clamp(28px, 6vh, 64px) 0 0; }
.ab-head .stamp { margin-top: 1.4rem; }
.ab-head h1 { font-size: clamp(3rem, 8.4vw, 7.6rem); line-height: .88; font-weight: 500; margin-top: 1rem; letter-spacing: -.02em; }
.ab-head h1 b { font-weight: 900; }

.ab-body {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 36px);
  margin-top: clamp(2.4rem, 7vh, 4.4rem); padding-top: 1.6rem; align-items: start;
}
.ab-text { grid-column: 1 / span 6; }
.ab-text p { font-size: clamp(1.1rem, 1.45vw, 1.28rem); line-height: 1.55; max-width: 34em; margin: 0 0 1.1em; }
.ab-text .h { color: var(--ha-ink); } .ab-text .o { color: var(--oiii-ink); } .ab-text .s { color: var(--sii-ink); }
.ab-facts { grid-column: 8 / span 5; }
.ab-sheet { margin: 0; display: grid; grid-template-columns: 6.6rem minmax(0, 1fr); text-shadow: none; }
.ab-sheet dt, .ab-sheet dd { margin: 0; padding: .7rem 0 .65rem; border-top: 1px solid var(--rule); }
.ab-sheet dt:first-of-type, .ab-sheet dt:first-of-type + dd { border-top: 0; padding-top: .1rem; }
.ab-sheet dt { font: 400 .62rem/1.9 var(--f-mono); font-stretch: 82%; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2); }
.ab-sheet dd { font-size: .96rem; line-height: 1.45; }
.ab-facts .repo { margin-top: 1.4rem; }
.ab-facts .repo__url { font-size: clamp(.8rem, 1.1vw, .95rem); }

.ab-find {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 36px);
  margin-top: clamp(64px, 12vh, 130px); padding-top: 1.2rem; align-items: start;
}
.ab-find h2 { grid-column: 1 / span 4; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1; margin-top: .2rem; }
.ab-links { grid-column: 5 / span 4; list-style: none; margin: 0; padding: 0; }
.ab-links li { background: linear-gradient(rgba(237, 230, 217, .26), rgba(237, 230, 217, .26)) 0 100% / 100% 1px no-repeat; }
.ab-links a {
  display: block; padding: .75rem 0 .8rem; text-decoration: none; overflow-wrap: anywhere;
  font: 700 clamp(1.25rem, 2vw, 1.7rem)/1.15 var(--f-display); letter-spacing: -.005em;
}
.ab-links small { display: block; font: 500 .6rem/1.4 var(--f-mono); font-stretch: 82%; text-transform: uppercase; letter-spacing: .14em; color: #F29A6A; margin-bottom: .3rem; }
.ab-links a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.ab-note { grid-column: 9 / span 4; align-self: center; margin: 0 0 0 4.6rem; font-size: 1.55rem; line-height: 1.02; max-width: 17em; }
.ab-note { position: relative; }
.ab-arrow--left { position: absolute; left: -66px; top: .1rem; }   /* points back at the links */
.ab-arrow--up { display: none !important; margin: 0 0 .3rem 1.2rem; }
/* the one touch of motion on About: the arrow is drawn once when the note comes into view (pages.js) */
.ab-note.is-waiting path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.ab-note.is-drawn path { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .7s ease .2s; }
.ab-note.is-drawn path + path { transition: stroke-dashoffset .25s ease .85s; }

/* ================================================================== smaller screens */
@media (max-width: 1180px) {
  .gal-index { grid-column: 7 / span 6; }
  .gal-entry__head, .gal-entry__data { grid-column: 1 / span 5; }
  .gal-fig { grid-column: 6 / span 7; }
  .ab-links { grid-column: 5 / span 8; }
  .ab-note { grid-column: 5 / span 8; grid-row: 2; margin: 1.6rem 0 0; }
  .ab-arrow--left { display: none !important; }
  .ab-arrow--up { display: block !important; }   /* the note sits under the links: point up at them */
}

@media (max-width: 1023px) {
  .gal-head, .gal-entry, .ab-body, .ab-find { grid-template-columns: minmax(0, 1fr); }
  .gal-head > *, .gal-entry > *, .ab-body > *, .ab-find > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .gal-head h1 { margin-top: .8rem; }
  .gal-head__stamp { margin-top: 1rem; }
  .gal-head .sub { margin-top: 1rem; }
  .gal-index { margin-top: 2.2rem; }
  .gal-entry { margin-top: 4.5rem; }
  .gal-fig { margin-top: 1.6rem; }
  .gal-entry__desc, .gal-data { max-width: 34rem; }
  .ab-facts { margin-top: 1.4rem; }
  .ab-find h2 { margin-bottom: 1rem; }
  .ab-note { margin: 1.4rem 0 0; }
}

@media (max-width: 600px) {
  .gal-row { grid-template-columns: 1.5rem 64px minmax(0, 1fr) auto; column-gap: .7rem; }
  .gal-row__thumb { width: 64px; }
  .gal-row__name b, .gal-row__total { font-size: 1.08rem; }
  .gal-index__note { font-size: 1.35rem; }
  .gal-lab { font-size: .5rem; }
  .gal-lab b { font-size: .86rem; margin-bottom: .1rem; }
  .gal-stage__note { font-size: 1.15rem; }
  .gal-toggle { width: 100%; }
  .ab-sheet { grid-template-columns: minmax(0, 1fr); }
  .ab-sheet dt { padding-bottom: 0; }
  .ab-sheet dd { border-top: 0; padding-top: .1rem; }
  .ab-note { font-size: 1.4rem; }
}

/* 404 */
.nf__in { padding: clamp(28px, 8vh, 90px) 0 0; max-width: 46rem; }
.nf__in h1 { font-size: clamp(3rem, 8.4vw, 7rem); line-height: .9; font-weight: 900; margin-top: 1.1rem; }
.nf__text { color: var(--ink-2); font-size: 1.08rem; margin-top: 1.4rem; max-width: 34rem; }
