/* Product page template. Pairs with base.css. Class names and ids are the ones the
   Instagram machine films (#pipeline #run, #transcript #cut, #chat #snap .confirm): keep them. */

/* ---------- Hero: the machine's spec sheet ---------- */
.p-hero { position: relative; overflow: hidden; padding: 104px 0 var(--section); }
.p-hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: clamp(32px, 5vw, 72px); align-items: start; }
.p-hero .crop { margin: 0 0 24px -14px; padding: 18px 14px; }
.p-hero h1 { font-size: clamp(2.6rem, 6.3vw, 6rem); line-height: .9; letter-spacing: -.05em; max-width: 12ch; }
.p-hero .lede { font-size: clamp(1.06rem, 1.3vw, 1.22rem); line-height: 1.35; letter-spacing: -.01em; max-width: 50ch; text-wrap: pretty; }

.spec { display: flex; flex-direction: column; border-top: 1px solid var(--ink); margin-top: 36px; max-width: 640px; }
.spec-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 12px 2px; border-bottom: 1px solid var(--rule); align-items: baseline; }
.spec-row dt { font-family: var(--mono); font-size: 12.5px; margin: 0; }
.spec-row dd { margin: 0; font-size: 1.02rem; line-height: 1.35; }
.spec-row dd b { font-weight: 600; }

/* the waitlist is a window */
.buybox { position: sticky; top: 72px; }
.buybox .win-body { display: flex; flex-direction: column; gap: 14px; }
.buybox .status { font-family: var(--px); font-size: 20px; line-height: 1; display: inline-flex; align-items: center; gap: 8px; }
.buybox .status i { width: 11px; height: 11px; background: var(--yellow); border: 1px solid var(--ink); flex: none; animation: blinkbox 1.4s steps(1) infinite; }
.status.live i { background: var(--ink); animation: none; }
@keyframes blinkbox { 50% { background: var(--win-field); } }
.buybox .price { font-family: var(--px); font-size: 40px; line-height: .95; }
.buybox .price small { font-family: var(--mono); font-size: 12px; line-height: 1.35; display: block; margin-top: 8px; letter-spacing: 0; text-wrap: balance; }
.buybox .incl { display: grid; gap: 7px; border-top: 1px solid var(--rule); padding-top: 14px; }
.incl span { display: grid; grid-template-columns: 18px 1fr; font-family: var(--px); font-size: 21px; line-height: 1.1; }
.incl span::before { content: ""; width: 9px; height: 9px; margin-top: 6px; background: var(--ink); }
.buybox .note { font-family: var(--mono); font-size: 12px; line-height: 1.35; color: var(--ink-soft); }
@media (max-width: 900px) {
  .p-hero { padding-top: 84px; }
  .p-hero .crop { margin-left: -4px; }
  .p-hero .wrap { grid-template-columns: 1fr; }
  .buybox { position: static; }
}

.wait { display: flex; flex-direction: column; gap: 9px; }
.wait-row { display: grid; gap: 8px; }
.wait .btn { width: 100%; }
.wait .msg { font-family: var(--px); font-size: 19px; line-height: 1.1; min-height: 1em; }
.wait .msg.ok { background: var(--yellow); padding: 3px 6px 2px; }
.wait .msg.err { background: var(--ink); color: var(--yellow); padding: 3px 6px 2px; }

/* ---------- The sandbox: a window on a yellow field ---------- */
.demo-block { background: var(--yellow); padding: var(--section) 0; }
.demo-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: clamp(32px, 4vw, 52px); }
.demo-head h2 { font-size: clamp(2.6rem, 6.3vw, 6rem); line-height: .9; letter-spacing: -.05em; max-width: 14ch; }
.demo-head .callout { font-family: var(--px); font-size: 19px; line-height: 1; background: var(--ink); color: var(--paper); padding: 4px 7px 3px; }

.chassis { background: var(--win); border: 1px solid var(--ink); box-shadow: inset 0 0 0 2px var(--win), inset 0 0 0 3px var(--ink); }
.chassis-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--paper); font-family: var(--px); font-size: 19px; line-height: 1; padding: 4px 7px 3px; }
.chassis-bar::after { content: "sandbox"; opacity: .75; }
.chassis-body { background: var(--paper); margin: 3px; padding: clamp(16px, 3vw, 30px); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: clamp(22px, 4vw, 48px); align-items: center; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

.runbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.hint { font-family: var(--px); font-size: 20px; line-height: 1; color: var(--ink-soft); }
.done-chip { font-family: var(--px); font-size: 21px; line-height: 1; background: var(--yellow); border: 1px solid var(--ink); padding: 5px 8px 4px; opacity: 0; transition: opacity .3s; }
.done-chip.on { opacity: 1; }

/* pipeline: a job list that runs */
.pipeline { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.stage { display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--rule); }
.lamp { width: 12px; height: 12px; border: 1px solid var(--ink); justify-self: center; background: transparent; }
.stage.run .lamp { background: var(--ink); animation: blinkbox 0.5s steps(1) infinite; }
.stage.done .lamp { background: var(--yellow); animation: none; }
.stage .s-name { font-family: var(--px); font-size: 23px; line-height: 1; color: var(--ink-soft); }
.stage.run .s-name, .stage.done .s-name { color: var(--ink); }
.stage.run { background: var(--win-field); }
.stage .s-out { font-family: var(--px); font-size: 19px; line-height: 1; opacity: 0; transition: opacity .3s; }
.stage.done .s-out { opacity: 1; }
@media (max-width: 600px) {
  .stage { grid-template-columns: 22px 1fr; row-gap: 2px; padding: 3px 2px; }
  .stage .s-name { font-size: 21px; }
  .stage .s-out { grid-column: 2; }
  .runbar { margin-top: 8px; flex-wrap: nowrap; }
  .done-chip { font-size: 18px; white-space: nowrap; }
}

/* phone preview: an ink 9:16 screen with dithered grain */
.phone { width: min(230px, 100%); margin: 0 auto; aspect-ratio: 9/17; border: 1px solid var(--ink); box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--ink); background: var(--ink); position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 16%; }
.phone::before { content: ""; position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 46px; height: 6px; background: #3A3A38; }
.phone .noise { position: absolute; inset: 0; background-image: radial-gradient(var(--ink-soft) .8px, transparent 1px); background-size: 4px 4px; opacity: .9; transition: opacity .8s; }
.phone.playing .noise { opacity: .35; }
.cap { position: relative; z-index: 2; text-align: center; font-family: var(--sans); font-weight: 700; letter-spacing: -.02em; font-size: 1.12rem; line-height: 1.2; color: var(--paper); padding: 0 12px; min-height: 3em; }
.cap .w { opacity: 0; display: inline-block; transform: translateY(6px); }
.cap .w.on { animation: wpop .24s var(--ease) forwards; }
.cap .w.key { color: var(--ink); background: var(--yellow); padding: 0 3px; }
@keyframes wpop { to { opacity: 1; transform: none; } }
.brandcard { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: var(--yellow); opacity: 0; pointer-events: none; transition: opacity .5s; }
.brandcard.on { opacity: 1; }
.brandcard span { font-family: var(--px); font-size: 24px; line-height: 1; border: 2px solid var(--ink); padding: 10px 14px 8px; color: var(--ink); }

/* transcript cutter */
.transcript { background: var(--paper); border: 1px solid var(--ink); padding: 20px 22px; font-size: 1.12rem; line-height: 2; letter-spacing: -.01em; max-width: 68ch; }
.transcript .fw, .transcript .sil { transition: all .4s var(--ease); display: inline-block; }
.transcript .fw { background: var(--yellow); padding: 0 4px; line-height: 1.4; }
.transcript .sil { font-family: var(--px); font-size: 19px; line-height: 1; background: var(--ink); color: var(--paper); padding: 3px 7px 2px; vertical-align: middle; }
.transcript .cutout { opacity: 0; max-width: 0; padding: 0; margin: 0; border: 0; transform: scale(.6); white-space: nowrap; overflow: hidden; vertical-align: middle; }
.transcript .cutout { margin-left: -.23em; }
@media (min-width: 821px) {
  .chassis-body:has(> .transcript) { display: grid; grid-template-columns: minmax(0, 1fr) 240px; grid-template-areas: "t s" "t r"; column-gap: 32px; row-gap: 22px; align-items: start; }
  .chassis-body > .transcript { grid-area: t; max-width: none; align-self: stretch; }
  .chassis-body > .stats { grid-area: s; margin-top: 0; flex-direction: column; align-items: flex-start; gap: 18px; }
  .chassis-body > .runbar { grid-area: r; margin-top: 0; }
}
.stats { display: flex; gap: 32px; align-items: flex-end; margin-top: 22px; flex-wrap: wrap; }
.stats .big { font-weight: 500; font-size: clamp(2.4rem, 4vw, 3.4rem); line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stats .lbl { font-family: var(--mono); font-size: 12.5px; display: block; margin-top: 6px; }

/* ledger */
.ledger-grid { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 24px; }
@media (max-width: 860px) { .ledger-grid { grid-template-columns: 1fr; } }
.chat { border: 1px solid var(--ink); background: var(--win-field); padding: 0 12px 14px; display: flex; flex-direction: column; gap: 10px; min-height: 340px; max-height: 480px; overflow-y: auto; }
.chat-title { position: sticky; top: 0; font-family: var(--px); font-size: 19px; line-height: 1; color: var(--paper); background: var(--ink); margin: 0 -12px; padding: 4px 8px 3px; }
.bub { max-width: 90%; padding: 9px 11px; font-size: .95rem; animation: bubin .3s var(--ease); border: 1px solid var(--ink); }
@keyframes bubin { from { opacity: 0; transform: translateY(6px); } }
.bub.user { align-self: flex-end; background: var(--paper); }
.bub.bot { align-self: flex-start; background: var(--win); }
.bub.user .who { display: block; margin-bottom: 5px; font-family: var(--px); font-size: 17px; line-height: 1; color: var(--ink-soft); }
.receipt { font-family: var(--mono); font-size: 12px; line-height: 1.7; background: var(--paper); color: var(--ink); padding: 8px 10px; border: 1px dashed var(--ink); }
.receipt .r-head { font-weight: 500; }
.receipt .r-total { border-top: 1px solid var(--ink); margin-top: 4px; padding-top: 4px; font-weight: 500; }
.parsed { display: flex; flex-direction: column; gap: 6px; }
.parsed .pr { display: flex; justify-content: space-between; gap: 18px; font-family: var(--px); font-size: 20px; line-height: 1; }
.parsed .pr b { font-weight: 400; }
.parsed .pr span:first-child { color: var(--ink-soft); }
.dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.dots i { width: 6px; height: 6px; background: var(--ink); animation: blinkbox .9s steps(1) infinite; }
.dots i:nth-child(2) { animation-delay: .3s; } .dots i:nth-child(3) { animation-delay: .6s; }
.book { display: flex; flex-direction: column; gap: 16px; }
.book .total { font-weight: 500; font-size: clamp(2.6rem, 4.4vw, 3.6rem); line-height: .9; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.book .lbl { font-family: var(--mono); font-size: 12.5px; display: block; margin-top: 8px; }
.book .snap { align-self: flex-start; }
.confirm-row { margin-top: 9px; }
.pocket { display: grid; grid-template-columns: 88px 1fr 84px; gap: 12px; align-items: center; font-family: var(--px); font-size: 21px; line-height: 1; }
.pocket .p-bar { height: 14px; border: 1px solid var(--ink); background: var(--paper); padding: 2px; }
.pocket .p-fill { height: 100%; background: var(--ink); transform-origin: left center; transition: transform .9s var(--ease); }
.pocket .p-amt { text-align: right; font-variant-numeric: tabular-nums; }
.entries { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.entry { display: flex; justify-content: space-between; gap: 14px; padding: 9px 2px; border-bottom: 1px solid var(--rule); font-size: .98rem; animation: bubin .3s var(--ease); }
.entry .e-cat { font-family: var(--px); font-size: 17px; background: var(--yellow); padding: 1px 5px 0; margin-left: 6px; }
.entry .e-amt { font-family: var(--px); font-size: 21px; font-variant-numeric: tabular-nums; }

/* ---------- Other machines on steel ---------- */
.more { background: var(--steel); padding: var(--section) 0; }
.more .demo-head h2 { font-size: clamp(2.2rem, 3.8vw, 3.5rem); }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.more-card { display: block; background: var(--win); border: 1px solid var(--ink); box-shadow: inset 0 0 0 2px var(--win), inset 0 0 0 3px var(--ink); text-decoration: none; color: var(--ink); transition: background-color .2s var(--ease); }
.more-card:hover { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--yellow), inset 0 0 0 3px var(--ink); }
.more-card .mc-n { display: block; font-family: var(--px); font-size: 19px; line-height: 1; background: var(--ink); color: var(--paper); padding: 4px 7px 3px; }
.more-card img { display: block; width: calc(100% - 6px); margin: 3px; height: auto; aspect-ratio: 16 / 10; object-fit: cover; image-rendering: pixelated; border-bottom: 1px solid var(--ink); }
.more-card .mc-d { display: block; padding: 16px 14px 18px; font-size: 1.08rem; line-height: 1.35; letter-spacing: -.01em; }
