/* dusk-site — home page styles (brief 01). Loads after site.css. Only the orb moves; its glow is the one shadow
   allowed on the site (spec 8). */

/* Brand hero (spec 4.1 row 1b, amended 2026-11-27) ------------------------------------------------------ */
/* "Shop the lamp ↓" scrolls to #buy. Smooth only when the visitor allows motion. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:root { --header-h: 53px; } /* .site-header: 52 px min-height + 1 px hairline */
main.home { padding-top: 0; }
main.home > .wrap { padding-top: 24px; }

/* Full-bleed photo: the whole first screen on a phone (minus the sticky header), 80vh on desktop. */
.brand-hero {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  min-height: 420px;
  overflow: hidden;
  background: var(--c-twilight);
}
.brand-hero .hero-photo, .brand-hero .hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
}
.brand-hero .hero-photo img {
  object-fit: cover;
  object-position: 45% 48%; /* keeps the lamp in frame at 390x664 and 1280x800 */
}
/* Text on a soft twilight gradient at the bottom: sand on twilight is far above 4.5:1. The gradient is CSS, never
   an image. */
.hero-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 160px 16px 28px;
  background: linear-gradient(to top, rgba(23, 27, 38, 0.92) 0%, rgba(23, 27, 38, 0.78) 45%, rgba(23, 27, 38, 0) 100%);
  color: var(--c-sand);
  text-align: center;
}
.hero-mark { width: 60px; height: 60px; margin: 0 auto 12px; }
.hero-line {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.2;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--c-sand);
  font-size: 1rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* The product block is the scroll target; keep its top clear of the sticky header. */
#buy { scroll-margin-top: var(--header-h); }

@media (min-width: 900px) {
  /* Desktop: two columns like TORV. Text on twilight at left, the portrait photo at right filling the height, so the
     lamp is never cropped or covered by the text. Phones keep the full-bleed photo above. */
  .brand-hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: minmax(0, 1fr); /* the tall portrait photo must not stretch the row past the hero height */
    height: 80vh;
    height: 80svh;
    min-height: 520px;
    max-height: 820px;
  }
  .brand-hero .hero-photo { grid-column: 2; grid-row: 1; min-height: 0; }
  .brand-hero .hero-photo img { min-height: 0; }
  .brand-hero .hero-photo img { object-position: 50% 55%; }
  .hero-text {
    position: static;
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 40px 40px 56px max(40px, calc((100vw - 1100px) / 2 + 16px));
    background: var(--c-twilight);
    text-align: left;
  }
  .hero-mark { width: 64px; height: 64px; margin: 0 0 20px; }
  .hero-line { font-size: 2.75rem; max-width: 12ch; margin-bottom: 16px; }
}

/* Product block ------------------------------------------------------------------------------------------- */
.photos { min-width: 0; }

/* Main photo: a real button holding the off photo, an on-layer added by home.js on the first tap, and the hint. */
.orb {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: left;
}
.orb picture, .orb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}
.orb picture { position: relative; z-index: 1; }
/* The on photo, created by home.js on the first tap, sits on top and fades in over 300 ms. */
.orb .orb-on {
  position: absolute;
  inset: 0;
  z-index: 2;
  height: 100%;
  opacity: 0;
  transition: opacity 300ms ease;
}
.orb.is-on .orb-on { opacity: 1; }
/* Soft amber glow around the frame. On a transparent box the shadow is drawn outside only, so it reads as light
   spilling past the edges of the photo. */
.orb::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: var(--radius);
  box-shadow: 0 0 56px 10px rgba(243, 185, 104, 0.55);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.orb.is-on::after { opacity: 1; }
/* Hint pill over the photo. Hidden until home.js is ready (JS off: nothing to tap); home.js adds hint-done to fade it
   out after the first tap (for good) and while a photo other than front-off is selected (the tap is inert then). */
.orb .hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--c-twilight);
  color: var(--c-sand);
  font: 600 0.8125rem/1.2 var(--font-body);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.orb.is-ready .hint { opacity: 1; }
.orb.is-ready.hint-done .hint { opacity: 0; transition: opacity 300ms ease; }
.orb:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 2px; }

/* Thumbnails (2026-11-27 photos change: eight). Desktop: four per row, two rows. Phone: one row that scrolls
   sideways and snaps, with the fifth thumb peeking in so the row reads as scrollable. The row itself scrolls, so the
   page never gets a horizontal scrollbar. Each thumb stays at least 44 px tall at 390 px wide. */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.thumb {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.thumb picture, .thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}
.thumb[aria-pressed="true"] { outline-color: var(--c-oak); }
.thumb:focus-visible { outline-color: var(--c-ink); }

/* Text column */
.title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.title-row h1, .title-row .price { margin: 0; }
.desc { margin-bottom: 20px; }
.trust {
  margin: 12px 0 24px;
  font-size: 0.9375rem;
  color: #5F5A54;
}
.buy-block ul { margin: 0; padding-left: 20px; }
.buy-block li { margin-bottom: 6px; }

/* Phone: keep the lamp, name, price and Buy button inside the first screen on 390 x 844. */
@media (max-width: 899px) {
  /* 4:5 at just under half the screen height: width = 0.8 x 48vh, never wider than the column. */
  .orb { width: min(100%, 38.4vh); margin-left: auto; margin-right: auto; }
  .thumb picture, .thumb img { aspect-ratio: 5 / 4; }
  /* One scrolling row: 4.5 thumbs visible (about 74 x 59 px at 390 px wide). */
  .gallery {
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3 * 8px) / 4.5);
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0;
    padding-bottom: 2px; /* room for the outline on the selected thumb */
    scrollbar-width: none;
  }
  .gallery::-webkit-scrollbar { display: none; }
  .thumb { scroll-snap-align: start; }
}

/* Room strip (2026-11-27 photos change: four rooms). Two by two on phones and small screens, four across from
   900 px. All 4:5, lazy, sized; no text. */
.life {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 48px;
}
.life picture, .life img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}
@media (min-width: 900px) {
  .life { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 64px; gap: 24px; }
}
