/* hellocaldera.com home page: the motion layer (assets/home.js sets the classes and scroll variables).
   Without JavaScript, or with "reduce motion" on, the page is the same content, fully shown and still
   (everything that hides or moves is scoped to html.motion). Only transform and opacity animate. */

/* ---- scroll progress ---- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ember-deep), var(--ember), #ffb066);
  transform-origin: 0 50%;
  transform: scaleX(var(--page, 0));
  box-shadow: 0 0 12px var(--ember-glow);
}

/* ---- hero ---- */
.home .hero {
  min-height: min(100svh, 980px);
  display: flex;
  align-items: center;
  padding: 96px 0 120px;
}
.home .hero::before {
  content: none; /* the photo mark is replaced by the live rings */
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 32px;
  width: 100%;
}
.hero-copy {
  position: relative;
  z-index: 2;
}
.home .hero h1 {
  font-size: clamp(42px, 7.2vw, 92px);
  max-width: 820px;
}
/* The chrome gradient sits on each line so the lines can move on their own. */
.home .hero h1.chrome {
  background: none;
  color: var(--ink);
}
.hero h1 .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
}
.hero h1 .line > span {
  display: inline-block;
  background: linear-gradient(180deg, var(--silver-1) 20%, var(--silver-2) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero h1 .line:nth-child(2) > span {
  background: linear-gradient(180deg, #ffd2a8 0%, var(--ember) 60%, var(--ember-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.sparks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

/* The mark: five rings stacked in depth. --p (0 → 1 over the hero) spreads them apart and tilts them. */
.mark {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 520px;
  justify-self: end;
  perspective: 900px;
}
.mark .defs {
  position: absolute;
}
.rings {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* --tilt: the mark's resting angle (straight-on on phones and tablets, where it's centered at the top). */
  transform: rotateX(calc(var(--p, 0) * 28deg)) rotateY(calc(var(--tilt, -14deg) + var(--p, 0) * 46deg)) rotateZ(calc(var(--p, 0) * -12deg));
}
.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: translateZ(calc((var(--i) - 2) * (14px + var(--p, 0) * 70px)));
}
/* Each ring is drawn like the logo: a glow, a drop shadow (the dark grooves), a dark edge, brushed steel lit from
   the top left, the ember on the lower right, and a thin highlight. */
.ring path {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: butt;
}
.ring .glow {
  stroke: url(#ring-ember);
  stroke-width: 18;
  filter: url(#ring-blur);
  opacity: 0.8;
}
.ring .shade {
  stroke: #000;
  stroke-width: 15.5;
  opacity: 0.7;
  transform: translate(2.5px, 3px);
}
.ring .edge {
  stroke: #1d1f22;
  stroke-width: 14.2;
}
.ring .metal {
  stroke: url(#ring-metal);
  stroke-width: 11.6;
}
.ring .ember {
  stroke: url(#ring-ember);
  stroke-width: 12.4;
}
.ring .shine {
  stroke: #fff;
  stroke-width: 1.2;
  opacity: 0.14;
  transform: translate(-1.2px, -1.2px);
}
.core-glow {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 122, 26, 0.35), transparent 70%);
  filter: blur(18px);
  transform: translateZ(-60px) translateY(18%);
  opacity: calc(0.5 + var(--p, 0) * 0.5);
}
/* A quiet chevron at the bottom of the hero (desktop only). */
.scroll-cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  color: var(--muted);
  opacity: 0.55;
  z-index: 2;
  transition:
    opacity 0.2s,
    color 0.2s;
}
.scroll-cue:hover {
  opacity: 1;
  color: var(--ember);
}
.scroll-cue svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- cards: a soft ember spotlight that follows the pointer (--mx/--my set by home.js) ---- */
.spot {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    border-color 0.25s,
    transform 0.25s;
}
.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, -40%), rgba(255, 122, 26, 0.16), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
}
.spot:hover {
  border-color: rgba(255, 122, 26, 0.38);
}
.spot:hover::before {
  opacity: 1;
}
.card .num {
  display: block;
  margin-bottom: 10px;
}
/* Vertical tiles: the name centered both ways. */
.tiles .card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 116px;
}
.tiles .card h3 {
  margin: 0;
}
.tiles .card p {
  margin: 6px 0 0;
}
.tiles .yours {
  border-color: rgba(255, 122, 26, 0.4);
  background: linear-gradient(180deg, rgba(255, 122, 26, 0.1), var(--bg-2));
}

/* ---- the stack: a pipeline the consumer travels down (--s, 0 → 1 through the steps) ---- */
.stack-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 56px;
  align-items: start;
}
.stack-pin {
  position: sticky;
  top: 96px;
}
.stack-link {
  margin-top: 26px;
}
.pipe {
  position: relative;
  margin-top: 8px;
  padding-left: 34px;
}
.pipe-track {
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--line-2);
  border-radius: 2px;
}
.pipe-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--ember), #ffb066);
  transform-origin: 50% 0;
  transform: scaleY(var(--s, 0));
  box-shadow: 0 0 14px var(--ember-glow);
}
.pipe-dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #ffd2a8;
  box-shadow:
    0 0 0 4px rgba(255, 122, 26, 0.25),
    0 0 22px 6px rgba(255, 122, 26, 0.55);
  transform: translateY(calc(var(--s, 0) * var(--track, 0px)));
}
.pipe-nodes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  font-weight: 650;
  color: var(--muted);
}
.pipe-nodes li {
  position: relative;
  transition:
    color 0.3s,
    transform 0.3s;
}
.pipe-nodes li span {
  position: absolute;
  left: -30px;
  top: 0.45em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: var(--bg);
  transition:
    border-color 0.3s,
    background 0.3s,
    box-shadow 0.3s;
}
.pipe-nodes li.lit {
  color: var(--ink);
  transform: translateX(4px);
}
/* The dot stays on the line while its label nudges right (Matt, Oct 27: the dots looked off-center). */
.pipe-nodes li.lit span {
  transform: translateX(-4px);
}
.pipe-nodes li.lit span {
  border-color: var(--ember);
  background: var(--ember);
  box-shadow: 0 0 12px var(--ember-glow);
}
.pipe-nodes li.you.lit {
  color: #ffd2a8;
}
/* The steps themselves: a tall column the page scrolls past while the pipeline stays pinned. */
.flow.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 12vh;
}
.flow.steps > li {
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  min-height: 34vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition:
    border-color 0.35s,
    background 0.35s,
    opacity 0.35s,
    transform 0.35s;
}
.flow.steps > li::after {
  content: none;
}
.flow.steps b {
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.01em;
}
.flow.steps span {
  font-size: 17px;
}
.flow.steps .you {
  border-color: rgba(255, 210, 168, 0.4);
}
.flow.steps .tag::before {
  content: counter(step, decimal-leading-zero) " · ";
  counter-increment: step;
  color: var(--ember);
}
.flow.steps {
  counter-reset: step;
}

/* ---- consent icons draw themselves ---- */
.ico {
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  fill: none;
  stroke: var(--ember);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- verticals: a drifting band of names ---- */
.verticals {
  overflow: hidden;
}
.marquee {
  margin: -24px 0 56px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 36px;
  width: max-content;
  transform: translateX(var(--mq, 0px));
  will-change: transform;
}
.marquee span {
  font-size: clamp(44px, 8vw, 112px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.22);
}
.marquee span:nth-of-type(3n) {
  -webkit-text-stroke-color: rgba(255, 122, 26, 0.7);
}
.marquee i {
  width: 14px;
  height: 14px;
  flex: none;
  transform: rotate(45deg);
  background: var(--ember);
  opacity: 0.7;
}

/* ---- partner block ---- */
.card.partner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 32px;
  align-items: center;
  padding: clamp(24px, 4vw, 44px);
  background: radial-gradient(500px 240px at 0% 0%, rgba(255, 122, 26, 0.12), transparent 70%), linear-gradient(180deg, var(--surface), var(--bg-2));
}
.card.partner .btn {
  margin-top: 18px;
}
.ticks li::before {
  width: 14px;
  height: 8px;
  top: 0.45em;
  background: none;
  border-left: 2px solid var(--ember);
  border-bottom: 2px solid var(--ember);
  border-radius: 0;
  transform: rotate(-45deg);
}

/* ---- closing band: the mark's rings, slowly turning ---- */
.cta-band {
  position: relative;
  overflow: hidden;
  padding: 120px 0;
}
.cta-band .wrap {
  position: relative;
}
.cta-rings {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 720px;
  height: 720px;
  margin: -360px 0 0 -360px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 34px, rgba(255, 255, 255, 0.05) 35px 37px, transparent 38px 52px),
    radial-gradient(closest-side, rgba(255, 122, 26, 0.18), transparent 75%);
  -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent);
  mask-image: radial-gradient(closest-side, #000 40%, transparent);
  pointer-events: none;
}

/* ================= motion (only with html.motion) ================= */
.motion .hero h1 .line > span {
  transform: translateY(105%);
  animation: rise 0.9s cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}
.motion .hero h1 .line:nth-child(2) > span {
  animation-delay: 0.14s;
}
.motion .rise {
  opacity: 0;
  transform: translateY(18px);
  animation: fade-up 0.8s cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
  animation-delay: calc(var(--d, 0) * 0.12s + 0.1s);
}
.motion .ring path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw 1.6s cubic-bezier(0.6, 0.05, 0.25, 1) forwards;
  animation-delay: calc(0.15s + (4 - var(--i)) * 0.11s);
}
.motion .ring {
  animation: breathe 7s ease-in-out infinite;
  animation-delay: calc(var(--i) * -1.1s);
}
.motion .scroll-cue svg {
  animation: cue 2.4s ease-in-out infinite;
}
.motion .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s cubic-bezier(0.2, 0.75, 0.2, 1),
    transform 0.8s cubic-bezier(0.2, 0.75, 0.2, 1),
    border-color 0.25s;
  transition-delay: calc(var(--d, 0) * 0.09s);
}
.motion .reveal.in {
  opacity: 1;
  transform: none;
}
.motion .draw .ico * {
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  transition: stroke-dashoffset 1.3s cubic-bezier(0.6, 0.05, 0.25, 1);
  transition-delay: calc(var(--d, 0) * 0.09s + 0.25s);
}
.motion .draw.in .ico * {
  stroke-dashoffset: 0;
}
.motion .ticks li {
  opacity: 0;
  transform: translateX(-10px);
  transition:
    opacity 0.5s,
    transform 0.5s;
  transition-delay: calc(var(--d) * 0.12s + 0.2s);
}
.motion .partner.in .ticks li {
  opacity: 1;
  transform: none;
}
.motion .flow.steps > li {
  opacity: 0.38;
  transform: scale(0.97);
}
.motion .flow.steps > li.active {
  opacity: 1;
  transform: none;
  border-color: rgba(255, 122, 26, 0.6);
  background: linear-gradient(180deg, rgba(255, 122, 26, 0.14), var(--surface));
}
.motion .flow.steps > li.passed {
  opacity: 0.7;
  transform: none;
}
.motion .cta-rings {
  animation: spin 60s linear infinite;
}
@keyframes rise {
  to {
    transform: none;
  }
}
@keyframes fade-up {
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.82;
  }
}
@keyframes cue {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ================= sizes ================= */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  /* Stacked: the headline first, then the mark under it, centered (never behind the words). */
  .home .hero {
    min-height: 0;
    padding: 72px 0 96px;
  }
  .home .hero h1 {
    font-size: clamp(42px, 9.5vw, 84px);
  }
  .mark {
    justify-self: center;
    width: min(70vw, 420px);
    margin-top: 12px;
  }
  /* Three cards on two columns: the odd one out spans the row. */
  .g3 > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .stack-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .scroll-cue {
    display: none;
  }
  .stack-pin {
    position: static;
  }
  .rings {
    --tilt: 0deg;
  }
  /* No shrink on the steps here: scaling a step moved its dot off the timeline (Matt, Oct 27). */
  .motion .flow.steps > li,
  .motion .flow.steps > li.active,
  .motion .flow.steps > li.passed {
    transform: none;
  }
  .pipe,
  .stack-link {
    display: none;
  }
  /* On narrower screens the steps carry their own line that fills as you scroll. */
  .flow.steps {
    position: relative;
    padding: 0 0 0 30px;
  }
  .flow.steps::before,
  .flow.steps::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    border-radius: 2px;
    background: var(--line-2);
  }
  .flow.steps::after {
    background: linear-gradient(180deg, var(--ember), #ffb066);
    transform-origin: 50% 0;
    transform: scaleY(var(--s, 0));
  }
  .flow.steps > li {
    min-height: 0;
  }
  .flow.steps > li::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 30px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--line-2);
    background: var(--bg);
    transition:
      background 0.3s,
      border-color 0.3s;
  }
  .flow.steps > li.active::before,
  .flow.steps > li.passed::before {
    border-color: var(--ember);
    background: var(--ember);
  }
  .stack .mobile-link {
    display: block;
  }
  .card.partner {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
  /* Phones: the mark first, so it draws itself on screen the moment the page opens. */
  /* The same space above the C (from the header) and below it (to the headline): --hero-gap. */
  .home .hero {
    --hero-gap: 24px;
    padding: var(--hero-gap) 0 56px;
  }
  .hero-grid {
    gap: var(--hero-gap);
  }
  .mark {
    order: -1;
    width: min(46vw, 200px);
    margin: 0 auto;
  }
  .home .hero h1 {
    font-size: clamp(38px, 11vw, 52px);
  }
  .marquee {
    margin: -8px 0 36px;
  }
  .cta-band {
    padding: 80px 0;
  }
  .cta-rings {
    width: 520px;
    height: 520px;
    margin: -260px 0 0 -260px;
  }
}
/* Short phones (iPhone SE with the browser bars): a smaller mark so the button fits on the first screen too. */
@media (max-width: 640px) and (max-height: 620px) {
  .home .hero {
    --hero-gap: 16px;
  }
  .mark {
    width: min(32vw, 130px);
  }
  .home .hero h1 {
    font-size: 34px;
  }
}
@media (min-width: 1500px) {
  .mark {
    max-width: 600px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sparks,
  .scroll-cue {
    display: none;
  }
}
