/* Chapter 03: Foresight (incl. "Foresight for iPhone"). */

/* -------------------------------------------------------------------------
   03 Foresight
   ------------------------------------------------------------------------- */
.ch--foresight { --rond: 0; color: #fff; padding-bottom: 16vh; }
.f-hero {
  position: relative;
  max-width: var(--max); margin: 0 auto; padding: calc(var(--nav-h) + 6vh) var(--pad) 8vh;
  min-height: 100vh;
  display: grid; grid-template-columns: .85fr 1.35fr; align-items: center; gap: 3vw;
}
.f-hero__text { order: 1; position: relative; z-index: 1; }
/* Slightly wider than tall (room for labels) and bleeds a little past the right gutter on large screens. */
.f-hero__viz {
  order: 2; position: relative; aspect-ratio: 1.15; justify-self: end;
  width: calc(100% + var(--pad) * .6); margin-right: calc(var(--pad) * -.6);
  max-width: 1000px;
}
.f-hero__viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.f-orb {
  position: absolute; left: 50%; top: 50%; height: 23%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 60px rgba(1, 161, 86, .45));
  animation: orb 8s ease-in-out infinite;
}
@keyframes orb { 50% { transform: translate(-50%, -52%) scale(1.03); } }
.ch--foresight .ch__title { font-weight: 700; font-size: clamp(40px, 5vw, 84px); font-stretch: 96%; letter-spacing: -.035em; max-width: 14ch; }
.f-sub { margin: 24px 0 34px; font-size: 18px; color: #c4c7c5; }
.f-sub span { margin: 0 8px; color: #81c995; }

.f-stack { position: relative; margin-top: 6vh; }
.f-card {
  position: sticky; top: calc(var(--nav-h) + 30px + var(--i) * 22px);
  display: grid; grid-template-columns: .9fr 1.25fr; gap: clamp(24px, 4vw, 64px); align-items: center;
  padding: clamp(24px, 3.4vw, 52px);
  margin-bottom: 8vh;
  border-radius: 36px;
  background: linear-gradient(160deg, #0d4a57 0%, #063a45 60%, #04313b 100%);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 -20px 60px -30px rgba(0, 0, 0, .5);
  transform-origin: 50% 0;
  will-change: transform;
}
.badge {
  display: inline-block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; font-stretch: 110%;
  padding: 7px 12px; border-radius: 99px; background: rgba(129, 201, 149, .14); color: #a8e6b8;
}
.f-card h3 { margin: 18px 0 14px; font-size: clamp(30px, 3vw, 48px); line-height: 1.04; letter-spacing: -.03em; font-weight: 700; }
.f-card p { margin: 0 0 22px; color: #c4c7c5; font-size: 16.5px; line-height: 1.6; }
.f-card__media {
  background: var(--mbg); /* sampled edge color of each media */
  border-radius: 24px;
  padding: clamp(10px, 1.2vw, 18px);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.f-card__media video,
.f-card__media img { width: 100%; height: auto; border-radius: 12px; }

/* Foresight for iPhone: hero feature. Intro head, then a pinned stage whose
   canvas tells two stories (on the go → sync, at your desk → hand off). */
.fm { position: relative; margin-top: 10vh; }
.fm-head {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 2vh 4vw; align-items: end;
  padding-bottom: 0;
}
.fm-eyebrow { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; font-size: 16px; font-weight: 500; color: #c4eed0; margin-bottom: 1vh; }
.fm-dot { margin: 0 6px; color: #81c995; }
.fm-new {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px 7px 11px; border-radius: 99px;
  background: rgba(129, 201, 149, .14); color: #a8e6b8;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; font-stretch: 110%;
}
.fm-new i { width: 7px; height: 7px; border-radius: 50%; background: #81c995; animation: fmPulse 2.2s infinite; }
@keyframes fmPulse {
  0% { box-shadow: 0 0 0 0 rgba(129, 201, 149, .6); }
  70% { box-shadow: 0 0 0 10px rgba(129, 201, 149, 0); }
  100% { box-shadow: 0 0 0 0 rgba(129, 201, 149, 0); }
}
.fm-title { grid-column: 1 / -1; margin: 0; max-width: 18ch; font-size: clamp(40px, 5vw, 84px); line-height: .96; letter-spacing: -.045em; font-weight: 700; font-stretch: 96%; }

.fm-pin { position: relative; margin-top: -8vh; height: 400vh; }
/* Device chips in the heading: icon + word on a wobbling blob highlight. */
.fm-nw { white-space: nowrap; }
.fm-chip {
  position: relative; display: inline-flex; align-items: center; gap: .14em;
  padding: 0 .1em 0 .05em; margin: 0 .08em; isolation: isolate; color: #e9fff0;
}
.fm-chip::before {
  content: ""; position: absolute; z-index: -1; inset: -.06em -.12em -.1em -.1em;
  background: rgba(255, 255, 255, .1);
  clip-path: polygon(0.5% 2%, 100% 0%, 99.5% 97%, 0% 100%);
}
.fm-chip--b::before { clip-path: polygon(0% 0%, 99.5% 2.5%, 100% 100%, 0.5% 97.5%); }
.fm-ico {
  font-family: "Material Symbols Sharp"; font-weight: normal; font-style: normal;
  font-size: .82em; line-height: 1; letter-spacing: normal; text-transform: none;
  white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; flex: none;
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 100;
  transform: translateY(40%) scale(.4); opacity: 0;
  transition: transform .9s var(--ease-out), opacity .5s; transition-delay: var(--d);
}
/* The phone glyph has wide side bearings; tuck it in to match the Mac icon. */
.fm-ico--phone { margin: 0 -.1em; }
.fm-chip > span:not(.fm-ico) {
  display: inline-block; transform: translateY(40%); opacity: 0;
  transition: transform 1.1s var(--ease-out), opacity .6s; transition-delay: var(--d);
}
.fm-title.in .fm-ico,
.fm-title.in .fm-chip > span:not(.fm-ico) { transform: none; opacity: 1; }
.fm-stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: radial-gradient(56% 64% at 68% 48%, rgba(1, 86, 102, .5), rgba(0, 48, 58, 0) 72%);
}
.fm-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.fm-copy {
  position: absolute; z-index: 2; top: 50%; transform: translateY(-46%);
  left: max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad)));
  width: min(30vw, 420px);
}
.fm-tabs { display: flex; gap: 10px; margin-bottom: 36px; }
.fm-tab {
  position: relative; flex: 1; appearance: none; border: 0; background: none; cursor: pointer;
  padding: 0 0 14px; text-align: left;
  font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; font-stretch: 110%;
  color: rgba(255, 255, 255, .42);
  transition: color .4s;
}
.fm-tab:hover { color: rgba(255, 255, 255, .8); }
.fm-tab[aria-selected="true"] { color: #fff; }
.fm-tab b { display: block; margin-bottom: 6px; font-size: 22px; font-weight: 500; letter-spacing: 0; font-stretch: 55%; color: #81c995; }
.fm-tab::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.fm-tab i { position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; border-radius: 2px; background: #81c995; box-shadow: 0 0 12px rgba(129, 201, 149, .7); transform-origin: 0 50%; transform: scaleX(0); }
.fm-acts { display: grid; }
.fm-act {
  grid-area: 1 / 1;
  opacity: 0; transform: translateY(26px); filter: blur(6px); pointer-events: none;
  transition: opacity .5s var(--ease-out), transform .9s var(--ease-out), filter .6s var(--ease-out);
}
.fm-act.is-on { opacity: 1; transform: none; filter: none; pointer-events: auto; transition-delay: .18s; }
.fm-act h3 { margin: 18px 0 14px; font-size: clamp(30px, 2.8vw, 46px); line-height: 1.04; letter-spacing: -.03em; font-weight: 700; }
.fm-act p { margin: 0 0 22px; color: #c4c7c5; font-size: 16.5px; line-height: 1.6; }
