/* Homepage layout. Tokens and components come from looper.css. */

/* ---------- Ring mark (the logo's two rings, from #rings in index.html) ---------- */
.mark { --logo-o: var(--ink); --logo-o2: var(--red); --logo-gap: var(--white); width: auto; height: 0.75em; flex: none; overflow: visible; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(243, 242, 242, 0.82);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: var(--s-6); height: 64px; }
.nav-links { display: flex; gap: var(--s-6); margin-left: auto; }
.nav-links a { font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; opacity: 0.78; transition: opacity var(--dur) var(--ease); }
.nav-links a:hover { opacity: 1; }
.nav-actions { display: flex; align-items: center; gap: var(--s-5); padding-left: var(--s-6); border-left: 1px solid var(--line); height: 20px; }
.nav-signin { font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; opacity: 0.78; transition: opacity var(--dur) var(--ease); }
.nav-signin:hover { opacity: 1; }
.nav-cta { font-size: 15px; }
@media (max-width: 719px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; padding-left: 0; border-left: 0; gap: var(--s-4); }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 9vw, 120px) 0 0; overflow: hidden; }
.hero-title .line { display: block; }
.hero-title { max-width: 14ch; }
.hero-title-2 { color: var(--ink-3); }
.hero-foot { display: grid; gap: var(--s-6); margin-top: var(--s-6); align-items: end; }
.hero-lead { max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
@media (min-width: 960px) {
  .hero-title { max-width: none; }
  .hero-foot { grid-template-columns: 1fr auto; gap: var(--s-8); }
}

.hero-shot { margin-top: clamp(48px, 7vw, 88px); margin-bottom: -1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
.shot-bar { display: flex; align-items: center; gap: var(--s-4); height: 44px; padding: 0 var(--s-4); border-bottom: 1px solid var(--line); background: var(--paper); }
.shot-dots { display: flex; gap: 6px; }
.shot-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.shot-url { margin: 0 auto; padding: 4px 14px; border-radius: var(--radius-pill); background: var(--white); border: 1px solid var(--line); font-size: 12px; color: var(--ink-3); transform: translateX(-24px); }

.shot-body { position: relative; display: grid; min-height: 520px; background: var(--white); }
.shot-site { padding: var(--s-5) var(--s-6); }
.shot-site-nav { display: flex; gap: var(--s-5); align-items: center; font-size: 13px; color: var(--ink-3); }
.shot-site-nav b { color: var(--ink-2); margin-right: auto; font-weight: 700; }
.shot-site-hero { display: grid; gap: 12px; max-width: 460px; margin-top: 72px; }
.sk { display: block; height: 12px; border-radius: 6px; background: var(--paper-2); }
.sk-lg { height: 30px; border-radius: 8px; background: #E4E1DF; }
.sk-short { width: 70%; }
.sk-mid { width: 80%; }
.shot-site-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 36px; }
.shot-site-tiles span { aspect-ratio: 4 / 3; border-radius: 10px; background: linear-gradient(160deg, #ECEAE8, #E2DFDC); }

/* Chat widget */
.widget {
  position: absolute; right: var(--s-6); bottom: var(--s-5); width: min(380px, calc(100% - 32px));
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 2px 4px rgba(32, 30, 29, 0.04), 0 24px 48px -12px rgba(32, 30, 29, 0.22);
  font-size: 14px; line-height: 1.45;
}
.widget-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.widget-head b { display: block; font-size: 14px; }
.widget-head small { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.widget-head .mark { --logo-gap: #fff; height: 8px; }
.widget-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 800; letter-spacing: -0.04em; }
.widget-thread { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; }
.msg--buyer { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.msg--bot { align-self: flex-start; background: var(--paper); color: var(--ink); border-bottom-left-radius: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips span { padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); background: #fff; font-size: 12px; font-weight: 600; }
.chips .on { border-color: var(--red); color: var(--red-deep); background: #FDF1EE; }
.widget-input { display: flex; justify-content: space-between; align-items: center; margin: 0 12px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-4); }
.widget-input span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 700; }

@media (max-width: 719px) {
  .shot-site { display: none; }
  .shot-body { min-height: 0; padding: var(--s-4) var(--s-4) 0; background: var(--paper); }
  .widget { position: static; width: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; }
}

/* ---------- Problem ---------- */
.problem-statement { margin-top: var(--s-4); max-width: 26em; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem); }
.problem-grid { margin-top: clamp(48px, 7vw, 96px); }
.problem-grid .h3 { margin: var(--s-3) 0 var(--s-2); }

/* ---------- Split: heading left, content right ---------- */
.split { display: grid; gap: var(--s-7); }
.split-head .h2 { margin-top: var(--s-4); max-width: 13em; }
@media (min-width: 960px) {
  .split { grid-template-columns: 5fr 6fr; gap: var(--s-9); }
  .split-head { position: sticky; top: 112px; align-self: start; }
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; }
.steps li { display: grid; grid-template-columns: 40px 1fr; gap: var(--s-4); padding: var(--s-5) 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps .h3 { margin-bottom: var(--s-1); }
.step-n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--ink); font: 500 12px var(--font-mono); color: var(--ink); }
.steps li:last-child .step-n { border-color: var(--red); color: var(--red-deep); }

/* Loop diagram: the logo's rings as "buyer" and "team", joined by Looper */
.loop { position: relative; margin: var(--s-8) 0 0; max-width: 440px; aspect-ratio: 80 / 52; }
.loop-rings { width: 100%; height: 100%; overflow: visible; fill: none; }
.loop .ring, .loop .over--a { stroke-width: 1.4; }
.loop .ring--a, .loop .over--a { stroke: var(--ink); }
.loop .ring--b { stroke: var(--red); }
.loop .over--gap { stroke: var(--paper); stroke-width: 5; }
.loop-side { position: absolute; top: 50%; display: grid; gap: 2px; text-align: center; transform: translate(-50%, -50%); line-height: 1.2; }
.loop-side b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.loop-side .label { font-size: 10px; }
.loop-side--a { left: 23%; }
.loop-side--b { left: 77%; }
.loop-join {
  position: absolute; left: 50%; top: 19.9%; transform: translate(-50%, -50%);
  padding: 3px 10px; border-radius: var(--radius-pill); background: var(--ink); color: var(--paper);
  font: 500 11px var(--font-mono); letter-spacing: var(--track-label); text-transform: uppercase;
}
@media (max-width: 959px) { .loop { margin-top: var(--s-7); } }
@media (max-width: 400px) { .loop-side .label { display: none; } }

/* ---------- Brief ---------- */
.section--sunken { background: var(--paper-2); }
.brief-wrap { display: grid; gap: var(--s-7); align-items: center; }
@media (min-width: 960px) { .brief-wrap { grid-template-columns: 5fr 6fr; gap: var(--s-9); } }
.brief-copy .h2 { margin: var(--s-4) 0 var(--s-5); }
.checks { list-style: none; padding: 0; margin: var(--s-6) 0 0; display: grid; gap: var(--s-3); }
.checks li { position: relative; padding-left: 28px; font-weight: 500; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 14px; height: 8px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }

.brief-card { padding: 0; }
.brief-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-4); padding: var(--s-5); border-bottom: 1px solid var(--line); }
.brief-title { margin: 6px 0 2px; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.brief-rows { margin: 0; padding: var(--s-2) var(--s-5); }
.brief-rows div { display: grid; grid-template-columns: 110px 1fr; gap: var(--s-4); padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.brief-rows div:last-child { border-bottom: 0; }
.brief-rows dt { color: var(--ink-3); }
.brief-rows dd { margin: 0; font-weight: 500; }
.calc { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--paper-2); font: 500 11px var(--font-mono); color: var(--ink-2); vertical-align: 1px; }
.brief-flags { display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5) var(--s-5); background: var(--paper); border-top: 1px solid var(--line); font-size: 15px; }
.brief-flags .tag { margin-right: 6px; }

/* ---------- Ink section ---------- */
.section--ink { background: var(--ink); color: var(--paper); border-top: 0 !important; }
.section--ink .label { color: var(--night-text-2); }
.section--ink .statement .muted { color: var(--night-text-2); }
.math-statement { margin-top: var(--s-4); max-width: 24em; }
.facts { display: grid; gap: var(--s-6); margin-top: clamp(48px, 7vw, 96px); }
.facts > div { padding-left: var(--s-5); border-left: 2px solid var(--red); }
.facts .h3 { margin-bottom: var(--s-2); }
.facts p { color: var(--night-text-2); }
@media (min-width: 800px) { .facts { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Builders ---------- */
.builders-head { margin-bottom: clamp(40px, 6vw, 72px); }
.builders { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.builders > div { padding: var(--s-6) var(--s-5); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color var(--dur) var(--ease); }
.builders > div:hover { background: var(--white); }
.builders .h3 { margin: var(--s-6) 0 var(--s-1); }
@media (min-width: 900px) { .builders { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 479px) { .builders { grid-template-columns: 1fr; } }

/* ---------- Demo (red) ---------- */
.section--red { position: relative; overflow: hidden; background: var(--red); color: #fff; border-top: 0 !important; }
.section--red > .container { position: relative; }
/* Big faint rings behind the headline, colored like the on-red logo. */
.demo-rings {
  --logo-o: var(--paper); --logo-o2: var(--ink); --logo-gap: var(--red);
  position: absolute; left: max(-160px, calc(50% - 760px)); bottom: -220px; width: 860px; height: auto; aspect-ratio: 80 / 52;
  opacity: 0.11; pointer-events: none;
}
@media (max-width: 959px) { .demo-rings { width: 560px; left: -120px; bottom: auto; top: -60px; } }
.demo { display: grid; gap: var(--s-7); align-items: start; }
@media (min-width: 960px) { .demo { grid-template-columns: 1fr 1fr; gap: var(--s-9); } }
/* White on brand red is 4.2:1: headline plus 20px+ copy only. */
.demo-copy .h1 { max-width: 10em; }
.demo-lead { margin-top: var(--s-5); font-size: 1.25rem; line-height: 1.5; font-weight: 500; max-width: 26em; }
.demo-form { display: grid; gap: var(--s-4); padding: var(--s-6); border: 0; color: var(--ink); box-shadow: 0 30px 60px -30px rgba(32, 30, 29, 0.45); }
.form-row { display: grid; gap: var(--s-4); }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.select { appearance: none; -webkit-appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236B6663' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
.demo-submit { width: 100%; margin-top: var(--s-2); }
.form-status:empty { display: none; }
.form-status { color: var(--ink-2); }
.form-status.is-error { color: var(--red-deep); }
.field.is-invalid .input { border-color: var(--red-deep); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--paper); padding: var(--s-9) 0 var(--s-6); }
.footer-inner { display: grid; gap: var(--s-7); }
@media (min-width: 800px) { .footer-inner { grid-template-columns: 1fr auto; } }
.footer-cols { display: grid; grid-template-columns: repeat(2, minmax(140px, auto)); justify-content: start; gap: var(--s-8); }
.footer-cols > div { display: grid; gap: var(--s-3); align-content: start; }
.footer-h { font-size: var(--text-sm); color: var(--night-text-2); margin-bottom: var(--s-1); }
.footer-cols a { color: var(--paper); text-decoration: none; font-size: 15px; opacity: 0.9; }
.footer-cols a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
/* Oversized wordmark across the bottom of the footer. */
.footer-mark {
  --logo-o: #3A3735; --logo-o2: var(--red); --logo-gap: var(--ink);
  display: flex; width: fit-content; margin: var(--s-9) 0 0 -0.07em;
  color: #3A3735; font-size: min(calc((100vw - 2 * var(--gutter)) / 3.1), calc(var(--container) / 3.1));
  line-height: 1; padding-bottom: 0.08em; transition: color var(--dur) var(--ease);
}
.footer-mark:hover { color: #4A4644; --logo-o: #4A4644; }
.footer-mark .logo-oo { width: auto; }
.footer-legal { margin-top: var(--s-6); padding-top: var(--s-5); border-top: 1px solid var(--night-line); font-size: var(--text-sm); color: var(--night-text-2); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Motion ----------
   Only under .js, which <head> sets unless the visitor prefers reduced motion; site.js drives it.
   Without JS the page is fully static. */
:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); }

/* Scroll reveal: rise and fade in, staggered by --i within a group. */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* Nav: clear at the top of the page, frosted once you scroll. */
.js .nav { background: rgba(243, 242, 242, 0); border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transition: background-color 0.4s var(--ease-out), border-color 0.4s var(--ease-out); }
.js .nav.scrolled { background: rgba(243, 242, 242, 0.82); border-bottom-color: var(--line); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); }

/* Hero: each headline line rises out of a mask, then the product window fades up
   and grows to full size as you scroll toward it (--p, 0 → 1). */
.js .hero-title .line { overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.js .hero-title .line > span { display: block; transform: translateY(110%); transition: transform 1.3s var(--ease-out); }
.js .hero-title .line + .line > span { transition-delay: 0.12s; }
.js.loaded .hero-title .line > span { transform: none; }
.js .hero-shot { opacity: 0; transform: scale(calc(0.9 + 0.1 * var(--p, 0))); transform-origin: 50% 0; transition: opacity 1.4s var(--ease-out) 0.5s, transform 0.25s linear; }
.js.loaded .hero-shot { opacity: 1; }

/* Chat messages arrive one at a time. */
.js .widget .msg { opacity: 0; transform: translateY(10px) scale(0.97); transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out); }
.js .widget .msg--buyer { transform-origin: 100% 100%; }
.js .widget .msg--bot { transform-origin: 0 100%; }
.js .widget .msg.in { opacity: 1; transform: none; }

/* Statements light up word by word as you scroll through them. */
.js .words .w { opacity: 0.18; transition: opacity 0.4s linear; }
.js .words .w.on { opacity: 1; }

/* Loop diagram draws itself, then the crossing and labels settle in. */
.js .loop .ring { stroke-dasharray: 100; stroke-dashoffset: 100; transform-box: fill-box; transform-origin: center; transform: rotate(-90deg); transition: stroke-dashoffset 1.8s var(--ease-out) 0.2s; }
.js .loop .ring--b { transform: rotate(90deg); transition-delay: 0.45s; }
.js .loop .over, .js .loop-join, .js .loop-side { opacity: 0; transition: opacity 0.6s var(--ease-out) 1.2s; }
.js .loop.in .ring { stroke-dashoffset: 0; }
.js .loop.in .over, .js .loop.in .loop-join, .js .loop.in .loop-side { opacity: 1; }

/* Demo rings drift slower than the page. */
.js .demo-rings { transform: translateY(var(--py, 0px)); will-change: transform; }

/* Footer wordmark rises from below. */
.js .footer-mark.reveal { transform: translateY(35%); transition-duration: 1.2s, 1.6s; }
.js .footer-mark.reveal.in { transform: none; }
