/* Hyggetivities, the front page (version 6, the hand-made look, 2026-11-16).
   Loaded after site.css on index.html only. Three parts, all on the site's warm base:
   1. the opening: the words, and beside them a taped print of beach volley against the setting
      sun (the founder's choice), with a note written under the empty chair in it;
   2. the afternoon: six prints laid on the table one by one as you scroll (a sticky stage; the
      plan of the day is written beside the pile on wide screens);
   3. the way to "Sådan virker det", which has its own page since this version.
   The prints, the tape, the paper and the handwriting come from site.css. Heights are measured
   with var(--svh) (site.css: the small viewport height, or 100vh where a browser lacks it). */

/* ---------- 1. the opening ---------- */
.open { padding-block: clamp(18px, 3.4vw, 48px) clamp(40px, 6vw, 88px); overflow-x: clip; } /* clip: while the print is being laid down it is turned and enlarged, and must not make a phone page wider than the screen */
.open-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 72px);
  min-height: min(720px, calc(var(--svh) - var(--nav-h) - 110px));
}
/* 3.875rem at most: the English "Do something" must stay on one line in the left column (four lines, never five) */
.open h1 { font-size: clamp(2.5rem, 4.5vw, 3.875rem); line-height: 1.02; letter-spacing: -0.045em; margin: 0 0 20px; }
.open .lead { max-width: 24em; }
/* the print: an upright photograph. Never taller than the screen (its note must stay in view), never wider than 560px, never smaller than a real print. */
.open-print { justify-self: center; width: max(230px, min(100%, 560px, calc((var(--svh) - var(--nav-h) - 190px) * 0.8 + 24px))); padding: 12px 12px 14px; transform: rotate(1.8deg); }
.open-print picture { display: block; }
.open-print .tape { width: 110px; height: 30px; top: -15px; }
.open-print figcaption { justify-content: flex-start; align-items: center; gap: 4px; min-height: 36px; margin-top: 10px; padding-left: 5%; }
.open-print .hand { font-size: clamp(1.5rem, 2.5vw, 2.15rem); }
/* the arrow starts at the words and ends under the empty chair, just above the paper edge */
.open-print .up { flex: none; width: 42px; height: 56px; margin-top: -40px; fill: none; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.open-print .up .halo { stroke: var(--print); stroke-width: 7; }
.open-print .up .line { stroke: var(--print-accent); stroke-width: 2.8; }
html.js .open-copy > * { animation: rise 1s var(--ease) both; }
html.js .open-copy > :nth-child(2) { animation-delay: 0.1s; }
html.js .open-copy > :nth-child(3) { animation-delay: 0.2s; }
html.js .open-print { animation: lay 1.1s var(--ease) 0.15s both; }
@keyframes lay { from { opacity: 0; transform: translateY(30px) rotate(7deg) scale(1.05); } }

/* ---------- 2. the afternoon: a pile of prints ---------- */
.reel { position: relative; height: calc(var(--reel-n, 6) * 62vh + 100vh); }
.stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center;
  overflow: hidden; /* a print on its way down is turned and enlarged: without this it makes a phone page wider than the screen */
  --pw: max(180px, min(38vw, 430px, calc((var(--svh) - var(--nav-h) - 150px) * 0.8))); /* the width of a print in the pile */
}
.stage-grid { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 80px); padding-top: calc(var(--nav-h) + 12px); }
.stage-copy h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.04; max-width: 11em; }
/* the plan of the day, written by hand: what has been, what is on the table now, what is still to come */
.plan { margin-top: clamp(18px, 3vh, 34px); display: grid; gap: 7px; }
.plan li { display: flex; align-items: baseline; gap: 14px; opacity: 0.5; transition: opacity 0.35s ease; }
.plan time { flex: none; width: 3.6em; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; color: var(--muted); }
.plan span { font-family: var(--script); font-weight: 600; font-size: clamp(1.4rem, 2.1vw, 1.85rem); line-height: 1.12; color: var(--fg); transition: color 0.35s ease; }
.plan li.done { opacity: 0.78; }
.plan li.now { opacity: 1; }
.plan li.now span { color: var(--ink); box-shadow: inset 0 -0.14em 0 var(--ink-wash); }
.pile { position: relative; justify-self: center; width: var(--pw); aspect-ratio: 1 / 1.34; }
.moment {
  position: absolute; left: 0; top: 0; width: 100%; --e: 1;
  /* --e runs from 0 (still in the hand, lower, turned, a little larger) to 1 (lying on the pile); home.js sets it from the scroll */
  transform: translate(var(--dx, 0px), calc(var(--dy, 0px) + (1 - var(--e)) * 80px)) rotate(calc(var(--r, 0deg) + (1 - var(--e)) * 8deg)) scale(calc(1 + (1 - var(--e)) * 0.06));
  opacity: calc(var(--e) * 2.5);
  will-change: transform, opacity;
}
html.js .moment:not(:first-of-type) { --e: 0; }

/* ---------- 3. the way to the walkthrough ---------- */
.how { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: clamp(24px, 5vw, 72px); padding: clamp(36px, 5vw, 72px) clamp(22px, 5vw, 72px); }
.how .eyebrow { margin-bottom: 14px; }
.steps { margin: 24px 0 30px; display: grid; gap: 10px; }
.steps li { display: flex; align-items: baseline; gap: 14px; font-size: 1.1875rem; font-weight: 600; }
.steps .hand { flex: none; width: 0.8em; font-size: 2.3rem; line-height: 0.8; text-align: center; }
/* the app's list as a taped print: no phone around it, just the screen */
.how-shot { position: relative; display: block; justify-self: center; width: min(100%, 290px); padding: 8px; background: var(--print); border-radius: 30px; box-shadow: var(--print-shadow); transform: rotate(3deg); transition: transform 0.4s var(--ease); }
.how-shot:hover { transform: rotate(1.4deg) translateY(-4px); }
.how-shot img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 8%; border-radius: 23px; } /* 8%: starts just under the status bar */
.how-shot .tape { top: -12px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  /* one column: the heading above the pile, the plan is on the prints themselves */
  .stage { --pw: max(150px, min(100vw - 64px, 380px, calc((var(--svh) - var(--nav-h) - 214px) * 0.8))); }
  .stage-grid { grid-template-columns: 1fr; gap: 30px; justify-items: center; text-align: center; } /* 30px: a turned print rises above its box, and its tape must not touch the heading */
  .stage-copy .eyebrow { display: none; }
  .stage-copy h2 { font-size: clamp(1.5rem, 5.6vw, 2.2rem); max-width: 12em; margin: 0 auto; }
  .plan { display: none; }
}
@media (max-width: 760px) {
  .open-grid { grid-template-columns: 1fr; gap: 22px; min-height: 0; }
  .open h1 { font-size: clamp(2rem, 8.6vw, 3rem); margin-bottom: 14px; }
  /* the print first, a square one here, sized so that the words and the button still stand on the first screen */
  .open-print { order: -1; width: max(230px, min(100%, calc(var(--svh) - var(--nav-h) - 372px + 24px))); transform: rotate(-1.2deg); }
  .open-print img { aspect-ratio: 1 / 1; }
  /* the English headline takes three lines here, so the print gives up a little more height */
  html[lang="en"] .open-print { width: max(230px, min(100%, calc(var(--svh) - var(--nav-h) - 408px + 24px))); }
  .open-print .up { width: 34px; height: 46px; margin-top: -32px; }
  .open .cta-row { margin-top: 22px; }
  .how { grid-template-columns: 1fr; }
  .how-shot { width: min(72%, 250px); margin-top: 8px; }
}
@media (max-width: 360px) {
  /* the smallest phones: the forced line break in the lead would leave one word alone on a third line */
  .open .lead br { display: none; }
  .open .lead { text-wrap: balance; }
}

/* ---------- without script nothing can lay the prints down: show all six side by side ---------- */
@media (scripting: none) {
  .reel { height: auto; }
  .stage { position: static; height: auto; overflow: visible; padding-block: 24px 8px; }
  .stage-grid { grid-template-columns: 1fr; gap: 34px; padding-top: 0; }
  .plan { display: none; }
  .pile { width: 100%; aspect-ratio: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 30px 26px; }
  .moment { position: relative; width: min(100%, 290px); }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html.js .open-copy > *, html.js .open-print { animation: none; }
  .plan li, .plan span, .how-shot { transition: none; }
}
