/* The home page: Ask Mango for Meta ads. Builds on styles.css (paper, ink,
   mango, the almanac's type and rules); everything here is this page's own. */

[data-lucide] { display: inline-grid; place-items: center; flex: none; }
[data-lucide] svg { width: 100%; height: 100%; }

.buttonLogo { width: 22px; height: auto; flex: none; }
.button.large .buttonLogo { width: 24px; }

/* ---------- hero ---------- */

.adsHero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  padding-top: clamp(40px, 6vw, 84px);
  padding-bottom: clamp(56px, 7vw, 100px);
}
.adsHero .heroTitle { font-size: clamp(42px, 4.7vw, 68px); }
.adsHero .heroTitle .line { white-space: nowrap; }
.adsHero .lede { max-width: 30em; }
.adsHero .lede b { color: var(--ink); font-weight: 600; }
.adsHero .ctaRow { gap: 26px; }

/* ---------- the demo conversation ---------- */

.demo {
  position: relative;
  margin: 0;
  border-radius: 22px;
  background: #fffdf8;
  border: 1px solid var(--rule);
  box-shadow: 0 2px 4px rgba(60, 40, 15, 0.05), 0 40px 80px -40px rgba(60, 40, 15, 0.45);
  overflow: hidden;
}
.demoBar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  background: rgba(243, 237, 225, 0.5);
}
.demoAvatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--ink); }
.demoAvatar img { width: 20px; height: 20px; }
.demoTitle { display: grid; line-height: 1.25; }
.demoTitle b { font: 600 15px var(--display); letter-spacing: -0.01em; }
.demoTitle small { font-size: 12.5px; color: var(--ink-3); }
.demoLive { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 99px; background: rgba(47, 90, 52, 0.09); font: 500 11.5px var(--mono); letter-spacing: 0.04em; color: var(--leaf); }
.demoLive i { width: 7px; height: 7px; border-radius: 50%; background: #3e8e4a; box-shadow: 0 0 0 3px rgba(62, 142, 74, 0.18); }

.demoBody { display: flex; flex-direction: column; gap: 14px; padding: 22px clamp(16px, 2.4vw, 26px) 26px; min-height: 560px; }

.bubble { max-width: 86%; padding: 12px 15px; border-radius: 16px; font-size: 15px; line-height: 1.5; }
.bubble p { margin: 0; }
.bubble.you { align-self: flex-end; background: var(--ink); color: #f6f1e7; border-bottom-right-radius: 5px; }
.bubble.mango { align-self: flex-start; background: var(--paper-2); color: var(--ink); border-bottom-left-radius: 5px; }
.bubbleThumbs { display: flex; gap: 6px; margin-bottom: 10px; }
.bubbleThumbs img { width: 66px; height: 66px; object-fit: cover; border-radius: 9px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }

.demoStep { display: flex; align-items: center; gap: 10px; margin: 0; font: 400 12.5px var(--mono); color: var(--ink-3); }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--rule-2); border-top-color: var(--mango-ink); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.proposal {
  align-self: stretch;
  border: 1px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 18px 36px -26px rgba(60, 40, 15, 0.55);
}
.proposal header { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); }
.proposal header div { display: grid; line-height: 1.3; }
.proposal header b { font: 600 15.5px var(--display); letter-spacing: -0.015em; }
.proposal header small { font-size: 12.5px; color: var(--ink-3); }
.proposalIcon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--mango); color: var(--ink); }
.proposal dl { margin: 0; padding: 6px 16px; }
.proposal dl div { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--rule); font-size: 14px; }
.proposal dl div:last-child { border-bottom: 0; }
.proposal dt { font: 500 11px/1.9 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.proposal dd { margin: 0; color: var(--ink); }
.pausedPill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 99px; background: var(--paper-3); font: 500 12px var(--mono); color: var(--ink-2); }
.pausedPill::before { content: ''; width: 6px; height: 6px; border-radius: 1px; background: var(--ink-3); box-shadow: 3px 0 0 -0px transparent; }
.proposal footer { display: flex; gap: 10px; padding: 12px 16px 14px; border-top: 1px solid var(--rule); }

.fakeButton { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 9px 18px; border: 1px solid var(--rule-2); border-radius: 8px; background: transparent; font: 600 14px var(--body); color: var(--ink); }
.fakeButton.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.fakeButton.small { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }
.inkRing { left: -22px; top: -16px; width: calc(100% + 44px); height: calc(100% + 32px); stroke-width: 2.6; }
.proposalDone { display: none; align-items: center; gap: 9px; margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--leaf); font-weight: 500; }
.proposalDone [data-lucide] { width: 18px; height: 18px; }

/* Played: steps appear in turn (home.js sets data-at); without script everything shows. */
.demo.playing [data-step] { opacity: 0; transform: translateY(10px); transition: opacity 500ms ease, transform 600ms var(--ease); }
.demo.playing [data-step].shown { opacity: 1; transform: none; }
.demo.playing .demoStep.over { opacity: 0; height: 0; margin-top: -14px; transition: opacity 300ms ease, height 300ms ease, margin 300ms ease; }
.demo.approved .proposal footer { display: none; }
.demo.approved .proposalDone { display: flex; }
.demo.approved .pausedPill { background: rgba(47, 90, 52, 0.1); color: var(--leaf); }
.demo .fakeButton.pressed { transform: scale(0.96); transition: transform 120ms ease; }

/* ---------- built on Meta ---------- */

.builtOn { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: rgba(255, 253, 248, 0.45); }
.builtOnInner { display: flex; align-items: center; justify-content: space-between; gap: 18px 40px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.builtOn p { margin: 0; font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.builtOn ul { display: flex; align-items: center; gap: 34px; margin: 0; padding: 0; list-style: none; }
.builtOn li { display: flex; align-items: center; gap: 10px; font: 600 16px var(--display); letter-spacing: -0.01em; color: var(--ink); }
.builtOn li img { height: 26px; width: auto; }
.builtOn li:first-child img { height: 22px; }

/* ---------- what to ask ---------- */

.asks { padding-top: clamp(90px, 11vw, 150px); padding-bottom: clamp(90px, 11vw, 150px); }
.askGrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.askGrid li { display: flex; flex-direction: column; gap: 10px; padding: 30px 28px 34px 0; border-bottom: 1px solid var(--rule-2); }
.askGrid li:not(:nth-child(3n + 1)) { padding-left: 28px; border-left: 1px solid var(--rule-2); }
.askIcon { width: 40px; height: 40px; padding: 9px; margin-bottom: 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--rule); color: var(--mango-text); }
.askGrid h3 { font-size: 22px; }
.askGrid p { margin: 0; color: var(--ink-2); font-size: 15.5px; }
.askGrid .askQuote { padding-left: 14px; border-left: 2px solid var(--mango); font: 500 17px/1.4 var(--display); letter-spacing: -0.01em; color: var(--ink); }

/* ---------- how it works ---------- */

.howAds { padding: clamp(90px, 11vw, 150px) 0; background: var(--paper-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.howSteps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); counter-reset: none; }
.howSteps > li { display: flex; flex-direction: column; gap: 10px; }
.howSteps .stepNo { font: 600 34px/1 var(--display); color: var(--mango-text); letter-spacing: -0.03em; }
.howSteps h3 { font-size: 24px; }
.howSteps p { margin: 0; color: var(--ink-2); font-size: 16px; }
.howVisual { margin-top: 18px; min-height: 150px; display: grid; align-content: center; gap: 12px; padding: 22px; border-radius: 16px; background: #fffdf8; border: 1px solid var(--rule); box-shadow: 0 24px 40px -34px rgba(60, 40, 15, 0.5); }

.fbButton { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 16px; border-radius: 8px; background: #1877f2; color: #fff; font: 600 15px var(--body); }
.fbButton img { width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.pickList { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pickList li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.tick { width: 18px; height: 18px; padding: 3px; border-radius: 5px; background: #1877f2; color: #fff; }

.fakeInput { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border: 1px solid var(--rule-2); border-radius: 14px; background: var(--card); font-size: 14.5px; }
.fakeInput > [data-lucide]:first-child { width: 18px; height: 18px; color: var(--ink-3); }
.fakeText { flex: 1; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fakeText::after { content: ''; display: inline-block; width: 1.5px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--mango-ink); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.fakeSend { width: 30px; height: 30px; padding: 7px; border-radius: 9px; background: var(--mango); color: var(--ink); }

.miniCard { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--ink); border-radius: 12px; background: var(--card); }
.miniCard p { margin: 0; font-size: 14px; }
.miniCard > div { display: flex; gap: 8px; margin-top: 2px; }
.beforeAfter { display: flex; align-items: center; gap: 8px; font: 500 13px var(--mono); color: var(--ink-2); }
.beforeAfter s { color: var(--ink-3); }
.beforeAfter [data-lucide] { width: 14px; height: 14px; color: var(--mango-text); }

/* ---------- control (night) ---------- */

.control { position: relative; overflow: hidden; padding: clamp(90px, 11vw, 150px) 0; background: var(--night); color: var(--cream); }
.controlInner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 6vw, 90px); align-items: center; }
.control .sectionHead { margin-bottom: 40px; }
.rules { margin: 0; display: grid; border-top: 1px solid rgba(239, 230, 210, 0.35); }
.rules div { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid rgba(239, 230, 210, 0.16); }
.rules dt { display: flex; gap: 12px; align-items: flex-start; font: 600 18px/1.3 var(--display); letter-spacing: -0.015em; color: var(--cream); }
.rules dt [data-lucide] { width: 20px; height: 20px; margin-top: 1px; color: var(--mango); }
.rules dd { margin: 0; color: rgba(239, 230, 210, 0.76); font-size: 15.5px; }

.ledgerPlate { position: relative; margin: 0; }
.ledgerPlate img { width: 100%; filter: drop-shadow(0 40px 50px rgba(0, 0, 0, 0.45)); }
.logCard { position: relative; margin: -12% 6% 0; padding: 6px 0; list-style: none; border-radius: 14px; background: #fffdf8; color: var(--ink); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7); }
.logCard li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--rule); }
.logCard li:last-child { border-bottom: 0; }
.logCard div { display: grid; line-height: 1.3; }
.logCard b { font: 600 14px var(--body); }
.logCard small { font-size: 12.5px; color: var(--ink-3); }
.logCard time { font: 400 12px var(--mono); color: var(--ink-3); }
.logDot { width: 9px; height: 9px; border-radius: 50%; }
.logDot.made { background: var(--leaf); }
.logDot.changed { background: var(--mango); }
.logDot.paused { background: var(--ink-3); }

/* ---------- pricing ---------- */

.adsPricing { padding-top: clamp(90px, 11vw, 150px); padding-bottom: clamp(90px, 11vw, 150px); }
.priceCards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 20px; align-items: stretch; }
.priceCard { display: flex; flex-direction: column; gap: 16px; padding: 30px; border: 1px solid var(--rule-2); border-radius: 18px; background: var(--card); }
.priceCard.featured { border-color: var(--ink); box-shadow: 0 30px 60px -40px rgba(60, 40, 15, 0.6); position: relative; }
.priceCard.featured::before { content: 'Never expires'; position: absolute; top: -12px; right: 24px; padding: 4px 10px; border-radius: 99px; background: var(--mango); font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.priceName { margin: 0; font: 500 12px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.priceAmount { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.priceAmount b { font: 600 52px/1 var(--display); letter-spacing: -0.045em; }
.priceAmount span { font-size: 14px; color: var(--ink-3); }
.priceCard ul { flex: 1; list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 10px; align-content: start; }
.priceCard li { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; color: var(--ink-2); }
.priceCard li b { color: var(--ink); font-weight: 600; }
.priceCard li [data-lucide] { width: 18px; height: 18px; margin-top: 3px; color: var(--leaf); }
.priceCard .button { justify-content: center; }
.priceNote { padding: 8px 0 0 8px; }
.priceNote h3 { font-size: 20px; margin-bottom: 10px; }
.priceNote p { margin: 0 0 12px; color: var(--ink-2); font-size: 15.5px; }

.faq .faqItem p a { color: var(--ink); text-decoration-color: var(--mango-ink); text-underline-offset: 3px; }

/* ---------- smaller screens ---------- */

@media (max-width: 1080px) {
  .priceCards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .priceNote { grid-column: 1 / -1; padding: 0; }
}

@media (max-width: 900px) {
  .adsHero { grid-template-columns: 1fr; }
  .demoBody { min-height: 0; }
  .askGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .askGrid li:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .askGrid li:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--rule-2); }
  .howSteps { grid-template-columns: 1fr; max-width: 560px; }
  .controlInner { grid-template-columns: 1fr; }
  .ledgerPlate { max-width: 560px; }
}

@media (max-width: 640px) {
  .navEnd .button.small { padding: 9px 12px; }
  .adsHero .ctaRow { gap: 16px; }
  .adsHero .button.large { width: 100%; justify-content: center; }
  .bubble { max-width: 94%; font-size: 14.5px; }
  .bubbleThumbs img { width: 56px; height: 56px; }
  .proposal dl div { grid-template-columns: 74px minmax(0, 1fr); }
  .builtOnInner { justify-content: center; text-align: center; }
  .builtOn ul { gap: 22px; flex-wrap: wrap; justify-content: center; }
  .askGrid { grid-template-columns: 1fr; }
  .askGrid li,
  .askGrid li:nth-child(even) { padding: 26px 0 28px; border-left: 0; }
  .rules div { grid-template-columns: 1fr; gap: 6px; }
  .priceCards { grid-template-columns: 1fr; }
  .priceCard { padding: 24px; }
  .logCard { margin: -10% 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .spin, .fakeText::after { animation: none; }
}
