/* ==========================================================================
   EcoCycle — editorial.css
   Public-site enhancement layer. Loaded ONLY by components/layouts/site.blade.php,
   so nothing here can reach the console or the two phone apps.

   Everything reads from the tokens in base.css — no new colours are invented,
   which is why the whole layer follows the theme toggle for free.
   ========================================================================== */

/* --- Motion policy -------------------------------------------------------
   One switch at the top. Every animated rule below is written so that turning
   this off leaves the page in its final, correct state rather than its initial
   one — a reader who prefers reduced motion gets the design, not a blank page. */
@media (prefers-reduced-motion: reduce) {
  .ed-reveal { opacity: 1 !important; transform: none !important; }
  .cine-img, .bento-card, .step-card { transition: none !important; }
  .pulse-dot::after { animation: none !important; }
}

/* --- Scroll progress ------------------------------------------------------ */
.scroll-rail {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: transparent; pointer-events: none;
}
.scroll-rail > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--cyan) 60%, var(--accent));
  transition: width 90ms linear;
}

/* --- Scroll reveal --------------------------------------------------------
   Set by JS on elements marked [data-reveal]. If JS never runs, the class is
   never added and the content simply renders — the reveal is an enhancement,
   never a precondition for reading the page. */
.ed-reveal { opacity: 0; transform: translateY(18px); }
.ed-reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .62s cubic-bezier(.22,.61,.36,1) var(--d, 0ms),
              transform .62s cubic-bezier(.22,.61,.36,1) var(--d, 0ms);
}

/* ==========================================================================
   CINEMATIC HERO
   ========================================================================== */
.cine {
  position: relative;
  min-height: min(88vh, 820px);
  display: flex; align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  isolation: isolate;
}

/* The photograph itself, as a real <img> so it keeps its alt text and its
   place in the document rather than becoming a decorative background. */
.cine-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.cine-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 42%;
  transform: scale(1.06);
  animation: cine-drift 22s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes cine-drift { to { transform: scale(1); } }

/* Two scrims, not one: a vertical ramp so the type at the bottom always has
   ground, and a side ramp so the headline holds on wide screens. */
.cine-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(8,12,10,.94) 0%, rgba(8,12,10,.74) 34%, rgba(8,12,10,.30) 66%, rgba(8,12,10,.42) 100%),
    linear-gradient(105deg, rgba(8,12,10,.72) 0%, rgba(8,12,10,.20) 52%, transparent 78%);
}

/* Brand mesh. Sits above the scrim, below the type. */
.cine-mesh {
  position: absolute; inset: -20% -10% auto -10%; height: 120%; z-index: -1;
  pointer-events: none; opacity: .5;
  background:
    radial-gradient(48% 42% at 12% 78%, color-mix(in srgb, var(--primary) 62%, transparent) 0%, transparent 68%),
    radial-gradient(38% 38% at 88% 18%, color-mix(in srgb, var(--cyan) 44%, transparent) 0%, transparent 66%),
    radial-gradient(34% 34% at 68% 92%, color-mix(in srgb, var(--accent) 34%, transparent) 0%, transparent 70%);
  filter: blur(14px);
}

.cine-inner { position: relative; z-index: 1; width: 100%; padding: 132px 0 34px; }

/* Everything inside the hero sits on the photograph, so the type scale is
   pinned to white here rather than inheriting the page's ink tokens. */
.cine .eyebrow      { color: rgba(255,255,255,.72); }
.cine .display      { color: #fff; text-wrap: balance; }
.cine .lede         { color: rgba(255,255,255,.80); }
.cine .tiny,
.cine .small        { color: rgba(255,255,255,.70); }

.cine-title {
  font-size: clamp(38px, 6.4vw, 82px);
  line-height: 1.02;
  letter-spacing: -.022em;
}

/* Live pill ---------------------------------------------------------------- */
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 11px; border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.20);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.92);
}
.pulse-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #6ee7a8; flex: none; }
.pulse-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid #6ee7a8; opacity: .7;
  animation: pulse-ring 2.1s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(.6); opacity: .75; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* The in-transit caption, lifted off the old <figcaption> ------------------- */
.cine-note {
  border-left: 2px solid rgba(255,255,255,.28);
  padding-left: 14px;
  max-width: 46ch;
}

/* Glass stat strip --------------------------------------------------------- */
.cine-figures {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; margin-top: 40px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-lg); overflow: hidden;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.cine-figures > div { background: rgba(10,14,12,.42); padding: 20px 22px; }
.cine-figures .n {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(24px, 3vw, 36px); font-weight: 500; letter-spacing: -.03em;
  color: #fff; line-height: 1.05;
}
.cine-figures .k { font-size: 11.5px; color: rgba(255,255,255,.66); margin-top: 6px; }
@media (max-width: 760px) {
  .cine-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cine-inner   { padding-top: 104px; }
  .cine         { min-height: auto; }
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

/* A soft brand wash for the alternating bands, replacing the flat fill. */
.band-soft {
  position: relative;
  background:
    radial-gradient(62% 78% at 8% 0%, color-mix(in srgb, var(--primary) 6%, transparent) 0%, transparent 62%),
    radial-gradient(52% 70% at 96% 100%, color-mix(in srgb, var(--cyan) 6%, transparent) 0%, transparent 60%),
    var(--surface-2);
  border-block: 1px solid var(--border);
}

/* Section eyebrow with a rule running off it. */
.ed-head .eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.ed-head .eyebrow::after {
  content: ''; width: 44px; height: 1px; background: var(--border-strong);
}

h2, .h2-lg { text-wrap: balance; }

/* ==========================================================================
   BENTO — the three surfaces
   ========================================================================== */
.bento {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px;
}
.bento-card {
  grid-column: span 3;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  transition: transform .42s cubic-bezier(.22,.61,.36,1),
              box-shadow .42s cubic-bezier(.22,.61,.36,1),
              border-color .42s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.bento-card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--primary-line); }
.bento-card .media { border-radius: 0; }
.bento-card .media > img { transition: transform .7s cubic-bezier(.22,.61,.36,1); }
.bento-card:hover .media > img { transform: scale(1.05); }

/* The pointer sheen. Coordinates come from JS as --mx/--my. */
.bento-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity .4s var(--ease);
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%),
              color-mix(in srgb, var(--primary) 16%, transparent), transparent 62%);
}
.bento-card:hover::after { opacity: 1; }

/* The third card runs full width and lays out horizontally — the rhythm break
   that stops three identical cards reading as a table. */
.bento-wide { grid-column: span 6; flex-direction: row; align-items: stretch; }
.bento-wide .media { width: 46%; flex: none; height: auto; aspect-ratio: auto; min-height: 232px; }
.bento-wide .card-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 34px 38px; }

.bento-num {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
}
.bento-num::before {
  content: ''; width: 22px; height: 1px; background: var(--primary);
}
.bento-go {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--primary);
}
.bento-go .i { transition: transform var(--fast); }
.bento-card:hover .bento-go .i { transform: translateX(4px); }

@media (max-width: 940px) {
  .bento-card, .bento-wide { grid-column: span 6; }
  .bento-wide { flex-direction: column; }
  .bento-wide .media { width: 100%; aspect-ratio: 16 / 9; min-height: 0; }
  .bento-wide .card-body { padding: 22px; }
}

/* ==========================================================================
   PIPELINE STEPS
   Scoped to .home-flow so the shared x-flow-steps component is untouched.
   ========================================================================== */
.home-flow .ed-steps { gap: 0; }
.home-flow .ed-step {
  position: relative;
  /* Wider media and a tighter gap. The stock 360px column left a dead zone
     between a two-line description and the photograph; a 16:9 band closes it
     and keeps six rows readable without scrolling past them. */
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 440px);
  gap: 32px;
  padding: 22px 0;
  transition: background .3s var(--ease);
}
.home-flow .ed-step .media { aspect-ratio: 16 / 9; border-radius: var(--r-md); }
.home-flow .ed-step h3 { font-size: 19px; letter-spacing: -.015em; }
.home-flow .ed-step p  { max-width: 46ch; }

@media (max-width: 1100px) {
  .home-flow .ed-step { grid-template-columns: 56px minmax(0, 1fr) minmax(0, 340px); gap: 24px; }
}
@media (max-width: 820px) {
  .home-flow .ed-step { grid-template-columns: 44px minmax(0, 1fr); gap: 16px; }
  .home-flow .ed-step::before { display: none; }
}
.home-flow .ed-step::before {
  content: ''; position: absolute; left: 15px; top: 0; bottom: 0; width: 1px;
  background: var(--border);
}
.home-flow .ed-step:first-child::before { top: 50%; }
.home-flow .ed-step:last-child::before  { bottom: 50%; }

.home-flow .ed-step .marker {
  position: relative; z-index: 1;
  width: 31px; height: 31px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border-strong);
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  transition: all .34s cubic-bezier(.22,.61,.36,1);
}
.home-flow .ed-step:hover .marker {
  background: var(--primary); border-color: var(--primary);
  color: var(--text-inv); transform: scale(1.12);
}
.home-flow .ed-step .media { transition: transform .5s cubic-bezier(.22,.61,.36,1); }
.home-flow .ed-step:hover .media { transform: scale(1.02); }

/* ==========================================================================
   MISC
   ========================================================================== */

/* Figure captions on the facility row, tightened. */
.fig-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; }
@media (max-width: 820px) { .fig-grid { grid-template-columns: minmax(0,1fr); } }

/* The settlement split tiles in the data-model section. */
.split-tile { padding: 15px 16px; border-radius: var(--r-md); border: 1px solid transparent; }
.split-tile.is-hh { background: var(--primary-soft); border-color: var(--primary-line); }
.split-tile.is-ag { background: var(--info-soft); }

/* Intelligence list, as a bordered stack rather than loose bullets. */
.cap-list { display: grid; gap: 0; border-top: 1px solid var(--border); }
.cap-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 2px; border-bottom: 1px solid var(--border);
  transition: padding-left .3s var(--ease);
}
.cap-list li:hover { padding-left: 8px; }
.cap-list .i { color: var(--primary); margin-top: 2px; flex: none; }

/* Sticky CTA that only appears once the hero has gone. */
.cta-dock {
  position: fixed; left: 50%; bottom: 22px; z-index: 55;
  transform: translate(-50%, 130%);
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px 9px 18px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--border); box-shadow: var(--sh-3);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  transition: transform .48s cubic-bezier(.22,.61,.36,1);
}
.cta-dock.is-up { transform: translate(-50%, 0); }
@media (max-width: 620px) { .cta-dock { display: none; } }
