/* experience.css — immersive v2 layout: opening, statement, service scenes, horizontal gallery,
   close, mobile action bar. Everything here reads fully without JS; rules that hide content
   before a reveal are scoped to .has-motion (added by js/motion.js). */

/* ===== Lenis smooth scroll (from lenis 1.3.26 dist/lenis.css) ===== */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ===== Header estimate button ===== */
.header__cta {
  margin-left: 1.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .header__cta { display: none; }
  /* spec: tap targets >= 48px on phones */
  .lang-btn { min-width: 48px; min-height: 48px; }
  .mobile-menu-btn { min-width: 48px; min-height: 48px; justify-content: center; align-items: center; }
}

/* ===== OPENING — blueprint → built ===== */
.opening {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.opening__photos {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr;
}
.opening__photo { margin: 0; overflow: hidden; }
.opening__photo img { width: 100%; height: 100%; object-fit: cover; }
.opening__photo--side { display: none; }
.opening__shade {
  position: absolute;
  inset: 0;
  background-color: var(--ink);
  opacity: 0.65;
}
.opening__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 20, 18, 0.95) 0%, rgba(14, 20, 18, 0.55) 35%, rgba(14, 20, 18, 0) 70%);
}

/* the house frame drawing + (desktop) the 01-06 services index under it */
.opening__plan {
  position: absolute;
  top: 12%;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: min(88%, 110vh);
  /* above .opening__content, whose wide box would otherwise swallow clicks on the index */
  z-index: 4;
}
.blueprint {
  display: block;
  width: 100%;
  height: auto;
  fill: none;
  stroke: var(--gold-light);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.blueprint .bp-member { stroke-width: 1.6; }
.blueprint .bp-ghost { opacity: 0.3; }
.blueprint .bp-plate { fill: var(--gold); fill-opacity: 0.35; stroke-width: 1.5; }
.has-motion .blueprint [data-draw] { stroke-dasharray: 100; stroke-dashoffset: 100; }
.has-motion .blueprint rect { opacity: 0; }

/* services index under the drawing: links to the six scenes */
.opening__index {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 1.5rem;
  margin-top: 1rem;
}
.opening__index a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  color: var(--cream);
  font-family: 'Oswald', sans-serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.opening__index a:hover,
.opening__index a:focus-visible { color: var(--gold-light); }
.opening__index-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 0.75rem;
}

.opening__content {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 980px;
  padding: 0 clamp(1.5rem, 6vw, 6rem) clamp(4rem, 12vh, 7rem);
}
.opening__content h1 {
  font-size: clamp(2.1rem, 6vw, 5.5rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}
.opening__tagline { margin-bottom: 2rem; }

@media (min-width: 901px) {
  .opening__photos { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .opening__photo--side { display: block; }
  /* keep the drawing clear of the title, which sits bottom-left */
  .opening__plan { left: auto; right: 4vw; margin: 0; top: 12%; width: min(50%, 82vh); }
}

/* phones: house + services index at the top, title and CTA below, in one column with no dead gap */
@media (max-width: 900px) {
  .opening {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 1.5rem;
  }
  .opening__plan {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: min(100% - 3rem, 520px);
    margin: 0 auto;
    padding-top: calc(80px + 0.75rem);
  }
  .blueprint { stroke-width: 4; }
  .blueprint .bp-member { stroke-width: 2.5; }
  .blueprint .bp-plate { stroke-width: 3; }
  .opening__index { gap: 0.5rem; margin-top: 1.25rem; }
  .opening__index a {
    min-height: 48px;
    padding: 0.35rem 0.6rem;
    gap: 0.5rem;
    border: 1px solid var(--ink-3);
    border-radius: 4px;
    background-color: rgba(14, 20, 18, 0.6);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    line-height: 1.2;
  }
  .opening__index-num { width: 24px; height: 24px; font-size: 0.7rem; }
  .opening__content { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
  .opening__content .btn-primary { width: 100%; }
}

/* ===== STATEMENT (About) ===== */
.statement { padding: clamp(6rem, 16vh, 11rem) clamp(1.5rem, 6vw, 6rem); }
.statement__inner { max-width: 1150px; margin: 0 auto; }
.statement__title {
  font-size: clamp(0.95rem, 1.3vw, 1.2rem);
  letter-spacing: 0.3em;
  margin-bottom: 2rem;
}
.statement__body {
  font-family: 'Oswald', sans-serif;
  font-weight: 300;
  font-size: clamp(1.7rem, 4vw, 3.6rem);
  line-height: 1.25;
  color: var(--cream);
  margin-bottom: 3rem;
}
.statement__callout {
  display: inline-block;
  padding: 1.25rem 1.75rem;
  border-left: 3px solid var(--gold);
  background-color: var(--ink-2);
  border-radius: 0 4px 4px 0;
}
.statement__callout p {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--cream);
}

/* ===== SERVICES — scenes ===== */
.scenes { padding: 0; }
.scenes__intro { padding: clamp(4rem, 10vh, 6rem) clamp(1.5rem, 6vw, 6rem) 2rem; }
.scenes__intro .section-title { margin-bottom: 0; }

.scene {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 6rem);
  padding: 5rem clamp(1.5rem, 6vw, 6rem);
  border-top: 1px solid var(--ink-3);
}
.scene--flip .scene__media { order: 2; }

/* blurred, darkened copies of the scene's photos as the backdrop (decorative) */
.scene__bg { position: absolute; inset: 0; z-index: 0; }
.scene__bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* tiny pre-blurred copies (*-blur.webp) upscaled: soft without a runtime blur filter */
  filter: brightness(0.3) saturate(1.1);
  transform: scale(1.25);
}
.scene__bg img + img { opacity: 0; }

/* static layout: main photo + two supporting photos, all visible */
.scene__media {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1rem;
  height: min(80vh, 760px);
}
.scene__frame {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ink-3);
  border-radius: 4px;
  background-color: var(--ink-2);
}
.scene__frame:first-child { grid-row: 1 / span 2; }
.scene__frame img { width: 100%; height: 100%; object-fit: cover; }

.scene__text { position: relative; z-index: 1; max-width: 560px; }
.scene__num {
  font-family: 'Oswald', sans-serif;
  font-weight: 300;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: transparent;
  -webkit-text-stroke: 1px var(--gold);
  margin-bottom: 1rem;
}
.scene__title { font-size: clamp(2.25rem, 4.5vw, 4rem); margin-bottom: 1.25rem; }
.scene__body { color: var(--cream); font-size: 1.15rem; margin: 0; }

/* motion layer, desktop: one portrait panel; photos 2 and 3 wipe in over photo 1 while pinned */
@media (min-width: 901px) {
  .has-motion .scene { height: 100vh; height: 100dvh; padding-top: 3rem; padding-bottom: 3rem; }
  .has-motion .scene__media {
    display: block;
    height: min(80vh, 820px);  /* stays clear of the 80px fixed header */
    width: auto;
    aspect-ratio: 9 / 16;
    justify-self: center;
  }
  .has-motion .scene__frame { position: absolute; inset: 0; }
}

/* mobile: full-height main photo with the text over a gradient, two photos below */
@media (max-width: 900px) {
  .scene,
  .scene--flip {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 100vh auto;
    grid-template-rows: 100dvh auto;
    align-items: stretch;
    gap: 0;
    padding: 0;
    min-height: 0;
  }
  .scene__bg { display: none; }
  .scene__media { display: contents; }
  .scene--flip .scene__media { order: 0; }
  .scene__frame { border: 0; border-radius: 0; aspect-ratio: 4 / 5; grid-row: 2; }
  .scene__frame:first-child { grid-column: 1 / -1; grid-row: 1; aspect-ratio: auto; }
  .scene__text {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: end;
    z-index: 2;
    max-width: none;
    /* bottom padding clears the fixed action bar (64px) */
    padding: 7rem 1.5rem calc(2.5rem + 64px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(14, 20, 18, 0.96) 0%, rgba(14, 20, 18, 0.8) 55%, rgba(14, 20, 18, 0) 100%);
  }
  .scene__num { font-size: 3rem; margin-bottom: 0.5rem; }
  .scene__title { font-size: 2.25rem; margin-bottom: 0.75rem; }
  .scene__body { font-size: 1.05rem; }
}
@media (max-width: 900px) and (max-height: 640px) {
  .scene__text { padding-top: 3rem; }
  .scene__num { font-size: 2rem; margin-bottom: 0.25rem; }
  .scene__title { font-size: 1.9rem; }
}

/* ===== WORK — horizontal gallery ===== */
.work { padding: clamp(5rem, 12vh, 8rem) 0; overflow: hidden; }
.work__head { padding: 0 clamp(1.5rem, 6vw, 6rem); }
.work__head .section-title { text-align: left; margin-bottom: 2.5rem; }
.work__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 1rem;
}
.work__track {
  position: relative;
  display: flex;
  gap: 1rem;
  width: max-content;
  padding: 0 clamp(1.5rem, 6vw, 6rem);
}

.gallery-tile {
  position: relative;
  flex: 0 0 auto;
  height: min(68vh, 640px);
  width: auto;
  aspect-ratio: 4 / 5;
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
  display: block;
  scroll-snap-align: center;
}
.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease-out;
}
.gallery-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(14, 20, 18, 0.9) 0%, rgba(14, 20, 18, 0) 40%);
  opacity: 0;
  transition: opacity 300ms ease-out;
}
.gallery-tile__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem;
  color: var(--cream);
  font-family: 'Oswald', sans-serif;
  font-weight: 300;
  letter-spacing: 0.05em;
  font-size: 1.1rem;
  text-align: left;
  z-index: 2;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}
.gallery-tile:hover img { transform: scale(1.05); }
.gallery-tile:hover::after,
.gallery-tile:hover .gallery-tile__caption,
.gallery-tile:focus-visible::after,
.gallery-tile:focus-visible .gallery-tile__caption {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 901px) {
  .has-motion .work {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
  }
  .has-motion .work__viewport { overflow: hidden; scroll-snap-type: none; }
}
@media (max-width: 900px) {
  .gallery-tile { height: auto; width: 78vw; }
  .gallery-tile::after,
  .gallery-tile .gallery-tile__caption { opacity: 1; transform: none; }
}

/* ===== CLOSE ===== */
.close { padding: clamp(6rem, 14vh, 10rem) clamp(1.5rem, 6vw, 6rem); }
.close__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
}
.close__photo {
  margin: 0;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--ink-3);
}
.close__photo img { width: 100%; height: 100%; object-fit: cover; }
.close__tagline {
  font-size: clamp(3rem, 8vw, 7.5rem);
  line-height: 1.02;
  margin: 0;
}
@media (max-width: 900px) {
  .close__inner { grid-template-columns: 1fr; }
  .close__photo { max-width: none; aspect-ratio: 4 / 5; }
}

/* ===== ESTIMATE — contact + request form ===== */
.estimate {
  position: relative;
  padding: clamp(5rem, 13vh, 9rem) clamp(1.5rem, 6vw, 6rem);
  border-top: 1px solid var(--ink-3);
  background-color: var(--ink);
  /* faint blueprint grid, echoing the opening drawing */
  background-image:
    linear-gradient(to bottom, var(--ink) 0%, transparent 18%, transparent 82%, var(--ink) 100%),
    linear-gradient(color-mix(in srgb, var(--gold) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--gold) 7%, transparent) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
}
.estimate__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}
.estimate__title {
  font-size: clamp(2.6rem, 5.5vw, 4.75rem);
  line-height: 1.02;
  margin-bottom: 1.25rem;
}
.estimate__lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: var(--cream-dim);
  max-width: 34ch;
  margin-bottom: 2.5rem;
}

.estimate__contacts { list-style: none; margin: 0; padding: 0; }
.estimate__contact {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 1rem;
  align-items: center;
  min-height: 72px;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--ink-3);
  color: var(--cream);
}
.estimate__contacts li:first-child .estimate__contact { border-top: 1px solid var(--ink-3); }
.estimate__icon {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  transition: background-color 200ms ease-out, color 200ms ease-out;
}
.estimate__icon svg { width: 20px; height: 20px; fill: currentColor; }
.estimate__label {
  align-self: end;
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.estimate__value { align-self: start; font-size: 1.1rem; overflow-wrap: anywhere; }
.estimate__contact:hover,
.estimate__contact:focus-visible { color: var(--gold-light); }
.estimate__contact:hover .estimate__icon,
.estimate__contact:focus-visible .estimate__icon { background-color: var(--gold); color: var(--ink); }

/* the form card */
.estimate__card {
  position: relative;
  padding: clamp(1.75rem, 4vw, 3rem);
  background-color: color-mix(in srgb, var(--ink-2) 88%, transparent);
  border: 1px solid var(--ink-3);
  border-top: 3px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(14, 20, 18, 0.6);
}
/* align the fields of a row even when one label wraps */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; align-items: end; }
.form-group { display: flex; flex-direction: column; margin-bottom: 1.6rem; }
.form-group label {
  margin-bottom: 0.35rem;
  font-family: 'Oswald', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.form-control {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink-3);
  border-radius: 0;
  background-color: transparent;
  color: var(--cream);
  font-family: inherit;
  font-size: 16px; /* no iOS zoom */
  transition: border-color 200ms ease-out, box-shadow 200ms ease-out;
}
.form-control:focus { outline: none; border-bottom-color: var(--gold-light); box-shadow: 0 1px 0 0 var(--gold-light); }
.form-control.has-error { border-bottom-color: var(--error); box-shadow: 0 1px 0 0 var(--error); }
textarea.form-control {
  min-height: 120px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ink-3);
  border-radius: 4px;
  resize: vertical;
}
textarea.form-control:focus { border-color: var(--gold-light); box-shadow: none; }
select.form-control option { background-color: var(--ink-2); color: var(--cream); }
.select-wrapper { position: relative; }
.select-wrapper select { -webkit-appearance: none; appearance: none; padding-right: 2.5rem; cursor: pointer; }
.select-wrapper::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.25rem;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C9972E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}
.estimate__submit { width: 100%; min-height: 56px; margin-top: 0.5rem; font-size: 1.05rem; }

.input-error-msg { margin-top: 0.4rem; font-size: 0.85rem; color: var(--error); }
.form-error-banner {
  display: none;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--error);
  border-radius: 4px;
  background-color: color-mix(in srgb, var(--error) 10%, transparent);
  color: var(--error);
}
.form-error-banner a { color: var(--error-dim); text-decoration: underline; }
.form-success-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 3rem 1.5rem;
  text-align: center;
}
.form-success-panel svg { width: 64px; height: 64px; margin-bottom: 1.5rem; stroke: var(--gold); }
.form-success-panel p { font-size: 1.25rem; color: var(--cream); }

@media (max-width: 900px) {
  .estimate { padding: 4.5rem 1.25rem 4rem; }
  .estimate__inner { grid-template-columns: 1fr; }
  .estimate__lead { margin-bottom: 1.75rem; }
  .form-row { grid-template-columns: 1fr; }
}

/* ===== TOAST (email copied) ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 120;
  max-width: calc(100% - 2rem);
  padding: 0.85rem 1.25rem;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background-color: var(--ink-2);
  color: var(--cream);
  font-size: 0.95rem;
  box-shadow: 0 12px 40px rgba(14, 20, 18, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity 200ms ease-out, transform 200ms ease-out, visibility 0s linear 200ms;
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}
@media (max-width: 900px) {
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ===== MOBILE ACTION BAR ===== */
.action-bar { display: none; }
@media (max-width: 900px) {
  .action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom));
    background-color: rgba(14, 20, 18, 0.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--ink-3);
    transition: transform 250ms ease-out;
  }
  .action-bar.is-hidden { transform: translateY(110%); }
  .action-bar__btn {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gold);
    border-radius: 4px;
    color: var(--gold);
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .action-bar__btn--primary { background-color: var(--gold); color: var(--ink); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
