/* =========================================================
   AtoAI — Company profile
   Mobile layouts live in the media queries at the bottom.
   ========================================================= */

:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-2: #0b1120;
  --surface: #0f172a;
  --surface-2: #131c33;
  --glass: rgba(15, 23, 42, .62);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.26);
  --text: #e6ebf5;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --brand: #2dd4bf;          /* teal */
  --brand-2: #6366f1;        /* indigo */
  --brand-3: #38bdf8;        /* sky */
  --grad: linear-gradient(120deg, var(--brand) 0%, var(--brand-3) 45%, var(--brand-2) 100%);
  --grad-btn: linear-gradient(120deg, #2dd4bf 0%, #38bdf8 70%, #818cf8 100%);
  --ok: #34d399;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.7);
  --container: 1160px;
  --gutter: 24px;
  --section-y: 112px;
  --nav-h: 60px;
  --head-h: 72px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: clamp(2.05rem, 1.45rem + 3vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.65rem, 1.25rem + 1.9vw, 2.75rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.3; }
p { margin: 0 0 1em; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(45, 212, 191, .3); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 820px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #04201c; padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 600; }
.skip-link:focus { left: 8px; }

.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 24px; border-radius: 14px; font-weight: 650; font-size: .98rem; line-height: 1.3; text-align: center;
  border: 1px solid transparent; cursor: pointer; font-family: inherit; touch-action: manipulation;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--grad-btn); color: #04121a; box-shadow: 0 12px 32px -12px rgba(45, 212, 191, .6); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: rgba(255,255,255,.03); }
.btn-sm { min-height: 42px; padding: 8px 16px; font-size: .9rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-arrow::after { content: "→"; transition: transform .2s ease; }

/* ---------- Header (floating glass bar) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding-top: 10px; height: var(--head-h); pointer-events: none; }
.nav {
  position: relative; pointer-events: auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: calc(100% - 24px); max-width: calc(var(--container) - 24px); height: var(--nav-h); padding: 0 10px 0 16px;
  background: rgba(11, 17, 32, .72); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.site-header.scrolled .nav { background: rgba(11, 17, 32, .9); border-color: var(--line-strong); box-shadow: 0 14px 40px -20px rgba(0, 0, 0, .8); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.brand b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 2px; }
.nav-links a:not(.btn) { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 550; font-size: .94rem; transition: color .15s, background .15s; }
.nav-links a:not(.btn):hover, .nav-links a.active { color: var(--text); background: rgba(255,255,255,.06); }
.nav-cta { display: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; }

.lang-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(255,255,255,.02); }
.lang-switch button {
  font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  min-width: 38px; min-height: 38px; padding: 0 8px; border: 0; background: transparent; color: var(--muted); border-radius: 9px; cursor: pointer; touch-action: manipulation;
}
.lang-switch button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: transparent; cursor: pointer; flex-direction: column; justify-content: center; align-items: center; gap: 4px; touch-action: manipulation; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }

/* ---------- Hero ---------- */
.hero { position: relative; margin-top: calc(var(--head-h) * -1); padding: calc(var(--head-h) + 64px) 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  opacity: .45;
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(520px 420px at 72% 12%, rgba(99, 102, 241, .26), transparent 70%),
    radial-gradient(560px 460px at 48% 0%, rgba(45, 212, 191, .18), transparent 70%),
    radial-gradient(420px 380px at 4% 62%, rgba(56, 189, 248, .08), transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 64px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; margin-bottom: 22px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(255,255,255,.04);
  font-size: .84rem; font-weight: 600; line-height: 1.35; color: var(--soft);
}
.pulse { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.lead { font-size: clamp(1.02rem, .98rem + .3vw, 1.15rem); color: var(--soft); max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 36px; }
.hero-stats {
  list-style: none; margin: 0; padding: 20px 4px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px;
  border-top: 1px solid var(--line);
}
.hero-stats strong { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.025em; line-height: 1.25; }
.hero-stats span { display: block; font-size: .85rem; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.hero-note { position: relative; font-size: .75rem; color: var(--muted); text-align: right; margin-top: 26px; margin-bottom: 0; }

/* Chat mock */
.hero-visual { position: relative; padding: 18px 0; }
.chat-card {
  position: relative; background: linear-gradient(180deg, rgba(19, 28, 51, .95), rgba(13, 20, 38, .95));
  border: 1px solid var(--line-strong); border-radius: 24px; box-shadow: var(--shadow), 0 0 80px -30px rgba(56, 189, 248, .4);
  overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #04121a; background: var(--grad-btn); }
.chat-name { margin: 0; font-weight: 700; font-size: .95rem; }
.chat-status { margin: 0; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }
.chat-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; font-size: .9rem; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; }
.msg.user { align-self: flex-end; background: linear-gradient(120deg, rgba(45,212,191,.22), rgba(56,189,248,.18)); border: 1px solid rgba(45, 212, 191, .25); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--soft); }
.msg b { color: var(--text); }
.msg b.up { color: var(--ok); }
.mini-bars { margin-top: 10px; display: grid; gap: 6px; }
.mini-bars div { display: grid; grid-template-columns: 12px 1fr; gap: 8px; align-items: center; }
.mini-bars span { height: 8px; width: var(--w); border-radius: 4px; background: var(--grad); }
.mini-bars em { order: -1; font-style: normal; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.chat-input { margin: 0 18px 34px; padding: 9px 10px 9px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: .85rem; display: flex; justify-content: space-between; align-items: center; }
.chat-input i { width: 26px; height: 26px; border-radius: 9px; background: var(--grad-btn); opacity: .9; }
.float-tag {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px;
  background: rgba(15, 23, 42, .94); border: 1px solid var(--line-strong); border-radius: 12px;
  font-size: .78rem; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap;
  animation: float 6s ease-in-out infinite;
}
.float-tag .ico { width: 15px; height: 15px; color: var(--brand); }
/* Sit on the card's edge so they never cover the chat text. */
.tag-1 { top: 0; right: 18px; }
.tag-2 { bottom: 0; left: 18px; animation-delay: -3s; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* ---------- Sections ---------- */
.section { padding: var(--section-y) 0; position: relative; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head > p:last-child:not(.kicker) { color: var(--muted); font-size: 1.05rem; margin-bottom: 0; }
.kicker { font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); margin-bottom: 14px; }

/* Cards */
.cards { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  position: relative; padding: 28px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, rgba(19, 28, 51, .72), rgba(15, 23, 42, .5));
  border: 1px solid var(--line); transition: border-color .2s, transform .2s;
}
/* Soft glow that follows the pointer (position set in main.js). */
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 0%), rgba(45, 212, 191, .13), transparent 70%);
}
.card > * { position: relative; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 20px; background: rgba(45, 212, 191, .1); border: 1px solid rgba(45, 212, 191, .25); }
.card-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--brand); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tabs button {
  font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; touch-action: manipulation;
  min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.02); color: var(--muted); transition: background .15s, color .15s, border-color .15s;
}
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab-panel {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start;
  padding: 40px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line);
}
.tab-panel[hidden] { display: none; }
.panel-copy h3 { font-size: clamp(1.25rem, 1.1rem + .7vw, 1.6rem); line-height: 1.25; }
.panel-copy p { color: var(--muted); margin: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checks li { position: relative; padding-left: 34px; color: var(--soft); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 22px; height: 22px; border-radius: 7px;
  background: rgba(45, 212, 191, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232dd4bf' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.step { position: relative; padding: 28px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(15, 23, 42, .5); }
.step::after { content: ""; position: absolute; top: 46px; right: -19px; width: 19px; height: 1px; background: linear-gradient(90deg, var(--brand), var(--brand-3)); opacity: .55; }
.step:last-child::after { display: none; }
.step-num { display: inline-grid; place-items: center; min-width: 40px; height: 34px; font-family: var(--mono); font-size: .85rem; font-weight: 500; color: var(--brand); padding: 0 10px; border-radius: 10px; border: 1px solid rgba(45, 212, 191, .3); background: rgba(45, 212, 191, .08); margin-bottom: 18px; }
.step p { color: var(--muted); font-size: .94rem; margin: 0; }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.about-grid > div > p:not(.kicker) { color: var(--soft); }
.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.stack span { font-family: var(--mono); font-size: .78rem; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--line-strong); color: var(--soft); background: rgba(255,255,255,.03); }
.why { display: grid; gap: 14px; }
.why-item { display: flex; gap: 18px; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.why-ico { flex: none; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; color: var(--brand); background: rgba(45, 212, 191, .1); border: 1px solid rgba(45, 212, 191, .22); }
.why-item h3 { margin-bottom: 4px; font-size: 1.02rem; }
.why-item p { color: var(--muted); font-size: .93rem; margin: 0; }

/* FAQ */
.faq { display: grid; gap: 12px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color .2s; }
.faq details[open] { border-color: rgba(45, 212, 191, .35); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 60px 18px 22px; min-height: 60px; display: flex; align-items: center; font-weight: 650; line-height: 1.4; position: relative; touch-action: manipulation; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; width: 30px; height: 30px; margin-top: -15px;
  display: grid; place-items: center; border-radius: 50%; background: rgba(45, 212, 191, .1);
  font-size: 1.25rem; font-weight: 400; line-height: 1; color: var(--brand); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; margin: 0; color: var(--muted); animation: faq-open .25s ease; }
@keyframes faq-open { from { opacity: 0; transform: translateY(-4px); } }

/* Contact */
.contact { background: radial-gradient(ellipse 60% 70% at 10% 50%, rgba(45, 212, 191, .08), transparent 70%), radial-gradient(ellipse 50% 60% at 90% 40%, rgba(99, 102, 241, .1), transparent 70%); border-top: 1px solid var(--line); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 14px; align-items: center; min-width: 0; }
.contact-list li > div { min-width: 0; }
.ci { width: 44px; height: 44px; flex: none; border-radius: 13px; display: grid; place-items: center; font-size: 1.2rem; background: var(--surface); border: 1px solid var(--line); color: var(--brand); }
.contact-list small { display: block; font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.contact-list a { display: inline-block; padding: 8px 0; margin: -6px 0; font-weight: 650; overflow-wrap: anywhere; }
.contact-form {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px;
  padding: 32px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.contact-form > * { grid-column: 1 / -1; }
.contact-form > .field:nth-child(-n+2) { grid-column: auto; }
.field { margin-bottom: 16px; min-width: 0; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 6px; color: var(--soft); }
/* 16px text stops iOS Safari from zooming in when a field gets focus. */
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; font: inherit; font-size: 16px; color: var(--text);
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { display: block; resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(45, 212, 191, .18); }
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; text-overflow: ellipsis; }
.field select option { background: var(--surface); }
.form-note { font-size: .8rem; color: var(--muted); text-align: center; margin: 12px 0 0; }
.form-error { font-size: .85rem; color: #fca5a5; text-align: center; margin: 8px 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 28px; background: #05080f; }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 32px; }
.footer-grid p { color: var(--muted); font-size: .92rem; margin: 12px 0 0; max-width: 34em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: flex-start; }
.footer-links a { color: var(--muted); font-size: .92rem; transition: color .15s; }
.footer-bottom { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.footer-bottom::before { content: ""; flex: 0 0 100%; height: 1px; margin-bottom: 14px; background: var(--line); }
.footer-bottom p { margin: 0; }
.status { display: inline-flex; align-items: center; gap: 8px; }

/* Sticky call-to-action, phones only (shown by main.js) */
.mobile-cta { display: none; }

/* Reveal: an entrance animation rather than a transition, so it can't delay hover effects. */
.js-reveal .reveal { opacity: 0; }
.js-reveal .reveal.in { opacity: 1; animation: rise .6s ease var(--d, 0ms) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Pointer-only effects (hover sticks on touch screens) ---------- */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: scale(.98); }
  .btn-primary:hover { box-shadow: 0 16px 38px -12px rgba(56, 189, 248, .7); }
  .btn-ghost:hover { border-color: var(--brand); }
  .btn-arrow:hover::after { transform: translateX(3px); }
  .card:hover { border-color: rgba(45, 212, 191, .4); transform: translateY(-3px); }
  .card:hover::before { opacity: 1; }
  .step:hover, .why-item:hover { border-color: var(--line-strong); }
  .tabs button:hover { color: var(--text); }
  .tabs button[aria-selected="true"]:hover { color: var(--bg); }
  .contact-list a:hover { color: var(--brand); }
  .footer-links a:hover { color: var(--text); }
}

/* ---------- Large screens: stagger the card grids ---------- */
@media (min-width: 961px) {
  .card:nth-child(3n+2), .step:nth-child(2) { --d: 80ms; }
  .card:nth-child(3n), .step:nth-child(3) { --d: 160ms; }
  .step:nth-child(4) { --d: 240ms; }
}

/* ---------- Small laptop / tablet landscape ---------- */
@media (max-width: 1080px) {
  :root { --section-y: 96px; }
  .hero-grid { gap: 44px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step::after { display: none; }
  .about-grid, .contact-grid { gap: 44px; }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  :root { --section-y: 84px; }
  .hero { padding-top: calc(var(--head-h) + 44px); }
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .hero-visual { max-width: 540px; margin: 0 auto; width: 100%; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab-panel { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 28px; }

  .menu-toggle { display: flex; }
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; flex-direction: column; gap: 2px;
    max-height: calc(100vh - var(--head-h) - 16px); max-height: calc(100dvh - var(--head-h) - 16px); overflow-y: auto;
    padding: 10px; background: #0b1120; border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow);
    transform: translateY(-8px) scale(.98); transform-origin: top; opacity: 0; visibility: hidden;
    transition: transform .2s ease, opacity .2s ease, visibility .2s;
  }
  .nav-links a:not(.btn) { display: flex; align-items: center; min-height: 50px; padding: 8px 14px; font-size: 1.05rem; }
  .nav-cta { display: inline-flex; margin-top: 8px; }

  .menu-open { overflow: hidden; }
  .menu-open::after { content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(3, 6, 12, .6); }
  .menu-open .nav-links { transform: none; opacity: 1; visibility: visible; }
  .menu-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .footer-links a { padding: 6px 0; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  :root { --gutter: 18px; --section-y: 64px; }
  .hide-sm { display: none; }

  .hero { padding-top: calc(var(--head-h) + 28px); padding-bottom: 24px; }
  .hero-grid { gap: 28px; }
  .eyebrow { font-size: .78rem; margin-bottom: 16px; }
  .hero-cta { margin: 24px 0 24px; gap: 10px; }
  .hero-cta .btn { flex: 1 1 100%; }

  /* Stats become one compact card with divided rows. */
  .hero-stats { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 4px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--glass); }
  .hero-stats li { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px 0; }
  .hero-stats li + li { border-top: 1px solid var(--line); }
  .hero-stats strong { font-size: 1.15rem; white-space: nowrap; }
  .hero-stats span { margin: 0; font-size: .8rem; }

  .chat-body { padding: 14px; font-size: .86rem; gap: 10px; }
  .chat-head { padding: 14px; }
  .chat-input { margin: 0 14px 32px; }
  .tag-1 { right: 10px; }
  .tag-2 { left: 10px; }
  .hero-note { text-align: center; margin-top: 12px; }

  .section-head { margin-bottom: 28px; }
  .section-head > p:last-child:not(.kicker) { font-size: 1rem; }
  .kicker { margin-bottom: 10px; }

  /* Services: icon beside the title keeps six cards from filling several screens. */
  .cards { gap: 12px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .card { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; align-items: center; padding: 18px; border-radius: 18px; }
  .card-ico { width: 44px; height: 44px; margin: 0; border-radius: 13px; }
  .card-ico svg { width: 22px; height: 22px; }
  .card h3 { margin: 0; font-size: 1.05rem; }
  .card p { grid-column: 1 / -1; margin-top: 12px; font-size: .93rem; line-height: 1.6; }

  /* Tabs: one swipeable row, edge to edge, fading out to hint at more. */
  .tabs {
    flex-wrap: nowrap; gap: 8px; margin: 0 calc(var(--gutter) * -1) 14px; padding: 2px var(--gutter);
    overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: none; white-space: nowrap; scroll-snap-align: start; font-size: .88rem; padding: 8px 16px; }
  .tab-panel { padding: 20px; gap: 18px; border-radius: 18px; }
  .checks { gap: 12px; }
  .checks li { font-size: .95rem; line-height: 1.55; }

  /* Process: a vertical timeline instead of four boxes. */
  .steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .step { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; padding: 0 0 26px; border: 0; border-radius: 0; background: none; }
  .step:last-child { padding-bottom: 0; }
  .step::after { display: block; top: 42px; bottom: 6px; left: 21px; right: auto; width: 2px; height: auto; background: linear-gradient(180deg, rgba(45, 212, 191, .55), rgba(56, 189, 248, .12)); opacity: 1; }
  .step:last-child::after { display: none; }
  .step-num { grid-row: 1 / span 2; width: 44px; height: 36px; min-width: 0; padding: 0; margin: 0; align-self: start; }
  .step h3 { margin: 6px 0 4px; }

  .about-grid, .contact-grid { gap: 28px; }
  .stack { gap: 6px; margin-top: 20px; }
  .stack span { font-size: .75rem; padding: 5px 10px; }
  .why { gap: 10px; }
  .why-item { gap: 14px; padding: 16px; border-radius: 18px; }
  .why-ico { width: 40px; height: 40px; font-size: 1.15rem; }

  .faq { gap: 10px; }
  .faq summary { padding: 14px 54px 14px 16px; font-size: .97rem; }
  .faq summary::after { right: 12px; }
  .faq details p { padding: 0 16px 16px; font-size: .95rem; }

  .contact-list { margin-top: 22px; gap: 14px; }
  .contact-form { grid-template-columns: minmax(0, 1fr); padding: 18px; border-radius: 20px; }
  .contact-form > .field:nth-child(-n+2) { grid-column: 1 / -1; }
  .field { margin-bottom: 14px; }

  .site-footer { padding: 36px 0 24px; }
  .footer-grid { gap: 20px; padding-bottom: 20px; }

  .mobile-cta {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, rgba(7, 11, 20, .92) 34%);
    transform: translateY(110%); visibility: hidden; transition: transform .25s ease, visibility .25s;
  }
  .mobile-cta.show { transform: none; visibility: visible; }
  .menu-open .mobile-cta { transform: translateY(110%); visibility: hidden; }
}

/* ---------- Very small phones ---------- */
@media (max-width: 350px) {
  :root { --gutter: 14px; }
  .nav { width: calc(100% - 16px); padding: 0 8px 0 12px; gap: 8px; }
  .brand { font-size: 1.08rem; gap: 8px; }
  .nav-actions { gap: 6px; }
  .lang-switch button { min-width: 34px; }
  .hero-stats li { grid-template-columns: 72px minmax(0, 1fr); }
  .float-tag { font-size: .72rem; padding: 7px 10px; }
}

/* ---------- Short landscape phones: the header shouldn't eat the screen ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .site-header { position: relative; }
  html { scroll-padding-top: 12px; }
  .mobile-cta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
