/* Through the Gate — homepage film and the architect tools strip. Builds on house.css tokens. */

.film { position: relative; height: 1450vh; background: #cfdbe6; }
.film-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.film-fallback { position: absolute; inset: 0; }
.film-fallback img { width: 100%; height: 100%; object-fit: cover; }
.film-live .film-fallback { display: none; }

/* Loader: a quiet stone-white veil with a counter, lifted once every slab texture is in. */
.film-loader { position: absolute; inset: 0; z-index: 6; display: none; place-content: center; justify-items: center; gap: 10px; background: var(--limestone); transition: opacity 1.1s var(--ease), visibility 0s linear 1.1s; }
.film-live .film-loader { display: grid; }
.film-loader b { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(64px, 9vw, 132px); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.film-loader.is-done { opacity: 0; visibility: hidden; }

/* Without the film (no WebGL, reduced motion) the section is the gate and its title. */
html:not(.film-live) .film { height: auto; }
html:not(.film-live) .film-stage { position: relative; height: 100svh; }
html:not(.film-live) .film-cap:not(.film-cap-intro):not(.film-menu), html:not(.film-live) .film-progress, html:not(.film-live) .film-rail, html:not(.film-live) .film-play { display: none; }

/* Captions: editorial, set low and left on a soft limestone wash, never over the stone's centre. */
.film-cap {
  position: absolute; z-index: 3; left: var(--gutter); bottom: clamp(28px, 7vh, 80px); width: min(520px, calc(100% - 2 * var(--gutter)));
  padding: 26px 28px 24px; background: rgba(244, 240, 233, 0.84); -webkit-backdrop-filter: blur(18px) saturate(1.1); backdrop-filter: blur(18px) saturate(1.1);
  border: 1px solid rgba(27, 28, 26, 0.1);
  opacity: 0; transform: translateY(22px); pointer-events: none; transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.film-cap.is-on, html:not(.film-live) .film-cap-intro { opacity: 1; transform: none; pointer-events: auto; }
.film-cap .mono { color: var(--mute); }
.film-cap .display { font-size: clamp(28px, 2.8vw, 44px); line-height: 1.04; margin: 12px 0 12px; }
.film-cap h1 em, .film-cap h2 em { font-style: italic; color: var(--terracotta); }
.film-cap p { font-size: 15px; line-height: 1.55; margin: 0 0 14px; color: var(--ink-soft); }
.film-cap .text-link { font-size: 14px; }
.film-cap-intro { width: min(640px, calc(100% - 2 * var(--gutter))); background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 0; }
.film-cap-intro::before { content: ""; position: absolute; z-index: -1; inset: -140px -220px -120px -160px; background: radial-gradient(52% 56% at 36% 62%, rgba(244, 240, 233, 0.97) 0%, rgba(244, 240, 233, 0.88) 45%, rgba(244, 240, 233, 0) 78%); }
.film-cap-intro > .mono { display: inline-block; padding: 5px 9px; background: rgba(244, 240, 233, 0.88); color: var(--ink-soft); }
.film-cap-intro .display { font-size: clamp(40px, 4.6vw, 76px); line-height: 1.0; margin: 16px 0 18px; }
.film-cap-intro p { font-size: 16.5px; max-width: 40ch; }
.film-cap-right { left: auto; right: calc(var(--gutter) + 140px); }

/* The Brescia story: captions for the stations on the sea; the first carries the year large. */
.film-cap-story .display { font-size: clamp(30px, 3vw, 48px); }
.story-year { display: block; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(64px, 7vw, 112px); line-height: 0.9; letter-spacing: -0.03em;
  margin: 10px 0 0; background: linear-gradient(180deg, #d9b878, #9c7333); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* The last frame: four ways into the site under the Brescia mark. Each panel is a small 3D object:
   it flips up into place, tilts toward the cursor, and a sheen of light follows the pointer. */
.film-menu { left: var(--gutter); right: calc(var(--gutter) + 120px); width: auto; padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.film-menu-kicker { display: inline-block; padding: 5px 9px; margin-bottom: 12px; background: rgba(244, 240, 233, 0.9); color: var(--ink-soft); }
.film-menu ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; perspective: 1100px; }
.film-menu li { opacity: 0; transform: rotateX(-62deg) translateY(36px); transform-origin: 50% 100%;
  transition: opacity 0.9s var(--ease), transform 1.1s cubic-bezier(0.2, 0.9, 0.25, 1.12); }
.film-menu.is-on li { opacity: 1; transform: none; }
.film-menu.is-on li:nth-child(2) { transition-delay: 0.09s; }
.film-menu.is-on li:nth-child(3) { transition-delay: 0.18s; }
.film-menu.is-on li:nth-child(4) { transition-delay: 0.27s; }
.xcard { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --lift: 0px; position: relative; display: block; height: clamp(200px, 30vh, 280px); text-decoration: none; color: #fff;
  border-radius: 4px; overflow: hidden; transform-style: preserve-3d; isolation: isolate;
  transform: translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset, 0 22px 44px -24px rgba(24, 18, 10, 0.6), 0 2px 0 rgba(200, 161, 101, 0.0);
  transition: transform 0.8s var(--ease), box-shadow 0.6s var(--ease); animation: xfloat 7s ease-in-out infinite; }
.film-menu li:nth-child(2) .xcard { animation-delay: -1.6s; }
.film-menu li:nth-child(3) .xcard { animation-delay: -3.2s; }
.film-menu li:nth-child(4) .xcard { animation-delay: -4.8s; }
@keyframes xfloat { 0%, 100% { --lift: 0px; } 50% { --lift: -6px; } }
@property --lift { syntax: "<length>"; inherits: false; initial-value: 0px; }
.xcard.is-tracking { transition: transform 0.12s linear, box-shadow 0.6s var(--ease); }
.xcard:hover, .xcard:focus-visible { animation-play-state: paused; --lift: -14px;
  box-shadow: 0 0 0 1px rgba(232, 200, 140, 0.9) inset, 0 46px 70px -28px rgba(24, 18, 10, 0.7), 0 0 0 4px rgba(232, 200, 140, 0.18); }
.xcard-media { position: absolute; inset: 0; z-index: -2; }
.xcard-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); filter: saturate(0.95) brightness(0.96);
  transition: transform 1.6s var(--ease), filter 1s var(--ease); }
.xcard:hover .xcard-media img, .xcard:focus-visible .xcard-media img { transform: scale(1.16); filter: saturate(1.08) brightness(1.02); }
.xcard-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 13, 8, 0) 30%, rgba(18, 13, 8, 0.78) 100%); }
/* a slow band of light passes across each card, like a lamp over polished stone */
.xcard::after { content: ""; position: absolute; inset: -40% -60%; z-index: -1; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 246, 228, 0.8) 50%, transparent 58%); transform: translateX(-60%);
  animation: xsweep 6.5s var(--ease) infinite; }
.film-menu li:nth-child(2) .xcard::after { animation-delay: 0.5s; }
.film-menu li:nth-child(3) .xcard::after { animation-delay: 1s; }
.film-menu li:nth-child(4) .xcard::after { animation-delay: 1.5s; }
@keyframes xsweep { 0%, 55% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.xcard-body { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; transform: translateZ(36px); }
.xcard-body .mono { color: #e8c88c; letter-spacing: 0.22em; }
.xcard strong { font-family: var(--serif); font-weight: 480; letter-spacing: -0.02em; font-size: clamp(25px, 2.1vw, 34px); line-height: 1.02; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }
.xcard-copy { font-size: 13.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.86); max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.7s var(--ease), opacity 0.6s var(--ease); }
.xcard:hover .xcard-copy, .xcard:focus-visible .xcard-copy { max-height: 64px; opacity: 1; }
.xcard-go { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff; font-size: 16px; transform: translateZ(50px); transition: transform 0.6s var(--ease), background-color 0.4s var(--ease), border-color 0.4s; }
.xcard:hover .xcard-go, .xcard:focus-visible .xcard-go { background: var(--terracotta); border-color: var(--terracotta); transform: translateZ(50px) rotate(45deg) scale(1.1); }
.xcard-sheen { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; mix-blend-mode: soft-light;
  background: radial-gradient(380px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 45%); transition: opacity 0.5s var(--ease); }
.xcard:hover .xcard-sheen { opacity: 1; }
.xcard::before { content: ""; position: absolute; left: 20px; right: 20px; bottom: 12px; height: 1px; background: #e8c88c; transform: scaleX(0); transform-origin: left; transition: transform 0.8s var(--ease); }
.xcard:hover::before, .xcard:focus-visible::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { .xcard, .xcard::after { animation: none; } }
.film-menu-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 14px; }
.film-menu-visit { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; text-decoration: none; color: #fff; font-size: 14px; font-weight: 600;
  background: var(--ink); border: 1px solid var(--ink); transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease); }
.film-menu-visit span { display: inline-block; transition: transform 0.5s var(--ease); }
.film-menu-visit:hover { background: var(--terracotta); border-color: var(--terracotta); }
.film-menu-visit:hover span { transform: translate(3px, -3px); }
.film-menu-families { padding: 7px 11px; background: rgba(244, 240, 233, 0.9); color: var(--ink-soft); }
.film-menu-families a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(27, 28, 26, 0.3); }
.film-menu-families a:hover { color: var(--terracotta); border-color: var(--terracotta); }

/* The project brief: a sheet over the film, opened by any link to #inquiry, closed by #close. */
.inquiry-sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; visibility: hidden; opacity: 0;
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s; }
.inquiry-sheet:target { visibility: visible; opacity: 1; transition: opacity 0.5s var(--ease); }
.inquiry-scrim { position: absolute; inset: 0; background: rgba(24, 20, 14, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.inquiry-card { position: relative; width: min(560px, 100%); max-height: calc(100svh - 32px); overflow: auto; padding: 34px 34px 28px; background: var(--limestone);
  border: 1px solid rgba(27, 28, 26, 0.1); box-shadow: 0 40px 90px -30px rgba(20, 14, 8, 0.6); transform: translateY(24px) scale(0.98); transition: transform 0.6s var(--ease); }
.inquiry-sheet:target .inquiry-card { transform: none; }
.inquiry-card .display { font-size: clamp(32px, 3.4vw, 48px); margin: 10px 0 10px; }
.inquiry-card .display em { font-style: italic; color: var(--terracotta); }
.inquiry-card .lede { margin: 0 0 8px; font-size: 15px; }
.inquiry-card .inquiry-form { padding: 6px 0 0; border: 0; background: none; box-shadow: none; }
.inquiry-card .inquiry-form label { margin-top: 8px; }
.inquiry-card .inquiry-form textarea { min-height: 72px; }
.inquiry-close { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; display: grid; place-items: center; font-size: 26px; text-decoration: none; color: var(--ink-soft); }
.inquiry-close:hover { color: var(--terracotta); }

/* Without the film the panels sit under the title. */
html:not(.film-live) .film-stage { height: auto; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; padding: 120px 0 40px; }
html:not(.film-live) .film-cap-intro, html:not(.film-live) .film-menu { position: relative; inset: auto; left: auto; right: auto; bottom: auto; margin: 0 var(--gutter); opacity: 1; transform: none; pointer-events: auto; }
html:not(.film-live) .film-menu li { opacity: 1; transform: none; }

.film-skip { position: absolute; z-index: 5; right: var(--gutter); bottom: 22px; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  font: 600 13px/1 var(--sans); color: var(--ink); background: rgba(244, 240, 233, 0.88); border: 1px solid rgba(27, 28, 26, 0.18); border-radius: 999px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); cursor: pointer; opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), background-color 0.3s; }
.film-skip.is-on { opacity: 1; transform: none; pointer-events: auto; }
.film-skip:hover { background: var(--ink); color: var(--limestone); }
@media (max-width: 760px) { .film-skip { top: 92px; bottom: auto; right: 14px; min-height: 36px; } }

/* Chapter rail and progress. */
.film-rail { position: absolute; z-index: 4; right: var(--gutter); top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; color: rgba(27, 28, 26, 0.42); font-size: 10.5px; }
.film-rail li { display: flex; align-items: center; justify-content: flex-end; gap: 10px; transition: color 0.5s var(--ease); flex-direction: row-reverse; }
.film-rail i { width: 18px; height: 1px; background: currentColor; transition: width 0.5s var(--ease), background-color 0.5s; }
.film-rail li.is-on { color: var(--ink); }
.film-rail li.is-on:last-of-type, .film-rail li.is-on:not(:has(~ li.is-on)) { color: var(--terracotta); }
.film-rail li.is-on:not(:has(~ li.is-on)) i { width: 34px; background: var(--terracotta); }
.film-rail li { text-shadow: 0 0 12px rgba(244, 240, 233, 0.9); }
.film-progress { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(27, 28, 26, 0.1); }
.film-progress i { position: absolute; inset: 0; background: var(--terracotta); transform-origin: left; transform: scaleX(0); }

@media (max-width: 760px) {
  .film { height: 1250vh; }
  .film-cap, .film-cap-right { left: 14px; right: 14px; width: auto; bottom: 18px; padding: 18px 18px 16px; }
  .film-cap .display { font-size: clamp(28px, 8.4vw, 40px); }
  .film-cap-intro { left: var(--gutter); right: var(--gutter); bottom: 26px; }
  .film-cap-intro .display { font-size: clamp(40px, 11.5vw, 56px); }
  /* phones: label, headline and one link per chapter; the full wording lives in the guide below the film */
  .film-cap:not(.film-cap-intro) p { display: none; }
  .film-cap-intro p { display: none; }
  .film-cap-intro > .mono { font-size: 10px; letter-spacing: 0.12em; }
  .film-cap { padding: 14px 16px 14px; }
  .film-cap .display { font-size: clamp(25px, 7.4vw, 34px); margin: 8px 0 6px; }
  .film-cap .hero-actions .btn { min-height: 44px; }
  .film-cap-end .hero-actions .btn-ghost { display: none; }
  .film-rail { display: none; }
  .story-year { font-size: 52px; margin-top: 4px; }
  .film-menu { left: 14px; right: 14px; bottom: 18px; }
  .film-menu ol { grid-template-columns: 1fr 1fr; gap: 8px; }
  .xcard { height: 128px; }
  .xcard-body { padding: 10px 12px 12px; gap: 2px; }
  .xcard strong { font-size: 19px; }
  .xcard-copy { display: none; }
  .xcard-go { width: 28px; height: 28px; font-size: 13px; top: 8px; right: 8px; }
  .film-menu-families { display: none; }
  .inquiry-card { padding: 26px 20px 22px; }
}

/* ------------------------------------------------------------------ architect tools */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tool { display: flex; flex-direction: column; gap: 10px; text-decoration: none; padding-bottom: 6px; }
.tool-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--sand); margin-bottom: 6px; }
.tool-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.tool:hover .tool-media img { transform: scale(1.06); }
.tool strong { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; font-size: 27px; line-height: 1.05; }
.tool > span:last-child { font-size: 14.5px; line-height: 1.55; color: var(--ink-soft); }
.tool:hover strong { color: var(--terracotta); }
@media (max-width: 1000px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tool-grid { grid-template-columns: 1fr; } }

.house-teaser { position: relative; display: block; margin-top: 56px; overflow: hidden; text-decoration: none; color: #fff; aspect-ratio: 21 / 9; background: var(--sand); }
.house-teaser img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease); }
.house-teaser:hover img { transform: scale(1.04); }
.house-teaser-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(18px, 3vw, 40px); display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, transparent, rgba(15, 12, 8, 0.58)); }
.house-teaser-copy strong { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; font-size: clamp(32px, 4vw, 60px); line-height: 1; }
@media (max-width: 760px) { .house-teaser { aspect-ratio: 4 / 5; } }
