/* ============================================================
   Forvalt Landing — ported from Welcor base, rebranded.
   Clean & trustworthy: navy accent on cream/off-white.
   Pure vanilla CSS. Light theme default + optional dark toggle.
   ============================================================ */
:root {
  /* ---- Forvalt brand palette ---- */
  --navy-900: #122836;   /* darkest — headlines, text */
  --navy-800: #173952;   /* primary accent */
  --navy-600: #2C4D66;   /* secondary accent, links */
  --sand-500: #D8C8B0;   /* borders, muted detail */
  --cream-200: #EDDECC;  /* soft card / section bg */
  --cream-50:  #F1EBE5;  /* page background */
  --white:     #ffffff;

  /* ---- Type ---- */
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.2,.7,.2,1);

  /* ---- Theme tokens (LIGHT default) ---- */
  --bg: var(--cream-50);
  --bg-elev: var(--white);
  --fg: var(--navy-900);
  --fg-muted: #5d6b75;
  --accent: var(--navy-800);
  --accent-ink: var(--cream-50);
  --card: var(--white);
  --card-line: rgba(18, 40, 54, 0.12);
  --card-line-strong: rgba(18, 40, 54, 0.22);
}

/* ---- Dark theme (toggle) ---- */
[data-theme="dark"] {
  --bg: var(--navy-900);
  --bg-elev: var(--navy-800);
  --fg: var(--cream-50);
  --fg-muted: #a9bbc9;
  --accent: var(--sand-500);
  --accent-ink: var(--navy-900);
  --card: rgba(255, 255, 255, 0.04);
  --card-line: rgba(255, 255, 255, 0.10);
  --card-line-strong: rgba(255, 255, 255, 0.20);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--fg);
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ Shell ============ */
.shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .wrap { padding: 0 20px; } }

/* ============ Nav ============ */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  position: relative;
}
.brand-mark {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  transition: transform .4s var(--ease);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.08); }
/* Wordmark: hidden by default, slides in smoothly on hover/focus */
.brand-word {
  font-family: "Century Gothic", "Futura", "Trebuchet MS", sans-serif;
  font-weight: 700; font-size: 19px; letter-spacing: 0.01em;
  text-transform: lowercase; color: var(--accent);
  display: inline-block; overflow: hidden; white-space: nowrap;
  max-width: 0; opacity: 0; margin-left: -8px;
  transition:
    max-width .45s var(--ease),
    opacity .35s var(--ease),
    margin-left .35s var(--ease);
}
.brand:hover .brand-word,
.brand:focus-visible .brand-word {
  max-width: 160px; opacity: 1; margin-left: 0;
}
/* Touch devices have no hover — always show the wordmark so mobile users see the brand */
@media (hover: none) {
  .brand-word { max-width: 160px; opacity: 1; margin-left: 0; }
}

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 14px; color: var(--fg-muted);
  transition: color .2s var(--ease);
}
.nav-links a:hover { color: var(--fg); }
@media (max-width: 720px) { .nav-links a:not(.btn) { display: none; } }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  transition: transform .15s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), filter .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #D8C8B0; }
.btn-primary:hover { filter: brightness(1.08); }
/* Dark mode: button bg becomes sand, so keep navy text for contrast */
[data-theme="dark"] .btn-primary { color: var(--accent-ink); }
/* Nav primary button: override .nav-links a (higher specificity) so the text color sticks */
.nav-links a.btn-primary,
.nav-links a.btn-primary:hover { color: #D8C8B0; }
[data-theme="dark"] .nav-links a.btn-primary,
[data-theme="dark"] .nav-links a.btn-primary:hover { color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--card-line); }
.btn-ghost:hover { border-color: var(--fg-muted); }

/* ============ Hero ============ */
.hero { padding: 56px 0 24px; position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px;
  align-items: center;
}
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--card-line); background: var(--card);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: #22b573; position: relative;
  animation: heartbeat 1.6s ease-in-out infinite;
}
.eyebrow .dot::before {
  content: ''; position: absolute; inset: 0; border-radius: 999px;
  background: #22b573; animation: heartbeatRing 1.6s ease-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.25); }
  40% { transform: scale(1); }
  60% { transform: scale(1.18); }
  80% { transform: scale(1); }
}
@keyframes heartbeatRing {
  0% { transform: scale(1); opacity: .55; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* Headlines */
.h-display {
  font-size: clamp(42px, 6vw, 80px);
  line-height: 0.99; letter-spacing: -0.035em;
  margin: 22px 0 20px; font-weight: 600;
  text-wrap: balance;
}
.h-display .accent {
  color: var(--accent); font-style: italic;
  font-family: var(--font-display); font-weight: 400;
  letter-spacing: -0.02em;
}
.lede {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55; color: var(--fg-muted);
  max-width: 52ch; margin: 0 0 32px;
  text-wrap: pretty;
}

/* Waitlist form */
.waitlist {
  display: flex; gap: 8px; align-items: center;
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: 999px; padding: 6px 6px 6px 18px;
  max-width: 460px;
}
.waitlist input {
  flex: 1; border: 0; background: transparent; outline: none;
  color: var(--fg); font: inherit; font-size: 15px; padding: 11px 0;
}
.waitlist input::placeholder { color: var(--fg-muted); }
.waitlist .btn-primary { padding: 12px 18px; white-space: nowrap; }
.waitlist-status {
  margin-top: 12px; font-size: 14px; min-height: 20px;
  color: var(--fg-muted);
}
.waitlist-status.ok { color: var(--accent); font-weight: 600; }
.waitlist-status.err { color: #c0392b; }
.waitlist-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; font-size: 13px; color: var(--fg-muted);
}

.waitlist-proof {
  margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--accent);
}

/* ============ Hero illustration ============ */
.hero-art {
  position: relative; aspect-ratio: 1 / 1;
  width: 100%; max-width: 520px; margin-left: auto;
  display: grid; place-items: center;
}
.hero-logo {
  width: 64%; height: auto; filter: drop-shadow(0 24px 50px rgba(18,40,54,0.18));
  animation: floatY 6s ease-in-out infinite;
}
.float-card {
  position: absolute;
  background: var(--bg-elev);
  border: 1px solid var(--card-line);
  border-radius: 16px; padding: 12px 14px; font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 14px 36px rgba(18,40,54,0.12);
  animation: floatY 4.6s ease-in-out infinite;
}
.float-card .ico {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 15px; flex-shrink: 0;
}
.float-card .meta { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.float-card .meta b { font-weight: 600; }
.float-card .meta span { color: var(--fg-muted); font-size: 11px; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.fc-1 { top: 4%; left: -2%; animation-delay: 0s; }
.fc-2 { top: 40%; right: -4%; animation-delay: 1.2s; }
.fc-3 { bottom: 4%; left: 8%; animation-delay: 2.4s; }
/* Keep the floating cards visible on mobile — just smaller and tucked in-bounds */
@media (max-width: 520px) {
  .float-card { font-size: 11px; padding: 8px 10px; gap: 8px; }
  .float-card .ico { width: 26px; height: 26px; font-size: 13px; }
  .float-card .meta span { font-size: 10px; }
  .fc-1 { top: 0; left: 0; }
  .fc-2 { top: 44%; right: 0; }
  .fc-3 { bottom: 0; left: 2%; }
}

/* ============ Scroll-triggered animations ============ */
.anim-ready [data-anim] {
  opacity: 0; will-change: transform, opacity, filter;
  transition:
    opacity 1.1s var(--ease) var(--anim-delay, 0ms),
    transform 1.25s var(--ease) var(--anim-delay, 0ms),
    filter 1.1s var(--ease) var(--anim-delay, 0ms);
}
.anim-ready [data-anim="up"]    { transform: translateY(46px); filter: blur(6px); }
.anim-ready [data-anim="up-sm"] { transform: translateY(26px); filter: blur(4px); }
.anim-ready [data-anim="fade"]  { filter: blur(8px); }
.anim-ready [data-anim="scale"] { transform: scale(.94); filter: blur(6px); }
.anim-ready [data-anim].is-in {
  opacity: 1; transform: none; filter: blur(0);
}
.rm-on [data-anim] { opacity: 1 !important; transform: none !important; filter: none !important; }

/* ============ Trust strip — infinite marquee ============ */
.trust {
  border-top: 1px solid var(--card-line);
  border-bottom: 1px solid var(--card-line);
  padding: 22px 0; margin-top: 72px;
  color: var(--fg-muted); font-size: 13px;
  position: relative; overflow: hidden;
  --trust-fade: 80px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--trust-fade), #000 calc(100% - var(--trust-fade)), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 var(--trust-fade), #000 calc(100% - var(--trust-fade)), transparent 100%);
}
.trust-track {
  display: flex; align-items: center; gap: 48px;
  width: max-content; animation: trustScroll 30s linear infinite;
}
.trust:hover .trust-track { animation-play-state: paused; }
.trust-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; color: var(--fg); white-space: nowrap; flex-shrink: 0;
}
.trust-pill svg { color: var(--accent); flex-shrink: 0; }
.trust-sep { width: 4px; height: 4px; border-radius: 999px; background: var(--accent); opacity: .5; flex-shrink: 0; }
@keyframes trustScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .trust-track { animation: none; } }

/* ============ Demo section ============ */
.demo { padding: 100px 0 110px; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-eyebrow {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 16px;
}
.section-title {
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.03; letter-spacing: -0.03em;
  margin: 0 0 16px; font-weight: 600; text-wrap: balance;
}
.section-title em {
  font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--accent);
}
.section-sub { color: var(--fg-muted); font-size: 17px; line-height: 1.55; text-wrap: pretty; }

.demo-stage {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center;
}
@media (max-width: 960px) { .demo-stage { grid-template-columns: 1fr; gap: 40px; } }
.demo-side h3 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 12px; font-weight: 600; }
.demo-side p { color: var(--fg-muted); margin: 0 0 24px; line-height: 1.55; max-width: 44ch; }
.demo-hint {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--fg-muted);
  padding: 8px 12px; border-radius: 10px;
  background: var(--cream-200); border: 1px solid var(--card-line);
}
[data-theme="dark"] .demo-hint { background: var(--card); }

/* Phone */
.phone {
  width: 330px; max-width: 100%; margin: 0 auto;
  background: var(--bg-elev); border: 1px solid var(--card-line);
  border-radius: 38px; padding: 16px 14px 22px; position: relative;
  box-shadow: 0 30px 60px -20px rgba(18,40,54,0.28), 0 8px 20px -6px rgba(18,40,54,0.15);
}
.phone::before {
  content: ''; position: absolute; top: 14px; left: 50%;
  transform: translateX(-50%); width: 100px; height: 22px;
  border-radius: 999px; background: var(--bg);
}
.phone-screen {
  margin-top: 26px; background: var(--bg);
  border-radius: 24px; padding: 14px 12px; height: 560px;
  display: flex; flex-direction: column;
}
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 4px 12px; border-bottom: 1px solid var(--card-line); margin-bottom: 12px;
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 999px;
  background: var(--cream-50);
  border: 1px solid var(--card-line-strong);
  display: grid; place-items: center; overflow: hidden;
  flex-shrink: 0;
}
.chat-avatar img { width: 78%; height: 78%; object-fit: contain; display: block; }
.chat-header .who { font-size: 14px; font-weight: 600; }
.chat-header .status { font-size: 11px; color: var(--fg-muted); display: inline-flex; align-items: center; gap: 6px; }
.chat-header .status::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: #2ecc71; }
.chat-channel {
  margin-left: auto; font-size: 10px; padding: 4px 8px;
  border-radius: 999px; border: 1px solid var(--card-line);
  color: var(--fg-muted); letter-spacing: 0.06em; text-transform: uppercase;
}
.chat-lang {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 2px 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--card-line);
}
.lang-pill {
  appearance: none; cursor: pointer; font-family: inherit;
  font-size: 11px; font-weight: 500; line-height: 1;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--card-line); background: transparent;
  color: var(--fg-muted); transition: all .2s var(--ease);
}
.lang-pill:hover { border-color: var(--fg-muted); color: var(--fg); }
.lang-pill.is-active {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.chat-body {
  flex: 1 1 0; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 2px; overflow-y: auto; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--card-line) transparent;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--card-line); border-radius: 4px; }
.bubble {
  max-width: 82%; padding: 10px 13px; border-radius: 16px;
  font-size: 13.5px; line-height: 1.4; animation: bubbleIn .4s var(--ease);
  white-space: pre-wrap; word-wrap: break-word;
}
.bubble.bot {
  align-self: flex-start;
  background: var(--cream-200); color: var(--navy-900);
  border-bottom-left-radius: 4px;
}
[data-theme="dark"] .bubble.bot { background: var(--card); color: var(--fg); }
.bubble.user {
  align-self: flex-end; background: var(--accent); color: var(--accent-ink);
  border-bottom-right-radius: 4px;
}
.bubble.system { align-self: center; font-size: 11px; color: var(--fg-muted); background: transparent; padding: 4px 8px; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.typing {
  align-self: flex-start; background: var(--cream-200);
  border-radius: 16px; border-bottom-left-radius: 4px;
  padding: 12px 14px; display: inline-flex; gap: 4px;
}
[data-theme="dark"] .typing { background: var(--card); }
.typing i {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--fg-muted); display: inline-block; animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

.chat-input {
  margin-top: 8px; display: flex; align-items: center; gap: 8px;
  padding: 6px 6px 6px 14px; border: 1px solid var(--card-line);
  border-radius: 999px; background: var(--bg-elev);
}
.chat-input input {
  flex: 1; border: 0; background: transparent; outline: none;
  color: var(--fg); font: inherit; font-size: 13px; padding: 6px 0;
}
.chat-input input::placeholder { color: var(--fg-muted); }
.chat-input input:disabled { opacity: .5; }
.chat-input .send {
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 15px; border: 0; flex-shrink: 0;
}
.chat-input .send:disabled { opacity: .5; cursor: not-allowed; }
.chat-limit { text-align: center; font-size: 11px; color: var(--fg-muted); margin-top: 8px; }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--card-line); padding: 64px 0 40px; background: var(--bg); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 56px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-muted); margin: 0 0 16px; font-weight: 600;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer ul a, .footer ul li {
  font-size: 14px; color: var(--fg); display: inline-flex; align-items: center; gap: 8px;
}
.footer ul a:hover { color: var(--accent); }
.footer ul li svg { color: var(--fg-muted); flex-shrink: 0; }
.footer-slogan {
  font-family: var(--font-display); font-style: italic;
  font-size: 18px; line-height: 1.35; color: var(--fg); margin: 18px 0 0; max-width: 24ch;
}
.footer-slogan b { font-style: normal; font-family: var(--font-sans); font-weight: 600; color: var(--accent); }
.footer-tag { font-size: 14px; color: var(--fg-muted); line-height: 1.55; margin: 12px 0 0; max-width: 32ch; }
.footer-bottom {
  display: flex; justify-content: flex-end; align-items: center;
  padding-top: 28px; border-top: 1px solid var(--card-line);
  font-size: 13px; color: var(--fg-muted); flex-wrap: wrap; gap: 16px;
}

/* ============ Scroll progress bar ============ */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
  z-index: 60; pointer-events: none;
  box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 60%, transparent);
}
@media (prefers-reduced-motion: reduce) { .scroll-progress { display: none; } }

/* ============ Theme toggle ============ */
.theme-toggle {
  appearance: none; background: transparent;
  border: 1px solid var(--card-line); border-radius: 999px;
  padding: 4px; display: inline-flex; align-items: center; cursor: pointer;
  transition: border-color .2s var(--ease);
}
.theme-toggle:hover { border-color: var(--fg-muted); }
.theme-toggle-track {
  width: 46px; height: 24px; border-radius: 999px; position: relative;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
}
.theme-toggle-thumb {
  position: absolute; top: 2px; width: 20px; height: 20px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; left: 2px;
  transition: left .35s var(--ease), background-color .25s var(--ease);
}
[data-theme="dark"] .theme-toggle-thumb { left: 24px; }
