/* Homepage. Loads after landing.css (base styles) and pricing-cards.css. */

/* Darker secondary text so small gray text passes 4.5:1. */
:root {
  --ink-faint: #5a716a;
}

/* ---------- Header and mobile menu ---------- */
.fp .site-nav { position: sticky; top: 0; z-index: 50; }
.fp-menu-button { display: none; width: 44px; height: 44px; border-radius: 10px; align-items: center; justify-content: center; color: var(--ink); }
.fp-menu-button:hover { background: var(--surface-subtle); }
.fp-menu-button:focus-visible, .chat-item:focus-visible, .chat-switch-btn:focus-visible, .m-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fp-menu-close { display: none; }
.fp-menu-button[aria-expanded="true"] .fp-menu-open { display: none; }
.fp-menu-button[aria-expanded="true"] .fp-menu-close { display: inline; }
.fp-menu-only { display: none; }

@media (max-width: 768px) {
  .fp .nav-inner { position: relative; }
  .fp .nav-menu { display: none; position: absolute; top: 100%; left: -24px; right: -24px; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); }
  .fp .nav-menu.is-open { display: flex; }
  .fp .nav-menu .nav-link { display: block; padding: 14px 8px; font-size: 16px; border-bottom: 1px solid var(--line-subtle); }
  .fp .nav-menu .nav-link:last-child { border-bottom: 0; }
  .fp-menu-only { display: block; }
  .fp-desktop-only { display: none; }
  .fp-menu-button { display: inline-flex; }
}
@media (max-width: 640px) {
  .fp .nav-inner { flex-wrap: nowrap; }
  .fp .nav-actions { width: auto; }
  .fp .nav-actions .btn { padding: 10px 12px; font-size: 13px; }
}
@media (max-width: 400px) {
  .fp .nav-inner { gap: 8px; }
  .fp .nav-actions { gap: 4px; }
  .fp-menu-button { width: 40px; }
}
@media (max-width: 360px) {
  .fp .nav-inner { gap: 6px; }
  .fp .brand-wordmark { width: 92px; height: 30px; }
  .fp .nav-actions .btn { padding: 9px 9px; font-size: 12px; }
  .fp-menu-button { width: 38px; }
}

/* ---------- Hero (original headline and globe from landing.css) ---------- */
.fp .fp-hero-globe { min-height: 640px; padding: 56px 0 56px; }
.fp .hero-actions { margin-bottom: 0; }
.fp .hero-trial { font-size: 14px; color: var(--ink-muted); }
.fp-safety { margin-top: 22px; display: flex; align-items: flex-start; gap: 8px; max-width: 560px; font-size: 13.5px; color: var(--ink-muted); }
.fp-safety svg { flex: none; margin-top: 2px; color: var(--accent); }
@media (max-width: 640px) { .fp .fp-hero-globe { min-height: 0; padding: 36px 0 40px; } }

/* ---------- Chat mockup ---------- */
.fp-demo { padding: 20px 0 72px; }
.fp-noscript { text-align: center; color: var(--ink-muted); }

.chat {
  --c-bg: #faf9f5; --c-side: #f3f1ea; --c-line: #e6e2d7; --c-ink: #1f1e1d; --c-muted: #6b675e;
  --c-user: #efece3; --c-send: #c96442; --c-send-ink: #fff; --c-card: #ffffff; --c-hover: #ebe8de;
  --c-font: ui-serif, Georgia, Cambria, 'Times New Roman', serif;
  max-width: 1080px; margin: 0 auto; border-radius: 18px; overflow: hidden;
  background: var(--c-bg); color: var(--c-ink); border: 1px solid var(--c-line);
  box-shadow: 0 30px 80px rgba(19, 39, 34, 0.12), 0 2px 6px rgba(19, 39, 34, 0.05);
  transition: background-color .3s, color .3s;
}
.chat[data-theme="chatgpt"] {
  --c-bg: #ffffff; --c-side: #f9f9f9; --c-line: #ececec; --c-ink: #0d0d0d; --c-muted: #5d5d5d;
  --c-user: #f1f1f1; --c-send: #0d0d0d; --c-send-ink: #fff; --c-card: #ffffff; --c-hover: #ececec;
  --c-font: var(--font-sans);
}
.chat-top { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--c-line); background: var(--c-bg); }
.chat-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--c-side); border: 1px solid var(--c-line); }
.chat-switch-btn { padding: 6px 14px; min-height: 32px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--c-muted); }
.chat-switch-btn.is-on { background: var(--c-card); color: var(--c-ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.chat-top-title { flex: 1; font-size: 14px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-connector { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--c-muted); padding: 5px 10px; border: 1px solid var(--c-line); border-radius: 999px; }
.chat-connector-dot { width: 7px; height: 7px; border-radius: 50%; background: #22a06b; }

.chat-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 640px; }
.chat-side { background: var(--c-side); border-right: 1px solid var(--c-line); padding: 14px 10px; overflow-y: auto; }
.chat-side-label { font-size: 12px; font-weight: 600; color: var(--c-muted); padding: 2px 10px 8px; }
.chat-list { display: flex; flex-direction: column; gap: 2px; }
.chat-item { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px 10px; border-radius: 9px; color: var(--c-ink); }
.chat-item:hover { background: var(--c-hover); }
.chat-item.is-active { background: var(--c-hover); }
.chat-item-title { font-size: 13.5px; font-weight: 600; }
.chat-item-ask { font-size: 12.5px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 28px clamp(16px, 4vw, 48px) 24px; scroll-behavior: smooth; }
.chat-scroll:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.msg { max-width: 680px; margin: 0 auto; }
.msg-user { display: flex; justify-content: flex-end; margin-bottom: 22px; animation: fp-fade .35s ease both; }
.msg-bubble { max-width: 80%; background: var(--c-user); padding: 10px 16px; border-radius: 18px; font-size: 15px; line-height: 1.5; }
.chat[data-theme="claude"] .msg-bubble { border-radius: 14px; }
.msg-ai { font-family: var(--c-font); font-size: 16px; line-height: 1.65; display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.chat[data-theme="chatgpt"] .msg-ai { font-size: 15.5px; }

.m-p strong { font-weight: 700; }
.m-h { font-family: var(--font-sans); font-size: 15px; font-weight: 700; margin-top: 4px; }
.m-ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* tool call line */
.m-tool { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: 13px; color: var(--c-muted); padding: 6px 12px 6px 8px; border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-card); }
.chat[data-theme="chatgpt"] .m-tool { border: 0; padding-left: 0; background: transparent; }
.m-tool code { font-family: var(--font-mono); font-size: 12px; color: var(--c-ink); }
.m-tool-icon { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--c-line); border-top-color: var(--accent); animation: fp-spin .8s linear infinite; }
.m-tool.is-done .m-tool-icon { animation: none; border: 0; background: var(--accent-soft); position: relative; }
.m-tool.is-done .m-tool-icon::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--accent); }
.m-tool-chev { color: var(--c-muted); }
.chat[data-theme="claude"] .t-chatgpt, .chat[data-theme="chatgpt"] .t-claude { display: none; }

/* KPI tiles */
.m-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-family: var(--font-sans); }
.m-kpi { background: var(--c-card); border: 1px solid var(--c-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.m-kpi-label { font-size: 12.5px; color: var(--c-muted); }
.m-kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.m-delta { font-size: 12.5px; font-weight: 700; }
.m-delta.up { color: #157a52; }
.m-delta.down { color: #b42318; }

/* tables */
.m-table-wrap { overflow-x: auto; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-card); }
.m-table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: 14px; }
.m-table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--c-muted); padding: 9px 14px; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
.m-table td { padding: 9px 14px; border-bottom: 1px solid var(--c-line); }
.m-table tr:last-child td { border-bottom: 0; }
.m-table td:first-child { font-weight: 600; }

/* charts */
.cv { background: var(--c-card); border: 1px solid var(--c-line); border-radius: 12px; padding: 14px 14px 8px; font-family: var(--font-sans); }
.cv-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-bottom: 8px; }
.cv-title { font-size: 13.5px; font-weight: 700; }
.cv-legend, .m-stack-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--c-muted); }
.cv-key { display: inline-flex; align-items: center; gap: 6px; }
.cv-swatch { width: 10px; height: 10px; border-radius: 3px; }
.cv-box { width: 100%; min-height: 40px; }
.cv-box svg { display: block; overflow: visible; }
.cv-grid { stroke: var(--c-line); stroke-width: 1; }
.cv-axis { font-size: 11.5px; fill: var(--c-muted); }
.cv-label { font-size: 13px; fill: var(--c-ink); font-weight: 600; }
.cv-value { font-size: 12.5px; font-weight: 700; }
.cv-value.r-risk { fill: #b42318; } .cv-value.r-warn { fill: #9a5b00; } .cv-value.r-ok { fill: #157a52; }
.cv-track { fill: var(--c-side); }
.cv-hbar.r-risk { fill: #e5484d; } .cv-hbar.r-warn { fill: #f0a830; } .cv-hbar.r-ok { fill: #3a9b74; }
.cv-marker { stroke: var(--c-ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.cv-marker-label { font-size: 11.5px; font-weight: 700; fill: var(--c-ink); }
.cv-area { fill: rgba(23, 102, 78, 0.10); }
.cv-line { fill: none; stroke: #17664e; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.cv-dot { fill: #17664e; stroke: var(--c-card); stroke-width: 2; }
.cv-callout { font-size: 12px; font-weight: 700; fill: var(--c-ink); }
.s-a { fill: #17664e; background: #17664e; }
.s-b { fill: #a8d5c2; background: #a8d5c2; }
.s-c { fill: #e3a33b; background: #e3a33b; }
.s-d { fill: #d9dedb; background: #d9dedb; }

/* stacked share bar */
.m-stack { font-family: var(--font-sans); display: flex; flex-direction: column; gap: 10px; }
.m-stack-bar { display: flex; height: 18px; border-radius: 6px; overflow: hidden; gap: 2px; }
.m-seg { display: block; height: 100%; flex-basis: 0; }
.w31 { flex-grow: 31; } .w16 { flex-grow: 16; } .w11 { flex-grow: 11; } .w42 { flex-grow: 42; }

/* findings */
.m-findings { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.m-finding { display: flex; gap: 10px; align-items: baseline; }
.m-finding-text strong { font-family: var(--font-sans); font-size: .95em; }
.m-badge { flex: none; font-family: var(--font-sans); font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; min-width: 52px; text-align: center; }
.b-good { background: #e3f4ea; color: #12643f; }
.b-watch { background: #fdf0d5; color: #7a4a00; }
.b-act { background: #fde5e3; color: #9b1c13; }

/* product photos (before / after) */
.m-photos { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-family: var(--font-sans); }
.m-photo { position: relative; border: 1px solid var(--c-line); border-radius: 12px; overflow: hidden; background: var(--c-card); }
.m-photo img { display: block; width: 100%; height: auto; }
.m-photo-label { position: absolute; top: 8px; left: 8px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.92); color: var(--c-ink); }

/* confirm card */
.m-confirm { font-family: var(--font-sans); background: var(--c-card); border: 1px solid var(--c-line); border-radius: 14px; overflow: hidden; }
.m-confirm-head { display: flex; flex-direction: column; padding: 12px 16px; border-bottom: 1px solid var(--c-line); }
.m-confirm-label { font-size: 12px; font-weight: 700; color: var(--c-muted); }
.m-confirm .m-table td, .m-confirm .m-table th { padding-inline: 16px; }
.m-old { color: var(--c-muted); text-decoration: line-through; }
.m-new { font-weight: 700; color: #157a52; }
.m-confirm-note { margin: 0; padding: 10px 16px; font-size: 13.5px; background: #fdf6e7; color: #6b4200; border-top: 1px solid var(--c-line); }
.m-confirm-actions { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--c-line); }
.m-btn { min-height: 40px; padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; border: 1px solid var(--c-line); color: var(--c-ink); background: var(--c-card); }
.m-btn-primary { background: var(--c-send); color: var(--c-send-ink); border-color: var(--c-send); }
.m-btn:hover { filter: brightness(.96); }
.m-confirm-done { font-size: 14px; font-weight: 700; color: var(--c-muted); padding: 9px 0; }
.m-confirm-done.ok { color: #157a52; }

/* composer */
.chat-composer { margin: 0 clamp(12px, 4vw, 48px) 16px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border: 1px solid var(--c-line); border-radius: 18px; background: var(--c-card); box-shadow: 0 2px 10px rgba(0,0,0,.04); max-width: 728px; width: calc(100% - 2 * clamp(12px, 4vw, 48px)); align-self: center; }
.chat[data-theme="chatgpt"] .chat-composer { border-radius: 28px; }
.chat-plus { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--c-line); color: var(--c-muted); font-size: 18px; line-height: 1; }
.chat-placeholder { flex: 1; color: var(--c-muted); font-size: 15px; }
.chat[data-theme="claude"] .chat-placeholder::before { content: attr(data-claude); }
.chat[data-theme="chatgpt"] .chat-placeholder::before { content: attr(data-chatgpt); }
.chat-send { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--c-send); color: var(--c-send-ink); }
.chat[data-theme="chatgpt"] .chat-send { border-radius: 50%; }

/* motion */
.reveal { animation: fp-fade .45s ease both; }
.cv-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: fp-grow-y .7s cubic-bezier(.2,.7,.2,1) both; }
.cv-hbar { transform-box: fill-box; transform-origin: 0 50%; animation: fp-grow-x .8s cubic-bezier(.2,.7,.2,1) both; }
.cv-line { stroke-dasharray: 1; animation: fp-draw 1.2s ease both; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .1s; } .d3 { animation-delay: .15s; } .d4 { animation-delay: .2s; }
.d5 { animation-delay: .25s; } .d6 { animation-delay: .3s; } .d7 { animation-delay: .35s; } .d8 { animation-delay: .4s; } .d9 { animation-delay: .45s; }
.no-anim .reveal, .no-anim.chat-scroll .msg-user, .no-anim .cv-bar, .no-anim .cv-hbar, .no-anim .cv-line, .no-anim.cv-box .cv-bar, .no-anim.cv-box .cv-hbar, .no-anim.cv-box .cv-line { animation: none; }
@keyframes fp-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fp-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fp-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fp-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .reveal, .cv-bar, .cv-hbar, .cv-line, .msg-user, .m-tool-icon { animation: none !important; }
  .chat-scroll { scroll-behavior: auto; }
}

/* chat on tablets and phones: recents become a row of chips above the conversation */
@media (max-width: 860px) {
  .chat-body { grid-template-columns: minmax(0, 1fr); height: auto; }
  .chat-side, .chat-main { min-width: 0; }
  .chat-side { border-right: 0; border-bottom: 1px solid var(--c-line); padding: 10px 0; overflow: visible; }
  .chat-side-label { display: none; }
  .chat-list { flex-direction: row; overflow-x: auto; gap: 8px; padding: 0 12px; scrollbar-width: none; }
  .chat-list::-webkit-scrollbar { display: none; }
  .chat-item { flex: none; border: 1px solid var(--c-line); border-radius: 999px; padding: 8px 14px; min-height: 40px; background: var(--c-card); justify-content: center; }
  .chat-item.is-active { background: var(--c-ink); color: var(--c-bg); border-color: var(--c-ink); }
  .chat-item-ask { display: none; }
  .chat-scroll { min-height: 560px; overflow: visible; padding: 22px 16px 16px; }
  .chat-top-title { display: none; }
  .chat-top { justify-content: space-between; }
}
@media (max-width: 520px) {
  .chat { border-radius: 14px; }
  .chat-connector { font-size: 0; gap: 0; padding: 7px; }
  .chat-connector::after { content: 'Connected'; font-size: 12px; margin-left: 6px; }
  .msg-ai { font-size: 15.5px; }
  .m-kpis { grid-template-columns: 1fr 1fr; }
  .m-kpi:first-child { grid-column: 1 / -1; }
  .m-kpi-value { font-size: 19px; }
  .m-table { font-size: 13.5px; }
  .m-table th, .m-table td { padding: 8px 10px; }
  .chat-composer { margin-bottom: 12px; }
}
/* Narrowest phones: the connection pill shows only its green dot. */
@media (max-width: 380px) {
  .chat-top { gap: 8px; padding-inline: 10px; }
  .chat-connector { padding: 9px; }
  .chat-connector::after { content: none; }
  .chat-switch-btn { padding-inline: 12px; }
}

/* ---------- Platforms ---------- */
.fp .soon-badge { color: #4e655e; background: #eef2f0; }
@media (max-width: 640px) {
  .fp .platforms-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .fp .platforms-row .platform-card { display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 8px; row-gap: 6px; padding: 10px 8px; font-size: 14px; }
  .fp .platforms-row .platform-card > :last-child { grid-column: 1 / -1; justify-self: center; }
}

/* ---------- Three steps ---------- */
.fp-steps { padding: 88px 0; background: var(--surface-subtle); }
.fp-steps-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 1040px; margin: 0 auto; }
.fp-step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; }
.fp-step-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; margin-bottom: 14px; }
.fp-step h3 { font-size: 18px; letter-spacing: -0.02em; margin-bottom: 6px; }
.fp-step p { color: var(--ink-muted); font-size: 15px; }
.fp-steps-cta { display: flex; justify-content: center; margin-top: 32px; }
@media (max-width: 860px) {
  .fp-steps-list { grid-template-columns: 1fr; max-width: 540px; gap: 12px; }
  .fp-steps { padding: 64px 0; }
  .fp-step { display: grid; grid-template-columns: 34px 1fr; column-gap: 14px; padding: 18px; }
  .fp-step-num { grid-row: span 2; margin-bottom: 0; }
}

/* ---------- Other sections ---------- */
.fp .section-head { margin-bottom: 40px; }
.fp .privacy-box h3 { font-size: 16px; margin-bottom: 8px; letter-spacing: -0.01em; }
.js .fp .currency-picker button[type="submit"] { display: none; }
.fp .benefits-section, .fp .pricing-section, .fp .privacy-section, .fp .faq-section { scroll-margin-top: 80px; }
#workflows, #how-it-works, #pricing { scroll-margin-top: 80px; }
@media (max-width: 768px) {
  .fp .footer-links a { display: inline-block; padding: 10px 0; }
  .fp .footer-links { gap: 0; }
}

/* ---------- Faint three.js backgrounds (ambient-scenes.js) ---------- */
.fp-has-ambient { position: relative; overflow: hidden; }
.fp-has-ambient > :not(.fp-ambient) { position: relative; z-index: 1; }
.fp-ambient { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
@media (prefers-reduced-motion: reduce) { .fp-ambient { display: none; } }
