/* Hallmark · home: the walk in through the shop's doors to Sophie, then one screen each for new garments, kinds, the film, Sophie, service and the visit */

/* ---------- the entrance: shop front, glass doors, the way in, Sophie ---------- */

/* Without script or with motion off the page shows the two stills one after the other. entrance.js adds .is-live, pins the stage and plays the walk on the canvas. */
:root { --color-on-photo: #fbf8f3; --hero-scrim: linear-gradient(to top, rgb(21 20 19 / 0.86) 0%, rgb(21 20 19 / 0.66) 38%, rgb(21 20 19 / 0.28) 58%, rgb(21 20 19 / 0) 74%); }

.entrance { --announce-h: 0px; --stage-h: max(30rem, calc(100svh - var(--masthead-h) - var(--announce-h))); position: relative; background: var(--color-paper); }
:root:has(.announce) .entrance { --announce-h: 40px; }
.entrance__stage { display: grid; }
.scene { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); height: var(--stage-h); overflow: hidden; background: var(--color-paper); }
.scene__view { position: relative; grid-area: 1 / 1; min-height: 0; margin: 0; background: var(--color-paper-2); }
.scene__view img, .scene__view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.scene__view canvas { opacity: 0; }
.scene__view canvas.is-on { opacity: 1; }

/* phones and tablets: the photograph fills the screen and the words sit on it, white over a soft shade at the foot, like a campaign page */
.scene__view::after { content: ""; position: absolute; inset: 0; background: var(--hero-scrim); pointer-events: none; }
.scene__copy { position: relative; grid-area: 1 / 1; align-self: end; display: grid; justify-items: start; gap: var(--space-sm); padding: var(--space-3xl) var(--gutter) calc(var(--space-md) * 2 + 56px + env(safe-area-inset-bottom, 0px)); background: none; color: var(--color-on-photo); }
.scene__copy h1, .scene__copy h2 { max-width: 14ch; font-size: var(--text-display); line-height: 1.08; text-wrap: balance; color: var(--color-on-photo); }
.scene__line { max-width: 34ch; font-size: var(--text-lead); line-height: 1.45; color: var(--color-on-photo); }
.scene__actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: var(--space-2xs); width: 100%; max-width: 28rem; margin-top: var(--space-sm); }
.scene__actions .btn { justify-self: stretch; padding-inline: var(--space-md); border-color: var(--color-on-photo); background: var(--color-on-photo); color: var(--color-ink); }
.scene__actions .btn:hover { background: var(--color-paper-2); border-color: var(--color-paper-2); }
.scene__actions .btn--line { justify-self: start; min-height: 48px; padding-inline: 0; border: 0; background: none; color: var(--color-on-photo); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
.scene__actions .btn--line:hover { background: none; text-decoration-thickness: 2px; }
.scene__actions .btn:focus-visible { outline-color: var(--color-on-photo); }

/* wide screens: words at the start, the photograph filling the end half to the edge of the window */
@media (min-width: 60rem) {
  .scene { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scene__view { grid-area: 1 / 2; }
  .scene__copy { grid-area: 1 / 1; align-self: center; gap: var(--space-lg); padding: var(--space-2xl) var(--space-3xl) var(--space-2xl) max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter))); background: none; }
  .scene__actions { display: flex; flex-wrap: wrap; width: auto; max-width: none; gap: var(--space-md); }
  .scene__view::after { display: none; }
  .scene__copy, .scene__copy h1, .scene__copy h2 { color: var(--color-ink); }
  .scene__line { color: var(--color-ink-2); }
  .scene__actions .btn { justify-self: auto; border-color: var(--color-accent); background: var(--color-accent); color: var(--color-accent-ink); }
  .scene__actions .btn:hover { background: var(--color-accent-2); border-color: var(--color-accent-2); }
  .scene__actions .btn--line { min-height: 52px; padding-inline: var(--space-xl); border: var(--rule-hair) solid var(--color-ink); background: transparent; color: var(--color-ink); text-decoration: none; }
  .scene__actions .btn--line:hover { background: var(--color-paper-2); }
  .scene__actions .btn:focus-visible { outline-color: var(--color-focus); }
}

/* live: the stage pinned under the masthead for 110vh of scroll. The first scroll plays the walk in on the canvas as one film,
   Sophie appearing in it where the aisle ends; the rest of the pin holds her with her hello at the top, and a snap point in that
   hold stops a fast flick until the hello has been seen. Her own <img> stays hidden: the canvas shows her, so nothing swaps. */
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-a11y-still]) .entrance.is-live { height: calc(var(--stage-h) + 110vh); }
  :root:not([data-a11y-still]) .is-live .entrance__stage { position: sticky; top: var(--masthead-h); }
  :root:has(.entrance.is-live):not([data-a11y-still]) { scroll-snap-type: y proximity; }
  :root:not([data-a11y-still]) .is-live .entrance__hold { position: absolute; inset-inline: 0; top: calc(110vh * 0.5 + var(--space-lg)); height: 1px; scroll-snap-align: start; scroll-snap-stop: always; }
  :root:not([data-a11y-still]) .is-live .scene--in { position: absolute; inset: 0; background: none; pointer-events: none; }
  :root:not([data-a11y-still]) .is-live .scene--in .scene__view { background: none; }
  :root:not([data-a11y-still]) .is-live .scene--in .scene__view img { opacity: 0; transition: opacity var(--dur-short) var(--ease-out); }
  :root:not([data-a11y-still]) .is-live:not(.has-sophie)[data-phase="in"] .scene--in .scene__view img { opacity: 1; transition-duration: 450ms; }
  :root:not([data-a11y-still]) .is-live .hello { opacity: 0; transform: translateY(8px); transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out); }
  :root:not([data-a11y-still]) .is-live[data-phase="in"] .hello { opacity: 1; transform: none; transition-duration: 450ms; transition-delay: 80ms; }
  :root:not([data-a11y-still]) .is-live[data-phase="in"] .scene--in { pointer-events: auto; }
  :root:not([data-a11y-still]) .is-live .scene__copy { transition: opacity var(--dur-long) var(--ease-out), visibility 0s; }
  :root:not([data-a11y-still]) .is-live:not([data-phase="open"]) .scene--out .scene__copy,
  :root:not([data-a11y-still]) .is-live:not([data-phase="in"]) .scene--in .scene__copy { opacity: 0; visibility: hidden; transition: opacity var(--dur-short) var(--ease-out), visibility 0s linear var(--dur-short); }
  :root:not([data-a11y-still]) .is-live:not(.is-ready) :is(.scene__copy, .scene--in .scene__view img, .hello) { transition: none; }
  :root:not([data-a11y-still]) .is-live .scene__view canvas { transition: opacity var(--dur-long) var(--ease-out); }
  /* the shade under the shop front's words lifts as soon as she walks in */
  :root:not([data-a11y-still]) .is-live .scene--out .scene__view::after { transition: opacity var(--dur-long) var(--ease-out); }
  :root:not([data-a11y-still]) .is-live:not([data-phase="open"]) .scene--out .scene__view::after { opacity: 0; }
}
.entrance__hold { display: none; }
:root:not([data-a11y-still]) .is-live .entrance__hold { display: block; }

/* Sophie's hello: written across the top of her picture like a campaign line, on a veil of paper that fades into the shop's ceiling, signed in the wordmark's face; nothing covers her */
:root { --hello-veil: rgb(251 248 243 / 0.92); --hello-veil-end: rgb(251 248 243 / 0); }
.scene__view--sophie img { object-position: 50% 30%; }
.hello { position: absolute; z-index: 1; inset: 0 0 auto; display: grid; justify-items: center; gap: var(--space-2xs); padding: var(--space-lg) var(--gutter) var(--space-3xl); background: linear-gradient(var(--hello-veil) 55%, var(--hello-veil-end)); color: var(--color-ink); text-align: center; }
.hello__line { max-width: 18ch; font: var(--display-weight) var(--text-xl)/1.25 var(--font-display); text-wrap: balance; overflow-wrap: break-word; }
.hello__sign { font: 400 var(--text-lg)/1 var(--font-mark); color: var(--color-wine); }
.hello__go { display: none; }

/* phones and tablets: her picture fills the scene; the hello and one button to the collections sit above her head, and the headline is kept for screen readers only */
@media (max-width: 59.99rem) {
  .scene--in .scene__view { container-type: inline-size; }
  .scene--in .scene__view::after { display: none; }
  .scene--in .scene__view img { object-position: 50% 0; }
  .scene--in .hello { padding-top: var(--space-md); }
  .scene--in .hello__go { display: inline-flex; margin-top: var(--space-sm); padding-inline: var(--space-xl); border-color: var(--color-accent); background: var(--color-accent); color: var(--color-accent-ink); }
  .scene--in .hello__go:hover { border-color: var(--color-accent-2); background: var(--color-accent-2); }
  .scene--in .scene__copy { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .scene--in .scene__actions { display: none; }
}

/* ---------- sections ---------- */

.home-sec { margin-top: var(--section-gap); }
.home-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xs) var(--space-xl); margin-bottom: var(--space-xl); }

/* the rows of garments use the shop's own .tiles grid from shop.css, unchanged */

/* ---------- the kinds ---------- */

.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xl) var(--space-2xs); }
@media (min-width: 60rem) { .kinds { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: var(--space-2xl); } }
.kinds__link { display: grid; gap: var(--space-sm); color: var(--color-ink); text-decoration: none; }
.kinds__photo { display: block; aspect-ratio: 3 / 4; overflow: hidden; background: var(--color-paper-2); }
.kinds__photo img { width: 100%; height: 100%; object-fit: cover; }
.kinds__name { font-size: var(--text-lg); line-height: 1.3; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.kinds__link:hover .kinds__name { text-decoration-line: underline; }
.kinds__link:active .kinds__name { color: var(--color-ink-2); }
.kinds__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

/* ---------- the film ---------- */

.film__frame { position: relative; display: grid; gap: var(--space-md); width: min(100%, calc((100svh - var(--masthead-h) - 10rem) * 0.8)); min-width: min(100%, 20rem); margin: 0 auto; }
.film__video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 35%; background: var(--color-paper-2); }
.film__toggle { position: absolute; top: var(--space-md); inset-inline-end: var(--space-md); display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border: var(--rule-hair) solid var(--color-ink); border-radius: var(--radius-pill); background: var(--color-paper); color: var(--color-ink); transition: background-color var(--dur-short) var(--ease-out); }
.film__toggle:hover { background: var(--color-paper-2); }
.film__toggle:active { background: var(--color-paper-3); }
.film__toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.film__icon--pause { display: none; }
.is-playing .film__icon--pause { display: inline-grid; }
.is-playing .film__icon--play { display: none; }
.film__caption { font-size: var(--text-md); color: var(--color-ink-2); }

/* ---------- Sophie, and the visit: a photograph and a few words side by side ---------- */

.split { display: grid; gap: var(--space-xl); align-items: center; }
.split__photo { margin: 0; aspect-ratio: 4 / 5; overflow: hidden; background: var(--color-paper-2); }
.split__photo img { width: 100%; height: 100%; object-fit: cover; }
.split__photo--tall img { object-position: 50% 62%; }
.split__text { display: grid; justify-items: start; gap: var(--space-lg); min-width: 0; }
.split__text .lead { max-width: 46ch; }
.split__text p:not(.lead) { max-width: 60ch; }
.split__links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); }
@media (min-width: 60rem) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4xl); }
  .split--flip .split__photo { order: 2; }
}

/* ---------- service: a calm list on hairlines ---------- */

.service { border-top: var(--rule-hair) solid var(--color-rule-ink); }
.service__row { display: grid; gap: var(--space-xs); padding-block: var(--space-lg); border-bottom: var(--rule-hair) solid var(--color-rule); }
.service__name { font-size: var(--text-title); }
.service__text { max-width: 58ch; color: var(--color-ink-2); }
.service__go { margin-top: var(--space-lg); }
@media (min-width: 48rem) {
  .service__row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-xl); align-items: baseline; }
}

/* ---------- the visit ---------- */

.visit__area { display: block; margin-top: var(--space-xs); font-size: var(--text-lead); color: var(--color-ink-2); }
.visit__facts { display: grid; gap: var(--space-lg); margin: 0; }
.visit__facts dt { font-size: var(--text-sm); color: var(--color-muted); }
.visit__facts dd { margin: 0; }
.visit__line { display: block; }
.visit__facts .link { min-height: 48px; }
.visit__go { display: flex; flex-wrap: wrap; gap: var(--space-md); }
/* on a phone the two ways there sit side by side at one width, a single row under the facts */
@media (max-width: 40rem) { .visit__go { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); } .visit__go .btn { padding-inline: var(--space-sm); } }

@media (prefers-reduced-motion: reduce) {
  .scene__copy, .scene__view, .scene__view canvas, .hello, .film__toggle { transition: none; }
}
:root[data-a11y-still] .scene__copy, :root[data-a11y-still] .scene__view, :root[data-a11y-still] .scene__view canvas, :root[data-a11y-still] .hello { transition: none; }

/* Sophie's section until her photograph arrives, and the visit block, which carries no photograph */
.split--solo { justify-items: start; }
@media (min-width: 60rem) {
  .split.split--solo { grid-template-columns: minmax(0, 46rem); }
  .split.split--top { align-items: start; }
}
