/* Tread product page (/tread). Page-only styles; the site header and footer keep styles.css.
 * Palette comes from the Tread app icon. Scroll effects read --p (0…1), set by tread.js. */

.tread {
  --t-green: #0f4f44;
  --t-deep: #0a2f29;
  --t-ink: #06201c;
  --t-orange: #ef8b3f;
  --t-cream: #f3f0e8;
  --t-cream-ink: #1d2b27;
  --t-muted: color-mix(in oklch, var(--t-cream) 68%, transparent);
  --t-header: 64px;
  --t-pin: calc(100svh - var(--t-header));
  background: var(--t-deep);
  color: var(--t-cream);
  font-family: var(--font-body, system-ui, sans-serif);
  overflow-x: clip;
}

.tread h1, .tread h2, .tread h3 {
  font-family: var(--font-display, system-ui, sans-serif);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0;
  text-wrap: balance;
}
.tread h1, .tread h2, .tread h3, .tread p { color: inherit; }
.tread p { margin: 0; text-wrap: pretty; }
.tread img, .tread video { display: block; max-width: 100%; height: auto; }

.t-eyebrow {
  display: inline-block;
  font-family: var(--font-display, system-ui, sans-serif);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--t-orange);
  margin-bottom: 18px;
}
.t-h2 { font-size: clamp(40px, 7vw, 96px); font-weight: 800; }
.t-h3 { font-size: clamp(30px, 4.2vw, 56px); font-weight: 700; }
.t-lede { font-size: clamp(18px, 1.8vw, 24px); line-height: 1.45; color: var(--t-muted); max-width: 34em; }
.t-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.t-center { text-align: center; }
.t-center .t-lede { margin-left: auto; margin-right: auto; }

.t-badge { display: inline-block; line-height: 0; border-radius: 9px; transition: transform 0.2s ease; }
.t-badge:hover { transform: translateY(-2px); }
.t-badge:focus-visible { outline: 3px solid var(--t-orange); outline-offset: 4px; }
.t-badge img { height: 54px; width: auto; }

.t-icon { border-radius: 22.37%; box-shadow: 0 18px 50px rgb(0 0 0 / 0.35), 0 0 0 1px rgb(255 255 255 / 0.12); }

/* Pinned sections: a tall track with a sticky stage. */
.t-track { position: relative; }
.t-stage {
  position: sticky;
  top: var(--t-header);
  height: var(--t-pin);
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* Devices: screenshots framed with Apple Frames (frames-cli), transparent around the hardware. */
.t-phone {
  position: relative;
  width: min(360px, 74vw);
  aspect-ratio: 900 / 1836;
  filter: drop-shadow(0 40px 60px rgb(0 0 0 / 0.35));
}
.t-phone > img, .t-phone__screens { width: 100%; height: 100%; }
.t-phone__screens { position: relative; }
.t-phone__screens img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.55s ease;
}
.t-phone__screens img:first-child, .t-phone__screens img.is-on { opacity: 1; }
.t-phone__screens img.is-on { z-index: 1; }

/* 1. Hero: the name up top, then the banner film grows from a framed card to full bleed */
.t-hero { height: 230svh; background: radial-gradient(90% 60% at 50% 0%, #17604f 0%, var(--t-deep) 70%); }
.t-hero .t-stage { place-items: stretch; }
.t-hero__content {
  position: absolute; left: 0; right: 0; top: clamp(28px, 7vh, 80px);
  padding: 0 24px;
  text-align: center;
  z-index: 1;
  opacity: clamp(0, calc(1 - var(--p, 0) * 2.6), 1);
  transform: translateY(calc(var(--p, 0) * -120px)) scale(calc(1 - var(--p, 0) * 0.15));
}
.t-hero__film {
  --grow: clamp(0, calc(var(--p, 0) * 1.6), 1);
  position: absolute; left: 50%; bottom: 0;
  width: calc(64% + var(--grow) * 36%);
  height: calc(34% + var(--grow) * 66%);
  transform: translateX(-50%) translateY(calc((1 - var(--grow)) * -6vh));
  border-radius: calc((1 - var(--grow)) * 28px);
  overflow: hidden;
  box-shadow: 0 40px 100px rgb(0 0 0 / 0.45);
}
.t-hero__video { width: 100%; height: 100%; object-fit: cover; }
.t-hero__icon { width: clamp(76px, 8vw, 104px); margin: 0 auto 18px; }
.t-hero h1 { font-size: clamp(64px, 11vw, 150px); font-weight: 800; letter-spacing: -0.05em; }
.t-hero h1 span { color: var(--t-orange); }
.t-hero__sub { font-size: clamp(20px, 2.4vw, 30px); font-weight: 500; margin: 8px 0 24px; }
.t-hero__platforms { margin-top: 18px; font-size: 14px; letter-spacing: 0.04em; color: var(--t-muted); }

/* 2. Statement with the App Preview in a phone that settles into place */
.t-intro { height: 220svh; background: var(--t-deep); }
.t-intro .t-stage { align-content: center; gap: 28px; }
.t-intro .t-h2 { font-size: clamp(36px, 5.6vw, 80px); }
.t-intro__copy {
  text-align: center; padding: 0 24px;
  opacity: clamp(0, calc(var(--p, 0) * 3), 1);
  transform: translateY(calc((1 - clamp(0, calc(var(--p, 0) * 3), 1)) * 40px));
}
.t-intro .t-phone {
  width: min(320px, 62vw, calc((var(--t-pin) - 300px) * 0.49));
  transform: translateY(calc((1 - clamp(0, calc(var(--p, 0) * 1.6), 1)) * 30vh))
             scale(calc(1.35 - clamp(0, calc(var(--p, 0) * 1.6), 1) * 0.35));
}

/* 3. Pinned story: captions on the left, one phone on the right */
.t-story { height: 420svh; background: var(--t-cream); color: var(--t-cream-ink); }
.t-story .t-stage { grid-template-columns: 1fr auto; gap: clamp(32px, 7vw, 120px); max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.t-story__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 34px; }
.t-story__steps li { opacity: 0.22; transition: opacity 0.4s ease, transform 0.4s ease; transform: translateX(-6px); }
.t-story__steps li.is-on { opacity: 1; transform: none; }
.t-story__steps h3 { font-size: clamp(26px, 3.2vw, 44px); font-weight: 700; }
.t-story__steps p { margin-top: 8px; font-size: 18px; line-height: 1.5; color: color-mix(in oklch, var(--t-cream-ink) 70%, transparent); max-width: 26em; }
.t-story__steps .t-eyebrow { color: #c4651d; margin-bottom: 8px; }
.t-story .t-phone { width: min(350px, 34vw, calc((var(--t-pin) - 80px) * 0.49)); filter: drop-shadow(0 36px 50px rgb(15 79 68 / 0.28)); }
.t-story__bar { position: absolute; left: 24px; right: 24px; bottom: 28px; height: 3px; border-radius: 3px; background: rgb(15 79 68 / 0.12); max-width: 1132px; margin: 0 auto; }
.t-story__bar::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--t-green); border-radius: inherit; }

/* 4. Stickers */
.t-stickers { padding: clamp(110px, 16vh, 180px) 0; background: radial-gradient(120% 90% at 50% 0%, #145a4d 0%, var(--t-deep) 60%); position: relative; }
.t-stickers__art { position: relative; height: clamp(300px, 42vw, 520px); margin-top: 56px; }
.t-sticker { position: absolute; width: clamp(220px, 34vw, 440px); filter: drop-shadow(0 30px 40px rgb(0 0 0 / 0.4)); }
.t-sticker--max { left: 50%; top: 4%; transform: translate(-92%, calc((0.5 - var(--p, 0.5)) * 120px)) rotate(calc(-10deg + var(--p, 0.5) * 6deg)); }
.t-sticker--amp { left: 50%; top: 24%; transform: translate(-6%, calc((var(--p, 0.5) - 0.5) * 140px)) rotate(calc(12deg - var(--p, 0.5) * 8deg)); }

/* 5. Retire-at ring */
.t-forecast { padding: clamp(110px, 16vh, 180px) 0; background: var(--t-cream); color: var(--t-cream-ink); }
.t-forecast .t-lede { color: color-mix(in oklch, var(--t-cream-ink) 70%, transparent); }
.t-forecast__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.t-ring { position: relative; width: min(440px, 80vw); aspect-ratio: 1; margin: 0 auto; }
.t-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.t-ring circle { fill: none; stroke-width: 22; stroke-linecap: round; }
.t-ring__track { stroke: rgb(15 79 68 / 0.1); }
.t-ring__fill { stroke: var(--t-green); stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--ring, 0) * 100); transition: stroke 0.3s ease; }
.t-ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.t-ring__num { font-family: var(--font-display, system-ui, sans-serif); font-weight: 800; font-size: clamp(64px, 9vw, 116px); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.t-ring__of { font-size: 18px; color: color-mix(in oklch, var(--t-cream-ink) 60%, transparent); margin-top: 6px; }
.t-forecast__facts { margin-top: 34px; display: grid; gap: 14px; font-size: 17px; }
.t-forecast__facts b { font-family: var(--font-display, system-ui, sans-serif); color: var(--t-green); }

/* 6. Apple Watch: a row that slides sideways while pinned */
.t-watch { height: 300svh; background: var(--t-ink); }
.t-watch .t-stage { align-content: center; justify-items: start; gap: 48px; }
.t-watch__head { padding: 0 24px; width: 100%; max-width: 1180px; margin: 0 auto; }
.t-watch__row { display: flex; gap: clamp(28px, 4vw, 56px); padding: 0 max(24px, calc((100vw - 1132px) / 2)); transform: translateX(calc(var(--shift, 0px) * -1)); will-change: transform; }
.t-watch__item { flex: none; text-align: center; }
.t-watch__case { width: clamp(190px, 19vw, 250px); filter: drop-shadow(0 30px 40px rgb(0 0 0 / 0.45)); }
.t-watch__case img { width: 100%; height: auto; }
.t-watch .t-stage { gap: 28px; }
.t-watch__item p { margin-top: 6px; font-family: var(--font-display, system-ui, sans-serif); font-weight: 600; font-size: 18px; }

/* 7. iPhone Duo: the two halves unfold from the hinge */
.t-duo { height: 240svh; background: radial-gradient(110% 80% at 50% 100%, #145a4d 0%, var(--t-deep) 65%); }
.t-duo .t-stage { align-content: center; gap: 40px; }
.t-duo__copy { padding: 0 24px; }
.t-duo__device {
  --open: clamp(0, calc(var(--p, 0) * 1.7 - 0.1), 1);
  display: flex;
  width: min(900px, 88vw, calc((var(--t-pin) - 280px) * 1.377));
  aspect-ratio: 1800 / 1307;
  perspective: 2400px;
  filter: drop-shadow(0 50px 70px rgb(0 0 0 / 0.45));
}
.t-duo__half { position: relative; width: 50%; height: 100%; }
.t-duo__half--l { transform-origin: right center; transform: rotateY(calc((1 - var(--open)) * 70deg)); }
.t-duo__half--r { transform-origin: left center; transform: rotateY(calc((1 - var(--open)) * -70deg)); }
.t-duo__screen { width: 100%; height: 100%; overflow: hidden; }
.t-duo__screen img { width: 200%; max-width: none; height: 100%; }
.t-duo__half--r .t-duo__screen img { transform: translateX(-50%); }

/* 8. Privacy */
.t-privacy { padding: clamp(120px, 18vh, 200px) 0; background: var(--t-deep); }
.t-privacy__icon { width: clamp(120px, 14vw, 180px); margin: 0 auto 44px; }
.t-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 40px; }
.t-chips span { padding: 11px 20px; border-radius: 999px; background: rgb(243 240 232 / 0.08); border: 1px solid rgb(243 240 232 / 0.14); font-weight: 600; font-size: 16px; }

/* 9. Final call to action */
.t-cta { padding: clamp(120px, 18vh, 200px) 0 clamp(100px, 14vh, 160px); background: linear-gradient(180deg, var(--t-deep), var(--t-green)); }
.t-cta__icon { width: 128px; margin: 0 auto 30px; }
.t-cta h2 { font-size: clamp(56px, 10vw, 128px); font-weight: 800; letter-spacing: -0.05em; }
.t-cta .t-lede { margin-top: 14px; }
.t-cta__badge { margin-top: 36px; }
.t-cta__links { margin-top: 30px; display: flex; gap: 26px; justify-content: center; font-size: 15px; }
.t-cta__links a { color: var(--t-cream); opacity: 0.8; text-decoration: none; border-bottom: 1px solid rgb(243 240 232 / 0.3); }
.t-cta__links a:hover { opacity: 1; }

/* Reveal on scroll */
.t-reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.t-reveal.is-in { opacity: 1; transform: none; }
.t-reveal[data-delay="1"] { transition-delay: 0.12s; }
.t-reveal[data-delay="2"] { transition-delay: 0.24s; }

/* Narrow screens: unpin the long tracks, stack the story, swipe the watches. */
@media (max-width: 820px) {
  .t-hero { height: 180svh; }
  .t-hero__film { width: calc(88% + var(--grow) * 12%); height: calc(26% + var(--grow) * 74%); }
  .t-intro { height: 170svh; }
  .t-story { height: auto; padding: 96px 0; }
  .t-story .t-stage { position: static; height: auto; overflow: visible; grid-template-columns: 1fr; padding: 0; }
  .t-story__phone, .t-story__bar { display: none; }
  .t-story__steps { gap: 72px; padding: 0 24px; }
  .t-story__steps li { opacity: 1; transform: none; }
  .t-story__shot { display: block !important; margin-top: 28px; }
  .t-forecast__grid { grid-template-columns: 1fr; gap: 48px; text-align: center; }
  .t-forecast .t-lede { margin: 0 auto; }
  .t-watch { height: auto; padding: 96px 0; }
  .t-watch .t-stage { position: static; height: auto; overflow: visible; }
  .t-watch__row { transform: none; overflow-x: auto; scroll-snap-type: x mandatory; width: 100%; padding-bottom: 12px; scrollbar-width: none; }
  .t-watch__item { scroll-snap-align: center; }
  .t-duo { height: 180svh; }
}
.t-story__shot { display: none; }
.t-story__shot .t-phone { width: min(280px, 70vw); margin: 0 auto; }

/* Reduced motion: no pinning or scroll-driven movement; everything shows at rest. */
@media (prefers-reduced-motion: reduce) {
  .tread * { transition: none !important; }
  .t-hero, .t-intro, .t-duo { height: auto; }
  .t-hero .t-stage, .t-intro .t-stage, .t-duo .t-stage { position: relative; top: 0; }
  .t-hero .t-stage { height: auto; min-height: var(--t-pin); display: block; padding-bottom: 60px; }
  .t-hero__content { position: relative; top: 0; padding-top: 60px; }
  .t-hero__film { --grow: 0.4; position: relative; left: 0; margin: 48px auto 0; transform: none; aspect-ratio: 3840 / 1646; height: auto; width: min(1100px, 92vw); border-radius: 24px; }
  .t-intro .t-stage, .t-duo .t-stage { height: auto; padding: 110px 0; overflow: visible; }
  .t-hero__content, .t-intro__copy, .t-intro .t-phone, .t-sticker--max, .t-sticker--amp { --p: 0.5; }
  .t-hero__content, .t-intro__copy { opacity: 1; transform: none; }
  .t-intro .t-phone { transform: none; }
  .t-duo__device { --open: 1; }
  .t-watch { height: auto; padding: 110px 0; }
  .t-watch .t-stage { position: static; height: auto; overflow: visible; }
  .t-watch__row { transform: none; overflow-x: auto; width: 100%; }
  .t-reveal { opacity: 1; transform: none; }
}
