/* ==========================================================================
   Home page (/ and /fr)
   Loaded only on this page, AFTER /css/style.css (shared styles, colours,
   motion system). Rules used on more than one page belong in style.css.
   ========================================================================== */

/* ---- Hero ---------------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate;
  color: var(--off-white);
  background: var(--charcoal);
  min-height: min(88vh, 760px);
  display: flex; align-items: center;
  padding: 4.5rem 0;
}
.hero-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--charcoal); }
.hero-media img,
.hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video { pointer-events: none; }
/* Dark overlay keeps the headline readable over the moving flames (mobile:
   text spans the full width, so the overlay is evenly strong). */
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(30, 27, 24, 0.55) 0%, rgba(30, 27, 24, 0.2) 40%, rgba(30, 27, 24, 0.7) 100%),
    linear-gradient(100deg, rgba(30, 27, 24, 0.85) 0%, rgba(30, 27, 24, 0.7) 100%);
}
@media (min-width: 900px) {
  .hero-media::after {
      background:
        linear-gradient(180deg, rgba(30, 27, 24, 0.35) 0%, transparent 35%, rgba(30, 27, 24, 0.55) 100%),
        linear-gradient(100deg, rgba(30, 27, 24, 0.9) 0%, rgba(30, 27, 24, 0.72) 45%, rgba(30, 27, 24, 0.3) 100%);
    }
}
/* Reduced motion: poster image only (the <source> media queries already stop
   the download in most browsers; this hides the element everywhere else). */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}
.hero-content { max-width: var(--container); }
.hero h1 { max-width: 16ch; color: var(--off-white); }
.hero-tagline {
  font-family: var(--font-display); font-size: clamp(1.2rem, 3vw, 1.5rem);
  color: var(--ember); font-weight: 600; margin-bottom: 0.75rem;
}
.hero-lead { max-width: 58ch; font-size: 1.1rem; color: #e9e2d8; margin-bottom: 1.75rem; }
.hero-points {
  list-style: none; padding: 0; margin: 2rem 0 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  font-size: 0.95rem; color: #e9e2d8;
}
.hero-points li { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-points .icon { color: var(--ember); }
/* ---- Feature cards ------------------------------------------------------- */
.feature-grid { display: grid; gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
.feature-card {
  position: relative; overflow: hidden;
  display: grid; gap: 1.1rem; align-content: start;
  padding: 1.75rem;
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(30, 27, 24, 0.05);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.35s ease;
}
/* Ember accent: a thin bar that grows along the top edge on hover */
.feature-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ember), #f4a66d);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: rgba(232, 116, 42, 0.35); }
.feature-card:hover::before { transform: scaleX(1); }
.feature-card h3 { font-size: 1.3rem; margin-bottom: 0.45rem; }
.feature-card p { font-size: 1rem; line-height: 1.6; }
.feature-icon--lg {
  width: 64px; height: 64px; margin: 0; border-radius: 18px;
  background: linear-gradient(145deg, var(--beige-soft), var(--beige));
  box-shadow: inset 0 0 0 1px rgba(168, 74, 20, 0.14);
  transition: background 0.35s ease, color 0.35s ease, transform 0.35s var(--ease-out);
}
.feature-card:hover .feature-icon--lg { background: var(--ember); color: var(--charcoal); transform: rotate(-4deg) scale(1.04); }
/* ---- Calculator teaser (home) -------------------------------------------- */
.calc-teaser-inner { display: grid; gap: 2rem; align-items: center; }
.calc-teaser-form {
  background: rgba(250, 247, 242, 0.06);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.calc-teaser-form label { color: var(--off-white); }
/* ---- Markets ------------------------------------------------------------- */
.market-grid { display: grid; gap: 1.25rem; list-style: none; padding: 0; margin: 0; }
.market-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 1.5rem;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.35s ease;
}
.market-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: rgba(232, 116, 42, 0.35); }
.market-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.1rem; }
.market-card h3 { margin-bottom: 0.3rem; font-size: 1.25rem; }
.market-card h3 a { color: var(--charcoal); text-decoration: none; }
.market-card:hover h3 a { color: var(--ember-text); }
.market-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.ports-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1.5rem 0 0; color: var(--muted); }
.ports-line .icon { color: var(--ember-text); }
/* ---- Process ------------------------------------------------------------- */
.process { position: relative; list-style: none; padding: 0; margin: 0; display: grid; gap: 2rem; }
/* Connecting line — vertical on small screens, horizontal from 900 px */
.process::before {
  content: ""; position: absolute; z-index: 0;
  left: 23px; top: 24px; bottom: 24px; width: 2px;
  background: linear-gradient(180deg, var(--ember), rgba(232, 116, 42, 0.25));
  transform-origin: top;
  transition: transform 1.4s var(--ease-out);
}
.process-step { position: relative; z-index: 1; padding-left: 4.25rem; min-height: 48px; }
.process-num {
  position: absolute; left: 0; top: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--off-white); color: var(--ember-text);
  border: 2px solid var(--ember);
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s var(--ease-out);
}
.process-step:hover .process-num { background: var(--ember); color: var(--charcoal); transform: scale(1.06); }
.process-step h3 { font-size: 1.1rem; margin-bottom: 0.35rem; }
.process-step p { color: var(--muted); margin: 0; font-size: 0.95rem; }
/* ---- Sustainability teaser: gentle parallax inside a fixed frame --------- */
.parallax-frame { border-radius: var(--radius-lg); overflow: hidden; }
.parallax-frame .photo { border-radius: 0; }
.js-motion .parallax-frame .photo img { transform: translate3d(0, var(--parallax, 0px), 0) scale(1.12); will-change: transform; }

/* ==========================================================================
   Motion — scroll reveals (public/js/main.js)
   Only active when <html> has "js-motion" (JavaScript on, IntersectionObserver
   available, no reduced-motion preference). Otherwise everything is visible.
   Only opacity and transform are animated. Each element animates once; when
   done, main.js removes data-reveal so hover effects run at their own speed.
   ========================================================================== */
/* "How it works" connecting line draws in */
.js-motion .process[data-reveal-line]::before { transform: scaleY(0); }
.js-motion .process[data-reveal-line].is-revealed::before { transform: none; }
@media (min-width: 900px) {
  .js-motion .process[data-reveal-line]::before { transform: scaleX(0); }
  .js-motion .process[data-reveal-line].is-revealed::before { transform: none; }
}

/* ==========================================================================
   Breakpoints (mobile-first)
   ========================================================================== */
@media (min-width: 600px) {
  /* 4 or 2 cards: 2 × 2 / 1 × 2. 3 cards: the last one spans the row (900 px+: 3 columns) */
  .feature-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .feature-grid--n2 .feature-card, .feature-grid--n4 .feature-card { grid-template-columns: auto 1fr; align-items: start; gap: 1.4rem; padding: 2rem; }
}
@media (min-width: 900px) {
  .feature-grid--n2 .feature-card, .feature-grid--n4 .feature-card { padding: 2.25rem; gap: 1.6rem; }
  .market-grid { grid-template-columns: repeat(4, 1fr); }
  .market-grid--featured { grid-template-columns: repeat(3, 1fr); }
  /* Steps side by side; the line runs from the first number to the last */
  .process { grid-template-columns: repeat(var(--steps, 5), 1fr); gap: 1.75rem; }
  .process--n4 { --steps: 4; }
  .process::before {
      left: 24px; right: calc((100% - (var(--steps, 5) - 1) * 1.75rem) / var(--steps, 5) - 24px);
      top: 23px; bottom: auto; width: auto; height: 2px;
      background: linear-gradient(90deg, var(--ember), rgba(232, 116, 42, 0.3));
      transform-origin: left;
    }
  .process-step { padding-left: 0; padding-top: 4.25rem; }
  .calc-teaser-inner { grid-template-columns: 1.1fr 1fr; gap: 3.5rem; }
}
