/* The home page, from the layout approved on 17 Nov 2026: one phone stays
   put while the story scrolls past it, under the app's yellow tape measure. */

/* ---------- hero ---------- */
.hero {
  background: var(--ink);
  color: #fff;
  padding-block: clamp(28px, 5vw, 64px) clamp(56px, 8vw, 96px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 7fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero-text {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.hero h1 {
  font-size: clamp(38px, 5.4vw, 64px);
  letter-spacing: -0.022em;
}
.hero h1 em {
  font-style: normal;
  color: var(--yellow);
}
.hero .lede {
  color: #dbe3e9;
  max-width: 36ch;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero small {
  color: #aebccb;
  font-size: 15px;
}
.hero-art {
  position: relative;
  min-width: 0;
}
.hero-photo {
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.hero-phone {
  position: absolute;
  right: clamp(8px, 3vw, 28px);
  bottom: -44px;
  width: clamp(128px, 20vw, 210px);
  transform: translateY(calc(var(--hero-p, 0) * -46px));
}

/* ---------- the story: tape + pinned phone ---------- */
.tape {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px)
      left bottom / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 50px)
      left bottom / 100% 13px no-repeat,
    var(--yellow);
  border-bottom: 4px solid var(--timber);
}
.tape-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-block: 9px 19px;
  position: relative;
}
.tape-stage {
  text-align: center;
  font: 700 clamp(14px, 2.4vw, 18px) / 1 var(--body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(27, 44, 61, 0.5);
  transition: color 0.25s;
}
.tape-stage.on {
  color: var(--ink);
}
.tape-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  border-radius: 3px;
  background: var(--ink);
  left: calc(var(--story-p, 0) * (100% - 9px));
}

.story {
  background: var(--plaster);
}
.story-head {
  padding-block: clamp(40px, 6vw, 72px) 0;
  display: grid;
  gap: 14px;
}
.story-head h2 {
  font-size: clamp(30px, 4.6vw, 52px);
}
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 6vw, 80px);
  padding-bottom: clamp(40px, 6vw, 80px);
}
.pin {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 76px);
  align-self: start;
  height: min(76vh, 640px);
  display: grid;
  place-items: center;
}
.pin-phone {
  height: 100%;
  position: relative;
}
.pin-phone img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.pin-phone img.on {
  opacity: 1;
}
.moment {
  min-height: 70vh;
  display: grid;
  align-content: center;
  gap: 12px;
  transition: opacity 0.3s;
}
.moment .stage {
  color: var(--timber);
}
.moment h3 {
  font-size: clamp(26px, 3.4vw, 40px);
}
.moment p {
  color: var(--muted);
  max-width: 40ch;
  font-size: clamp(18px, 1.8vw, 20px);
}
.inline-phone {
  display: none;
  width: min(62vw, 250px);
  margin-top: 8px;
}
.motion .story:not(.stacked) .moment {
  opacity: 0.32;
}
.motion .story:not(.stacked) .moment.on {
  opacity: 1;
}
.story.stacked .story-grid {
  grid-template-columns: minmax(0, 1fr);
}
.story.stacked .pin {
  display: none;
}
.story.stacked .moment {
  min-height: 0;
  padding-block: 26px;
}
.story.stacked .inline-phone {
  display: block;
}

/* ---------- try it ---------- */
.try-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.try-grid .lede {
  margin-top: 14px;
}
.control {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  max-width: 420px;
}
.control label {
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.control label span {
  font: 700 26px/1 var(--body);
  font-variant-numeric: tabular-nums;
}
.control input {
  width: 100%;
  accent-color: var(--ink);
  height: 32px;
}
.control output {
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.wallbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(12px, 2.4vw, 24px);
  min-width: 0;
}
.wallbox svg {
  width: 100%;
  height: auto;
  display: block;
}
.wallbox small {
  color: var(--muted);
  display: block;
  margin-top: 10px;
  font-size: 15px;
}

/* ---------- styles ---------- */
.styles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 32px);
}
.style {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.style figure {
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
}
.style img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  transform: scale(calc(1.12 - var(--p, 1) * 0.12));
}
.style h3 {
  font-size: 26px;
}
.style h3 a {
  text-decoration: none;
}
.style h3 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--yellow);
  text-decoration-thickness: 3px;
}
.style p {
  color: var(--muted);
}
.tag {
  justify-self: start;
  font-size: 15px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--plaster);
}
.tag.yes {
  border-color: var(--yellow);
  background: var(--note);
}

/* ---------- build ---------- */
.build-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.rig {
  background: #f8f7f4;
  border-radius: 14px;
  padding: clamp(12px, 2.4vw, 24px);
}
.rig svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.plist {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.plist li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  transition: background 0.25s;
}
.plist li.on {
  background: rgba(255, 204, 0, 0.2);
}
.plist i {
  grid-row: span 2;
  font: 700 18px/1 var(--body);
  font-style: normal;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  place-items: center;
}
.plist b {
  font-size: 17px;
}
.plist span {
  color: #cbd5dd;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ---------- real walls ---------- */
.walls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2.4vw, 24px);
}
.wall-card {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  align-content: start;
  min-width: 0;
}
.wall-card img {
  width: 100%;
  aspect-ratio: 760 / 607;
  object-fit: cover;
  display: block;
  background: var(--plaster);
}
.wall-card figcaption {
  padding: 14px 16px 18px;
  display: grid;
  gap: 4px;
}
.wall-card b {
  font-size: 20px;
}
.wall-card span {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- the cut drawing and the fan of guide pages ---------- */
.cutfig {
  margin: 0;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.cutfig img {
  width: 100%;
  display: block;
  border-radius: 12px;
}
.cutfig figcaption {
  color: #cbd5dd;
  font-size: 16px;
}
.fan-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.fan {
  --card: clamp(118px, 17vw, 184px);
  --step: 11deg;
  position: relative;
  height: calc(var(--card) * 2.5);
  overflow: hidden;
}
.fan-card {
  position: absolute;
  left: 50%;
  bottom: calc(var(--card) * 0.12);
  width: var(--card);
  margin-left: calc(var(--card) / -2);
  border: 5px solid var(--ink-deep);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 12px 26px rgba(17, 30, 42, 0.26);
  transform-origin: 50% 150%;
  transform: rotate(calc(var(--i) * var(--fan, 1) * var(--step)));
}
.fan-card img {
  width: 100%;
  display: block;
}
.fan-copy {
  display: grid;
  gap: 14px;
}
.chapters {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chapters li {
  font-weight: 700;
  font-size: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--note);
  border: 1px solid var(--yellow);
}
.fine-dark {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- tools ---------- */
.tools {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
}
.tools img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.tool-copy {
  display: grid;
  gap: 14px;
}
.tool-copy h3 {
  font-size: 26px;
}
.tool-copy .btn {
  justify-self: start;
}

@media (max-width: 880px) {
  .hero-grid,
  .try-grid,
  .build-grid,
  .tools {
    grid-template-columns: minmax(0, 1fr);
  }
  .story-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pin {
    display: none;
  }
  .moment {
    min-height: 0;
    padding-block: 26px;
    opacity: 1 !important;
  }
  .inline-phone {
    display: block;
  }
  .styles {
    grid-template-columns: minmax(0, 1fr);
  }
  .fan-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .fan {
    --step: 9deg;
  }
  .walls {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 80%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }
  .wall-card {
    scroll-snap-align: start;
  }
  .plist {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-phone {
    bottom: -36px;
  }
}
