/* ============================================================
   Living Hub – Collection · Digital Catalog
   Design system — PROJECT_SPECIFICATION_v1.0
   ============================================================ */

:root {
  --white: #ffffff;
  --ivory: #f6f3ee;
  --charcoal: #403d39;
  --stone: #cfc7bc;

  --font: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(1.5rem, 6vw, 6rem);
  --section-pad: clamp(5rem, 16vh, 10rem);
  --gallery-gap: clamp(4rem, 12vh, 9rem);
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--charcoal);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible {
  outline: 1px solid var(--charcoal);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1.2rem;
  background: var(--white);
  color: var(--charcoal);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Typography ---------- */

.title-main {
  font-weight: 300;
  font-size: clamp(1.5rem, 5vw, 3.6rem);
  letter-spacing: 0.28em;
  text-indent: 0.28em; /* optical centering compensation */
  text-transform: uppercase;
  line-height: 1.25;
}

.title-section {
  font-weight: 500;
  font-size: clamp(0.8rem, 1.1vw, 0.95rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.slogan {
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.3rem, 2.3vw, 1.85rem);
  line-height: 1.5;
}

.body-text {
  font-weight: 400;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.85;
  max-width: 34em;
  margin-inline: auto;
}

.eyebrow {
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
}

/* ---------- Reveal motion (almost invisible) ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 1.2s ease,
    transform 1.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Cover ---------- */

.cover {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  color: var(--white);
}

.cover__media,
.cover__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cover__media img {
  object-fit: cover;
  will-change: transform;
}

.cover::before,
.cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.cover::before {
  top: 0;
  height: 34%;
  background: linear-gradient(to bottom, rgba(24, 22, 20, 0.42), transparent);
}

.cover::after {
  bottom: 0;
  height: 42%;
  background: linear-gradient(to top, rgba(24, 22, 20, 0.55), transparent);
}

.cover__logo {
  position: relative;
  z-index: 2;
  width: min(280px, 52vw);
  margin-top: 9svh;
}

.cover__titleblock {
  position: relative;
  z-index: 2;
  margin-bottom: 11svh;
  text-align: center;
  padding-inline: var(--gutter);
}

.cover__rule {
  width: 54px;
  height: 1px;
  background: var(--stone);
  margin: 0 auto 2rem;
  border: 0;
}

/* ---------- Section opener (full-viewport photograph) ---------- */

.opener {
  position: relative;
  height: 100svh;
  overflow: hidden;
}

.opener__media,
.opener__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.opener__media img {
  object-fit: cover;
  will-change: transform;
}

.opener::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  background: linear-gradient(to top, rgba(24, 22, 20, 0.55), transparent);
  pointer-events: none;
}

.opener__caption {
  position: absolute;
  z-index: 1;
  left: var(--gutter);
  bottom: clamp(2.5rem, 9svh, 6rem);
  color: var(--white);
}

.opener--right .opener__caption {
  left: auto;
  right: var(--gutter);
  text-align: right;
}

/* Panoramic photographs: cap the container height so the wide framing
   survives instead of being cropped to a viewport-shaped slice. */
.opener--pano {
  height: clamp(220px, 52vw, 100svh);
}

.opener--pano .opener__caption {
  bottom: clamp(1.25rem, 5vw, 6rem);
}

.opener__caption .eyebrow {
  display: block;
  opacity: 0.8;
  margin-bottom: 1.1rem;
}

.opener__caption .title-main {
  text-indent: 0;
}

/* ---------- Opener crop corrections ----------
   Per-photograph focal points so the furniture reads complete.
   object-position handles the container crop; transform-origin keeps
   the protected edge intact under the subtle parallax zoom. */

#cover .cover__media img {
  object-position: 50% 100%;
  transform-origin: 50% 100%;
}

#interior .opener__media img {
  object-position: 50% 100%;
  transform-origin: 50% 100%;
}

#kitchen .opener__media img {
  object-position: 50% 90%;
  transform-origin: 50% 90%;
}

#living-room .opener__media img {
  object-position: 55% 85%;
  transform-origin: 100% 90%;
}

#bedroom .opener__media img {
  object-position: 50% 90%;
  transform-origin: 50% 90%;
}

/* Bedroom (18), panoramic gallery crop: keep the bottom of the bed
   fully visible within the 21:10 framing. */
#bedroom .g-bleed--crop img {
  object-position: 50% 82%;
}

/* Storage Room: the photograph was cropped at both edges.
   Frame the opener at the image's own 3:2 proportion (no parallax zoom)
   so the full composition is visible; margins over cropping. */
#storage-room .opener {
  width: min(100%, 150svh);
  margin-inline: auto;
}

#study .opener__media img {
  object-position: 50% 95%;
  transform-origin: 50% 95%;
}

#outdoor-living .opener__media img {
  object-position: 50% 85%;
  transform-origin: 50% 85%;
}

/* ---------- Editorial intro blocks ---------- */

.intro {
  background: var(--white);
  padding: var(--section-pad) var(--gutter);
  text-align: center;
}

.intro--ivory {
  background: var(--ivory);
}

.intro__mark {
  width: 30px;
  height: 34px;
  margin: 0 auto 2.6rem;
  opacity: 0.9;
}

.intro__rule {
  width: 54px;
  height: 1px;
  background: var(--stone);
  border: 0;
  margin: 2.4rem auto;
}

.intro .slogan {
  max-width: 26em;
  margin-inline: auto;
}

/* ---------- Brand story ---------- */

.brand-story {
  padding: clamp(7rem, 20vh, 13rem) var(--gutter);
}

.brand-story__logo {
  width: min(190px, 44vw);
  margin: 0 auto 4.5rem;
}

.brand-story .title-main {
  margin-bottom: 3.2rem;
}

.brand-story .body-text + .body-text {
  margin-top: 1.6rem;
}

/* ---------- Contents ---------- */

.contents {
  background: var(--ivory);
  padding: var(--section-pad) var(--gutter);
}

.contents__head {
  text-align: center;
  margin-bottom: clamp(3.5rem, 9vh, 6rem);
}

.contents__head .eyebrow {
  display: block;
  color: var(--charcoal);
  opacity: 0.55;
  margin-bottom: 1.4rem;
}

.contents__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(2.5rem, 6vw, 5.5rem);
  max-width: 880px;
  margin-inline: auto;
}

.contents__group .title-section {
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--stone);
}

.contents__group a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(207, 199, 188, 0.45);
  font-weight: 300;
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  letter-spacing: 0.06em;
  transition: letter-spacing 0.5s ease;
}

.contents__group a:hover {
  letter-spacing: 0.12em;
}

.contents__group a .num {
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--stone);
}

/* ---------- Galleries ---------- */

.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--gallery-gap);
  padding-bottom: var(--section-pad);
}

.gallery figure {
  margin: 0;
}

.g-full {
  width: min(1120px, 86vw);
  margin-inline: auto;
}

.g-bleed {
  width: 100%;
}

.g-bleed--crop img {
  width: 100%;
  aspect-ratio: 21 / 10;
  height: auto;
  object-fit: cover;
  max-height: 88svh;
}

.g-pair,
.g-trio {
  display: grid;
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: start;
  margin-inline: auto;
}

.g-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(1240px, 90vw);
}

.g-trio {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(1320px, 92vw);
}

.g-pair--offset > figure:last-child {
  margin-top: clamp(2.5rem, 9vh, 6.5rem);
}

/* ---------- Lightbox (small gallery images only) ---------- */

.g-pair img,
.g-trio img {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 220ms ease;
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__image {
  max-width: 92vw;
  max-height: 92svh;
  width: auto;
  height: auto;
}

.lightbox__close {
  position: absolute;
  top: clamp(0.75rem, 2.5vh, 1.5rem);
  right: clamp(1rem, 2.5vw, 1.75rem);
  padding: 0.25rem 0.75rem;
  background: none;
  border: 0;
  font-family: var(--font);
  font-weight: 300;
  font-size: 2rem;
  line-height: 1;
  color: var(--white);
  opacity: 0.75;
  cursor: pointer;
  transition: opacity 220ms ease;
}

.lightbox__close:hover {
  opacity: 1;
}

.lightbox__close:focus-visible {
  outline: 1px solid var(--white);
  outline-offset: 4px;
  opacity: 1;
}

.scroll-locked {
  position: fixed;
  width: 100%;
  overflow-y: scroll;
}

/* ---------- Contact ---------- */

.contact {
  background: var(--white);
  padding: clamp(7rem, 20vh, 13rem) var(--gutter);
  text-align: center;
}

.contact__logo {
  width: min(230px, 50vw);
  margin: 0 auto 4.5rem;
}

.contact .title-main {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  margin-bottom: 3.5rem;
}

.contact__channels {
  max-width: 420px;
  margin-inline: auto;
}

.contact__channels li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid rgba(207, 199, 188, 0.45);
}

.contact__channels li:first-child {
  border-top: 1px solid var(--stone);
}

.contact__channels .label {
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.contact__channels .value {
  font-weight: 300;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

/* ---------- Back cover ---------- */

.backcover {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: var(--white);
}

.backcover__logo {
  width: min(300px, 58vw);
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  .g-trio {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g-trio figure:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .g-pair,
  .g-trio {
    grid-template-columns: 1fr;
    width: min(560px, 88vw);
  }

  .g-pair--offset > figure:last-child,
  .g-trio figure:last-child {
    margin-top: 0;
    grid-column: auto;
  }

  .contents__grid {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .contact__channels li {
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
  }

  .title-main {
    letter-spacing: 0.2em;
    text-indent: 0.2em;
  }

  .opener__caption .title-main {
    text-indent: 0;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lightbox,
  .lightbox__close {
    transition: none;
  }
}

/* ---------- Print (future PDF foundation) ---------- */

@media print {
  .cover,
  .opener,
  .backcover {
    height: auto;
    min-height: 0;
    page-break-after: always;
  }

  .cover__media,
  .cover__media img,
  .opener__media,
  .opener__media img {
    position: static;
    height: auto;
  }

  .cover::before,
  .cover::after,
  .opener::after {
    display: none;
  }

  .opener__caption,
  .cover__logo,
  .cover__titleblock {
    position: static;
    color: var(--charcoal);
    text-align: left;
    margin: 1rem 0;
  }

  .gallery figure {
    page-break-inside: avoid;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
