/* Hallmark · macrostructure: Editorial Catalogue · page: home
   Rebuilt to the stacking-panel structure: ink hero, ink reel, ink
   studio, paper shelf list, ink stack. Every colour is a Section 1
   token. The only gradient is the display-type fill, which is the
   structure's signature, and the neutral veil over the hero video. */

/* ==========================================================================
   InihaoStudio — css/pages/home.css
   Home only. Loaded after components.css on index.html.
   ========================================================================== */

.page-home {
  background-color: var(--ink);
}

/* .fill-display and the .stack* deck now live in components.css so the
   shop can share them. This file keeps only the home shell geometry. */

/* ---- Header over the dark panels ------------------------------------ */

/* The header is sticky and sits on top of ink until the paper panel
   arrives. Over ink it takes the ink surface itself: the reel runs light
   covers behind it, so light type on a transparent bar would be unreadable
   wherever a cover passes under. Past the studio it falls back to the
   paper surface every other page uses. */
.page-home .site-header .brand,
.page-home .site-header .nav__link {
  transition: color var(--dur-fast) var(--ease-out);
}

.page-home .site-header.is-over-dark {
  background-color: var(--ink);
  border-bottom-color: transparent;
}

.page-home .site-header.is-over-dark .brand,
.page-home .site-header.is-over-dark .nav__link {
  color: var(--paper);
}

.page-home .site-header.is-over-dark .nav__link:hover {
  color: var(--paper);
  opacity: 0.72;
}

.page-home .site-header.is-over-dark.is-scrolled {
  border-bottom-color: transparent;
}

/* ---- 1. Hero -------------------------------------------------------- */

.hero {
  --hero-exit: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100svh - var(--header-h));
  padding: var(--space-5) 0 var(--space-6);
  overflow: hidden;
  background-color: var(--ink);
  color: var(--paper);
  isolation: isolate;
}

/* Overscanned so hero.js can parallax it without exposing an edge. */
.hero__video {
  position: absolute;
  inset: -18px;
  width: calc(100% + 36px);
  max-width: none;
  height: calc(100% + 36px);
  object-fit: cover;
  object-position: center 38%;
  pointer-events: none;
  /* The clip is light and nearly monochrome. Pulled toward the ink ground
     so it sits inside the palette instead of reading as pale wallpaper. */
  filter: grayscale(0.6) contrast(1.12) brightness(0.72);
  background-color: var(--ink);
  will-change: transform;
}

/* Neutral veil. Dark at the top under the header and at the foot under
   the bar, clear through the middle where the figure is. */
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: linear-gradient(
    180deg,
    rgba(16, 13, 10, 0.88) 0%,
    rgba(16, 13, 10, 0.42) 28%,
    rgba(16, 13, 10, 0.34) 58%,
    rgba(16, 13, 10, 0.9) 100%
  );
}

.hero__stack {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
}

.hero__word-wrap {
  overflow: hidden;
  padding-top: clamp(0.5rem, 3vh, 3rem);
  container-type: inline-size;
}

.hero__word {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15.1cqi;
  font-variation-settings: "opsz" 144;
  font-weight: 600;
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The foot bar: note left, one action right. */
.hero__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  padding-top: var(--space-7);
  opacity: calc(1 - var(--hero-exit) * 0.9);
  translate: 0 calc(var(--hero-exit) * 16px);
}

.hero__note {
  max-width: 26ch;
  margin: 0;
  color: var(--paper-3);
  font-size: clamp(0.8125rem, 1.25vw, 1.0625rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__note strong {
  color: var(--paper);
  font-weight: 600;
}

/* The structure's one filled pill, in this palette's accent. */
.pill-cta {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.72em 1.6em;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background-color: var(--accent);
  color: var(--accent-ink);
  font-size: clamp(0.8125rem, 1.35vw, 1.0625rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}

.pill-cta::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  rotate: 45deg;
  translate: -0.15em 0;
}

.pill-cta:hover {
  background-color: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.pill-cta:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 3px;
}

/* ---- 2. Reel -------------------------------------------------------- */

.reel {
  padding: clamp(3.5rem, 9vw, 8rem) 0 clamp(1.5rem, 4vw, 3rem);
  overflow: hidden;
  background-color: var(--ink);
}

.reel__rows {
  display: grid;
  gap: clamp(0.5rem, 1vw, 0.75rem);
}

.reel__row {
  overflow: hidden;
}

.reel__track {
  display: flex;
  gap: clamp(0.5rem, 1vw, 0.75rem);
  width: max-content;
  margin-inline: auto;
  will-change: transform;
}

.reel__tile {
  flex: none;
  /* Portrait, because that is the shape of a product cover. Cropping the
     covers into a landscape band cut the title off every one of them. */
  width: clamp(126px, 13.5vw, 232px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: clamp(0.5rem, 1.2vw, 0.9rem);
  background-color: var(--ink-2);
  text-decoration: none;
}

.reel__tile img,
.reel__tile svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel__tile:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 3px;
}

/* ---- 3. Studio ------------------------------------------------------ */

.studio {
  position: relative;
  padding: clamp(4rem, 11vw, 10rem) 0 clamp(5rem, 13vw, 12rem);
  background-color: var(--ink);
  color: var(--paper);
}

.studio__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  text-align: center;
}

.studio__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8.6vw, 8rem);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: -0.045em;
  word-spacing: 0.08em;
  text-transform: uppercase;
}

.studio__text {
  max-width: 34ch;
  margin: 0;
  color: var(--paper);
  font-size: clamp(0.98rem, 2vw, 1.3rem);
  font-weight: 500;
  line-height: 1.5;
}

/* One span per character, written by home.js. Each character lights as
   the paragraph's progress passes its own index; without the script the
   paragraph is plain text at full strength. */
.studio__text .ch {
  opacity: 1;
}

.studio__text.is-split .ch {
  /* --i is the character's position, 0 at the first and 1 at the last.
     Scaled by 0.9 so the closing words reach full strength before the
     paragraph's progress tops out at 1. */
  opacity: clamp(0.18, calc((var(--p, 0) - var(--i, 0) * 0.9) * 14), 1);
}

.studio__objects {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* The four corner objects are real product covers, so the decoration is
   the catalogue rather than an arbitrary shape. */
.studio__object {
  position: absolute;
  overflow: hidden;
  border-radius: clamp(0.6rem, 1.4vw, 1.1rem);
  background-color: var(--ink-2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.studio__object img,
.studio__object svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio__object--tl {
  top: 8%;
  left: 2%;
  width: clamp(76px, 12vw, 190px);
  aspect-ratio: 4 / 5;
  rotate: -7deg;
}

.studio__object--tr {
  top: 9%;
  right: 2%;
  width: clamp(72px, 11vw, 175px);
  aspect-ratio: 4 / 5;
  rotate: 6deg;
}

.studio__object--bl {
  bottom: 9%;
  left: 4%;
  width: clamp(68px, 10vw, 165px);
  aspect-ratio: 4 / 5;
  rotate: 5deg;
}

.studio__object--br {
  right: 4%;
  bottom: 9%;
  width: clamp(74px, 11.5vw, 185px);
  aspect-ratio: 4 / 5;
  rotate: -5deg;
}

/* ---- 4. Shelf list (paper panel) ------------------------------------ */

.shelves {
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(4rem, 9vw, 8rem);
  border-radius: clamp(1.75rem, 4vw, 3.75rem) clamp(1.75rem, 4vw, 3.75rem) 0 0;
  background-color: var(--paper);
  color: var(--ink);
}

.shelves__title {
  max-width: 16ch;
  margin: 0 auto clamp(2.5rem, 6vw, 5rem);
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8.5vw, 7.5rem);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: -0.045em;
  text-align: center;
  text-transform: uppercase;
}

.shelves__list {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.shelf-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(0.9rem, 4vw, 3.5rem);
  align-items: start;
  padding: clamp(1.4rem, 3.2vw, 2.8rem) 0;
  border-top: 1px solid rgba(28, 25, 21, 0.16);
}

.shelf-row:last-child {
  border-bottom: 1px solid rgba(28, 25, 21, 0.16);
}

.shelf-row__num {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7.5vw, 6.5rem);
  font-weight: 600;
  line-height: 0.78;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.shelf-row__body {
  display: grid;
  gap: 0.35rem;
}

.shelf-row__name {
  margin: 0;
  font-size: clamp(1rem, 2.1vw, 1.9rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.shelf-row__desc {
  max-width: 56ch;
  margin: 0;
  opacity: 0.68;
  font-size: clamp(0.875rem, 1.5vw, 1.1875rem);
  font-weight: 400;
  line-height: 1.55;
}

.shelf-row__link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0.15rem;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.shelf-row__link:hover {
  color: var(--accent);
}

/* ---- 5. Stack (three sheets) ---------------------------------------- */

/* The deck's rules are shared with the shop and live in components.css.
   Home only adds its shell: the sheet rises out of the paper panel above
   it, so the corners are cut at the top and the top edge overlaps. */
.page-home .stack {
  margin-top: clamp(-2.5rem, -4vw, -1.5rem);
  border-radius: clamp(1.75rem, 4vw, 3.75rem) clamp(1.75rem, 4vw, 3.75rem) 0 0;
}

/* ---- 6. Close (letter + the delivery note) --------------------------- */

.close {
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3rem);
  background-color: var(--ink);
  color: var(--paper);
}

.close__inner {
  display: grid;
  gap: clamp(1.6rem, 4vw, 2.75rem);
  padding-top: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid rgba(231, 218, 198, 0.22);
}

.close__title {
  max-width: 20ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.2vw, 4rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.close__lead {
  max-width: 52ch;
  margin: 0;
  color: var(--paper-3);
  font-size: clamp(0.9375rem, 1.5vw, 1.125rem);
  line-height: 1.55;
}

.close__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  max-width: 34rem;
}

.close__field {
  display: grid;
  flex: 1 1 14rem;
  gap: 0.35rem;
}

.close__label {
  color: var(--paper-3);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.close__input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(231, 218, 198, 0.3);
  border-radius: var(--radius-sm);
  background-color: rgba(247, 241, 230, 0.06);
  color: var(--paper);
  font: inherit;
  font-size: var(--text-base);
}

.close__input::placeholder {
  color: rgba(231, 218, 198, 0.45);
}

.close__input:focus-visible {
  outline: 2px solid var(--marigold);
  outline-offset: 2px;
}

.close__btn {
  padding: 0.72rem 1.3rem;
  border: 1px solid var(--paper-3);
  border-radius: var(--radius-sm);
  background-color: var(--paper-3);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out);
}

.close__btn:hover {
  background-color: var(--paper);
}

.close__hint {
  margin: 0;
  color: rgba(231, 218, 198, 0.6);
  font-size: var(--text-sm);
}

.close__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.close__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper-3);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.close__links a:hover {
  color: var(--paper);
}

/* ---- Phones --------------------------------------------------------- */

@media (max-width: 767px) {
  .hero {
    justify-content: flex-end;
    padding-bottom: var(--space-5);
  }

  .hero__word-wrap {
    padding-top: var(--space-7);
  }

  .hero__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding-top: var(--space-5);
  }

  .hero__note {
    max-width: 30ch;
  }

  .studio__object--tl,
  .studio__object--bl {
    left: -4%;
  }

  .studio__object--tr,
  .studio__object--br {
    right: -4%;
  }

  .studio__object--tl,
  .studio__object--tr {
    top: 2%;
  }

  .studio__object--bl,
  .studio__object--br {
    bottom: 2%;
  }

  .shelf-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .shelf-row__num {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  /* The deck's phone geometry is shared and lives in components.css.
     Home hides the sheet button on phones; the shop keeps its own,
     because there it applies the category filter. */
  .page-home .stack__btn {
    display: none;
  }
}

/* Reduced motion: no scaling, no parallax, no character fill-in.
   Everything stays legible and in place. */
@media (prefers-reduced-motion: reduce) {
  .hero__foot {
    opacity: 1;
    translate: none;
  }

  .hero__video {
    transform: none !important;
  }

  .reel__track {
    transform: none !important;
  }

  .studio__text .ch {
    opacity: 1;
  }

  .stack__card {
    transform: none !important;
    will-change: auto;
  }
}
