/* Same family as junttu.fi: one orange accent (hover and focus only), quiet.
   Light is the default; dark follows the system unless the visitor picks a theme (data-theme on <html>). */
:root{color-scheme:light; --bg:#f3efe7; --fg:#1b1a18; --muted:#6b675f; --orange:#b04c08; --hair:#d9d5cc}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){color-scheme:dark; --bg:#0c0b0d; --fg:#f2eee8; --muted:#8a8782; --orange:#ff7a1a; --hair:#2a2826}}
:root[data-theme="dark"]{color-scheme:dark; --bg:#0c0b0d; --fg:#f2eee8; --muted:#8a8782; --orange:#ff7a1a; --hair:#2a2826}
*{box-sizing:border-box; margin:0}
html,body{background:var(--bg); color:var(--fg)}
body{font:500 1rem/1.5 "Satoshi",system-ui,sans-serif; min-height:100vh}
.sr-only{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}

/* Top-left label and top-right controls: 13px, muted, on one line */
.controls{position:fixed; top:14px; right:40px; z-index:5; display:flex; align-items:center; gap:28px; font-size:13px}
.lang{display:flex; gap:28px}
.lang button,.theme{color:var(--muted); background:none; border:0; padding:.8em 0; cursor:pointer; font:inherit; font-size:13px}
.back{color:var(--muted); text-decoration:none; padding:.8em 0; font:500 12px/1.5 ui-monospace,Menlo,monospace}
.back:hover,.back:focus-visible{color:var(--orange)}
.back:focus-visible{outline:none}
.lang button:hover,.theme:hover{color:var(--orange)}
.lang button[aria-pressed="true"]{color:var(--fg); text-decoration:underline; text-underline-offset:.3em}
.lang button:focus-visible,.theme:focus-visible,.v-btn:focus-visible{outline:2px solid var(--fg); outline-offset:3px}

/* The toggle shows the mode it switches to: "light" while dark is on, else "dark" */
.theme[aria-pressed="true"] .to-dark,.theme[aria-pressed="false"] .to-light{display:none}

/* Hero: the whole screen, one strip of photos between the label and the tick rail.
   app.js drifts it sideways and lets visitors drag or scroll it (.drift). Without JS, or with reduced motion, it is a plain scrollable strip. */
.gallery{height:100vh; height:100dvh; display:flex; align-items:center; padding:96px 0 120px; box-sizing:border-box}
.marquee{width:100%; overflow-x:auto}
.marquee.drift{overflow:hidden; cursor:grab; touch-action:pan-y; user-select:none; -webkit-user-select:none}
.marquee.drift .open{cursor:grab}
.marquee.dragging,.marquee.dragging .open{cursor:grabbing}
/* --base must match the sizes calc in scripts/build-photos.mjs */
.track{--base:min(52vh,520px); display:flex; align-items:center; gap:clamp(16px,3vw,32px); width:max-content; height:calc(var(--base) + 3rem); will-change:transform}
.shot{flex:none; margin:0; text-align:center}
.open{display:block; padding:0; border:0; background:none; cursor:zoom-in}
.open img{display:block; width:auto; max-width:none; height:var(--base)}
/* Staggered row: heights 100% / 72% / 86% of the base, aligned to the top, middle and bottom in turn */
.s0{align-self:flex-start}
.s1{align-self:center}
.s1 .open img{height:calc(var(--base) * .72)}
.s2{align-self:flex-end}
.s2 .open img{height:calc(var(--base) * .86)}
.open:focus-visible img{outline:2px solid var(--orange); outline-offset:4px}
/* The photo's number under it: no title is shown */
figcaption{margin-top:14px; font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; transition:color .2s}
.open:hover+figcaption{color:var(--orange)}

/* Tick rail: a hairline with one tick per photo. The tick nearest the middle is taller and full colour. */
.rail{position:fixed; left:40px; right:40px; bottom:64px; z-index:4; display:flex; justify-content:space-between; align-items:flex-end; border-bottom:1px solid var(--hair)}
.tick{position:relative; width:9px; height:22px; margin-bottom:-1px; padding:0; border:0; background:none; cursor:pointer}
.tick::before{content:""; position:absolute; left:4px; bottom:0; width:1px; height:14px; background:var(--muted)}
.tick[aria-current="true"]::before{height:22px; background:var(--fg)}
.tick:hover::before,.tick:focus-visible::before{background:var(--orange)}
.tick:focus-visible{outline:none}
.counter{position:fixed; left:40px; bottom:28px; z-index:4; font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums}

@media (max-width:599px){
  .counter{left:20px}
  .controls{right:20px}
  .rail{left:20px; right:20px}
  .tick::before{height:12px}
  .tick[aria-current="true"]::before{height:20px}
}

/* Blocks fade in on load (opacity only; the script adds .in). Without JS they just show. */
.js .fade{opacity:0; transition:opacity 1.4s ease}
.js .fade.in{opacity:1}
@media (prefers-reduced-motion:reduce){.js .fade{opacity:1; transition:none}}

/* Full-screen viewer: dark in both themes, so its own colours are fixed here */
.viewer{--fg:#f2eee8; --muted:#8a8782; --orange:#ff7a1a; position:fixed; inset:0; z-index:20; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:64px 96px 120px}
.viewer[hidden]{display:none}
/* The backdrop is its own layer so it can fade apart from the controls; the photo moves with transform only (app.js) */
.v-bg{position:absolute; inset:0; z-index:0; background:#0c0b0d}
.v-count{position:absolute; top:28px; left:40px; z-index:1; margin:0; font-size:13px; color:var(--muted); font-variant-numeric:tabular-nums}
.v-stage{position:relative; z-index:1; display:flex; align-items:center; justify-content:center; width:100%; min-height:0}
.v-stage img{display:block; width:auto; height:auto; transform-origin:0 0}
.v-ghost{position:fixed; z-index:1; margin:0; pointer-events:none}
.v-btn{position:absolute; z-index:1; top:50%; transform:translateY(-50%); color:var(--muted); background:none; border:0; padding:0; font:300 28px/1 system-ui,sans-serif; cursor:pointer}
.v-btn:hover{color:var(--orange)}
.v-prev{left:40px}
.v-next{right:40px}
.v-close{top:24px; right:40px; transform:none; font:500 13px/1 "Satoshi",system-ui,sans-serif}
/* Thumbnails along the bottom: the current one is full opacity, the rest faded; auto margins centre them without clipping the first or last */
.v-thumbs{position:absolute; left:0; right:0; bottom:40px; z-index:1; display:flex; gap:14px; overflow-x:auto; padding:6px}
.v-thumbs>:first-child{margin-left:auto}
.v-thumbs>:last-child{margin-right:auto}
.v-thumb{flex:none; width:44px; height:56px; padding:0; border:0; background:none; opacity:.35; cursor:pointer}
.v-thumb img{display:block; width:100%; height:100%; object-fit:cover}
.v-thumb[aria-current="true"]{opacity:1; outline:1px solid var(--fg); outline-offset:4px}
.v-thumb:hover,.v-thumb:focus-visible{opacity:1; outline:1px solid var(--orange); outline-offset:4px}
.v-title{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}   /* read by screen readers only */

@media (max-width:599px){
  .viewer{padding:56px 16px 120px}
  .v-count{left:20px}
  .v-close{right:20px}
  .v-prev{left:12px}
  .v-next{right:12px}
}
