/* ==========================================================================
   Tryvon — motion & signature moments (ported from the Lovable design, CSS-first).
   Loaded after site.css. Everything respects prefers-reduced-motion (block at the end).
   ========================================================================== */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .18s ease both; }
::view-transition-new(root) { animation: vt-in .3s var(--ease) both; }
::view-transition-group(*) { animation-duration: .45s; animation-timing-function: var(--ease); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }

/* trust strip above the header */
.trust-strip { background: #052C3A; color: #E6F0EF; font-size: .76rem; position: relative; z-index: 51; }
.trust-strip-inner { max-width: var(--page-max); margin: 0 auto; padding: 7px var(--gutter); display: flex; gap: 8px 26px; justify-content: center; flex-wrap: wrap; }
.trust-strip span { display: inline-flex; gap: 7px; align-items: center; opacity: .92; }
.trust-strip .i { color: #E8BA54; }
@media (max-width: 720px) { .trust-strip span:nth-child(n+2) { display: none; } }

/* ---------- dark aurora hero ---------- */
.hero.hero-dark { background: #052C3A; color: #F4F1EA; isolation: isolate; padding-bottom: 72px; }
.hero.hero-dark::before { content: ""; position: absolute; inset: -25%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 38% at 18% 32%, rgba(42,155,170,.55), transparent 70%),
    radial-gradient(30% 34% at 82% 18%, rgba(212,160,59,.38), transparent 70%),
    radial-gradient(46% 42% at 62% 92%, rgba(19,106,117,.65), transparent 70%),
    radial-gradient(30% 30% at 40% 60%, rgba(100,186,181,.25), transparent 70%);
  filter: blur(8px); animation: aurora 18s ease-in-out infinite alternate; }
.hero.hero-dark::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; width: auto; height: auto; border-radius: 0; filter: none;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%); mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%); animation: none; }
@keyframes aurora { 0% { transform: translate3d(0,0,0) rotate(0deg) scale(1); } 100% { transform: translate3d(5%,3%,0) rotate(8deg) scale(1.08); } }
.hero-dark h1 { color: #FBF9F4; }
.hero-dark .text-gradient { background: none; color: #8FDCD6; -webkit-text-fill-color: currentColor; }
.hero-dark .text-gradient .hero-word { background: linear-gradient(100deg, #9BE3DC, #64BAB5 45%, #E8BA54 110%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; padding-bottom: .06em; }
.hero-dark .text-gradient .hero-word:nth-last-child(-n+2) { background: linear-gradient(100deg, #8FD3C8, #E8BA54 70%); -webkit-background-clip: text; background-clip: text; }
.hero-dark .lead { color: rgba(244,241,234,.8); }
.hero-dark .eyebrow { color: #E8BA54; display: inline-flex; align-items: center; gap: 10px; }
.hero-dark .eyebrow::before { content: ""; width: 26px; height: 1px; background: #E8BA54; }
.hero-dark .trustline { color: rgba(244,241,234,.82); }
.hero-dark .trustline .i { color: #E8BA54; }
.hero-dark .stats dt { color: #FBF9F4; }
.hero-dark .stats dd { color: rgba(244,241,234,.72); }
.hero-dark .searchbar { background: rgba(251,249,244,.96); border-color: rgba(255,255,255,.35); box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
:root[data-theme="dark"] .hero-dark .searchbar { background: rgba(23,45,55,.92); }
.hero-word { display: inline-block; animation: word-reveal .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 85ms + 120ms); }
@keyframes word-reveal { from { opacity: 0; filter: blur(10px); transform: translateY(14px); } to { opacity: 1; filter: blur(0); transform: none; } }
.hero-symbol { position: absolute; right: max(2%, calc(50% - 640px)); top: 128px; width: min(30vw, 420px); z-index: 0; pointer-events: none;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.45)); animation: symbol-float 9s ease-in-out infinite, fade-in 1.4s .3s var(--ease) both; }
@keyframes symbol-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-18px) rotate(1.5deg); } }
@keyframes fade-in { from { opacity: 0; } }
@media (max-width: 1000px) { .hero-symbol { display: none; } }
.hero-dark .hero-inner > * { position: relative; z-index: 1; }

/* ---------- interactive "how we check" timeline ---------- */
.check-flow .step { cursor: pointer; border-top: 3px solid var(--line); transition: border-color .4s, transform .4s var(--ease), box-shadow .4s; }
.check-flow .step.active { border-top-color: var(--gold); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.check-flow .step.active .ico { background: var(--grad-gold); color: var(--gold-ink); }
.check-flow .step .bar { position: absolute; left: 0; top: 0; height: 3px; width: 0; background: var(--grad-gold); }
.check-flow .step.active .bar { animation: step-bar 3.6s linear both; }
@keyframes step-bar { to { width: 100%; } }

/* ---------- carousel ---------- */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 84%); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 4px 24px; scrollbar-width: none; overscroll-behavior-x: contain; }
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; }
@media (min-width: 700px) { .carousel { grid-auto-columns: calc((100% - 20px) / 2); } }
@media (min-width: 1000px) { .carousel { grid-auto-columns: calc((100% - 40px) / 3); } }
.carousel-nav { display: flex; gap: 8px; align-items: center; }
.carousel-nav button { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: background .2s, transform .2s; }
.carousel-nav button:hover { background: var(--soft); transform: scale(1.06); }

/* ---------- cards: 3D tilt + badge shine ---------- */
@media (hover: hover) {
  .card:hover { transform: perspective(1100px) rotateX(1.6deg) rotateY(-1.2deg) translateY(-5px); }
}
.badge.inspected { overflow: hidden; }
.badge.inspected::before { content: ""; position: absolute; inset: -40% -120%; background: linear-gradient(100deg, transparent 42%, rgba(255,255,255,.75) 50%, transparent 58%); transform: translateX(-45%); animation: badge-shine 7s ease-in-out infinite; pointer-events: none; }
@keyframes badge-shine { 0%, 72% { transform: translateX(-45%); } 92%, 100% { transform: translateX(45%); } }

/* ---------- map pins ---------- */
.pin-price { animation: pin-drop .7s var(--ease) both; }
.pin-price.hot { animation: pin-pulse 1.1s ease-out infinite; }
@keyframes pin-drop { from { opacity: 0; translate: 0 -22px; } 65% { translate: 0 3px; } to { opacity: 1; translate: 0 0; } }
@keyframes pin-pulse { 50% { box-shadow: 0 0 0 9px color-mix(in oklab, var(--gold) 28%, transparent); } }

/* ---------- Trust Scanner (listing page) ---------- */
.scanner::after { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--gold), #E8BA54); transform-origin: top; transform: scaleY(0); box-shadow: 0 0 12px rgba(212,160,59,.6); }
.scanner-wrap.run .scanner::after { animation: scan-line calc(var(--n, 8) * .32s + .3s) linear both; }
html.js .scanner-wrap:not(.run) .scanner li { opacity: 0; }
.scanner-wrap.run .scanner li { animation: scan-item .5s var(--ease) both; animation-delay: calc(var(--i) * .32s + .15s); }
.scanner-wrap.run .scanner li .dot { animation: tick-pop .45s var(--ease) both; animation-delay: calc(var(--i) * .32s + .3s); }
@keyframes scan-line { to { transform: scaleY(1); } }
@keyframes scan-item { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes tick-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.18); } 100% { transform: scale(1); } }
.verified-seal { display: flex; align-items: center; gap: 14px; margin-top: 6px; padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid color-mix(in oklab, var(--gold) 55%, transparent);
  background: linear-gradient(120deg, color-mix(in oklab, var(--gold) 12%, var(--card)), var(--card)); }
.verified-seal .seal { width: 52px; height: 52px; border-radius: 999px; display: grid; place-items: center; background: var(--grad-gold); color: var(--gold-ink); flex: none; box-shadow: 0 0 0 6px color-mix(in oklab, var(--gold) 18%, transparent); }
.verified-seal strong { display: block; font-size: 1.02rem; }
html.js .scanner-wrap:not(.run) .verified-seal { opacity: 0; }
.scanner-wrap.run .verified-seal { animation: seal-in .8s var(--ease) both, seal-glow 2.6s ease-in-out infinite; animation-delay: calc(var(--n, 8) * .32s + .45s), calc(var(--n, 8) * .32s + 1.3s); }
@keyframes seal-in { from { opacity: 0; transform: scale(.94) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes seal-glow { 50% { box-shadow: 0 0 34px -6px color-mix(in oklab, var(--gold) 55%, transparent); } }

/* ---------- wizard (sell) ---------- */
.wizard-progress { display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 20px; }
.wizard.on .wizard-progress { display: grid; }
.wizard-progress div { border-top: 3px solid var(--line); padding-top: 8px; font-size: .8rem; font-weight: 700; color: var(--muted); transition: border-color .4s, color .4s; }
.wizard-progress div.done { border-color: var(--brand); color: var(--brand); }
.wizard-progress div.current { border-color: var(--gold); color: var(--ink); }
.wizard.on fieldset[data-step] { display: none; }
.wizard.on fieldset[data-step].current { display: block; animation: vt-in .35s var(--ease) both; }
.wizard fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.wizard fieldset legend { font-weight: 800; font-size: 1.05rem; margin-bottom: 12px; padding: 0; }
.wizard-nav { display: none; gap: 10px; margin-top: 8px; }
.wizard.on .wizard-nav { display: flex; }
.wizard.on .wizard-submit { display: none; }
.wizard.on.last .wizard-submit { display: inline-flex; }
.wizard.on.last .wizard-next { display: none; }
.wizard.on:not(.has-back) .wizard-back { display: none; }
.review { display: none; gap: 8px; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; font-size: .92rem; }
.wizard.on .review { display: grid; }
.review div { display: flex; justify-content: space-between; gap: 12px; }
.review span { color: var(--muted); }
.review strong { text-align: right; overflow-wrap: anywhere; }

/* ---------- success ---------- */
.success-check { width: 92px; height: 92px; margin: 6px auto 10px; border-radius: 999px; display: grid; place-items: center; background: var(--brand-light); color: var(--brand); animation: success-pop .7s var(--ease) both; }
.success-check svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .6s .45s var(--ease) forwards; }
@keyframes success-pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- 6-box one-time code ---------- */
.otp-wrap { position: relative; width: 100%; max-width: 360px; margin: 4px 0 6px; }
.otp-boxes { display: none; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.otp-boxes span { height: 58px; border-radius: 14px; border: 1.5px solid var(--input); background: var(--card); display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; color: var(--ink); transition: border-color .2s, box-shadow .2s, transform .2s; }
.otp-boxes span.filled { border-color: var(--brand); transform: translateY(-1px); }
.otp-boxes span.active { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 18%, transparent); }
.otp-boxes span.active:empty::after { content: ""; width: 2px; height: 26px; background: var(--brand); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
html.js .otp-boxes { display: grid; }
html.js .otp-wrap input.otp { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; font-size: 16px; caret-color: transparent; cursor: text; }

/* ---------- office: countdown rings, pipeline, command palette ---------- */
.ring { --p: 1; width: 44px; height: 44px; border-radius: 999px; display: inline-grid; place-items: center; font-size: .68rem; font-weight: 800; color: var(--brand); flex: none; vertical-align: middle;
  background: radial-gradient(closest-side, var(--card) 74%, transparent 76% 100%), conic-gradient(var(--ring-col, var(--brand)) calc(var(--p) * 360deg), var(--soft) 0); }
.ring.warn { --ring-col: var(--gold); color: var(--warn); }
.ring.late { --ring-col: var(--err); color: var(--err); animation: pulse-ring 2s ease-out infinite; }
.lead-when { display: flex; align-items: center; gap: 10px; }
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.pipeline a { text-decoration: none; color: var(--ink); background: var(--surface); border-radius: var(--radius); padding: 12px 14px 16px; position: relative; overflow: hidden; transition: transform .25s var(--ease); }
.pipeline a:hover { transform: translateY(-2px); color: var(--ink); }
.pipeline a .n { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; }
.pipeline a .l { font-size: .78rem; color: var(--muted); font-weight: 650; }
.pipeline a .fill { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--grad-ocean); width: calc(var(--w) * 1%); animation: grow 1s var(--ease) both; }
@keyframes grow { from { width: 0; } }
.kbar-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: .86rem; cursor: pointer; }
.kbar-btn kbd, .palette kbd { margin-left: auto; font: 700 .7rem var(--font-ui); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; background: var(--soft); color: var(--muted); }
.palette { position: fixed; inset: 0; z-index: 300; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; background: rgba(5,25,32,.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.palette.open { display: flex; animation: fade .15s ease; }
.palette-box { width: min(620px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .22s var(--ease); }
.palette-box input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-height: 58px; font-size: 1.05rem; padding: 0 20px; box-shadow: none !important; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 8px; margin: 0; list-style: none; }
.palette-list a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; }
.palette-list a.sel, .palette-list a:hover { background: var(--soft); }
.palette-list .hint { font-size: .78rem; color: var(--muted); padding: 6px 12px; }

/* ---------- field inspection ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--soft); }
.seg label { margin: 0; cursor: pointer; font-weight: 700; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 10px; font-size: .86rem; color: var(--muted); transition: background .2s, color .2s; }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.seg input[value="Ok"]:checked + span { background: var(--ok); color: #fff; }
.seg input[value="Issue"]:checked + span { background: var(--err); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid color-mix(in oklab, var(--ring) 70%, transparent); }
.seg input:disabled + span { opacity: .6; cursor: default; }
.check-row { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .check-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, .8fr); align-items: center; } }
.check-row .name { font-weight: 700; }
.inspect-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.progress-ring { --p: 0; width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center; font-weight: 800; font-size: .9rem; color: var(--brand); flex: none;
  background: radial-gradient(closest-side, var(--card) 76%, transparent 78% 100%), conic-gradient(var(--gold) calc(var(--p) * 360deg), var(--soft) 0); }
.radar-btn { position: relative; overflow: hidden; }
.radar-btn.locating::before { content: ""; position: absolute; inset: -60%; background: conic-gradient(from 0deg, transparent 0 75%, color-mix(in oklab, var(--brand) 35%, transparent) 100%); animation: radar-spin 1.4s linear infinite; }
.radar-btn.locating::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 999px; border: 2px solid var(--brand); animation: radar-ping 1.4s ease-out infinite; }
@keyframes radar-spin { to { transform: rotate(360deg); } }
@keyframes radar-ping { from { transform: scale(1); opacity: 1; } to { transform: scale(9); opacity: 0; } }

/* ---------- assistant typing dots ---------- */
.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 999px; background: var(--brand); animation: typing 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 50% { opacity: .35; transform: translateY(-4px); } }

.magnetic { transition: transform .25s var(--ease), box-shadow .25s, background .2s; will-change: transform; }


/* ---------- header: hide on scroll down, slide back on scroll up ---------- */
.topbar { transition: transform .35s var(--ease), opacity .35s var(--ease); will-change: transform; }
.public .topbar.nav-hidden { transform: translateY(calc(-100% - 14px)); opacity: 0; pointer-events: none; }
@media (max-width: 1239px) { .office .topbar.nav-hidden { transform: translateY(calc(-100% - 14px)); opacity: 0; pointer-events: none; } }
/* desktop office sidebar is position:fixed inside .topbar — any transform/will-change on .topbar would trap it in a 0px box */
.topbar.scrolled .topbar-inner { box-shadow: var(--shadow-lg); }
@media (min-width: 1240px) {
  .office .topbar { will-change: auto; transform: none !important; transition: none; }
  .office .topbar.scrolled .topbar-inner { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .topbar { transition: none; } }

@media (prefers-reduced-motion: reduce) {
  .hero.hero-dark::before, .hero-symbol, .hero-word, .badge.inspected::before, .scanner::after, .scanner li, .verified-seal, .pin-price { animation: none !important; }
  html.js .scanner-wrap:not(.run) .scanner li, html.js .scanner-wrap:not(.run) .verified-seal { opacity: 1; }
  .scanner::after { transform: none; }
  ::view-transition-group(*), ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
