/* Colors, type and spacing. Change them here only.
   One ink, one paper, one red for emphasis, as in a printed almanac. */
:root{
  --paper:#0d0c0b;          /* page: warm near-black, flat */
  --plate:#000;             /* behind photographs */
  --ink:#e9e4d8;            /* body text */
  --ink-2:#a8a296;          /* secondary text */
  --ink-3:#7b766c;          /* tertiary: rules, captions */
  --rule:#34312c;           /* hairline rules between sections */
  --red:#e2553d;            /* rubric: links, active state, emphasis */
  --focus:#f2c14e;

  --serif:Spectral, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono:"IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --measure:34rem;          /* reading column */
  --gutter:clamp(16px,4vw,48px);
  --wide:1240px;
}

/* Element defaults, page, focus, skip link. */
[hidden]{display:none!important}  /* the attribute always wins over component display rules */
*{box-sizing:border-box}
html{scroll-behavior:smooth}
@media (prefers-reduced-motion: reduce){html{scroll-behavior:auto}}
body{margin:0;min-height:100vh;background:var(--paper);color:var(--ink);font:400 1.0625rem/1.6 var(--serif);-webkit-font-smoothing:antialiased;font-kerning:normal;font-variant-numeric:oldstyle-nums}
a{color:inherit;text-decoration:underline;text-decoration-color:var(--red);text-decoration-thickness:1px;text-underline-offset:.2em}
a:hover{color:var(--red)}
strong{font-weight:500}
:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip{position:absolute;left:var(--gutter);top:-60px;z-index:50;background:var(--ink);color:var(--paper);padding:8px 12px;font:400 .85rem var(--mono)}
.skip:focus{top:12px}
/* The mono voice: labels, figures, dates, credits. */
.label,.dateline,.issue,figcaption.credit,.dims,dt,.count{font-family:var(--mono);font-variant-numeric:tabular-nums lining-nums}

/* Page layer (formerly a decorative star field; removed so the photographs carry the spectacle). */
.page{position:relative}

/* Masthead and main column. */
.masthead{max-width:var(--wide);margin:0 auto;padding:28px var(--gutter) 0}
.masthead-row{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:6px 24px}
.masthead-row + .masthead-row{border-top:1px solid var(--rule);margin-top:14px;padding:8px 0 0}
.masthead h1{margin:0;font:300 clamp(2.2rem,6vw,4.4rem)/1 var(--serif);letter-spacing:-.02em}
.issue{margin:0;display:flex;gap:18px;font-size:.8rem;color:var(--ink-2)}
.motto{margin:0;font-style:italic;color:var(--ink-2);font-size:1rem}
nav.site-nav ul{list-style:none;margin:0;padding:0;display:flex;gap:22px;flex-wrap:wrap}
nav.site-nav a{text-decoration:none;font-size:1rem}
nav.site-nav a:hover{text-decoration:underline;text-decoration-color:var(--red)}

main{max-width:var(--wide);margin:0 auto;padding:0 var(--gutter) 80px}
section{scroll-margin-top:16px}
.masthead h1 .home-link{color:inherit;text-decoration:none}
.masthead h1 .home-link:focus-visible{outline:1px solid var(--rule);outline-offset:4px}

/* Buttons read as words, not boxes. Pressed state is set in red. */
button,.btn{font:400 1rem/1.3 var(--serif);color:var(--ink);background:none;border:0;border-radius:0;padding:6px 0;margin:0;cursor:pointer;text-decoration:underline;text-decoration-color:var(--rule);text-decoration-thickness:1px;text-underline-offset:.25em;min-height:36px;display:inline-flex;align-items:center;gap:.35em}
button:hover,.btn:hover{color:var(--ink);text-decoration-color:var(--red)}
button[disabled]{color:var(--ink-3);text-decoration:none;cursor:default}
button[aria-pressed=true]{color:var(--red);text-decoration-color:var(--red)}
.count{font-size:.78rem;color:var(--ink-3)}

/* Dateline, notice, the photograph (edge to edge), overlay labels, credit, title and actions. */
.dateline{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 18px;margin:28px 0 12px;font-size:.8rem;color:var(--ink-2)}
.dateline .cat{color:var(--red)}
.dateline .when{color:var(--ink)}
.dateline .rollover{margin-left:auto}

.notice{margin:0 0 14px;font-style:italic;color:var(--ink-2);max-width:70ch}


figure.feature{margin:0 calc(50% - 50vw)}          /* bleed to the viewport edges */
.stage{position:relative;height:clamp(320px,78vh,980px);background:var(--plate);display:flex;align-items:center;justify-content:center;overflow:hidden}
.frame{position:relative;cursor:zoom-in;transition:opacity .45s ease}
.frame img{display:block;width:100%;height:100%;object-fit:contain;user-select:none}
.stage.loading .frame{opacity:.2}
@media (prefers-reduced-motion: reduce){.frame{transition:none}}
.spinner{position:absolute;inset:0;display:none;align-items:center;justify-content:center;margin:0;font:400 .8rem var(--mono);color:var(--ink-2)}
.stage.loading .spinner{display:flex}
.dims{position:absolute;right:12px;bottom:8px;font-size:.72rem;color:rgba(233,228,216,.6)}
.labels{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .3s}
.frame.annotated .labels{opacity:1}
.lbl{position:absolute;transform:translate(-5px,-5px);display:flex;align-items:center;gap:6px;white-space:nowrap}
.lbl i{width:10px;height:10px;border-radius:50%;border:1.5px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.6);flex:none}
.lbl b{font:400 .75rem/1.3 var(--mono);color:#fff;text-shadow:0 0 3px #000,0 0 6px #000}
.lbl.flip{flex-direction:row-reverse;transform:translate(calc(-100% + 5px),-5px)}
figcaption.credit{max-width:var(--wide);margin:10px auto 0;padding:0 var(--gutter);font-size:.78rem;line-height:1.55;color:var(--ink-2)}
figcaption.credit strong{font-weight:400;color:var(--ink-2)}
figcaption.credit a{color:var(--ink-2)}

.titlebar{margin:52px 0 0}
.titlebar h2{font:300 clamp(2.1rem,4.8vw,3.8rem)/1.05 var(--serif);letter-spacing:-.015em;margin:0;max-width:24ch}
.titlebar .cap{margin:12px 0 0;font-style:italic;color:var(--ink-2);font-size:1.12rem;line-height:1.5;max-width:60ch}
.titlebar .cap .date{font-style:normal}

/* Options sit directly under the photograph, one line on wide screens. */
.actions{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 28px;margin:14px 0 0}
@media (max-width:600px){.actions{gap:0 20px}}
@media (max-width:600px){.dateline .rollover{margin-left:0;flex-basis:100%}}

.dl-wrap{position:relative;display:inline-block}
.dl-menu{position:absolute;z-index:5;left:0;top:100%;min-width:18rem;display:flex;flex-direction:column;align-items:flex-start;padding:10px 16px 12px;background:var(--paper);box-shadow:0 10px 30px rgba(0,0,0,.6)}
.dl-menu[hidden]{display:none}
.dl-menu button{min-height:32px;padding:3px 0}
.dl-terms{margin:8px 0 0;font-size:.8rem;color:var(--ink-3);max-width:24rem}
.dl-note{margin:8px 0 0;font-size:.9rem;font-style:italic;color:var(--ink-2);max-width:70ch}
@media (max-width:600px){.dl-menu{position:fixed;left:16px;right:16px;top:auto;bottom:16px;min-width:0}}

/* Hubble-vs-Webb slider. The right image sits on top, clipped from the left at --split. */
.compare{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.stage.comparing .frame,.stage.comparing .dims{display:none}
.cmp-box{position:relative;--split:50%}
.cmp-box img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none}
.cmp-box img.top{clip-path:inset(0 0 0 var(--split))}
.cmp-handle{position:absolute;top:0;bottom:0;left:var(--split);width:1px;background:var(--ink);pointer-events:none}
.cmp-handle::after{content:"";position:absolute;top:50%;left:50%;width:14px;height:44px;transform:translate(-50%,-50%);background:var(--ink);box-shadow:0 0 0 1px rgba(0,0,0,.5)}
.cmp-box input[type=range]{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:ew-resize;touch-action:pan-y}
.cmp-box:has(input:focus-visible) .cmp-handle::after{outline:2px solid var(--focus);outline-offset:3px}
.cmp-tag{position:absolute;bottom:10px;font:400 .74rem/1.4 var(--mono);color:#fff;text-shadow:0 0 3px #000,0 0 8px #000;pointer-events:none}
.cmp-tag.left{left:12px} .cmp-tag.right{right:12px;text-align:right}
.cmp-note{max-width:var(--wide);margin:10px auto 0;padding:0 var(--gutter);font-size:.95rem;font-style:italic;color:var(--ink-2)}
.cmp-note .src{font-style:normal;color:var(--ink-3)}

/* "Another photograph" line. */
.discover{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:4px 24px;margin:56px 0 0;padding-top:16px;border-top:1px solid var(--rule)}
.discover .row{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 16px;margin:0}
.discover #discoverHead{font-style:italic;color:var(--ink-2)}
.discover .or{color:var(--ink-3);font-style:italic}

/* Story column with margin notes, scale line, understand panel, fold-out panels. */
.story-grid{display:grid;grid-template-columns:minmax(0,var(--measure)) minmax(0,18rem);gap:28px clamp(40px,8vw,120px);margin-top:36px;align-items:start}
@media (max-width:860px){.story-grid{grid-template-columns:minmax(0,1fr)}}
.story p{margin:0 0 1.1em;font-size:1.16rem;line-height:1.68;hyphens:manual}
.story p:first-child{font-size:1.3rem;line-height:1.5}
.story p + p{text-indent:1.5em;margin-top:-1.1em}     /* book paragraphs: indent, no gap */
.scale{margin:1.6em 0 0;font-style:italic;color:var(--ink-2)}
.scale .label{font-style:normal;font-size:.76rem;color:var(--red);margin-right:.4em}

.notes dl{margin:0;display:grid;gap:0}
.notes dt{font-size:.76rem;color:var(--ink-3);margin-top:22px}
.notes dt:first-child{margin-top:4px}
.notes dd{margin:4px 0 0;font-size:1rem;line-height:1.5;color:var(--ink-2)}
.notes .src{color:var(--ink-3)}
.notes ul{margin:0;padding:0;list-style:none}
.notes li{margin:2px 0}

#understandPanel{margin:28px 0 0;max-width:46rem}
#understandPanel h3{margin:0 0 8px;font:italic 400 1.35rem/1.2 var(--serif)}
#understandPanel p{margin:0 0 .8em;color:var(--ink)}
table.filters{border-collapse:collapse;width:100%;margin:14px 0 18px;font:400 .8rem/1.45 var(--mono)}
table.filters th,table.filters td{text-align:left;padding:5px 16px 5px 0;border-bottom:1px solid var(--rule);vertical-align:top}
table.filters th{font-weight:400;color:var(--ink-3)}
.sw{display:inline-block;width:.8em;height:.8em;margin-right:6px;vertical-align:-.05em}

details.panel{margin-top:22px}
details.panel > summary{cursor:pointer;list-style:none;padding:0;font:italic 400 1.25rem/1.3 var(--serif)}
details.panel > summary::-webkit-details-marker{display:none}
details.panel > summary::before{content:"+";display:inline-block;width:1.1em;font:400 1rem var(--mono);font-style:normal;color:var(--red)}
details.panel[open] > summary::before{content:"−"}
details.panel .body{padding:10px 0 0 1.1em}
details.panel .body p{margin:0 0 .8em}
dl.meta{display:grid;grid-template-columns:minmax(120px,11rem) 1fr;gap:6px 18px;margin:0}
dl.meta dt{font-size:.74rem;color:var(--ink-3);padding-top:.25em}
dl.meta dd{margin:0;font-size:.98rem;color:var(--ink-2)}
@media (max-width:560px){dl.meta{grid-template-columns:1fr} dl.meta dd{margin-bottom:8px}}
.missing{color:var(--ink-3);font-style:italic}

/* Archive, favorites, about, footer. */
.section-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:12px 24px;margin:96px 0 22px;border-top:1px solid var(--ink-3);padding-top:18px}
.section-head h2{font:300 clamp(1.9rem,3.4vw,2.6rem)/1.1 var(--serif);letter-spacing:-.01em;margin:0}
.section-head p{margin:6px 0 0;color:var(--ink-2);font-style:italic;max-width:60ch}
.filters-row{display:flex;flex-wrap:wrap;gap:0 18px}

/* Contact sheet: pictures first, a line of type under each, no boxes. */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(180px,42vw),1fr));gap:28px 18px}
.tile{display:flex;flex-direction:column}
.tile .open{all:unset;cursor:pointer;display:block}
.tile .open:focus-visible{outline:2px solid var(--focus);outline-offset:4px}
.tile .thumb{aspect-ratio:1;background:var(--plate);display:flex;align-items:center;justify-content:center;overflow:hidden}
.tile .thumb img{width:100%;height:100%;object-fit:cover;display:block;transition:opacity .2s}
.tile .open:hover .thumb img{opacity:.8}
.tile .meta{padding:8px 0 0}
.tile .meta span{display:block;font:400 .72rem/1.4 var(--mono);color:var(--ink-3)}
.tile .meta strong{display:block;font:400 1.02rem/1.25 var(--serif);margin-top:3px}
.tile .open:hover .meta strong{color:var(--red)}
.tile .remove{align-self:flex-start;font-size:.88rem;color:var(--ink-2);min-height:30px}
.empty{color:var(--ink-2);font-style:italic;margin:0}

.about{columns:2 22rem;column-gap:clamp(32px,5vw,72px)}
.about-part{break-inside:avoid;margin:0 0 28px}
.about h3{font:italic 400 1.3rem/1.25 var(--serif);margin:0 0 6px}
.about p,.about li{color:var(--ink-2);margin:0 0 .7em}
.about ul{padding-left:1.1em;margin:0}
.about li::marker{color:var(--red)}

footer{max-width:var(--wide);margin:0 auto;padding:0 var(--gutter) 56px}
footer p{display:flex;flex-wrap:wrap;gap:4px 28px;margin:0;padding-top:14px;border-top:1px solid var(--rule);font:400 .74rem/1.5 var(--mono);color:var(--ink-3)}
.grid > .empty{grid-column:1/-1}

/* On this day: date picker, events as a dated list, photographs published on the date. */
.otd-nav{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 14px}
.otd-pick select{font:400 1rem var(--serif);color:var(--ink);background:none;border:0;border-bottom:1px solid var(--rule);padding:4px 2px;cursor:pointer}
.otd-pick select:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.otd-pick option{background:var(--paper);color:var(--ink)}
.otd-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:28px clamp(32px,6vw,80px);align-items:start}
@media (max-width:860px){.otd-grid{grid-template-columns:minmax(0,1fr)}}
.otd-grid h3{font:italic 400 1.3rem/1.2 var(--serif);margin:0 0 12px}
ol.events{list-style:none;margin:0;padding:0}
ol.events > li{display:grid;grid-template-columns:5.5rem minmax(0,1fr);gap:0 14px;margin:0 0 20px}
ol.events > li.none{display:block}
ol.events .yr{font:400 .82rem/1.9 var(--mono);color:var(--red)}
ol.events p{margin:0}
ol.events .ev-src{margin-top:4px;font-size:.88rem;color:var(--ink-3)}
ol.events .ev-src a{color:var(--ink-2)}
ol.events .ev-photos{margin-top:6px;font-size:.95rem}
ol.events .ev-photos button{min-height:0;padding:2px 0}
ol.events .rel{font-size:.85rem;color:var(--ink-3);font-style:italic}
.grid.small{grid-template-columns:repeat(auto-fill,minmax(min(140px,40vw),1fr));gap:22px 14px}
.otd-grid h3.otd-near-head{margin-top:28px}
.otd-note{font:400 .95rem/1.5 var(--serif);color:var(--ink-2);margin:0 0 12px;max-width:52ch}

/* Collection search: one line of type, no boxes, the same underline as the date pickers. */
.search{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px 18px;margin:-6px 0 26px}
.search-q{flex:1 1 18rem}
.search input{width:100%;font:400 1.05rem var(--serif);color:var(--ink);background:none;border:0;border-bottom:1px solid var(--rule);padding:6px 2px;border-radius:0}
.search input::placeholder{color:var(--ink-3);font-style:italic}
.search input:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.more-row{margin:22px 0 0}
ol.events .ev-find{margin-top:4px;font-size:.95rem}
ol.events .ev-find button{min-height:0;padding:2px 0}

/* Immersive viewer. */
dialog#viewer{padding:0;border:0;margin:0;width:100vw;height:100vh;max-width:none;max-height:none;background:#000;color:var(--ink)}
dialog#viewer::backdrop{background:#000}
.vsurface{position:absolute;inset:0;overflow:hidden;touch-action:none;cursor:grab}
.vsurface.dragging{cursor:grabbing}
.vsurface img{position:absolute;left:0;top:0;transform-origin:0 0;user-select:none;-webkit-user-drag:none;max-width:none}
.vbar{position:absolute;left:0;right:0;display:flex;align-items:center;gap:8px;padding:10px 16px;pointer-events:none}
.vbar > *{pointer-events:auto}
.vbar.top{top:0;justify-content:space-between;align-items:flex-start;background:linear-gradient(rgba(0,0,0,.7),transparent)}
.vbar.bottom{bottom:0;justify-content:space-between;flex-wrap:wrap;background:linear-gradient(transparent,rgba(0,0,0,.75));padding-bottom:calc(10px + env(safe-area-inset-bottom))}
.vbar button{color:#fff;text-decoration-color:rgba(255,255,255,.35);text-shadow:0 0 4px #000}
.vbar #vZoomOut,.vbar #vZoomIn{font:400 1.2rem var(--mono);text-decoration:none;min-width:28px;justify-content:center}
.vcredit{font:400 .74rem/1.5 var(--mono);color:#d5d0c4;max-width:70ch}
.vstatus{font:400 .72rem var(--mono);color:#a9a397}
.vgroup{display:flex;gap:0 18px;flex-wrap:wrap;align-items:center}
.vsurface img.flying{transition:transform .9s cubic-bezier(.3,.1,.2,1)}

/* Guided tour caption inside the immersive viewer: a plain caption block, not a card. */
.tour-card{position:absolute;left:16px;bottom:calc(64px + env(safe-area-inset-bottom));width:min(26rem,calc(100vw - 32px));padding:14px 18px 10px;background:rgba(13,12,11,.92)}
.tour-card .step{margin:0;font:400 .74rem/1 var(--mono);color:var(--red)}
.tour-card h3{margin:6px 0 6px;font:italic 400 1.4rem/1.2 var(--serif)}
.tour-card p{margin:0 0 8px;font-size:1rem;color:var(--ink)}
.tour-card .row{display:flex;gap:0 20px;flex-wrap:wrap}
.tour-card .end{margin-left:auto;color:var(--ink-2)}
@media (max-width:600px){.tour-card{bottom:calc(96px + env(safe-area-inset-bottom))}}

/* Editorial refinement layer: hierarchy, rhythm and quiet chrome. Loaded last. */

/* 1 · The photograph first */
.stage { height: clamp(360px, 84vh, 1100px); background: var(--plate); }
.stage img { transition: opacity .9s ease, filter 1.2s ease; }
.stage.loading img { opacity: 0; }
.stage .sharpening, .stage img.sharpening { filter: blur(6px); }
.spinner { font: 400 .72rem/1 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.dims { opacity: 0; transition: opacity .3s; }
.stage:hover .dims { opacity: .8; }
.credit { font: 400 .7rem/1.5 'IBM Plex Mono', monospace; color: var(--ink-3); letter-spacing: .02em; text-align: right; margin-top: .6rem; padding-inline: var(--gutter); }
.dateline { font: 400 .72rem/1 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 1rem; }

.titlebar { max-width: 46rem; margin: clamp(2rem, 5vw, 3.5rem) auto 0; text-align: center; padding-inline: var(--gutter); }
.titlebar h2 { font-weight: 300; letter-spacing: -.01em; line-height: 1.05; text-wrap: balance; margin: 0; }
.titlebar .cap { font-style: italic; font-size: 1.15rem; line-height: 1.55; color: var(--ink-2); max-width: var(--measure); margin: 1rem auto 0; text-wrap: pretty; }

.actions { display: flex; flex-direction: column; align-items: center; gap: .9rem; margin: 2rem auto 0; padding-inline: var(--gutter); border: 0; }
.act-primary, .act-secondary { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.6rem; }
.act-primary button { font-size: 1.05rem; }
.act-secondary { gap: .3rem 1.3rem; }
.act-secondary button, .act-secondary .btn { font: 400 .74rem/1.6 'IBM Plex Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); text-decoration-color: transparent; }
.act-secondary button:hover, .act-secondary .btn:hover { color: var(--ink); text-decoration-color: currentColor; }
.dl-note { text-align: center; }

/* 2 · Story versus reference */
.story-grid { row-gap: 3rem; }
.story-main p { font-size: 1.12rem; line-height: 1.72; max-width: var(--measure); hanging-punctuation: first; }
.notes { font-size: .9rem; line-height: 1.6; color: var(--ink-2); border-left: 1px solid var(--rule); padding-left: 1.5rem; }
.notes h3, .notes h4, .notes summary { font: 500 .68rem/1.4 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 2rem 0 .5rem; }
.notes > :first-child, .notes > :first-child h3 { margin-top: 0; }
@media (max-width: 860px) { .notes { border-left: 0; border-top: 1px solid var(--rule); padding: 2rem 0 0; } }

/* 3–4 · Type and rhythm */
body { text-rendering: optimizeLegibility; font-kerning: normal; }
section { padding-block: clamp(4rem, 9vw, 8rem); }
.section-head { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); align-items: end; }
.section-head h2 { font-weight: 300; letter-spacing: -.005em; }
.section-head p { color: var(--ink-2); max-width: var(--measure); }
p { text-wrap: pretty; }

/* 5 · Navigation */
.site-nav a { position: relative; color: var(--ink-2); text-decoration: none; transition: color .25s; }
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--ink); }
.site-nav a::after { content: ''; position: absolute; left: 50%; bottom: -.55rem; width: 4px; height: 4px; border-radius: 50%; background: var(--red); transform: translateX(-50%) scale(0); transition: transform .3s ease; }
.site-nav a[aria-current="true"]::after { transform: translateX(-50%) scale(1); }
@media (max-width: 640px) {
  .site-nav { width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, #000 85%, transparent); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { flex-wrap: nowrap; gap: 1.2rem; padding-bottom: .7rem; white-space: nowrap; font-size: .92rem; }
}

/* 6 · On this day as a history-book page */
.otd-date { font-weight: 300; font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1; margin: .2rem 0 0; letter-spacing: -.02em; }
.otd-nav { gap: .2rem .9rem; font-size: .9rem; }
.otd-nav button { color: var(--ink-2); }
.events { list-style: none; padding: 0; margin: 0; }
.events li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.2rem; padding: 1.2rem 0; border-top: 1px solid var(--rule); }
.events li:first-child { border-top: 0; padding-top: 0; }
.events .yr { font: 400 1.5rem/1.2 Spectral, serif; color: var(--red); font-variant-numeric: oldstyle-nums; text-align: right; }
.events li p { margin: 0 0 .4rem; max-width: var(--measure); }
.events .ev-src, .events .rel { font: .7rem/1.5 'IBM Plex Mono', monospace; color: var(--ink-3); }
.events .none { display: block; }
@media (max-width: 560px) { .events li { grid-template-columns: 1fr; gap: .2rem; } .events .yr { text-align: left; } }

/* 7 · Archive as contact sheet */
.search { gap: .6rem 1.2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.8rem; }
.search input, .search select { background: transparent; border: 0; border-bottom: 1px solid var(--rule); color: var(--ink); font: inherit; padding: .35rem 0; border-radius: 0; }
.search input:focus, .search select:focus { border-color: var(--ink-2); outline: none; }
.grid { gap: clamp(6px, 1vw, 12px) !important; }
.grid .tile, .grid > a, .grid > button { background: var(--plate); }
.grid img { transition: opacity .6s ease, transform .9s cubic-bezier(.2,.7,.2,1), filter .6s; filter: saturate(.92) brightness(.92); }
.grid img:not([src]), .grid img[data-loading] { opacity: 0; }
.grid > *:hover img { transform: scale(1.025); filter: none; }
.grid .sub, .grid figcaption, .grid .t { font-size: .78rem; color: var(--ink-3); }

/* 8 · Favorites empty state */
.empty-state { text-align: center; padding: clamp(2.5rem, 7vw, 5rem) var(--gutter); grid-column: 1 / -1; }
.empty-state .mark { font-size: 1.8rem; color: var(--ink-3); display: block; margin-bottom: .6rem; }
.empty-state h3 { font-weight: 300; font-size: 1.5rem; margin: 0 0 .5rem; }
.empty-state p { color: var(--ink-2); max-width: 28rem; margin: 0 auto; font-style: italic; }

/* 9 · Immersive view: chrome recedes */
.vbar { transition: opacity .7s ease, transform .7s ease; }
#viewer.idle .vbar { opacity: 0; pointer-events: none; }
#viewer.idle .vbar.top { transform: translateY(-6px); }
#viewer.idle .vbar.bottom { transform: translateY(6px); }
#viewer.idle { cursor: none; }

/* 10 · Hubble vs Webb, the signature comparison */
.cmp-handle { width: 1px !important; background: rgba(233,228,216,.85) !important; box-shadow: 0 0 12px rgba(0,0,0,.6); }
.cmp-handle::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 10px; height: 52px; background: var(--ink); box-shadow: 0 0 0 1px rgba(0,0,0,.55); transition: height .25s ease; }
.cmp-box:hover .cmp-handle::after, .cmp-box:active .cmp-handle::after { height: 72px; }
.cmp-tag { top: 14px; bottom: auto !important; font: 500 .68rem/1 'IBM Plex Mono', monospace !important; letter-spacing: .16em; text-transform: uppercase; background: rgba(13,12,11,.78); padding: .45rem .65rem !important; color: var(--ink) !important; text-shadow: none !important; }
.cmp-tag.left { left: 14px !important; } .cmp-tag.right { right: 14px !important; }
.cmp-hint { position: absolute; left: var(--split); bottom: 18px; transform: translateX(-50%); font: 400 .7rem/1 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: rgba(13,12,11,.78); padding: .45rem .7rem; pointer-events: none; white-space: nowrap; transition: opacity .6s ease .2s; }
.cmp-hint.gone { opacity: 0; }
.cmp-note details, #understandBody details { border-top: 1px solid var(--rule); }
.cmp-note summary, #understandBody summary { cursor: pointer; padding: .7rem 0; font: 400 .74rem/1.4 'IBM Plex Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); list-style: none; }
.cmp-note summary::before, #understandBody summary::before { content: '+'; display: inline-block; width: 1.2em; color: var(--red); transition: transform .3s; }
details[open] > summary::before { transform: rotate(45deg); }
.cmp-note summary:hover, #understandBody summary:hover { color: var(--ink); }
.cmp-note details { text-align: left; padding-bottom: .6rem; }
.cmp-note { max-width: var(--measure); margin: 1rem auto 0; text-align: center; font-style: italic; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
#otdEvents li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.2rem; }
#otdEvents .yr { font: 400 1.6rem/1.15 Spectral, serif; color: var(--red); font-variant-numeric: oldstyle-nums; text-align: right; letter-spacing: 0; }
@media (max-width: 560px) { #otdEvents li { grid-template-columns: 1fr; gap: .25rem; } #otdEvents .yr { text-align: left; font-size: 1.3rem; } }
#otdEvents .none { display: block; }
@media (max-width: 640px) { .stage { height: clamp(260px, 58vh, 620px); } #feature { padding-top: 1.5rem; } }

/* 12 · Understand the image: an inset in the story, not a help panel */
#understandPanel { max-width: 40rem; margin: 2.2rem auto 0; padding: 0 var(--gutter); animation: rise .5s ease both; }
#understandPanel h3 { font: 500 .7rem/1.4 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .8rem; }
#understandBody .lede { font-size: 1.15rem; line-height: 1.65; margin-bottom: 1.2rem; }
#understandBody details > :not(summary) { margin: 0 0 1rem 1.2em; color: var(--ink-2); }
#understandBody details[open] > :not(summary) { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

/* 11 · Guided tour: a caption the astronomer leaves beside the feature */
.tour-card { background: rgba(10,9,8,.86) !important; border-left: 2px solid var(--red); padding: 16px 20px 10px !important; }
.tour-card.turn > * { animation: rise .45s ease both; }
.tour-card h3 { font-weight: 300 !important; }
.tour-card p { line-height: 1.55; }
.tour-card .row button { font-size: .95rem; }

/* 13–14 · Evidence as museum placard */
.notes dt, .notes .label { font: 500 .66rem/1.4 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-top: 1.4rem; }
.notes dt:first-child { margin-top: 0; }
.notes dd { margin: .3rem 0 0; color: var(--ink-2); }
.notes a { color: var(--ink-2); text-decoration-color: var(--rule); }
.notes a:hover { color: var(--ink); text-decoration-color: var(--red); }
.credit a { color: var(--ink-2); text-decoration-color: var(--rule); }

/* 15 · Darkness with tonal separation: warm near-black, slightly lifted bands for reference sections */
:root { --paper: #0f0e0c; --band: #151412; }
body { background: var(--paper); }
#onthisday, #about { background: var(--band); }
#favorites { background: var(--paper); }
.stage { background: #050505; }

/* 18 · Components: one control height, one hover, one focus */
button, .btn { min-height: 44px; transition: color .2s ease, text-decoration-color .2s ease; }
button:hover, .btn:hover { text-decoration-color: var(--ink-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
select { min-height: 40px; }

/* 19 · Small, useful motion */
#favBtn[aria-pressed="true"] #favText { color: var(--red); }
#favBtn[aria-pressed="true"] { animation: settle .35s ease; }
@keyframes settle { 40% { transform: scale(1.04); } }
.grid > * { animation: rise .4s ease both; }
#viewer[open] { animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; } }

/* 20 · Phones */
@media (max-width: 640px) {
  .titlebar { text-align: left; margin-top: 1.6rem; }
  .titlebar .cap { margin-left: 0; font-size: 1.05rem; }
  .actions { align-items: flex-start; }
  .act-primary, .act-secondary { justify-content: flex-start; gap: 0 1.2rem; }
  .credit { text-align: left; }
  .cmp-tag { top: 8px; font-size: .6rem !important; }
  .tour-card { left: 0 !important; width: 100vw !important; border-left: 0; border-top: 2px solid var(--red); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Another photograph: a clear invitation at the top of the page */
.discover { margin: clamp(1rem, 2.5vw, 1.8rem) 0 0; padding: .9rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); align-items: center; gap: .4rem 2rem; }
.discover .row.pick { gap: .2rem 1.4rem; align-items: center; }
.discover #discoverHead { font: 500 .72rem/1 'IBM Plex Mono', monospace; font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-right: .4rem; }
.discover .pick button { font-size: 1.2rem; font-style: italic; text-decoration-color: var(--ink-3); }
.discover .pick button:hover { text-decoration-color: var(--red); }
.discover .pick button[data-random="surprise"] { font-style: normal; color: var(--ink); }
.discover .or { font-size: 1.05rem; }
.discover .back button { font-size: .95rem; color: var(--ink-2); }
.discover .back:has(button:not([hidden]):not([disabled])) { display: flex; }
@media (max-width: 640px) {
  .discover { padding: .7rem 0; }
  .discover .row.pick { gap: 0 1rem; }
  .discover #discoverHead { flex-basis: 100%; margin: 0 0 .1rem; }
  .discover .pick button { font-size: 1.08rem; }
}

/* Developing photograph: blurred thumbnail first, the real file fades in over it */
.frame .blur { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: blur(18px) saturate(1.15); transform: scale(1.03); opacity: 0; transition: opacity .5s ease; }
.frame.has-blur .blur { opacity: 1; }
.frame #photo { position: relative; transition: opacity .9s ease; }
.frame.developing #photo { opacity: 0; }
.stage.loading .frame { opacity: 1 !important; }
.stage.loading img { opacity: unset; }
.stage.loading .frame.has-blur ~ .spinner { display: none !important; }
.stage.sharpening .frame #photo { filter: none; }

/* Edge to edge on wide screens (the stage takes the photograph's own height) */
.stage.bleed { transition: height .5s ease; }

/* Immersive view: paging and a quiet page-turn */
.vpage { display: flex; gap: 1.4rem; }
.vpage button[disabled] { opacity: .35; }
.vsurface img { transition: opacity .35s ease; }
.vsurface.turning img { opacity: .25; }
@media (max-width: 640px) { .vpage { order: -1; width: 100%; justify-content: space-between; } }

/* Tour marker: shown only with ?tourcheck, to check stop positions */
.tour-mark { position: absolute; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 1px solid rgba(233,228,216,.9); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.45), inset 0 0 0 1px rgba(0,0,0,.35); pointer-events: none; animation: ring 1.6s ease-out .9s both; }
.tour-mark.moving { transition: transform .9s cubic-bezier(.3,.1,.2,1); }
@keyframes ring { from { opacity: 0; scale: 1.5; } to { opacity: 1; scale: 1; } }

/* On this day, under today's photograph */
.otd-teaser { max-width: 40rem; margin: 1.8rem auto 0; padding: 0 var(--gutter); text-align: center; color: var(--ink-2); font-size: 1rem; line-height: 1.6; }
.otd-teaser .k { display: block; font: 500 .68rem/1.4 'IBM Plex Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: .35rem; }
.otd-teaser a { color: var(--ink); white-space: nowrap; text-decoration-color: var(--rule); }
.otd-teaser a:hover { text-decoration-color: var(--red); }
@media (max-width: 640px) { .otd-teaser { text-align: left; } }
#feature { padding-top: clamp(.5rem, 2vw, 1.5rem); }
.discover .any { display: inline-flex; align-items: center; gap: .8rem; white-space: nowrap; }
.labels .tc { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 2px solid #ffd84a; border-radius: 50%; box-shadow: 0 0 0 1px #000; }
.labels .tc b, .labels .tc { font: 500 .7rem/1 'IBM Plex Mono', monospace; color: #ffd84a; text-shadow: 0 0 3px #000; white-space: nowrap; }
.labels .tc { text-indent: 46px; line-height: 36px; }

/* ── On this day / About: tidy bands ───────────────────────────── */
/* The tinted band reaches the screen edges while the content keeps the page's gutter. */
#onthisday, #about { box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); }
section { padding-block: clamp(3rem, 6vw, 5.5rem); }
section > .section-head { margin-top: 0; }
#onthisday .section-head, #about .section-head { border-top: 0; padding-top: 0; }

/* Header: small kicker, big date, one line of context, then the controls */
#onthisday .section-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1rem 2rem; margin-bottom: clamp(1.8rem, 3.5vw, 2.8rem); }
#otdHead { font: 500 .72rem/1 'IBM Plex Mono', monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
#onthisday .otd-date { margin: .5rem 0 .4rem; font-style: italic; color: var(--ink); }
#onthisday .section-head p:not(.otd-date) { margin: 0; font-size: .98rem; }
#onthisday .otd-nav { align-items: center; justify-content: flex-end; gap: .2rem 1rem; }
#onthisday .otd-nav button { min-height: 40px; }
@media (max-width: 760px) {
  #onthisday .section-head { grid-template-columns: minmax(0, 1fr); }
  #onthisday .otd-nav { justify-content: flex-start; }
}

/* Two columns that never spill: events on the left, photographs on the right */
.otd-grid { gap: 2.4rem clamp(2rem, 5vw, 4.5rem); }
.otd-grid > * { min-width: 0; }
.otd-grid h3 { font: 500 .7rem/1.4 'IBM Plex Mono', monospace !important; font-style: normal !important; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem !important; padding-bottom: .6rem; border-bottom: 1px solid var(--rule); }
#otdEvents li { grid-template-columns: 4.2rem minmax(0, 1fr); gap: 0 1.1rem; padding: 0 0 1.4rem; margin: 0 0 1.4rem; border-bottom: 1px solid var(--rule); border-top: 0; }
#otdEvents li:last-child { border-bottom: 0; margin-bottom: 0; }
#otdEvents .yr { font-size: 1.35rem; text-align: left; }
#otdEvents li > div { min-width: 0; overflow-wrap: anywhere; }
#otdEvents li p { margin: 0 0 .45rem; }
#otdEvents .ev-photos, #otdEvents .ev-find { font-size: .95rem; line-height: 1.5; }
#otdEvents .ev-photos button, #otdEvents .ev-find button { display: inline; min-height: 0; padding: 0; text-align: left; }
#otdEvents .ev-photos { line-height: 1.9; }
#otdEvents .ev-photos .rel { font: .66rem/1.4 'IBM Plex Mono', monospace; font-style: normal; margin-left: .4rem; white-space: nowrap; }
#otdEvents .ev-photos::before { content: 'Related photographs'; display: block; font: 500 .64rem/1.4 'IBM Plex Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: .6rem; }
#otdEvents .ev-find .rel { display: block; font-style: normal; font: .68rem/1.5 'IBM Plex Mono', monospace; }
#otdEvents .ev-src a { overflow-wrap: anywhere; }
@media (max-width: 560px) { #otdEvents li { grid-template-columns: minmax(0, 1fr); } #otdEvents .yr { margin-bottom: .15rem; } }

#onthisday .grid.small { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
@media (max-width: 560px) { #onthisday .grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); } #onthisday .grid .sub { font-size: .62rem; } #onthisday .grid .t, #onthisday .grid h3, #onthisday .grid figcaption { font-size: .85rem; } }
#onthisday .otd-nav { padding-right: 2px; }
#onthisday .grid .sub { overflow-wrap: anywhere; }
.otd-near-head { margin-top: 2rem !important; }

/* On this day: a few constellations drawn faintly behind the heading, like an old star atlas */
#onthisday { position: relative; isolation: isolate; }
.otd-sky { position: absolute; inset: 0 calc(-1 * var(--gutter)) auto; height: min(640px, 100%); z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-mask: linear-gradient(#000 55%, transparent); mask: linear-gradient(#000 55%, transparent); }
.otd-sky svg { width: 100%; height: 100%; display: block; }
.otd-sky .cl line { stroke: var(--ink-3); stroke-width: 1; opacity: .45; stroke-dasharray: 400; stroke-dashoffset: 0; }
.otd-sky .cs circle { fill: var(--ink-2); opacity: .7; }
.otd-sky .cst-orion .cs circle:first-child, .otd-sky .cst-orion .cs circle:nth-child(7) { fill: var(--red); opacity: .8; }   /* Betelgeuse warm, Rigel bright */
.otd-sky .cst-orion .cs circle:nth-child(7) { fill: var(--ink); }
/* Drawn in once, line by line, the first time the section comes into view */
.otd-sky.draw .cl line { stroke-dashoffset: 400; animation: draw 2.4s cubic-bezier(.4,.1,.2,1) forwards; }
.otd-sky.draw .cs circle { opacity: 0; animation: starIn .8s ease forwards; }
.otd-sky.draw .cst-dipper line, .otd-sky.draw .cst-dipper circle { animation-delay: .5s; }
.otd-sky.draw .cst-cass line, .otd-sky.draw .cst-cass circle { animation-delay: 1s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes starIn { to { opacity: .7; } }
@media (max-width: 760px) { .otd-sky { inset: 0 calc(-1 * var(--gutter)) auto; opacity: .8; } .otd-sky svg { width: 360%; margin-left: -262%; } .otd-sky .cst-dipper, .otd-sky .cst-cass { display: none; } }
html, body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { .otd-sky.draw .cl line { stroke-dashoffset: 0; } .otd-sky.draw .cs circle { opacity: .7; } }

/* ── Less template, more book ────────────────────────────────────
   Small labels were tracked-out monospace capitals everywhere, which reads as a UI kit.
   They now use the text face in small capitals, like running heads in a printed almanac.
   Monospace stays only where it means something: credits, dimensions and catalog data. */
.dateline, #otdHead, .otd-grid h3, .notes dt, .notes h3, .notes h4, #understandPanel h3,
.discover #discoverHead, .otd-teaser .k, .act-secondary button, .act-secondary .btn,
#otdEvents .ev-photos::before, .cmp-note summary, #understandBody summary, .scale .label {
  font-family: Spectral, Georgia, serif !important; font-variant: all-small-caps; text-transform: none !important;
  letter-spacing: .05em !important; font-size: 1rem !important; font-weight: 400 !important; line-height: 1.4 !important;
}
.dateline { font-size: .95rem !important; }
.dateline .when { font-style: italic; font-variant: normal; letter-spacing: 0; }
#otdHead, .discover #discoverHead, .otd-teaser .k { color: var(--red); font-size: 1.05rem !important; }
.act-secondary button, .act-secondary .btn { color: var(--ink-2); font-size: 1.02rem !important; }
.otd-grid h3 { color: var(--ink-2); }
.notes dt { color: var(--ink-3); font-size: .98rem !important; }
#otdEvents .ev-photos::before { content: 'Photographs'; color: var(--ink-3); }
#otdEvents .rel, #otdEvents .ev-find .rel { font: italic .9rem/1.4 Spectral, serif !important; color: var(--ink-3); }
.cmp-hint, .cmp-tag { font-family: Spectral, serif !important; text-transform: none !important; letter-spacing: .02em !important; font-size: .9rem !important; font-style: italic; }
.count { font: italic .9rem Spectral, serif; color: var(--ink-3); }
.empty-state { padding: 2rem 0; text-align: left; font-style: italic; color: var(--ink-2); max-width: 34rem; }
#understandBody summary::before, .cmp-note summary::before { content: '›'; transform: none; }
#understandBody details[open] > summary::before, .cmp-note details[open] > summary::before { transform: rotate(90deg); }
.discover .back button[disabled] { opacity: .35; cursor: default; text-decoration-color: transparent; }

/* Page changes: the old page dims into a soft blur while the new one rises out of it,
   and a brief drift of stars crosses the sky. */
main#main { view-transition-name: page; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(page) { animation: page-out .42s cubic-bezier(.4,0,.2,1) both; }
::view-transition-new(page) { animation: page-in .62s cubic-bezier(.16,1,.3,1) .08s both; }
.page-in { animation: page-in .62s cubic-bezier(.16,1,.3,1) both; }
@keyframes page-out { to { opacity: 0; filter: blur(6px) brightness(.7); transform: scale(.992); } }
@keyframes page-in  { from { opacity: 0; filter: blur(8px); transform: translateY(14px) scale(1.006); } }
.warp { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden;
  background: radial-gradient(60% 50% at 50% 45%, rgba(150,170,255,.07), transparent 70%);
  animation: warp-glow 1s ease-out both; }
.warp i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #f3efe4;
  box-shadow: 0 0 6px rgba(200,215,255,.8); opacity: 0; animation: warp-star .9s cubic-bezier(.2,.7,.3,1) both; }
@keyframes warp-glow { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes warp-star { 0% { opacity: 0; transform: translateX(0) scale(.4); }
  30% { opacity: .9; } 100% { opacity: 0; transform: translateX(var(--d)) scale(1); } }
@media (prefers-reduced-motion: reduce) { .warp, .page-in { animation: none; } }

/* On this day tiles: room around the caption */
#onthisday .grid.small .tile .meta { padding: .75rem .85rem .95rem; gap: .35rem; }
#onthisday .grid.small .tile .meta strong { line-height: 1.35; }
@media (max-width: 560px) { #onthisday .grid.small .tile .meta { padding: .6rem .65rem .8rem; } }

/* Sky chart: where the object is, drawn for the visitor's hemisphere */
.skymap { margin: 0 0 1.8rem; }
.sky-head { font: 500 .66rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .6rem; }
#skyCon { all: unset; cursor: pointer; color: var(--ink); border-bottom: 1px solid var(--red); letter-spacing: .14em; }
#skyCon:hover { color: var(--red); }
#skyCon:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sky-chart { background: radial-gradient(120% 90% at 50% 40%, #11285a, #0a1a3f 55%, #050e26); border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.sky-chart svg { display: block; width: 100%; height: auto; }
.sk-nb { fill: none; stroke: rgba(160,170,200,.16); stroke-width: .7; }
.sk-bound { fill: rgba(140,160,220,.04); stroke: rgba(160,175,220,.32); stroke-width: .7; stroke-dasharray: 2 3; }
.sk-line { fill: none; stroke: rgba(205,215,240,.62); stroke-width: 1; stroke-linejoin: round; }
.sk-star { fill: #eef0f6; }
.sk-mark circle { fill: none; stroke: var(--red); stroke-width: 1.4; }
.sk-mark .sk-dot { fill: var(--red); stroke: none; }
.sk-mark .sk-pulse { animation: sk-pulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sk-pulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
.sk-compass text { font: 500 9px var(--mono); fill: rgba(200,205,220,.45); text-anchor: middle; }
.sky-when { margin: .7rem 0 .3rem; font-size: .88rem; line-height: 1.55; color: var(--ink-2); }
.sky-view { margin: 0; font: .7rem/1.5 var(--mono); color: var(--ink-3); }
#skyFlip { all: unset; cursor: pointer; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
#skyFlip:hover { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .sk-mark .sk-pulse { animation: none; opacity: 0; } }

/* Constellation chips above the archive grid */
.con-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .5rem; margin: 0 0 1.6rem; }
.chips-label { font: 500 .66rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-right: .4rem; }
.con-chips button { text-decoration: none; font: .82rem/1 var(--serif); color: var(--ink-2); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: .42rem .75rem; cursor: pointer; transition: border-color .2s, color .2s; }
.con-chips button span { font: .68rem var(--mono); color: var(--ink-3); margin-left: .25rem; }
.con-chips button:hover, .con-chips button[aria-pressed="true"] { color: var(--ink); border-color: var(--red); }

/* Wow button */
.wow { display: inline-flex; align-items: center; gap: .35rem; }
.wow .wow-star { color: var(--ink-3); transition: color .2s, transform .3s; display: inline-block; }
.wow[aria-pressed="true"] .wow-star { color: var(--focus); }
.wow .wow-n { font: .72rem var(--mono); color: var(--ink-3); }
.wow.pop .wow-star { animation: wow-pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes wow-pop { 0% { transform: scale(1) rotate(0); } 40% { transform: scale(1.9) rotate(72deg); } 100% { transform: scale(1) rotate(144deg); } }
@media (prefers-reduced-motion: reduce) { .wow.pop .wow-star { animation: none; } }

/* Most loved this week: same tiles as On this day */
#loved .grid.small { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
#loved .grid.small .tile .meta { padding: .75rem .85rem .95rem; gap: .35rem; }
@media (max-width: 560px) { #loved .grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); } #loved .grid.small .tile .meta { padding: .6rem .65rem .8rem; } }

/* The four ways into a photograph read a step stronger than the utility row below them */
.act-primary button { font-weight: 500; color: var(--ink); letter-spacing: .01em;
  text-decoration: underline; text-decoration-color: rgba(143,179,230,.6); text-decoration-thickness: 1px; text-underline-offset: .35em; }
.act-primary button:hover, .act-primary button[aria-pressed="true"] { text-decoration-color: #a9c6f0; }

/* Wow / Save / Copy link / Download / Source: quiet outlined pills, so they read as buttons */
.act-secondary { gap: .55rem .6rem !important; }
.act-secondary button, .act-secondary .btn {
  color: var(--ink) !important; font-weight: 500 !important; text-decoration: none !important;
  border: 1px solid rgba(233,228,216,.24); border-radius: 999px; padding: .38rem .95rem .45rem !important;
  background: rgba(233,228,216,.03); transition: border-color .2s, background .2s, color .2s; }
.act-secondary button:hover, .act-secondary .btn:hover { border-color: rgba(169,198,240,.75); background: rgba(169,198,240,.07); }
.act-secondary button[aria-pressed="true"] { border-color: rgba(242,193,78,.6); background: rgba(242,193,78,.07); }
.act-secondary .wow .wow-star { color: var(--focus); }
.act-secondary .wow .wow-n { color: var(--ink-2); }

/* Night sky page */
#sky .section-head p { max-width: 40rem; }
.ns-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.4rem; margin: 0 0 1rem; }
.ns-hemi, .ns-zoom { display: flex; gap: .4rem; }
.ns-hemi button, .ns-zoom button { font: 500 .95rem/1 var(--serif); color: var(--ink-2); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: .5rem .95rem; cursor: pointer; }
.ns-zoom button { min-width: 2.4rem; }
.ns-hemi button[aria-pressed="true"] { color: var(--ink); border-color: rgba(169,198,240,.75); background: rgba(169,198,240,.08); }
.ns-hemi button:hover, .ns-zoom button:hover { color: var(--ink); border-color: var(--ink-3); }
.ns-legend { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .9rem; color: var(--ink-2); }
.ns-legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; vertical-align: .05em; }
.ns-legend b { font: .75rem var(--mono); color: var(--ink-3); margin-left: .2rem; }
.ns-wrap { position: relative; width: 100%; max-width: 940px; margin: 0 auto; }
.ns-chart { touch-action: none; cursor: grab; user-select: none; }
.ns-chart:active { cursor: grabbing; }
.ns-chart svg { display: block; width: 100%; height: auto; overflow: hidden; --z: 1; }
.ns-wrap { overflow: hidden; }
.ns-disc { fill: url(#nsSkyFill); stroke: rgba(169,198,240,.3); }
.ns-grid { fill: none; stroke: rgba(169,198,240,.09); stroke-width: calc(var(--z) * 1px); }
.ns-eq { stroke: rgba(169,198,240,.28); stroke-dasharray: calc(var(--z) * 4px) calc(var(--z) * 5px); }
.ns-bound { fill: none; stroke: rgba(160,175,220,.13); stroke-width: calc(var(--z) * .8px); }
.ns-line { fill: none; stroke: rgba(205,215,240,.42); stroke-width: calc(var(--z) * 1.1px); stroke-linejoin: round; }
.ns-star { fill: #eef0f6; }
.ns-con { font: italic calc(var(--z) * 13px) var(--serif); fill: rgba(200,210,235,.5); text-anchor: middle; cursor: pointer; letter-spacing: .02em; }
.ns-con:hover, .ns-con:focus { fill: var(--ink); outline: none; }
.ns-hour { font: 12px var(--mono); fill: var(--ink-3); text-anchor: middle; }
.ns-pole { font: italic calc(var(--z) * 11px) var(--serif); fill: rgba(200,210,235,.35); text-anchor: middle; }
.ns-dot { cursor: pointer; opacity: .92; transition: opacity .2s, filter .2s; }
.ns-dot use { pointer-events: all; }
.ns-dot:hover, .ns-dot:focus, .ns-dot.on { opacity: 1; outline: none; filter: brightness(1.35); }
.ns-dot.on use { stroke-width: .42; }
.ns-tip { position: absolute; z-index: 5; width: min(260px, 80%); padding: .7rem .85rem .8rem; background: rgba(13,12,11,.96); border: 1px solid rgba(169,198,240,.35); border-radius: 3px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.ns-tip strong { display: block; font: 400 1rem/1.3 var(--serif); color: var(--ink); margin: .2rem 0 .5rem; }
.ns-tip-cat { font: .68rem var(--mono); letter-spacing: .06em; color: var(--ink-3); }
#nsOpen { all: unset; cursor: pointer; font: 500 .9rem var(--serif); color: #a9c6f0; }
#nsOpen:hover { text-decoration: underline; }
.ns-foot { margin: 1rem auto 0; max-width: 940px; font-size: .85rem; color: var(--ink-3); }

/* Night sky: exploring a constellation */
.ns-area { fill: rgba(169,198,240,0); stroke: rgba(160,175,220,.13); stroke-width: calc(var(--z) * .8px); cursor: pointer; transition: fill .25s; }
.ns-area:hover { fill: rgba(169,198,240,.05); }
.ns-area.focus { fill: rgba(169,198,240,.09); stroke: rgba(169,198,240,.7); stroke-width: calc(var(--z) * 1.4px); stroke-dasharray: calc(var(--z) * 4px) calc(var(--z) * 4px); }
.ns-line { cursor: pointer; }
.focusing .ns-line:not(.focus) { stroke: rgba(205,215,240,.2); }
.ns-line.focus { stroke: rgba(225,232,250,.95); stroke-width: calc(var(--z) * 1.8px); }
.ns-con.focus { fill: var(--ink); font-weight: 500; }
.focusing .ns-dot { opacity: .6; }
.focusing .ns-dot:hover, .focusing .ns-dot.on { opacity: 1; }
.ns-layout { display: grid; gap: 1.6rem; }
#sky.has-panel .ns-layout { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); align-items: start; }
#sky.has-panel .ns-wrap { max-width: none; margin: 0; }
.ns-panel { border-left: 1px solid var(--rule); padding-left: 1.4rem; animation: ns-rise .5s ease both; }
@keyframes ns-rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .ns-panel { animation: none; } }
.ns-p-k { font: 500 .66rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.ns-panel h3 { font: 400 1.9rem/1.15 var(--serif); margin: .2rem 0 .3rem; }
.ns-p-n { color: var(--ink-2); font-style: italic; margin: 0 0 1rem; }
.ns-panel .grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.ns-panel .tile .meta { padding: .5rem .6rem .65rem; }
.ns-panel .tile .meta strong { font-size: .88rem; line-height: 1.3; }
.ns-p-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: 1rem 0 0; }
.ns-p-actions button { all: unset; cursor: pointer; font: 500 .95rem var(--serif); color: #a9c6f0; }
.ns-p-actions button:hover { text-decoration: underline; }
@media (max-width: 860px) {
  #sky.has-panel .ns-layout { grid-template-columns: 1fr; }
  .ns-panel { border-left: 0; border-top: 1px solid var(--rule); padding: 1.2rem 0 0; }
}

/* Night sky category filter (the legend) */
.ns-legend { align-items: center; gap: .4rem; }
.ns-show { font: 500 .66rem/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-right: .3rem; }
.ns-legend button { font: 400 .92rem/1 var(--serif); color: var(--ink-3); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: .42rem .8rem; cursor: pointer; transition: color .2s, border-color .2s, background .2s, opacity .2s; }
.ns-legend button[aria-pressed="true"] { color: var(--ink); border-color: rgba(169,198,240,.45); background: rgba(169,198,240,.06); }
.ns-legend button[aria-pressed="false"] i { opacity: .3; }
.ns-legend button:hover { border-color: rgba(169,198,240,.75); }
.hide-galaxy .ns-dot[data-cat="galaxy"], .hide-nebula .ns-dot[data-cat="nebula"], .hide-star .ns-dot[data-cat="star"] { display: none; }

/* Night sky: layer toggles and source menu, so busy areas can be thinned out */
.ns-bar2 { margin-top: -.3rem; }
.ns-layers { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.ns-layers button { font: 400 .88rem/1 var(--serif); color: var(--ink-3); background: none; border: 1px solid var(--rule); border-radius: 999px; padding: .38rem .72rem; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.ns-layers button[aria-pressed="true"] { color: var(--ink); border-color: rgba(169,198,240,.45); background: rgba(169,198,240,.06); }
.ns-layers button:hover { border-color: rgba(169,198,240,.75); }
.ns-org select { min-width: 12rem; }
.no-names .ns-con:not(.focus) { display: none; }
.no-lines .ns-line:not(.focus) { display: none; }
.no-bounds .ns-area:not(.focus) { stroke: transparent; }
.no-faint .ns-star.faint { display: none; }
.no-grid .ns-grid { display: none; }
.ns-dot.off { display: none; }
.ns-legend button, .ns-layers button, .ns-hemi button, .ns-zoom button { text-decoration: none !important; }
.ns-legend button b { text-decoration: none; }

/* ===== Night sky controls, v2: one labeled toolbar, map-style zoom on the chart ===== */
.ns-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.1rem 2.2rem; padding: 1rem 1.2rem 1.1rem; margin: 0 0 .7rem;
  background: rgba(169,198,240,.035); border: 1px solid var(--rule); border-radius: 8px; }
.ns-group { display: flex; flex-direction: column; gap: .45rem; }
.ns-label { font: 500 .64rem/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

.ns-seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--rule); border-radius: 999px; }
.ns-seg button { font: 500 .95rem/1 var(--serif); color: var(--ink-2); background: none; border: 0; border-radius: 999px; padding: .5rem 1rem; cursor: pointer; transition: background .2s, color .2s; }
.ns-seg button:hover { color: var(--ink); }
.ns-seg button[aria-pressed="true"] { color: var(--ink); background: rgba(169,198,240,.18); border: 0; }

#sky .ns-legend { display: flex; flex-wrap: wrap; gap: .4rem; }
#sky .ns-legend button { display: inline-flex; align-items: center; gap: .5rem; font: 500 .95rem/1 var(--serif); color: var(--ink-3); background: none;
  border: 1px solid var(--rule); border-radius: 999px; padding: .45rem .85rem .45rem .55rem; cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
#sky .ns-legend button[aria-pressed="true"] { color: var(--ink); border-color: rgba(169,198,240,.35); background: rgba(169,198,240,.06); }
#sky .ns-legend button:hover { border-color: rgba(169,198,240,.7); }
#sky .ns-legend b { font: 400 .72rem var(--mono); color: var(--ink-3); margin-left: .1rem; }
.ns-check { position: relative; width: 1rem; height: 1rem; border-radius: 50%; border: 1.5px solid var(--c); flex: none; transition: background .2s; }
[aria-pressed="true"] > .ns-check { background: var(--c); }
[aria-pressed="true"] > .ns-check::after { content: ''; position: absolute; left: 31%; top: 14%; width: 26%; height: 50%; border: solid #0a1a3f; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.ns-select { font: 500 .95rem/1 var(--serif); color: var(--ink); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: .5rem 2rem .5rem .9rem;
  appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) 55%, calc(100% - .75rem) 55%; background-size: .3rem .3rem; background-repeat: no-repeat; }
.ns-select:hover { border-color: rgba(169,198,240,.7); }
.ns-select option { background: #0d0c0b; }

.ns-more { margin-left: auto; align-self: flex-end; }
.ns-more summary { list-style: none; font: 500 .95rem/1 var(--serif); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: .5rem .95rem; cursor: pointer; }
.ns-more summary::-webkit-details-marker { display: none; }
.ns-more summary::after { content: ' ▾'; color: var(--ink-3); }
.ns-more[open] summary::after { content: ' ▴'; }
.ns-more summary:hover { color: var(--ink); border-color: rgba(169,198,240,.7); }
.ns-more[open] { flex-basis: 100%; margin-left: 0; }
.ns-more[open] summary { display: inline-block; margin-bottom: .7rem; }
#sky .ns-layers button { font: 400 .9rem/1 var(--serif); padding: .42rem .8rem; }

.ns-status { margin: 0 0 1rem; font-size: .92rem; color: var(--ink-2); font-style: italic; }
.ns-status b { font-style: normal; font-weight: 500; color: var(--ink); }
#nsClear { all: unset; cursor: pointer; font-style: normal; color: #a9c6f0; margin-left: .3rem; }
#nsClear:hover { text-decoration: underline; }

/* zoom buttons sit on the chart, like a map */
#sky .ns-zoom { position: absolute; top: .8rem; right: .8rem; z-index: 3; display: flex; flex-direction: column; gap: 0; border: 1px solid rgba(169,198,240,.3); border-radius: 10px; overflow: hidden; background: rgba(5,14,38,.75); backdrop-filter: blur(6px); }
#sky .ns-zoom button { width: 2.5rem; height: 2.5rem; min-width: 0; padding: 0; border: 0; border-radius: 0; font: 400 1.25rem/1 var(--serif); color: var(--ink); background: none; }
#sky .ns-zoom button + button { border-top: 1px solid rgba(169,198,240,.2); }
#sky .ns-zoom button:hover { background: rgba(169,198,240,.15); }
.ns-hint { position: absolute; left: 50%; bottom: .8rem; transform: translateX(-50%); z-index: 2; margin: 0; padding: .4rem .85rem; white-space: nowrap;
  font: .72rem var(--mono); color: var(--ink-2); background: rgba(5,14,38,.75); border: 1px solid rgba(169,198,240,.2); border-radius: 999px; pointer-events: none; transition: opacity .6s; }
.ns-hint.gone { opacity: 0; }
.ns-hint .coarse { display: none; }
@media (pointer: coarse) { .ns-hint .fine { display: none; } .ns-hint .coarse { display: inline; } }

@media (max-width: 700px) {
  .ns-controls { gap: .9rem 1.2rem; padding: .9rem; }
  .ns-more { margin-left: 0; }
  .ns-hint { font-size: .64rem; }
}
#sky .ns-zoom button { display: flex; align-items: center; justify-content: center; }
.ns-chart { cursor: default; }
.ns-chart.pannable { cursor: grab; }
.ns-chart.pannable:active { cursor: grabbing; }
.ns-chart:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }

/* Tonight's sky: time slider */
.ns-timerow { flex: 1 1 30rem; }
.ns-time { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.ns-tick { font: .72rem var(--mono); color: var(--ink-3); }
#nsTime { flex: 1 1 14rem; max-width: 26rem; accent-color: #a9c6f0; cursor: pointer; }
#nsTimeLabel { font: 500 1rem var(--serif); color: var(--ink); min-width: 6.5rem; }
#nsNow { all: unset; cursor: pointer; font: 500 .92rem var(--serif); color: #a9c6f0; }
#nsNow:hover { text-decoration: underline; }
.ns-cardinal { fill: var(--ink-2); font-weight: 500; font-size: 15px; }
.ns-hint { white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 1.6rem); }
.ns-seg button { white-space: nowrap; }
.ns-time { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .4rem .7rem; max-width: 34rem; }
#nsTime { width: 100%; max-width: none; }
#nsTimeLabel, #nsNow { grid-column: 1 / -1; }
#nsTimeLabel { min-width: 0; }
.ns-time #nsNow { justify-self: start; }
@media (min-width: 700px) {
  .ns-time { grid-template-columns: auto minmax(10rem, 1fr) auto auto auto; max-width: none; }
  #nsTimeLabel, #nsNow { grid-column: auto; }
}
@media (max-width: 360px) { .ns-seg button { padding: .5rem .7rem; } }

/* legend: the same symbols as on the chart */
.ns-sym { width: 1.05rem; height: 1.05rem; flex: none; overflow: visible; }
#sky .ns-legend button[aria-pressed="false"] .ns-sym { opacity: .35; }

/* Tonight's sky: quick-look popup */
.nsp { padding: 0; border: 0; background: none; color: var(--ink); max-width: min(560px, calc(100vw - 32px)); width: 100%; max-height: calc(100dvh - 32px); }
.nsp::backdrop { background: rgba(3,8,22,.72); backdrop-filter: blur(3px); }
.nsp[open] { animation: nsp-in .28s cubic-bezier(.2,.8,.2,1); }
@keyframes nsp-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.nsp-card { position: relative; background: var(--paper); border: 1px solid rgba(169,198,240,.28); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.nsp-img { background: #000; flex: none; display: flex; align-items: center; justify-content: center; max-height: 52dvh; overflow: hidden; }
.nsp-img img { display: block; width: 100%; height: auto; max-height: 52dvh; object-fit: contain; filter: blur(6px); transition: filter .4s; }
.nsp-img img.loaded { filter: none; }
.nsp-body { padding: 1.1rem 1.3rem 1.3rem; overflow-y: auto; }
.nsp-kicker { margin: 0 0 .35rem; font: 500 .66rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.nsp h3 { margin: 0 0 .55rem; font: 400 1.45rem/1.2 var(--serif); overflow-wrap: anywhere; }
.nsp-text { margin: 0 0 .7rem; color: var(--ink-2); line-height: 1.55; }
.nsp-credit { margin: 0 0 1rem; font: .72rem/1.5 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.nsp-full { font: 500 1rem/1 var(--serif); color: var(--ink); background: rgba(169,198,240,.1); border: 1px solid rgba(169,198,240,.55); border-radius: 999px; padding: .65rem 1.2rem; cursor: pointer; text-decoration: none; }
.nsp-full:hover { background: rgba(169,198,240,.2); }
.nsp-close { position: absolute; top: .55rem; right: .55rem; z-index: 2; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(5,14,38,.7); color: var(--ink); font: 300 1.4rem/1 var(--serif); cursor: pointer; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.nsp-close:hover { background: rgba(5,14,38,.95); }
@media (prefers-reduced-motion: reduce) { .nsp[open] { animation: none; } .nsp-img img { transition: none; } }
.nsp-card:focus { outline: none; }

/* popup close: a round button with a soft glow instead of a hard outline */
.nsp-close { width: 2.4rem; height: 2.4rem; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(20,34,70,.92), rgba(5,14,38,.88));
  box-shadow: 0 0 0 1px rgba(169,198,240,.10), 0 0 10px 1px rgba(169,198,240,.28), inset 0 0 6px rgba(169,198,240,.15);
  transition: box-shadow .25s, background .25s; }
.nsp-close svg { width: .8rem; height: .8rem; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.nsp-close:hover, .nsp-close:focus-visible { outline: none; background: radial-gradient(circle at 50% 45%, rgba(30,50,98,.95), rgba(8,20,50,.92));
  box-shadow: 0 0 0 1px rgba(169,198,240,.18), 0 0 16px 3px rgba(169,198,240,.42), inset 0 0 8px rgba(169,198,240,.2); }
#nsPreview .nsp-close { width: 2.4rem !important; height: 2.4rem !important; min-width: 0; min-height: 0; flex: none; line-height: 0; box-sizing: border-box; }

/* Tonight's sky: a bigger chart, sitting right under the controls */
.ns-status { margin-bottom: .35rem; }
.ns-wrap { max-width: min(100%, 1100px); }
#sky.has-panel .ns-wrap { max-width: none; }
#sky .ns-zoom { top: .4rem; right: .4rem; }

/* Tonight's sky: sunset glow on the horizon */
.ns-dusk { pointer-events: none; }
.ns-dusk-halo { fill: none; stroke: rgba(255,168,118,.18); stroke-width: 12; pointer-events: none; }
.ns-chart svg.mode-T .ns-disc { stroke: rgba(255,190,150,.21); }

/* Section intros run the full width of the section instead of wrapping at a reading measure */
.section-head > div { flex: 1 1 100%; min-width: 0; }
.section-head p, #sky .section-head p { max-width: none; }

/* ===== Touch screens: every control gets at least a 44 px target ===== */
@media (pointer: coarse), (max-width: 700px) {
  .site-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .15rem; }
  .site-nav ul { row-gap: 0; }
  [data-random] { min-width: 44px; justify-content: center; }
  details.panel > summary, .notes summary, #understandBody summary, .cmp-note summary { min-height: 44px; display: flex; align-items: center; }
  #skyCon, #skyFlip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .1rem; }
  #otdPrev, #otdNext { min-width: 44px; justify-content: center; }
  #otdToday { min-width: 44px; }
  #archiveQ { min-height: 44px; }
  .vbar button, #vZoomOut, #vZoomIn, #vReset, #vClose { min-width: 44px; justify-content: center; }
  .ns-more summary { min-height: 44px; display: inline-flex; align-items: center; }
  #sky .ns-layers button, #sky .ns-legend button, .ns-seg button, .ns-select { min-height: 44px; }
  .con-chips button { min-height: 40px; padding: .55rem .85rem; }
  #nsClear, #nsNow, .ns-p-actions button, #nsOpen { display: inline-flex; align-items: center; min-height: 44px; }
  /* the time slider: a bigger thumb and track that are easy to grab */
  #nsTime { height: 44px; -webkit-appearance: none; appearance: none; background: transparent; }
  #nsTime::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: rgba(169,198,240,.25); }
  #nsTime::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(169,198,240,.25); }
  #nsTime::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #a9c6f0; border: 3px solid #0a1a3f; box-shadow: 0 0 0 1px rgba(169,198,240,.6); }
  #nsTime::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #a9c6f0; border: 3px solid #0a1a3f; }
  /* zoom buttons on the chart: a little larger for thumbs */
  #sky .ns-zoom button { width: 2.9rem; height: 2.9rem; }
  /* popup close sits clear of the edge */
  #nsPreview .nsp-close { width: 2.75rem !important; height: 2.75rem !important; }
}
@media (pointer: coarse), (max-width: 700px) { #viewer #vZoomOut, #viewer #vZoomIn, #viewer #vReset { min-width: 44px !important; } }

/* Phones: the menu is one swipeable row instead of two wrapped rows */
@media (max-width: 700px) {
  nav.site-nav { width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  nav.site-nav.more { mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
  nav.site-nav::-webkit-scrollbar { display: none; }
  nav.site-nav ul { flex-wrap: nowrap; gap: 1.2rem; padding-right: .75rem; }
  nav.site-nav li { flex: none; }
  .site-nav a { white-space: nowrap; }
  .site-nav a::after { bottom: .3rem; }
}
@media (max-width: 700px) { nav.site-nav:not(.more) { -webkit-mask: none; mask: none; } }
@media (max-width: 700px) {
  nav.site-nav.less { -webkit-mask: linear-gradient(90deg, transparent, #000 15%); mask: linear-gradient(90deg, transparent, #000 15%); }
  nav.site-nav.less.more { -webkit-mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
}

/* Archive and favorites tiles: captions centered, with room from the edges */
#archiveGrid .tile .meta, #favGrid .tile .meta { text-align: center; align-items: center; padding: .8rem 1rem 1rem; gap: .35rem; }
#archiveGrid .tile .meta strong, #favGrid .tile .meta strong { line-height: 1.35; }
@media (max-width: 560px) { #archiveGrid .tile .meta, #favGrid .tile .meta { padding: .65rem .7rem .85rem; } }

/* daytime "right now": the slider rests, faded, until someone picks a time tonight */
.ns-timerow.daylight #nsTime { opacity: .4; }

/* Daily email sign-up, above the footer on every page */
.signup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: 1rem 2.5rem; align-items: end;
  margin: clamp(3rem, 7vw, 5rem) 0 0; padding: clamp(1.4rem, 3vw, 2rem); border: 1px solid var(--rule); border-radius: 8px; background: rgba(169,198,240,.035); }
.signup h2 { margin: 0 0 .3rem; font: 300 clamp(1.5rem, 2.6vw, 2rem)/1.15 var(--serif); }
.signup p { margin: 0; color: var(--ink-2); font-style: italic; }
.signup-form { display: flex; gap: .5rem; }
.signup-form input[type=email] { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 1rem; font: 1rem var(--serif); color: var(--ink);
  background: rgba(0,0,0,.25); border: 1px solid var(--rule); border-radius: 999px; }
.signup-form input[type=email]:focus { outline: none; border-color: rgba(169,198,240,.7); box-shadow: 0 0 0 3px rgba(169,198,240,.12); }
.signup-form button { flex: none; min-height: 44px; padding: 0 1.2rem; justify-content: center; text-decoration: none; font-weight: 500;
  border: 1px solid rgba(169,198,240,.55); border-radius: 999px; background: rgba(169,198,240,.1); }
.signup-form button:hover { background: rgba(169,198,240,.2); }
.signup-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup-msg { grid-column: 1 / -1; min-height: 1.2em; font-style: normal !important; font-size: .92rem; }
.signup-msg:empty { display: none; }
.signup-msg[data-kind="ok"] { color: #a9c6f0 !important; }
.signup-msg[data-kind="err"] { color: #ec8b6d !important; }
@media (max-width: 700px) { .signup { grid-template-columns: 1fr; } }
.toast { position: fixed; left: 50%; bottom: 1.2rem; z-index: 90; transform: translate(-50%, 20px); opacity: 0; transition: opacity .3s, transform .3s;
  max-width: calc(100vw - 32px); padding: .8rem 1.2rem; border-radius: 999px; background: rgba(13,12,11,.96); border: 1px solid rgba(169,198,240,.4);
  color: var(--ink); font: 1rem/1.4 var(--serif); box-shadow: 0 10px 30px rgba(0,0,0,.5); cursor: pointer; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Interaction motion (js/motion.js). Quiet, quick, and gone under prefers-reduced-motion. */

/* Iris reveal of a newly chosen photograph */
.stage.iris .frame { animation: iris 1.1s cubic-bezier(.22,.7,.2,1) both; }
@keyframes iris {
  from { clip-path: circle(0 at var(--ix) var(--iy)); filter: brightness(1.6); }
  60% { filter: brightness(1.08); }
  to { clip-path: circle(150% at var(--ix) var(--iy)); filter: none; }
}

/* Title and caption rise in after the photograph */
.rise-in { animation: riseIn .8s cubic-bezier(.2,.7,.2,1) .25s both; }
.rise-in-late { animation: riseIn .8s cubic-bezier(.2,.7,.2,1) .4s both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); letter-spacing: .01em; } }

/* Favorite burst */
#favBtn { position: relative; }
.burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--red);
  transform: rotate(var(--a)) translateY(0); animation: burst .8s cubic-bezier(.2,.7,.3,1) forwards; }
.burst i:nth-child(even) { background: var(--ink); width: 3px; height: 3px; }
@keyframes burst { 70% { opacity: 1; } to { transform: rotate(var(--a)) translateY(-34px); opacity: 0; } }

/* Copy link confirmation */
.pop { display: inline-block; animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: scale(.85); opacity: .4; } }

/* Gliding nav dot (replaces the per-link dot) */
.site-nav ul { position: relative; }
.site-nav a::after { display: none !important; }
.nav-dot { position: absolute; left: 0; bottom: -.15rem; width: 4px; height: 4px; border-radius: 50%; background: var(--red); opacity: 0;
  transition: transform .55s cubic-bezier(.3,1.3,.5,1), opacity .3s; pointer-events: none; }

/* Sections lift into place on first view */
.lift { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.lift.in { opacity: 1; transform: none; }
.story-main > .lift:nth-child(2) { transition-delay: .08s; }
.story-main > .lift:nth-child(3) { transition-delay: .16s; }

/* On this day: the date turns like a page */
.turn-page { animation: turnPage .55s cubic-bezier(.2,.7,.2,1); transform-origin: 0 100%; }
@keyframes turnPage { from { opacity: 0; transform: perspective(600px) rotateX(-55deg) translateY(10px); } }

/* Archive and favorites: tiles arrive in a short ripple */
.grid > * { animation: riseIn .5s cubic-bezier(.2,.7,.2,1) both; }
.grid > *:nth-child(2) { animation-delay: .03s } .grid > *:nth-child(3) { animation-delay: .06s }
.grid > *:nth-child(4) { animation-delay: .09s } .grid > *:nth-child(5) { animation-delay: .12s }
.grid > *:nth-child(6) { animation-delay: .15s } .grid > *:nth-child(7) { animation-delay: .18s }
.grid > *:nth-child(8) { animation-delay: .21s } .grid > *:nth-child(n+9) { animation-delay: .24s }

/* Comparison: the divider sweeps once to show what it does */
.cmp-box.sweeping .cmp-handle, .cmp-box.sweeping img.top { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .lift { opacity: 1; transform: none; }
  .nav-dot { transition: none; }
}

