/* LSA demo — visual system aligned to demo.cra-srl.com (light, Inter + JetBrains Mono,
   single-column max-1100px, card-deck). LSA accent = steel-cyan (distinct from the
   red/blue/purple of the sibling apps). */

/* Metric-matched fallbacks so web-font load causes ~no reflow (CLS fix). */
@font-face {
  font-family: "InterFallback";
  src: local("Arial");
  ascent-override: 90.20%;
  descent-override: 22.48%;
  line-gap-override: 0.00%;
  size-adjust: 107.40%;
}
@font-face {
  font-family: "MonoFallback";
  src: local("Consolas"), local("Menlo"), local("Courier New");
  ascent-override: 80%;
  descent-override: 20%;
  line-gap-override: 0%;
  size-adjust: 100%;
}

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-2: #F4F4F0;
  --border: #E5E5E0;
  --text: #1A1A1A;
  --muted: #6B6B6B;
  --faint: #9A9A9A;
  --success: #16a34a;
  --brand-red: #D32F2F;
  --accent: #0E7490;
  --accent-dark: #155E75;
  --accent-soft: #ECFEFF;
  --radius: 18px;
  --radius-sm: 10px;
  --maxw: 1100px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
  --mono: "JetBrains Mono", "MonoFallback", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", "InterFallback", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
a { color: var(--accent-dark); text-decoration: none; }
code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .08em .4em;
}

/* ---- Nav ---- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 250, 248, .78);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--brand-red); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.brand-word { letter-spacing: .02em; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: 14px; }
.nav-links a:hover { color: var(--text); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: .16s ease;
}
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ---- Hero ---- */
.hero { padding: 86px 0 64px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px;
  font-weight: 600; color: var(--accent-dark); margin: 0 0 14px;
}
h1 {
  font-size: clamp(34px, 5vw, 52px); line-height: 1.06;
  letter-spacing: -.03em; font-weight: 800; margin: 0 0 20px; max-width: 16ch;
}
.accent { color: var(--accent); }
.lead { font-size: clamp(17px, 2.1vw, 20px); color: var(--muted); max-width: 62ch; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions.center { justify-content: center; }
.hero-meta { margin-top: 20px; font-size: 13.5px; color: var(--faint); }

/* ---- Sections ---- */
.section { padding: 64px 0; }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -.02em; font-weight: 800; margin: 6px 0 8px; max-width: 22ch; }
.section-lead { color: var(--muted); max-width: 64ch; margin: 8px 0 28px; }
.section-lead.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---- Feature cards ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 18px; margin-top: 26px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(16,24,40,.09); }
.card-icon { font-size: 26px; margin-bottom: 12px; }
.card h3 { margin: 0 0 6px; font-size: 17.5px; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---- Demo ---- */
.proj-tabs { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 24px; }
.proj-tab {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 9px 18px;
  transition: .16s ease;
}
.proj-tab:hover { color: var(--text); border-color: var(--accent); }
.proj-tab[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.demo-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }

.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); position: sticky; top: 86px; min-height: 520px; }
.pc-name { font-family: var(--mono); font-weight: 600; font-size: 15px; color: var(--accent-dark); }
.pc-title { font-size: 18px; font-weight: 700; margin: 4px 0 2px; }
.pc-type { font-size: 13px; color: var(--faint); margin-bottom: 16px; }
.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.pc-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.pc-stat b { display: block; font-size: 19px; font-weight: 800; color: var(--text); }
.pc-stat span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.pc-section-t { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 14px 0 6px; font-weight: 600; }
.pc-list { list-style: none; margin: 0; padding: 0; }
.pc-list li { font-size: 13px; color: var(--muted); padding: 3px 0 3px 16px; position: relative; }
.pc-list li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ---- Chat ---- */
.chat-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 520px; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,.16); }
.chat-context { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.chat-badge { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); border: 1px solid #cdeef4; border-radius: 999px; padding: 3px 10px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; max-height: 560px; }
.chat-empty { color: var(--faint); font-size: 14px; text-align: center; margin: auto; max-width: 30ch; }

.msg { max-width: 92%; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 14px 14px 4px 14px; font-size: 14.5px; }
.msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 14px 16px; width: 100%; }
.msg.ai .ai-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--accent-dark); text-transform: uppercase; margin-bottom: 8px; display: inline-flex; align-items: center; gap: 6px; }
.msg.ai .ai-latency { color: var(--faint); font-weight: 500; letter-spacing: 0; text-transform: none; }
.typing-cursor { display: inline-block; width: 7px; height: 1.05em; background: var(--accent); margin-left: 2px; vertical-align: text-bottom; animation: blink 1s steps(2) infinite; }
@keyframes blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

/* markdown inside ai messages */
.md h2, .md h3, .md h4 { margin: 14px 0 6px; line-height: 1.25; letter-spacing: -.01em; }
.md h2 { font-size: 17px; } .md h3 { font-size: 15.5px; } .md h4 { font-size: 14px; color: var(--accent-dark); }
.md p { margin: 6px 0; font-size: 14px; }
.md ul { margin: 6px 0; padding-left: 20px; } .md li { font-size: 14px; margin: 2px 0; }
.md strong { font-weight: 700; }
.md table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12.5px; }
.md th, .md td { border: 1px solid var(--border); padding: 5px 8px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md pre { background: #0f1720; color: #d6e2ea; border-radius: var(--radius-sm); padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12px; margin: 8px 0; }
.md :not(pre) > code { background: var(--surface); }

.chat-suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.suggest-chip {
  font: inherit; font-size: 13px; cursor: pointer; text-align: left;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 13px;
  transition: .14s ease;
}
.suggest-chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); transform: translateY(-1px); }
.suggest-chip:disabled { opacity: .45; cursor: default; }

/* ---- Screenshots ---- */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 26px; }
.shot { margin: 0; }
.shot img { width: 100%; height: auto; aspect-ratio: 1440 / 900; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); display: block; }
.shot figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }

/* ---- CTA + footer ---- */
.section-cta { text-align: center; }
.section-cta h2 { margin-left: auto; margin-right: auto; }
.site-footer { border-top: 1px solid var(--border); padding: 24px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--faint); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .demo-grid { grid-template-columns: 1fr; }
  .project-card { position: static; }
  .nav-links { display: none; }
  .hero { padding: 60px 0 44px; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .pc-stats { grid-template-columns: repeat(2, 1fr); }
  .msg { max-width: 100%; }
  .section { padding: 48px 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .typing-cursor { animation: none; }
  .card:hover, .btn-accent:hover { transform: none; }
}
