/* Product storytelling for the homepage below its existing hero and the
   Retakes feature. These styles do not change the hero or other articles. */

.product-heading { max-width: 1000px; }
.product-heading h2,
.feature-detail-heading h2 {
  font-size: clamp(42px, 5.4vw, 80px);
  font-weight: 450;
  line-height: 1.04;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.product-heading h2 > span,
.feature-header h1 > span,
.feature-detail-heading h2 > span { color: var(--muted); }
.product-heading > p:not(.product-kicker) {
  max-width: 540px;
  margin-top: var(--space-5);
  padding: 0;
  font-size: 19px;
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
}
.product-kicker { margin-bottom: var(--space-4); color: var(--accent-text); font-size: var(--text-small); line-height: 1.4; font-weight: 500; }
.retake-spotlight { padding-block: var(--section-y); }
.retake-spotlight .product-heading { margin-bottom: var(--space-7); }
.product-section-link { display: flex; justify-content: flex-end; padding-top: var(--space-5); }
.product-section-link .text-link { font-size: 15px; }

/* A native capture and an explanation, never a simulated app interface. */
.retake-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--raised);
  box-shadow: var(--raise-2);
}
/* The capture stands in a recessed, softly lit bay. */
.retake-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: var(--space-8) var(--space-6) var(--space-5);
  margin: 0;
  background: var(--bay);
  box-shadow: inset -1px 0 0 var(--edge);
}
.product-phone {
  width: min(100%, 310px);
  padding: 7px;
  border: 0;
  border-radius: 47px;
  background: var(--device-frame);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16), 0 0 0 1px rgb(10 8 19 / .5), var(--shadow-device);
}
.product-phone img { display: block; width: 100%; height: auto; border-radius: 40px; }
.retake-screen figcaption { margin-top: var(--space-5); color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.retake-walkthrough { min-width: 0; padding: var(--space-7) clamp(28px, 4.5vw, 64px); }
.retake-steps { list-style: none; margin: 0; padding: 0; counter-reset: retake-step; }
.retake-steps > li { counter-increment: retake-step; padding: var(--space-5) 0; border-top: 1px solid var(--line); }
.retake-steps > li:first-child { border-top: 0; }
.retake-steps h3 { display: flex; align-items: baseline; gap: 18px; font-size: clamp(23px, 2.1vw, 30px); line-height: 1.2; letter-spacing: -.025em; font-weight: 450; }
.retake-steps h3::before {
  content: "0" counter(retake-step);
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sunken);
  box-shadow: var(--well);
  color: var(--accent-text);
  font-size: var(--text-caption);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  transition: background var(--dur-base) var(--ease-out), color var(--dur-base), box-shadow var(--dur-base);
}
/* With the module running, the open step is marked by its number, which
   fills with green; the steps stay ruled rows inside the one card. */
.is-interactive .retake-steps > li { padding-block: var(--space-5); }
.is-interactive .retake-steps > li.is-current h3::before { background: var(--lime); color: #0a0813; box-shadow: var(--glow-lime); }
.retake-steps h3 button { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; padding: 2px 0; color: var(--muted); text-align: left; font: inherit; letter-spacing: inherit; transition: color .2s ease; }
.retake-steps h3 button::after { content: ""; width: 8px; height: 8px; margin: 0 3px 4px; flex-shrink: 0; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform var(--dur-slow) var(--ease-expand); }
.retake-steps h3 button[aria-expanded="true"]::after { transform: translateY(4px) rotate(225deg); }
.retake-steps h3 button:hover,
.retake-steps h3 button[aria-expanded="true"] { color: var(--ink); }
.retake-steps p { margin: var(--space-3) 0 0 48px; color: var(--muted); font-size: 16px; line-height: 1.7; text-wrap: pretty; }
.is-interactive .retake-steps { min-height: 352px; }
/* Keeps the paragraph's margin inside the box lib/motion.js measures. */
.is-interactive [data-retake-detail] { display: flow-root; }
.retake-diagram { margin: var(--space-5) 0 0; }
.retake-track { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: var(--space-2); }
.retake-track > div { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-4); padding: var(--space-4); border-radius: var(--radius-sm); font-size: 13px; line-height: 1.4; }
.retake-kept { color: var(--ink); background: color-mix(in srgb, var(--lime) 18%, var(--raised)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--lime) 30%, transparent); }
.retake-last { border: 1px solid transparent; background: var(--raised-strong); color: var(--muted); box-shadow: 0 0 0 1px var(--edge), var(--shadow-1); transition: transform .5s cubic-bezier(.22, 1, .36, 1), background .35s, border-color .35s, box-shadow .35s; }
.retake-track-line { height: 3px; width: 100%; background: currentColor; opacity: .3; border-radius: 99px; transform-origin: left; transition: transform .55s cubic-bezier(.22, 1, .36, 1), opacity .35s; }
[data-retake-phase="1"] .retake-last { transform: translateY(5px); border-color: var(--line); border-style: dashed; background: transparent; box-shadow: none; }
[data-retake-phase="1"] .retake-last .retake-track-line { transform: scaleX(0); opacity: 0; }
[data-retake-phase="2"] .retake-last { background: var(--lime); color: #0a0813; border-color: var(--lime); box-shadow: var(--glow-lime); }
.retake-diagram figcaption { min-height: 58px; margin-top: var(--space-3); color: var(--muted); font-size: 13px; line-height: 1.6; }
.retake-boundary { padding-top: var(--space-4); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.7; }

/* Feature pages can introduce the product at full width, then return to the
   established reading column for instructions, evidence and qualifications. */
.feature-page { padding-top: var(--page-top); }
.feature-header { display: block; max-width: 1000px; margin: 0; padding: 0 0 var(--space-8); }
.feature-header h1 { font-size: clamp(48px, 7.1vw, 104px); line-height: 1.02; letter-spacing: -.06em; font-weight: 450; text-wrap: balance; }
.feature-header .article-lede { max-width: 580px; font-size: 21px; }
.feature-header-links { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); margin-top: var(--space-6); }
.feature-header-links .text-link { font-size: 15px; }
.feature-header .article-meta { border-top: 0; padding-top: 0; margin-top: var(--space-6); }
.feature-demonstration { scroll-margin-top: 30px; }
.feature-section-title { margin: 0 0 var(--space-5); font-size: clamp(25px, 2.5vw, 36px); line-height: 1.2; font-weight: 450; letter-spacing: -.035em; }
.feature-detail-heading { margin: var(--section-gap) 0 var(--space-7); }
.feature-detail-heading h2 { font-size: clamp(38px, 4.7vw, 64px); }
.feature-page .article-layout { padding-top: var(--space-8); }

/* The homepage's existing interactions keep their behavior; the hierarchy
   and presentation now give each chapter more room. */
/* The workflow is the page's one ink chapter: a stage drawn over the paper.
   Its tokens come from .tone-stage. Its side inset (72px at full width)
   matches the origin card further down. */
.home-story .studio-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-block: var(--section-y);
  padding: clamp(56px, 6vw, 88px) clamp(28px, 5vw, 72px) clamp(28px, 4vw, 56px);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--stage-glow), transparent 40%), var(--stage);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 0 0 1px rgb(10 8 19 / .3), var(--shadow-2);
}
.home-story .studio-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
  margin-top: var(--space-7);
  padding: var(--space-1);
  border: 0;
  border-radius: 99px;
  background: var(--sunken);
  box-shadow: var(--well);
}
.home-story .studio-tabs button { position: relative; border-radius: 99px; background: transparent; padding: 16px 22px; color: var(--muted); font-size: 17px; transition: background var(--dur-base) var(--ease-out), color var(--dur-base), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-spring); }
.home-story .studio-tabs button > svg { opacity: .45; transition: opacity var(--dur-base), color var(--dur-base), transform var(--dur-base) var(--ease-out); }
@media (hover: hover) {
  .home-story .studio-tabs button:hover { background: rgb(255 255 255 / .04); color: var(--ink); }
}
.home-story .studio-tabs button[aria-selected="true"] {
  color: var(--ink);
  background: var(--raised-strong);
  box-shadow: var(--raise-1);
}
.home-story .studio-tabs button[aria-selected="true"] > span { color: var(--accent-text); }
.home-story .studio-tabs button[aria-selected="true"] > svg { opacity: 1; color: var(--accent-text); transform: translate(1px, -1px); }
.home-story .studio-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); border-bottom: 0; }
.home-story .has-interacted .studio-panel.is-active { animation: product-enter .55s cubic-bezier(.22, 1, .36, 1) both; }
.home-story .studio-copy { padding-right: var(--space-8); }
.home-story .studio-copy h3 { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.12; max-width: 12ch; letter-spacing: -.04em; text-wrap: balance; }
.home-story .studio-copy p { max-width: 400px; }
.home-story .studio-copy small { max-width: 400px; }
.home-story .studio-copy li { align-items: flex-start; }
.home-story .studio-display { border-radius: var(--radius-lg); box-shadow: 0 0 0 1px rgb(255 255 255 / .06), 0 24px 48px -28px rgb(0 0 0 / .8); }
.home-story .screen-phone {
  padding: 6px;
  border: 0;
  border-radius: 40px;
  background: var(--device-frame);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16), 0 0 0 1px rgb(10 8 19 / .5), 0 8px 16px -8px rgb(30 24 16 / .4), 0 34px 56px -20px rgb(30 24 16 / .6);
}
.home-story .screen-phone img { border-radius: 34px; }
/* The caption bar floats over the photograph as opaque ivory (no
   backdrop-filter, which would be recomputed as the page scrolls). Its
   radius is the stage's minus its 12px inset. */
.home-story .display-caption {
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: var(--space-4) var(--space-5);
  border-top: 0;
  border-radius: var(--radius-xs);
  background: rgb(244 241 231 / .96);
  box-shadow: 0 8px 20px -12px rgb(30 24 16 / .45);
}
.home-story .caption-photo { border-radius: var(--radius-xl); box-shadow: 0 0 0 1px var(--edge), var(--shadow-2); }
.home-story .captions-layout { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(40px, 7vw, 96px); align-items: center; }
.home-story .caption-count > span { font-size: clamp(100px, 9vw, 150px); }
.home-story .native-section { border-top: 0; }
.home-story .native-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap); }
.home-story .native-features article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--card-pad);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--raised);
  box-shadow: var(--raise-1);
  transition: transform var(--dur-slow) var(--ease-spring);
}
@media (hover: hover) {
  .home-story .native-features article:hover { transform: translateY(-3px); }
}
/* Each feature's icon sits in a small recessed tile. */
.home-story .native-features article > svg {
  box-sizing: content-box;
  margin: 0 0 var(--space-5);
  padding: 11px;
  border-radius: var(--radius-sm);
  color: var(--accent-text);
  background: var(--sunken);
  box-shadow: var(--well);
}
.home-story .native-features p { margin-top: var(--space-3); font-size: 16px; line-height: 1.7; max-width: 52ch; }
.home-story .native-features h3 { font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.home-story .native-features article > a { margin-top: auto; padding-top: var(--space-5); }
.home-story .compatibility { max-width: 760px; }
.home-story .explore-section { border-top: 0; }
.home-story .explore-heading > p { max-width: 540px; }
.explore-paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); margin-top: var(--space-7); }
.explore-paths > a {
  display: flex;
  flex-direction: column;
  padding: var(--card-pad);
  border-radius: var(--radius-lg);
  background: var(--raised);
  box-shadow: var(--raise-1);
  transition: transform var(--dur-slow) var(--ease-spring);
}
@media (hover: hover) {
  .explore-paths > a:hover { transform: translateY(-3px); }
}
.explore-paths > a:active { transform: scale(.985); transition-duration: .1s; }
.explore-paths > a > span:first-child { color: var(--muted); font-size: 13px; line-height: 1.5; }
.explore-paths strong { display: block; margin: var(--space-4) 0 var(--space-6); max-width: 17ch; font-size: clamp(24px, 2.4vw, 34px); font-weight: 450; line-height: 1.2; letter-spacing: -.035em; text-wrap: balance; }
.explore-path-link { display: flex; align-items: center; gap: var(--space-3); margin-top: auto; font-size: var(--text-small); }
.explore-path-link svg { box-sizing: content-box; flex-shrink: 0; padding: 7px; border-radius: 50%; color: #0a0813; background: var(--lime); box-shadow: var(--glow-lime); transition: transform .25s ease; }
@media (hover: hover) {
  .explore-paths > a:hover .explore-path-link svg { transform: translate(2px, -2px); }
}
/* The directory well continues the card grid above it: the same gap, the
   same radius. */
.home-story .explore-grid { gap: var(--space-7); margin-top: var(--grid-gap); padding: var(--space-7) var(--card-pad); border-top: 0; border-radius: var(--radius-lg); background: var(--sunken); box-shadow: var(--well); }
.home-story .explore-card { padding: 0; background: none; border-radius: 0; }
.home-story .explore-card h3 { font-size: 22px; }
.home-story .explore-card li a { border-bottom: 0; font-size: var(--text-small); }
.home-story .explore-card ul { border-top: 0; margin-top: var(--space-3); }
.home-story .origin-section {
  position: relative;
  margin-block: var(--section-y);
  padding: clamp(48px, 6vw, 88px) clamp(28px, 5vw, 72px);
  border: 0;
  border-radius: var(--radius-xl);
  background: var(--raised);
  box-shadow: var(--raise-2);
}
/* The sculptural ribbon rests on the card's top edge and drifts slightly. */
.origin-mark {
  position: absolute;
  top: -64px;
  right: clamp(24px, 6vw, 100px);
  width: clamp(130px, 13vw, 196px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 30px 24px rgb(46 38 26 / .26)) drop-shadow(0 6px 8px rgb(46 38 26 / .14));
}
@media (prefers-reduced-motion: no-preference) {
  .origin-mark { animation: origin-drift 8s ease-in-out infinite; }
}
@keyframes origin-drift { 50% { transform: translateY(-10px) rotate(-3deg); } }
.home-story .origin-story .text-link { margin-top: var(--space-5); text-decoration: none; }

@keyframes product-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1000px) {
  .retake-walkthrough { padding: var(--space-6); }
  .retake-screen { padding: var(--space-7) var(--space-5) var(--space-5); }
  .product-phone { width: min(100%, 270px); border-radius: 38px; }
  .retake-steps h3 { font-size: 24px; gap: 12px; }
  .retake-steps p { font-size: 15px; margin-left: 32px; }
  .retake-steps > li, .is-interactive .retake-steps > li { padding-block: 20px; }
  .retake-track > div { padding: var(--space-3); }
  .feature-header .article-lede { font-size: 19px; }
  .home-story .studio-copy { padding-right: var(--space-6); }
  .home-story .captions-layout { gap: var(--space-6); }
  .home-story .caption-count > span { font-size: 100px; }
  .home-story .native-features p { font-size: 15px; }
  .home-story .studio-tabs button { padding-inline: 16px; }
  .home-story .native-features h3 { font-size: 22px; }
  .home-story .explore-grid { gap: var(--space-6); }
}

@media (max-width: 700px) {
  .product-heading h2 { font-size: clamp(37px, 9.7vw, 58px); letter-spacing: -.05em; }
  .product-heading > p:not(.product-kicker) { font-size: 17px; margin-top: var(--space-4); }
  .product-kicker { font-size: 13px; }
  .retake-spotlight .product-heading { margin-bottom: var(--space-6); }
  .retake-story { grid-template-columns: minmax(0, 1fr); border-radius: var(--radius-lg); }
  .retake-screen { box-shadow: inset 0 -1px 0 var(--edge); }
  .retake-screen { padding: var(--space-7) var(--space-5) var(--space-5); }
  .product-phone { width: min(100%, 235px); padding: 5px; border-radius: 37px; }
  .product-phone img { border-radius: 32px; }
  .retake-screen figcaption { font-size: var(--text-caption); margin-top: var(--space-4); }
  .retake-walkthrough { padding: var(--space-2) var(--card-pad) var(--space-5); }
  .retake-steps h3 { font-size: 22px; }
  .retake-steps h3 button { min-height: 44px; align-items: center; }
  .retake-steps > li, .is-interactive .retake-steps > li { padding-block: var(--space-4); }
  .retake-steps p { font-size: 15px; }
  .is-interactive .retake-steps { min-height: 315px; }
  .retake-diagram { margin-top: var(--space-3); }
  .retake-diagram figcaption { min-height: 60px; }
  .product-section-link { justify-content: flex-start; padding-top: var(--space-5); }
  .product-section-link .text-link { font-size: var(--text-small); }
  .feature-header { padding-bottom: var(--space-7); }
  .feature-header h1 { font-size: clamp(45px, 12vw, 76px); letter-spacing: -.055em; }
  .feature-header .article-lede { font-size: 18px; margin-top: var(--space-5); }
  .feature-header-links { gap: var(--space-4); margin-top: var(--space-5); }
  .feature-header-links .text-link { font-size: var(--text-small); }
  .feature-section-title { font-size: 26px; margin-bottom: var(--space-5); }
  .feature-detail-heading { margin: var(--section-gap) 0 var(--space-6); }
  .feature-detail-heading h2 { font-size: 36px; }
  .feature-page .article-layout { padding-top: var(--space-6); }
  .home-story .studio-section { padding: var(--space-7) var(--space-5) var(--space-5); border-radius: var(--radius-lg); }
  .home-story .studio-tabs { gap: 3px; margin-top: var(--space-6); padding: 4px; }
  .home-story .studio-tabs button { justify-content: center; padding: 12px 6px; gap: 7px; font-size: var(--text-small); }
  .home-story .studio-tabs button > svg { display: none; }
  .home-story .display-caption { left: 8px; right: 8px; bottom: 8px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-xs); }
  .home-story .studio-copy { padding: var(--space-6) 0; min-height: 0; }
  .home-story .studio-copy h3 { max-width: 16ch; font-size: 32px; }
  .home-story .studio-copy p { font-size: 16px; }
  .home-story .studio-display { height: 520px; margin-bottom: 0; border-radius: var(--radius-md); }
  .home-story .studio-display .screen-phone { width: 195px; }
  .home-story .captions-layout { gap: var(--space-7); }
  .home-story .caption-count > span { font-size: 110px; }
  .home-story .native-features { grid-template-columns: minmax(0, 1fr); }
  .home-story .native-features article { border-radius: var(--radius-md); }
  .home-story .native-features article > svg { margin-bottom: var(--space-4); padding: 10px; }
  .home-story .native-features h3 { font-size: 22px; }
  .explore-paths { grid-template-columns: minmax(0, 1fr); margin-top: var(--space-6); }
  .explore-paths > a { border-radius: var(--radius-md); }
  .explore-paths strong { font-size: 28px; max-width: 22ch; margin-block: var(--space-3) var(--space-5); }
  .home-story .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-5); padding: var(--card-pad); border-radius: var(--radius-md); }
  .home-story .explore-card h3 { font-size: 21px; }
  .home-story .explore-card > p { font-size: 13px; }
  .home-story .origin-section { padding: var(--space-8) var(--card-pad) var(--space-7); border-radius: var(--radius-lg); }
  .origin-mark { top: -46px; right: 16px; width: 108px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-story .has-interacted .studio-panel.is-active { animation: none; }
  .studio-section.is-tabbed > .studio-panel { transition: none; }
  .retake-last, .retake-track-line,
  .home-story .studio-tabs button::after { transition: none; transform: none; }
  .explore-paths > a:hover .explore-path-link svg { transform: none; }
}
