/* ==========================================================================
   Homepage only. Loaded after style.css on /index.html.
   Spec: docs/DESIGN.md + docs/milestone-website-revamp-brief.md (14 Oct 2026).
   All motion is CSS and sits inside prefers-reduced-motion: no-preference.
   Without it (or without CSS animation support) every element renders in its
   final, resting state.
   ========================================================================== */

/* ---------- Hero: asymmetric split ---------- */
.hero-split {
  background-color: var(--steel-100);
  padding: 64px 24px 80px;
  overflow: hidden;
}
.hero-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
  gap: 48px;
  align-items: center;
}
.hero-eyebrow {
  margin: 0 0 20px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
}
.hero-title {
  margin: 0 0 24px;
  font-size: clamp(2.25rem, 1.1rem + 2.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.hero-title .l { display: block; overflow: hidden; padding-bottom: 0.06em; }
.hero-title .l > span { display: block; }
.hero-sub {
  max-width: 36ch;
  margin: 0 0 32px;
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* Visual: the building cutaway still (from the /applications/ 3D scene)
   with numbered markers; image and caption link to /applications/. */
.hero-visual { position: relative; width: 100%; }
.cutaway { position: relative; margin: 0; }
.cutaway-img { display: block; position: relative; }
/* Play-once film (desktop, motion allowed; main.js adds it). Until it ends,
   the still and markers wait; then the still takes over (same frame) and the
   markers pop in. Edges are feathered so the video's background blends with
   the section colour. */
.cutaway-film {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 3%, #000 97%, transparent);
}
.cutaway.is-playing .cutaway-film { opacity: 1; }
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .js .cutaway[data-film]:not(.film-done) .cutaway-img img,
  .js .cutaway[data-film]:not(.film-done) .hs { visibility: hidden; }
  .cutaway.film-done .hs-n { animation: hf-pop-after 360ms var(--ease-foam) both; animation-delay: calc(var(--i, 0) * 60ms); }
}
@keyframes hf-pop-after { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.cutaway-img img { display: block; width: 100%; height: auto; }
.cutaway .hs { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
.cutaway .hs-n { width: 28px; height: 28px; font-size: 14px; }
.cutaway figcaption { margin-top: 8px; text-align: right; font-weight: 600; }

/* ---------- Hero motion (about 1.4s, plays once, rests) ----------
   Copy rises in; the still fades in; markers pop in one by one in
   hotspot order on the foam curve. Reduced motion: all at rest. */
@media (prefers-reduced-motion: no-preference) {
  .hero-eyebrow         { animation: hf-fade 320ms var(--ease-out) 0ms both; }
  .hero-title .l > span { animation: hf-mask 600ms var(--ease-out) both; }
  .hero-title .l:nth-child(1) > span { animation-delay: 60ms; }
  .hero-title .l:nth-child(2) > span { animation-delay: 140ms; }
  .hero-title .l:nth-child(3) > span { animation-delay: 220ms; }
  .hero-sub   { animation: hf-rise 320ms var(--ease-out) 260ms both; }
  .hero-ctas  { animation: hf-rise 320ms var(--ease-out) 320ms both; }
  .cutaway-img img { animation: hf-fade 600ms var(--ease-out) 120ms both; }
  .cutaway .hs-n { animation: hf-pop 360ms var(--ease-foam) both; animation-delay: calc(640ms + var(--i, 0) * 60ms); }
  .cutaway figcaption { animation: hf-rise 320ms var(--ease-out) 1100ms both; }
}
@keyframes hf-fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes hf-rise   { from { opacity: 0; transform: translateY(var(--rise)); } to { opacity: 1; transform: none; } }
@keyframes hf-mask   { from { transform: translateY(105%); } to { transform: none; } }
@keyframes hf-pop    { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* ---------- Hero: tablet and mobile ---------- */
@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-visual { max-width: 720px; margin: 0 auto; }
}
@media (max-width: 767px) {
  .hero-split { padding: 32px 16px 40px; }
  .hero-eyebrow { font-size: 14px; margin-bottom: 14px; }
  .hero-title { margin-bottom: 16px; }
  .hero-sub { font-size: 1.0625rem; margin-bottom: 24px; }
  .hero-ctas .btn { flex: 1 1 auto; text-align: center; }
  .cutaway .hs { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
  .cutaway .hs-n { width: 22px; height: 22px; font-size: 12px; }
  .cutaway figcaption { text-align: left; }
}

/* ==========================================================================
   Homepage sections below the hero (shared parts live in sections.css)
   ========================================================================== */

/* ---------- Proof band (partner, numbers, clients) ---------- */
.proofband { background: var(--paper); border-bottom: 1px solid var(--steel-200); padding: 28px 0; }
.pb-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
.pb-partner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.pb-partner .mapura-logo img { height: 30px; width: auto; }
.pb-partner p { margin: 0; font-weight: 600; color: var(--ink); }
.pb-stats { list-style: none; margin: 0; padding: 0; display: flex; gap: 40px; }
.pb-stats strong { display: block; font-size: 1.75rem; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.pb-stats span { display: block; font-size: 14px; color: var(--ink-2); }
.pb-clients { margin: 16px auto 0; padding-top: 16px; border-top: 1px solid var(--steel-200); color: var(--ink-2); }

/* ---------- What do you need to fix? ---------- */
.jobs { background: var(--steel-100); }
.jobs h2 { margin-bottom: 8px; }
.jobs-sub { margin: 0 0 32px; color: var(--ink-2); }
.jobs-grid { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.job a { display: grid; height: 100%; overflow: hidden; border: 1px solid var(--steel-200); border-radius: 8px; background: var(--paper); color: inherit; text-decoration: none; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.job a:hover, .job a:focus-visible { border-color: var(--accent); box-shadow: 0 1px 2px rgb(17 20 24 / .06), 0 8px 24px rgb(17 20 24 / .06); }
.job-img { display: block; overflow: hidden; background: var(--steel-100); }
.job-img img { display: block; width: 100%; height: auto; transition: transform var(--dur-fast) var(--ease-out); }
.job a:hover .job-img img { transform: scale(1.03); }
.job-body { display: flex; flex-direction: column; padding: 20px 24px 24px; }
.job h3 { margin: 0 0 8px; font-size: 1.375rem; color: var(--ink); }
.job p { margin: 0 0 16px; color: var(--ink-2); }
.job-link { margin-top: auto; font-weight: 600; color: var(--accent); }

/* ---------- Why foam ---------- */
.whyfoam { background: var(--paper); border-top: 1px solid var(--steel-200); padding: 48px 0; }
.whyfoam h2 { margin: 0 0 20px; font-size: var(--fs-h3, 1.5rem); }
.whyfoam ul { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 32px; }
.whyfoam li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-2); }
.whyfoam .ic { flex: 0 0 22px; width: 22px; height: 22px; margin-top: 2px; color: var(--accent); }

/* ---------- Product families (bento) ---------- */
.products-bento { background: var(--paper); border-top: 1px solid var(--steel-200); }
.bento { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.cell { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--steel-200); border-radius: 8px; background: var(--paper); }
.cell-pu { grid-row: span 2; }
.cell-fire { grid-column: span 2; flex-direction: row; }
.cell-img { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 24px; background: var(--steel-100); }
.cell-img img { transition: transform var(--dur-fast) var(--ease-out); }
.cell:hover .cell-img img { transform: scale(1.03); }
.cell-pu .cell-img { flex: 1 1 auto; }
.cell-pu .cell-img img { height: 340px; width: auto; }
.cell-fire .cell-img { flex: 0 0 44%; }
.cell-fire .cell-img img { height: 230px; width: auto; }
.cell-seal .cell-img, .cell-tools .cell-img { background: var(--paper); border-bottom: 1px solid var(--steel-200); }
.cell-seal .cell-img img, .cell-tools .cell-img img { width: 100%; max-width: 240px; height: auto; }
.cell-body { padding: 24px; }
.cell h3 { margin: 0 0 8px; font-size: 1.375rem; color: var(--ink); }
.cell p { margin: 0 0 16px; color: var(--ink-2); }
.cell .badges { margin-bottom: 16px; }
.cell-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

/* ---------- Proof ---------- */
.proof { background: var(--paper); }
.proof-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; }

/* ---------- Sections: tablet and mobile ---------- */
@media (max-width: 1023px) {
  .proof-grid, .pb-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .jobs-grid { grid-template-columns: minmax(0, 1fr); }
  .job a { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .bento { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cell-pu { grid-row: auto; grid-column: span 2; flex-direction: row; }
  .cell-pu .cell-img { flex: 0 0 40%; }
  .cell-pu .cell-img img { height: 260px; }
}
@media (max-width: 767px) {
  .job a { grid-template-columns: minmax(0, 1fr); }
  .pb-stats { gap: 24px; }
  .whyfoam ul { grid-template-columns: minmax(0, 1fr); }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .cell-pu, .cell-fire { grid-column: auto; flex-direction: column; }
  .cell-pu .cell-img img { height: 220px; }
  .cell-fire .cell-img img { height: 180px; }
}
