/* Home: the lit garden beside the agreed copy (D034, D036), then the selected work, reached by the
   thread the plan's pen draws down the page. The garden is assets/js/garden/; the page's script is
   assets/js/home/main.js. Tokens and the masthead come from site.css. */

.js .masthead:not(.is-scrolled) { background: none; }

/* The hero: on phones the words first, then the whole garden in a band below them. */
.hero { position: relative; display: flex; flex-direction: column; min-height: 100svh; overflow: hidden; }
.hero .copy { position: relative; z-index: 2; padding: calc(var(--header-h) + 28px + env(safe-area-inset-top)) var(--margin) 0; }
.stage { position: relative; flex: 1 0 auto; min-height: clamp(300px, 48svh, 460px); margin-top: 8px; touch-action: pan-y; cursor: grab; }
.stage.is-turning { cursor: grabbing; }
.stage.is-over:not(.is-turning) { cursor: pointer; }
.stage.is-raking { cursor: none; touch-action: none; }
.scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 380ms var(--ease); }
.is-live .scene { opacity: 1; }
.no-scene .scene { display: none; }
/* The garden's still, where the scene cannot run: without JavaScript or without WebGL. It sits in
   the box the scene fits the garden into (main.js, place()) and is contained in it as the scene
   is, so it stands where the garden would. Lazy, so a page that runs the scene never fetches it. */
.still { display: none; position: absolute; inset: 0 12px; }
.still img { display: block; width: 100%; height: 100%; object-fit: contain; }
:is(.no-js, .no-scene) .still { display: block; }
/* The garden lit (tools/home-still.py), from the first paint while the scene is built: the head script picks the
   file for the theme, the width and the band of the day, and the scene is built at the same hour, so when it fades
   in over the still nothing moves. It stands in the same box as the still and is contained in it as the scene is. */
.lit { display: none; position: absolute; inset: 0 12px; pointer-events: none; background: var(--lit-dark) center / contain no-repeat; }
:root[data-theme="light"] .lit { background-image: var(--lit-light); }
.js:not(.no-scene) .lit { display: block; }
.is-live .lit { visibility: hidden; transition: visibility 0s 400ms; }
@media (prefers-reduced-motion: reduce) { .scene { transition: none; } }

.hero h1 {
  font-family: var(--font-display);
  font-weight: var(--title-weight);
  font-size: clamp(31px, 8.6vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-optical-sizing: auto;
  text-wrap: balance;
}
.hero h1 .line { display: block; }
.hero h1 .line:first-child { color: var(--ink-2); }
.hero h1 .line + .line { margin-top: 0.08em; }
/* The headline leans toward the pointer (home/main.js, leanHeadline): each word a box of the width it
   has at rest, its letters centred, so a heavier word moves no other; its weight eases. */
.hero h1 .w { display: inline-block; text-align: center; white-space: nowrap; }
.hero h1.is-leaning .w { transition: font-weight 400ms var(--ease); }
/* Sized as the page lede (site.css); its spacing belongs to the hero. */
.intro { margin-top: 18px; max-width: 29rem; font-size: 17px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
.actions { margin-top: 14px; display: flex; align-items: center; gap: 14px; font-size: 16px; }
.actions a { display: inline-flex; align-items: center; min-height: 44px; }
.actions .sep { color: var(--ink-2); }

/* Wide screens: the words on the left, the garden on the right, one screen high, held for a short
   run of scrolling while the garden turns into its plan. */
@media (min-width: 900px) {
  .runway { height: calc(100svh + 70vh); }
  .runway .hero { position: sticky; top: 0; }
  .hero { display: block; height: 100svh; min-height: 640px; }
  .hero .copy { position: absolute; left: var(--margin); top: 50%; width: min(31rem, 37vw); padding: 0; transform: translateY(-46%); }
  .stage { position: absolute; inset: 0; min-height: 0; margin: 0; z-index: 1; }
  .still, .lit { inset: calc(var(--header-h) + 4px) 16px 8px calc(var(--margin) + min(31rem, 37vw) + 40px); }
  .hero h1 { font-size: clamp(46px, 4.1vw, 60px); line-height: 1.06; }
  .intro { margin-top: 30px; font-size: 19px; }
  .actions { margin-top: 28px; }
}
@media (min-width: 900px) and (max-height: 700px) {
  .hero { height: auto; min-height: 100svh; }
  .hero .copy { position: relative; top: auto; transform: none; padding: calc(var(--header-h) + 40px) 0 64px; }
}

/* The selected work: one essay and one working app, the proof under the headline. */
/* Home ends as every page does (.page in site.css): 120 px of ground, 160 px from 900 px. */
.selected { position: relative; padding: 120px var(--margin); }
@media (min-width: 900px) { .selected { padding: 168px var(--margin) 160px; } }
.selected-head { position: relative; z-index: 1; margin-bottom: 28px; }
@media (min-width: 900px) { .selected-head { margin-bottom: 40px; } }

/* The two pieces, a pair (design/evolution/README.md, Writing 3): the essay's lit garden and the
   app's plan in the garden plan's hand (D038), the same size, neither framed, each fading into the
   ground, with their labels and their feet on one line. Side by side from 1100 px; stacked below. */
.picks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 72px; padding: 0; margin: 0; list-style: none; }
.pick { position: relative; z-index: 1; }
.pick-link { display: flex; flex-direction: column; height: 100%; }
.pick-link:focus-visible { outline-offset: 8px; }
.pick .label { display: block; }
.pick .name { display: block; margin-top: 10px; font-size: 30px; line-height: 1.15; font-weight: 330; letter-spacing: -0.016em; text-wrap: balance; transition: color 400ms var(--ease); }
.pick .line { display: block; margin: 12px 0 28px; max-width: 30em; font-size: 16px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty; }
/* The essay's picture: its lit garden, cut to the app drawing's shape so the two stand the same size. */
.pick-lit { position: relative; display: block; width: 100%; aspect-ratio: 800 / 450; overflow: hidden; }
.pick-art .pick-lit img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1400ms var(--ease); }
.pick-link:hover .pick-art .pick-lit img { transform: scale(1.025); }
@media (max-width: 899.98px) { .pick-lit { aspect-ratio: 340 / 300; } .pick-art .pick-lit img { object-position: 62% 40%; } }
/* The essay's thumbnail is a concept with words in it (D061): on phones it stands whole, not cropped as the garden was. */
@media (max-width: 899.98px) { .pick-essay .pick-lit { aspect-ratio: 1200 / 630; } }
.pick .foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--hair); }
.pick .onward { font-size: 16px; white-space: nowrap; color: var(--ink); }
.pick .onward .arrow { display: inline-block; margin-left: 8px; transition: transform 500ms var(--ease); }
.pick .foot-gap { font-size: 13px; color: var(--ink-2); }
@media (hover: hover) {
  .pick-link:hover .name { color: var(--line); }
  .pick-link:hover .onward .arrow { transform: translateX(4px); color: var(--ink); }
}

/* The app's drawing: the phone composition below 900 px, the wide one above. */
.pick-art { position: relative; display: block; width: 100%; max-width: 360px; margin: 0 auto 18px; }
.pick-art picture, .pick-art img { display: block; width: 100%; height: auto; }
@media (min-width: 900px) { .pick-art { max-width: 760px; margin: 0 0 24px; } }
@media (min-width: 1100px) {
  .picks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
  .pick .name { font-size: 32px; }
  .pick-art { max-width: none; }
}

/* Names in the drawing: 11 px mono over a soft patch of the ground, numbers in blue (D038). */
.pick-art .names { position: absolute; inset: 0; pointer-events: none; }
.pick-art .nm { position: absolute; display: grid; gap: 2px; font: 400 11px/1.25 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; isolation: isolate; }
.pick-art .nm > span:first-child { color: var(--ink); }
.pick-art .nm .num { font-weight: 400; color: var(--accent); }
.pick-art .nm::before { content: ""; position: absolute; inset: -18px -34px; z-index: -1; background: var(--ground); -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 0.96) 52%, rgba(0, 0, 0, 0.7) 72%, transparent); mask-image: radial-gradient(closest-side, rgba(0, 0, 0, 0.96) 52%, rgba(0, 0, 0, 0.7) 72%, transparent); }
.pick-art .nm:is(.at-legend-l, .at-legend-r)::before { inset: -6px -4px; }
.pick-art .at-left { transform: translate(calc(-100% - 6px), -50%); text-align: right; justify-items: end; }
.pick-art .at-right { transform: translate(6px, -50%); }
.pick-art .at-legend-l { transform: none; }
.pick-art .at-legend-r { transform: translate(-100%, 0); text-align: right; justify-items: end; }
.pick-art .for-phone { display: none; }
@media (max-width: 899.98px) { .pick-art .for-wide { display: none; } .pick-art .for-phone { display: grid; } }

/* The thread: a line of light down from under the garden, splitting to the two cards. */
.thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.thread-line { fill: none; stroke: var(--line); stroke-opacity: 0.55; stroke-width: 1; vector-effect: non-scaling-stroke; }
.thread-tip { fill: var(--ink); filter: drop-shadow(0 0 6px var(--glow)) drop-shadow(0 0 2px var(--ink)); transition: opacity 300ms var(--ease); }
.no-js .thread { display: none; }
/* Where the thread lands inside a picture (data-thread-at, home/main.js): drawn above it and grown with it from the point where it enters, so the two never part. */
.pick-lit .thread-in { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; transition: transform 1400ms var(--ease); }
.pick-lit[data-thread-at] img, .pick-lit .thread-in { transform-origin: var(--thread-x, 50%) 0; }
.pick-link:hover .pick-lit .thread-in { transform: scale(1.025); }
.thread-end { fill: var(--line); opacity: 0; transition: opacity 300ms var(--ease); }
.thread-end.is-landed { opacity: 0.85; }
.thread-end.is-moving { fill: var(--ink); opacity: 1; filter: drop-shadow(0 0 6px var(--glow)) drop-shadow(0 0 2px var(--ink)); }
.no-js .thread-in { display: none; }

.selected .ends { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 56px; }
.selected .ends .all { font-size: 16px; }
/* The app's picture is framed close on its panel: it fades less at top and bottom, and on a phone it
   stays centred on the panel. */
.pick-app .pick-lit {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 11%, #000 89%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 11%, #000 89%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 5%, #000 95%, transparent 100%);
}
@media (max-width: 899.98px) { .pick-app .pick-art .pick-lit img { object-position: 50% 50%; } }
