/* The home page (js/home.cjs), after css/style.css. Set like a page of the logbook Jellyn keeps: hairlines between
   things, times in mono, each moment in its own flavour, and the raspberry kept for what you press. The poster, the
   photos that zoom, the community photos and the 3D card at the end keep their own look (css/style.css).

   The stage: a photo the size of the window, edge to edge and under the floating header, with the hero in the middle
   of it: the heading in big letters, the words and buttons centred under it. Its foot melts into the page, where
   "Scroll" waits. The words stay white in both themes: the photo is darkened behind them. */
.home-stage{position:relative;isolation:isolate;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:1fr auto;min-height:100svh;margin-top:calc(-1 * (var(--header-bar,60px) + var(--header-gap,0px)));padding-top:calc(var(--header-bar,60px) + var(--header-gap,0px));overflow:clip;color:#fff}
.home-photo{position:absolute;inset:0;z-index:-1;margin:0;background:#141018}
/* The photo (assets/hero-fire.jpg) is wide: the burning house on the left, the police SUV on the right. A narrow
   window shows the middle of it: the firefighter, the fire and the SUV's lights (below). */
.home-photo img{display:block;width:100%;height:100%;max-width:none;object-fit:cover;object-position:55% 50%;transform-origin:50% 0}
/* Over the photo: a black veil of 20% across all of it (the last layer, under the rest), a shade in the middle behind
   the words, and the melt into the page at its foot. */
.home-photo::after{content:"";position:absolute;inset:0;background:
  radial-gradient(70% 62% at 50% 48%,rgb(12 9 14 / .55),rgb(12 9 14 / .25) 55%,transparent 80%),
  linear-gradient(180deg,rgb(12 9 14 / .5) 0%,transparent 22%,transparent 62%,rgb(12 9 14 / .35) 82%,var(--paper) 100%),
  rgb(0 0 0 / .2)}
.home-hero{display:grid;justify-items:center;align-self:center;padding-block:clamp(48px,8vw,120px) clamp(40px,6vw,88px);text-align:center}
.home-hero-copy{display:grid;justify-items:center}
.home-hero h1{max-width:13em;margin:0 0 clamp(20px,2.4vw,32px);color:#fff;font-size:clamp(3rem,1.2rem + 6.2vw,7.25rem);line-height:.95;letter-spacing:-.035em;text-wrap:balance;text-shadow:0 4px 40px rgb(0 0 0 / .45)}
.home-lede{max-width:40em;margin:0;color:rgb(255 255 255 / .9);font-size:clamp(1.0625rem,.95rem + .35vw,1.25rem);line-height:1.6;text-wrap:pretty;text-shadow:0 1px 14px rgb(0 0 0 / .5)}
.home-hero .actions{justify-content:center;margin-top:clamp(28px,3vw,40px)}
.home-stage .button.ghost{border-color:rgb(255 255 255 / .5);background:rgb(255 255 255 / .08);color:#fff;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.home-stage .button.ghost:hover{background:rgb(255 255 255 / .18);border-color:#fff}
/* "Scroll": down to the evening (smoothly: css/style.css), its arrow nudging the way. */
.home-scroll{justify-self:center;display:inline-flex;align-items:center;gap:6px;margin:0 0 clamp(18px,3vh,32px);padding:8px 14px 8px 16px;border-radius:999px;background:rgb(12 9 14 / .45);color:#fff;font:600 .75rem var(--font-mono);letter-spacing:.08em;text-transform:uppercase;text-decoration:none;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-shadow:inset 0 0 0 1px rgb(255 255 255 / .18)}
.home-scroll:hover{background:rgb(12 9 14 / .6)}
.home-scroll:focus-visible{outline:2px solid var(--accent);outline-offset:3px}


/* The evening: one row of the log per moment, its time on the left; the drawing beside the words. */
.evening{padding-block:clamp(40px,5vw,72px) clamp(40px,5vw,72px);scroll-margin-top:calc(var(--header-h) + 16px)}
.evening-head{margin-bottom:clamp(28px,4vw,44px)}
.evening-head h2{margin:0 0 10px;font-size:clamp(1.9rem,1.3rem + 2vw,2.8rem);letter-spacing:-.02em}
.evening-head p{max-width:30em;margin:0;color:var(--muted)}
.evening-list{margin:0;padding:0;list-style:none;border-bottom:1px solid var(--line);overflow-x:clip}
.evening-entry{display:grid;grid-template-columns:7.5rem minmax(0,.85fr) minmax(0,1.15fr);align-items:start;column-gap:clamp(24px,4vw,64px);padding-block:clamp(30px,4vw,52px);border-top:1px solid var(--line);scroll-margin-top:calc(var(--header-h) + 16px)}
.evening-time{display:grid;gap:12px;padding-top:6px;color:var(--ink);font:500 1rem var(--font-mono);font-variant-numeric:tabular-nums;white-space:nowrap}
.evening-time::before{content:"";width:26px;height:3px;border-radius:2px;background:var(--tone)}
.evening-words h3{margin:0 0 12px;font-size:clamp(1.35rem,1.05rem + 1vw,1.8rem);letter-spacing:-.015em}
.evening-words p{max-width:33em;margin:0;line-height:1.65}
.evening-words .evening-where{margin-top:16px;color:var(--faint);font:500 .75rem/1.5 var(--font-mono)}
.evening-shot{display:grid;justify-items:end;min-width:0}
.evening-entry.is-last{grid-template-columns:7.5rem minmax(0,1fr)}
.evening-entry:target .evening-time{color:var(--tone)}
/* The drawings sit on the page as they would in Jellyn: a sheet with a hairline, no frame around the frame. */
.evening .ui-card{width:min(540px,100%);border-radius:var(--r-lg);box-shadow:none}

/* The poster keeps its picture and swatches; its heading stands alone. */
.poster-copy h2{letter-spacing:-.02em}

/* Setting it up: the quickstart's steps, numbered, between hairlines. */
.setup{display:grid;grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);align-items:start;gap:clamp(28px,5vw,80px);padding-block:clamp(56px,7vw,104px) clamp(32px,4vw,56px)}
.setup-head h2{margin:0 0 12px;font-size:clamp(1.9rem,1.3rem + 2vw,2.8rem);letter-spacing:-.02em}
.setup-head p{max-width:24em;margin:0 0 16px}
.setup-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin:0;padding:0;list-style:none;counter-reset:step;border-top:1px solid var(--line)}
.setup-steps li{counter-increment:step;padding:22px 0 26px;border-bottom:1px solid var(--line)}
.setup-steps li:nth-child(odd){padding-right:clamp(16px,3vw,36px);border-right:1px solid var(--line)}
.setup-steps li:nth-child(even){padding-left:clamp(16px,3vw,36px)}
.setup-steps li::before{content:counter(step,decimal-leading-zero);display:block;margin-bottom:12px;color:var(--accent);font:600 .75rem var(--font-mono)}
.setup-steps h3{margin:0 0 6px;font-size:1.125rem}
.setup-steps p{margin:0;font-size:.9375rem}

@media (prefers-reduced-motion:no-preference){
  .home-scroll .icon{animation:home-nudge 1.8s ease-in-out infinite}
  /* Scrolling, where the browser drives it from the scroll itself (no script): as the stage leaves the window the
     photo drifts down more slowly than the page and swells a little, the hero lifts and fades, "Scroll" goes first.
     Further down, each moment of the evening, the setup steps and the poster rise into place as they come into view. */
  @supports ((animation-timeline:view()) and (animation-range:entry)){
    .home-stage{view-timeline:--home-stage}
    .home-photo img{animation:home-drift linear both;animation-timeline:--home-stage;animation-range:exit 0% exit 100%}
    .home-hero{animation:home-lift linear both;animation-timeline:--home-stage;animation-range:exit 0% exit 75%}
    .home-scroll{animation:home-leave linear both;animation-timeline:--home-stage;animation-range:exit 0% exit 12%}
    .evening-head,.evening-entry,.poster-copy,.poster-frame,.setup-head,.setup-steps li{animation:home-rise linear both;animation-timeline:view();animation-range:entry 0% entry 65%}
    .evening-shot{animation:home-slide linear both;animation-timeline:view();animation-range:entry 10% entry 80%}
  }
}
@keyframes home-nudge{50%{transform:translateY(3px)}}
@keyframes home-drift{to{transform:translateY(32%) scale(1.08)}}
@keyframes home-lift{to{opacity:0;transform:translateY(-72px)}}
@keyframes home-leave{to{opacity:0;transform:translateY(12px)}}
@keyframes home-rise{from{opacity:0;transform:translateY(40px)}}
@keyframes home-slide{from{opacity:0;transform:translateX(48px) scale(.97)}}
@media (max-width:900px){
  .home-photo img{object-position:38% 50%}
  .home-photo::after{background:linear-gradient(180deg,rgb(12 9 14 / .7) 0%,rgb(12 9 14 / .55) 45%,rgb(12 9 14 / .45) 78%,var(--paper) 100%),rgb(0 0 0 / .2)}
  .evening-entry{grid-template-columns:6rem minmax(0,1fr);row-gap:22px}
  .evening-shot{grid-column:2;justify-items:start}
  .evening-entry.is-last{grid-template-columns:6rem minmax(0,1fr)}
  .setup{grid-template-columns:1fr}
}
@media (max-width:600px){
  .home-hero h1{font-size:clamp(2.5rem,1.2rem + 7vw,3.6rem)}
  .evening-entry,.evening-entry.is-last{grid-template-columns:1fr;row-gap:14px}
  .evening-time{display:flex;align-items:center;gap:10px;padding-top:0}
  .evening-shot{grid-column:auto;justify-items:stretch;margin-top:8px}
  .setup-steps{grid-template-columns:1fr}
  .setup-steps li:nth-child(n){padding-inline:0;border-right:0}
}
