/* =========================================================
   OTEC.STUDIO  —  digital systems for business
   ========================================================= */

:root {
  --bg: #0a0a0b;
  --bg-soft: #111114;
  --surface: #15151a;
  --surface-2: #1c1c22;
  --border: #26262d;
  --border-soft: #1d1d23;
  --text: #f0eee8;
  --text-mid: #b6b6b8;
  --text-dim: #76767e;
  --accent: #ff5c1f;
  --accent-glow: #ff5c1f33;
  --lime: #b8ff5e;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Onest', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --max: 1320px;
  --gut: clamp(20px, 4vw, 64px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html, body { background: var(--bg); color: var(--text); }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-feature-settings: 'ss01', 'ss02';
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ---------- Background atmosphere ---------- */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.atmos {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.atmos::before, .atmos::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
}

.atmos::before {
  top: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, #ff5c1f33 0%, transparent 70%);
  animation: drift1 22s ease-in-out infinite alternate;
}
.atmos::after {
  bottom: -20%;
  right: -10%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, #1f5cff22 0%, transparent 70%);
  animation: drift2 28s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(8vw, 6vw) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-6vw, -4vw) scale(0.95); } }

/* ---------- Layout ---------- */

main, section, header, footer { position: relative; z-index: 2; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ---------- Top bar ---------- */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gut);
  backdrop-filter: blur(14px);
  background: rgba(10, 10, 11, 0.55);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), background 0.4s var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--border-soft); background: rgba(10, 10, 11, 0.85); }

.logo {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo b { font-weight: 500; }
.logo .dot {
  width: 9px;
  height: 9px;
  background: var(--accent);
  display: inline-block;
  border-radius: 1px;
  box-shadow: 0 0 14px var(--accent-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

nav.nav-main {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-mid);
}
nav.nav-main a { transition: color 0.3s; position: relative; }
nav.nav-main a:hover { color: var(--text); }
nav.nav-main a::before {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  height: 1px;
  width: 0;
  background: var(--accent);
  transition: width 0.4s var(--ease);
}
nav.nav-main a:hover::before { width: 100%; }
@media (max-width: 880px) { nav.nav-main { display: none; } }

.btn-tg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.3s var(--ease);
  font-family: var(--mono);
}
.btn-tg:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0a0b;
}
.btn-tg .arrow { transition: transform 0.3s var(--ease); }
.btn-tg:hover .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */

.hero {
  min-height: 100vh;
  padding: 140px var(--gut) 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 80%);
  opacity: 0.4;
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 36px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-eyebrow .pill {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-mid);
}
.hero-eyebrow .live::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--lime);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 10px var(--lime);
  animation: pulse 1.8s ease-in-out infinite;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 156px);
  line-height: 0.92;
  letter-spacing: -0.04em;
  max-width: 14ch;
  margin-bottom: 36px;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
  position: relative;
}
.hero h1 em::after {
  content: '';
  position: absolute;
  left: -4%;
  bottom: 8%;
  width: 108%;
  height: 0.1em;
  background: var(--accent);
  opacity: 0.0;
  transform: scaleX(0);
  transform-origin: left;
  animation: underline 1.6s 0.8s var(--ease) forwards;
}
@keyframes underline { to { opacity: 0.3; transform: scaleX(1); } }

.hero p.lead {
  font-size: clamp(17px, 1.5vw, 21px);
  color: var(--text-mid);
  max-width: 60ch;
  margin-bottom: 48px;
  line-height: 1.5;
}
.hero p.lead em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--text);
  font-size: 1.1em;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 80px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  background: var(--accent);
  color: #0a0a0b;
  font-weight: 500;
  font-size: 16px;
  border-radius: 999px;
  transition: all 0.4s var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, #ffffff66 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px var(--accent-glow); }
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary .arrow { transition: transform 0.3s; }
.btn-primary:hover .arrow { transform: translate(3px, -3px); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 16px;
  transition: all 0.3s var(--ease);
}
.btn-ghost:hover { border-color: var(--text); }
.btn-ghost .arrow { transition: transform 0.3s; }
.btn-ghost:hover .arrow { transform: translateY(3px); }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  border-top: 1px solid var(--border-soft);
  padding-top: 32px;
  max-width: 720px;
}
.hero-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-meta .num {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  font-weight: 400;
  color: var(--text);
}
.hero-meta .num em { font-style: italic; color: var(--accent); }
.hero-meta .lbl {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
@media (max-width: 720px) { .hero-meta { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Section heading ---------- */

.section {
  padding: 120px var(--gut);
  position: relative;
}

.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  margin-bottom: 80px;
  align-items: end;
}
@media (max-width: 880px) { .section-head { grid-template-columns: 1fr; gap: 24px; } }

.section-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.section-num strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 64px;
  line-height: 1;
  color: var(--text);
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 80px);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 18ch;
}
.section-title em { font-style: italic; color: var(--accent); }

/* ---------- Manifesto ---------- */

.manifesto {
  padding: 80px var(--gut);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.manifesto p {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 22ch;
}
.manifesto p em { font-style: italic; color: var(--accent); }
.manifesto .meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 32px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.manifesto .meta .line { flex: 0 0 60px; height: 1px; background: var(--text-dim); }

/* ---------- Services grid ---------- */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
@media (max-width: 980px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .services-grid { grid-template-columns: 1fr; } }

.service {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 36px 32px 32px;
  position: relative;
  overflow: hidden;
  transition: background 0.4s var(--ease);
  display: flex;
  flex-direction: column;
  min-height: 280px;
}
.service::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--accent-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
}
.service:hover { background: var(--surface); }
.service:hover::before { opacity: 1; }

.service .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

.service h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text);
}
.service h3 em { font-style: italic; color: var(--accent); }

.service p {
  font-size: 14.5px;
  color: var(--text-mid);
  line-height: 1.55;
  margin-bottom: auto;
}

.service .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
}
.service .tags span {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ---------- Cases ---------- */

.cases-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.case {
  display: grid;
  grid-template-columns: 80px 1fr 1.4fr 1fr 60px;
  gap: 32px;
  align-items: center;
  padding: 42px 0;
  border-bottom: 1px solid var(--border);
  transition: padding 0.4s var(--ease), background 0.4s var(--ease);
  position: relative;
}
.case::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-glow), transparent 60%);
  transition: width 0.5s var(--ease);
}
.case:hover { padding-left: 32px; padding-right: 32px; }
.case:hover::before { width: 100%; }
.case > * { position: relative; }

.case-num { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.case-tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.case-title {
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.case-title em { font-style: italic; color: var(--accent); }
.case-desc { color: var(--text-mid); font-size: 14.5px; line-height: 1.55; }
.case-arrow {
  font-size: 22px;
  text-align: right;
  color: var(--text-dim);
  transition: color 0.3s, transform 0.4s var(--ease);
}
.case:hover .case-arrow { color: var(--accent); transform: translateX(8px); }

@media (max-width: 1080px) {
  .case { grid-template-columns: 60px 1fr 1fr 40px; }
  .case-tag { display: none; }
}
@media (max-width: 720px) {
  .case { grid-template-columns: 1fr; gap: 12px; padding: 32px 0; }
  .case-arrow { text-align: left; }
}

/* ---------- Stack marquee ---------- */

.stack {
  padding: 100px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.stack-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 36px;
}
.marquee {
  display: flex;
  width: max-content;
  animation: scroll 40s linear infinite;
  gap: 56px;
}
.marquee span {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 72px);
  font-style: italic;
  color: var(--text-dim);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 56px;
}
.marquee span::after {
  content: '✦';
  font-size: 0.5em;
  color: var(--accent);
  font-style: normal;
}
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Process ---------- */

.process-list {
  border-top: 1px solid var(--border);
}
.step {
  display: grid;
  grid-template-columns: 200px 1fr 2fr;
  gap: 48px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.step-num {
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 96px);
  font-style: italic;
  font-weight: 400;
  line-height: 0.9;
  color: var(--accent);
}
.step-name {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 36px);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.step-desc { color: var(--text-mid); font-size: 15.5px; line-height: 1.6; max-width: 50ch; }
.step-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 12px;
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
@media (max-width: 880px) {
  .step { grid-template-columns: 1fr; gap: 16px; padding: 36px 0; }
}

/* ---------- FAQ ---------- */

.faq-list { border-top: 1px solid var(--border); }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 28px 0;
  cursor: pointer;
  transition: padding 0.4s var(--ease);
}
.faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .toggle {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 22px;
  color: var(--accent);
  transition: transform 0.4s var(--ease);
  line-height: 1;
}
.faq-item[open] .toggle { transform: rotate(45deg); }
.faq-item .answer {
  margin-top: 18px;
  color: var(--text-mid);
  font-size: 16px;
  line-height: 1.65;
  max-width: 70ch;
}

/* ---------- CTA Final ---------- */

.cta-final {
  padding: 160px var(--gut);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-final::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, var(--accent-glow), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}
.cta-final h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 144px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  max-width: 14ch;
  margin: 0 auto 48px;
}
.cta-final h2 em { font-style: italic; color: var(--accent); }
.cta-final .row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.cta-final .meta {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cta-final .meta a { color: var(--text-mid); transition: color 0.3s; }
.cta-final .meta a:hover { color: var(--accent); }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 48px var(--gut);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-items: end;
}
footer .logo { text-transform: none; }
footer a { color: var(--text-mid); transition: color 0.3s; }
footer a:hover { color: var(--accent); }
footer .col { display: flex; flex-direction: column; gap: 8px; }
footer .right { text-align: right; }
@media (max-width: 720px) {
  footer { grid-template-columns: 1fr; }
  footer .right { text-align: left; }
}

/* ---------- Reveal animation ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Selection ---------- */

::selection { background: var(--accent); color: #0a0a0b; }
::-moz-selection { background: var(--accent); color: #0a0a0b; }

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* =========================================================
   Chat widget + Lead modal
   ========================================================= */

.chat-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 36px rgba(255, 92, 31, 0.45), 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  border: 0;
}
.chat-fab::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.5;
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring {
  0%   { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0;   }
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab svg { width: 28px; height: 28px; position: relative; }
.chat-fab .badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--lime);
  color: #0a0a0b;
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.chat-fab.is-open { transform: rotate(180deg); }
.chat-fab.is-open .badge { display: none; }

.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 79;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 130px);
  background: #111114;
  border: 1px solid var(--border);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.chat-panel.is-open { opacity: 1; pointer-events: auto; transform: none; }

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #161620, #111114);
}
.chat-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: #0a0a0b;
  flex-shrink: 0;
}
.chat-meta { flex: 1; min-width: 0; }
.chat-meta .name { font-size: 14.5px; font-weight: 500; color: var(--text); }
.chat-meta .status {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.chat-meta .status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
  display: inline-block;
}
.chat-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.chat-close:hover { background: var(--surface-2); color: var(--text); }

.chat-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.chat-body::-webkit-scrollbar { width: 4px; }

.bubble {
  max-width: 85%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: bubble-in 0.4s var(--ease) backwards;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px); } }
.bubble.bot {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #0a0a0b;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}
.bubble a { text-decoration: underline; }

.bubble.typing {
  display: flex; gap: 4px; padding: 14px 14px;
}
.bubble.typing span {
  width: 6px; height: 6px;
  background: var(--text-dim);
  border-radius: 50%;
  animation: dot 1.2s ease-in-out infinite;
}
.bubble.typing span:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot {
  0%, 80%, 100% { opacity: 0.2; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.chat-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 18px 8px;
}
.chat-quick button {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mid);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.3s;
}
.chat-quick button:hover { color: var(--accent); border-color: var(--accent); }

.chat-foot {
  padding: 12px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-foot textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.4;
  resize: none;
  outline: none;
  transition: border-color 0.3s;
}
.chat-foot textarea:focus { border-color: var(--accent); }
.chat-send {
  width: 42px; height: 42px;
  background: var(--accent);
  color: #0a0a0b;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.3s;
  flex-shrink: 0;
}
.chat-send:hover { transform: translateY(-1px); }
.chat-send:disabled { opacity: 0.4; cursor: wait; }

.chat-foot-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.chat-foot-row a { color: var(--accent); }
.chat-foot-row .handoff-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-mid);
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10.5px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.chat-foot-row .handoff-btn:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 600px) {
  .chat-panel {
    right: 8px; left: 8px; bottom: 90px;
    width: auto; max-width: none;
    height: calc(100vh - 110px);
    border-radius: 18px;
  }
  .chat-fab { right: 16px; bottom: 16px; width: 56px; height: 56px; }
}

/* ---------- Lead modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }

.modal {
  width: min(560px, 100%);
  background: #111114;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 36px;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.4s var(--ease);
}
.modal-backdrop.is-open .modal { transform: none; }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.3s, background 0.3s;
}
.modal-close:hover { color: var(--text); background: var(--surface-2); }

.modal h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.modal h3 em { font-style: italic; color: var(--accent); }
.modal .sub {
  color: var(--text-mid);
  font-size: 14.5px;
  margin-bottom: 24px;
  line-height: 1.55;
}

.field {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field input,
.field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s;
}
.field input:focus,
.field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 110px; line-height: 1.5; }

.modal .submit-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 8px;
}
.modal .hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.modal-status {
  margin-top: 14px;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  display: none;
}
.modal-status.ok    { display: block; background: rgba(184, 255, 94, 0.1); color: var(--lime); border: 1px solid rgba(184, 255, 94, 0.3); }
.modal-status.err   { display: block; background: rgba(255, 92, 31, 0.1); color: var(--accent); border: 1px solid rgba(255, 92, 31, 0.3); }

/* ---------- PWA install hint ---------- */

.install-hint {
  position: fixed;
  bottom: 100px;
  left: 24px;
  z-index: 70;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: 360px;
  font-size: 13.5px;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
  box-shadow: 0 18px 40px rgba(0,0,0,0.5);
}
.install-hint.is-open { opacity: 1; pointer-events: auto; transform: none; }
.install-hint b { font-weight: 500; color: var(--accent); }
.install-hint button {
  background: var(--accent);
  color: #0a0a0b;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.install-hint .ix {
  cursor: pointer;
  color: var(--text-dim);
  font-family: var(--mono);
  padding: 4px;
}
@media (max-width: 600px) {
  .install-hint { left: 8px; right: 8px; max-width: none; bottom: 86px; }
}

/* =========================================================
   Mobile bottom navigation (app-like tab bar)
   ========================================================= */

.mobile-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: rgba(11, 11, 14, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 10px;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.4);
}

.mob-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px 6px;
  border-radius: 14px;
  color: var(--text-mid);
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.3s, background 0.3s, transform 0.2s;
  border: 0;
  background: transparent;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.mob-tab svg { width: 22px; height: 22px; transition: transform 0.3s; }
.mob-tab:active { transform: scale(0.94); }
.mob-tab:active:not(.is-primary) { background: var(--surface-2); color: var(--text); }

.mob-tab.is-primary {
  color: var(--accent);
  position: relative;
}
.mob-tab.is-primary::before {
  content: '';
  position: absolute;
  inset: 4px 8px;
  border-radius: 14px;
  border: 1.5px solid var(--accent);
  opacity: 0.6;
  animation: ring 2.4s ease-out infinite;
  pointer-events: none;
}
.mob-tab.is-primary::after {
  content: '';
  position: absolute;
  top: 8px; left: 50%;
  width: 26px; height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.18;
  animation: ring 2.4s ease-out infinite;
  pointer-events: none;
}

@media (max-width: 880px) {
  .mobile-nav { display: grid; }
  .chat-fab { display: none; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .install-hint { bottom: calc(86px + env(safe-area-inset-bottom)); }
}
