/**
 * Component: Landing home sections (hero, doors, drive, haul, why, team, quote, motion)
 * Documentation: documentation/frontend/landing.md
 */

/* Hero: the clip runs edge to edge, headline sits in it, doors overlap its foot */
.hero {
  position: relative; overflow: hidden;
  min-height: clamp(620px, 96svh, 940px);
  display: flex; align-items: flex-end;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.hero > video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transform: scale(1.06); will-change: transform;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(5, 11, 25, 0.88) 0%, rgba(5, 11, 25, 0.55) 45%, rgba(5, 11, 25, 0.12) 72%, rgba(5, 11, 25, 0.5) 100%);
}
.hero-copy { position: relative; z-index: 2; padding: 0 var(--margin); margin-bottom: 250px; max-width: 1000px; }
.hero-copy h1 { font-size: var(--step-display); line-height: 0.94; letter-spacing: -0.045em; font-weight: 700; max-width: 12ch; }
.hero-copy p { font-size: clamp(1.2rem, 1rem + 0.9vw, 1.5rem); line-height: 1.3; font-weight: 500; margin-top: 28px; color: #dfe4ee; max-width: 38ch; }
.home .topbar { position: absolute; inset: 0 0 auto; z-index: 10; background: linear-gradient(to bottom, rgba(5, 11, 25, 0.65), rgba(5, 11, 25, 0)); }

/* Doors: the three things to do, staggered over the hero's foot */
.doors {
  position: relative; z-index: 5;
  display: grid; grid-template-columns: 5fr 5fr 3fr; gap: var(--gap); align-items: start;
  margin: -180px var(--margin) 0;
}
.doors .ticket:nth-child(2) { margin-top: 56px; }
.applet { margin-top: 112px; background: var(--ground-2); border-radius: var(--r); padding: 30px 32px; }
.applet b { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; display: block; }
.applet span { color: var(--ink-soft); font-size: var(--step-body); display: block; margin: 6px 0 20px; }
.applet .stores { display: flex; gap: 8px; flex-wrap: wrap; }
.applet .btn { min-height: 44px; padding: 0 18px; font-size: 1rem; }

/* Shared section frame */
.hsection { position: relative; margin-top: clamp(120px, 14vw, 200px); }
.hsection h2 { font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.04em; font-weight: 700; }

/* Drive: photo bleeds right, ticket overlaps it, phones float over its foot */
.drive { min-height: 840px; }
.drive-photo {
  position: absolute; right: 0; top: 0; width: 64%; height: 640px;
  border-radius: var(--r-lg) 0 0 var(--r-lg); overflow: hidden;
}
.drive-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 22% 60%; }
.drive-card { position: relative; z-index: 2; width: min(620px, 58%); margin: 90px 0 0 var(--margin); --stub: 112px; }
.drive-card .t-body { padding: 44px 48px 40px; }
.drive-card h2 { color: var(--ink-dark); font-size: clamp(2.25rem, 1.3rem + 2.4vw, 3.4rem); }
.drive-card .t-body p { font-size: var(--step-body); margin-top: 20px; max-width: 40ch; }
.perks { list-style: none; margin-top: 28px; display: grid; gap: 14px; }
.perks li { font-size: var(--step-body); font-weight: 500; color: var(--ink-dark); display: flex; gap: 14px; align-items: baseline; }
.perks li::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); transform: translateY(-2px); }
.drive-card .t-stub { padding-left: 48px; }
a.t-stub { text-decoration: none; color: inherit; }
/* The app: one phone in 3D (tour.css), its dispatch card lifts as the section scrolls; --p (0..1) set by home.js */
.drive-app { position: absolute; z-index: 3; right: 9%; top: 210px; perspective: 1600px; }
.drive-app .tour-phone { width: clamp(230px, 19vw, 290px); }
.drive-app .pop {
  opacity: 1; transition: none;
  transform: translate3d(calc(var(--dx) * var(--u) * var(--p, 0)), calc(var(--dy) * var(--u) * var(--p, 0)), calc(150px * var(--p, 0))) scale(calc(1 + (var(--s, 1.14) - 1) * var(--p, 0)));
  box-shadow: 0 calc(2 * var(--u)) calc(5 * var(--u)) rgba(2, 6, 16, calc(0.28 * var(--p, 0))), 0 calc(12 * var(--u)) calc(22 * var(--u)) calc(-4 * var(--u)) rgba(2, 6, 16, calc(0.55 * var(--p, 0))); /* taste-skill-ignore: the lifted card is in the air */
}
.drive-app .screen::after { opacity: calc(0.32 * var(--p, 0)); transition: none; }

/* Haul: faded quarry satellite behind a stepped row of photo tickets */
.haul::before {
  content: ''; position: absolute; z-index: 0; inset: -80px 0 auto; height: 640px;
  background: url('public/images/photos/quarry-aerial.jpg') center / cover no-repeat;
  opacity: 0.6;
  -webkit-mask: linear-gradient(to bottom, #000 45%, transparent 95%);
  mask: linear-gradient(to bottom, #000 45%, transparent 95%);
}
.haul-head { position: relative; display: flex; justify-content: space-between; align-items: end; gap: 40px; padding: 0 var(--margin); margin-bottom: 48px; }
.haul-head p { color: var(--ink-soft); max-width: 32ch; font-size: var(--step-body); }
.haul-row { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); padding: 0 var(--margin); align-items: start; }
.haul-row .ticket { --stub: 88px; }
.haul-row .ticket:nth-child(even) { margin-top: 72px; }
.haul-row figure { height: 240px; margin: 10px 10px 0; border-radius: 20px; overflow: hidden; }
.haul-row figure img { width: 100%; height: 100%; object-fit: cover; }
.haul-row .t-body { padding: 24px 26px 22px; }
.haul-row h3 { font-size: 1.6rem; }
.haul-row p { font-size: 1.05rem; margin-top: 10px; }
.haul-row .t-stub { padding-left: 26px; }
.haul-row .t-stub b { font-size: 1.1rem; }
.haul-row .go { width: 48px; height: 48px; }
.haul-row .go svg { width: 20px; height: 20px; }
.haul-count { padding: 0 var(--margin); margin-top: 32px; font-size: var(--step-body); color: var(--ink-soft); }
.haul-count a { color: var(--ink); text-underline-offset: 4px; }

/* Why: stepped figure cards */
.why { display: grid; grid-template-columns: 5fr 7fr; gap: var(--gap); padding: 0 var(--margin); align-items: start; }
.why-main {
  background: var(--ground-2); border-radius: var(--r-lg); padding: 48px;
  min-height: 540px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.why-main .fig { font-size: clamp(4rem, 2rem + 8vw, 8rem); font-weight: 700; letter-spacing: -0.05em; line-height: 0.85; margin-left: -0.04em; }
.why-main p { font-size: var(--step-body); max-width: 30ch; color: var(--ink-soft); }
.why-side { display: grid; gap: var(--gap); }
.why-side h2 { padding-left: 4px; margin-bottom: 8px; }
.why-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.why-card { background: var(--tile); border-radius: var(--r); padding: 36px; min-height: 320px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.why-card:nth-child(2) { margin-top: 72px; background: var(--paper); color: var(--ink-dark); }
.why-card .fig { font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); font-weight: 700; letter-spacing: -0.04em; line-height: 0.9; }
.why-card p { font-size: var(--step-body); max-width: 28ch; }
.why-card:nth-child(2) p { color: var(--ink-2); }

/* Who runs it: lead line on the ground, staggered person cards */
.about { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); align-items: start; }
.home .about { padding: 0 var(--margin); }
.about-lead { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; margin-bottom: 40px; }
.about-lead p { font-size: var(--step-lead); line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; max-width: 34ch; color: var(--ink-soft); }
.person { border-radius: var(--r); padding: 32px 32px 36px; min-height: 300px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.person:nth-child(2) { background: var(--paper); color: var(--ink-dark); }
.person:nth-child(3) { background: var(--tile-2); margin-top: 56px; }
.person:nth-child(4) { background: var(--accent); color: var(--ink-dark); }
.person:nth-child(5) { background: var(--tile-2); margin-top: 56px; }
.person h3 { font-size: var(--step-lead); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; }
.person .role { font-size: var(--step-body); font-weight: 500; margin-top: 6px; opacity: 0.8; }
.person p { font-size: var(--step-body); line-height: 1.35; }

/* Quote: faded jobsite strip behind, one large ticket holding the form */
.quote { position: relative; margin-top: clamp(120px, 14vw, 200px); padding: 0 var(--margin); }
.quote-back, .quote-strip { position: absolute; z-index: 0; inset: -40px 0 auto; height: 380px; overflow: hidden; }
.quote-back img, .quote-strip img { width: 100%; height: 100%; object-fit: cover; }
.quote-back, .quote-strip {
  opacity: 0.6;
  -webkit-mask: linear-gradient(to bottom, #000 30%, transparent 92%);
  mask: linear-gradient(to bottom, #000 30%, transparent 92%);
}
.quote-top { position: relative; display: grid; grid-template-columns: 7fr 5fr; gap: var(--gap); align-items: start; }
.quote-head h2 { font-size: var(--step-head); font-weight: 700; letter-spacing: -0.04em; line-height: 0.95; }
.quote-head p { font-size: var(--step-lead); line-height: 1.25; font-weight: 500; margin-top: 20px; max-width: 30ch; color: var(--ink-soft); }
.quote-desk { background: var(--ground-2); border-radius: var(--r); padding: 32px; display: grid; gap: 10px; align-content: start; font-size: var(--step-body); justify-self: end; width: min(420px, 100%); }
.quote-desk strong { font-size: var(--step-lead); font-weight: 700; letter-spacing: -0.02em; }
.quote-desk a { text-underline-offset: 4px; }
.quote-desk span { color: var(--ink-soft); }
.quote-form { position: relative; z-index: 1; margin-top: 48px; --stub: 124px; }
.quote-form .contact-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 44px 48px 32px; }
.quote-form .contact-form h2 { display: none; }
.quote-form .contact-form-row { display: contents; }
.quote-form .contact-form label { display: grid; gap: 8px; }
.quote-form .contact-form label span { font-size: var(--step-small); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-2); }
.quote-form .contact-form label span em { font-style: normal; font-weight: 400; text-transform: none; letter-spacing: 0; }
.quote-form .contact-form input, .quote-form .contact-form textarea {
  font: 500 var(--step-body) var(--font); color: var(--ink-dark);
  background: var(--paper-2); border: 0; border-radius: 16px;
  padding: 0 20px; min-height: 60px; outline: 0; transition: background-color 0.2s;
}
.quote-form .contact-form input:focus, .quote-form .contact-form textarea:focus { background: #fff; }
.quote-form .contact-form textarea { grid-column: 1 / -1; padding: 16px 20px; min-height: 130px; resize: none; }
.quote-form .contact-form label:has(textarea) { grid-column: 1 / -1; }
.quote-form .contact-form-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.quote-form .contact-form-foot {
  grid-column: 1 / -1; margin: 20px -48px -32px; padding: 0 24px 0 48px; height: var(--stub);
  background: var(--accent); display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.quote-form .contact-form-status { font-size: var(--step-body); font-weight: 500; min-height: 1.4em; }
.quote-form .contact-form-status--error { text-decoration: underline wavy; }
.quote-form .contact-form-submit {
  min-height: 56px; padding: 0 30px; border: 0; border-radius: 999px;
  background: var(--ink-dark); color: var(--ink);
  font: 500 var(--step-body) var(--font); cursor: pointer;
  transition: transform 0.25s var(--ease);
}
.quote-form .contact-form-submit:hover { transform: translateY(-2px); }
.quote-form .contact-form-submit:active { transform: scale(0.98); }
.quote-form .contact-form-submit:disabled { opacity: 0.6; }

/* Motion */
.js .rise { opacity: 0; transform: translateY(32px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .rise.in { opacity: 1; transform: none; }
.js .shutter > video { clip-path: inset(0 0 100% 0); transition: clip-path 1.2s var(--ease); }
.js .shutter.in > video { clip-path: inset(0); }

@media (prefers-reduced-motion: reduce) {
  .js .rise, .js .shutter > video { opacity: 1; transform: none; clip-path: none; transition: none; }
  .btn, .go { transition: none; }
  html { scroll-behavior: auto; }
}

/* Phone */
@media (max-width: 900px) {
  .home .topbar { position: absolute; }
  .hero { min-height: 78svh; border-radius: 0 0 24px 24px; }
  .hero-copy { margin-bottom: 200px; }
  .hero-copy h1 { font-size: clamp(2.75rem, 11vw, 4rem); }
  .hero-copy p { margin-top: 18px; }
  .doors { grid-template-columns: 1fr; margin-top: -150px; }
  .doors .ticket:nth-child(2) { margin-top: 0; }
  .applet { margin-top: 0; }
  .hsection { margin-top: 110px; }
  .drive { min-height: 0; }
  .drive-photo { position: relative; width: calc(100% - var(--margin)); margin-left: var(--margin); height: auto; aspect-ratio: 4 / 3; border-radius: 24px 0 0 24px; }
  .drive-card { width: auto; margin: -80px var(--margin) 0 calc(var(--margin) + 12px); }
  .drive-card .t-body { padding: 28px 24px 26px; }
  .drive-card h2 { font-size: 2.25rem; }
  .drive-card .t-stub { padding-left: 24px; }
  .drive-app { position: relative; right: auto; top: auto; display: grid; justify-items: center; margin: 36px var(--margin) 0; }
  .drive-app .tour-phone { width: min(60vw, 260px); }
  .haul-head { flex-direction: column; align-items: start; gap: 16px; margin-bottom: 32px; }
  .haul-row { grid-template-columns: 1fr 1fr; }
  .haul-row .ticket { --stub: 72px; }
  .haul-row .ticket:nth-child(even) { margin-top: 32px; }
  .haul-row figure { height: 140px; }
  .haul-row h3 { font-size: 1.25rem; }
  .haul-row p { font-size: 0.95rem; }
  .haul-row .t-stub { padding-left: 18px; }
  .haul-row .t-stub b { font-size: 0.95rem; }
  .haul-row .go { width: 40px; height: 40px; }
  .why { grid-template-columns: 1fr; }
  .why-main { min-height: 0; padding: 28px 24px; gap: 24px; }
  .why-cards { grid-template-columns: 1fr; }
  .why-card { min-height: 0; padding: 24px; gap: 16px; }
  .why-card:nth-child(2) { margin-top: 0; }
  .about { grid-template-columns: 1fr 1fr; }
  .about-lead { grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
  .person { min-height: 0; padding: 22px 20px 26px; }
  .person:nth-child(3), .person:nth-child(5) { margin-top: 0; }
  .quote-top { grid-template-columns: 1fr; }
  .quote-desk { justify-self: stretch; width: auto; }
  .quote-form { margin-top: 32px; --stub: 92px; }
  .quote-form .contact-form { grid-template-columns: 1fr; padding: 24px 20px 24px; gap: 14px; }
  .quote-form .contact-form-foot { margin: 6px -20px -24px; padding: 0 14px 0 20px; height: 92px; }
  .quote-form .contact-form-status { font-size: var(--step-small); }
  .quote-form .contact-form-submit { min-height: 48px; padding: 0 22px; }
}
