/* SGP Labs — sgplabs.in
   Palette: Kashi Lab (fixed). Single dark theme by design. */

:root {
  --night: #0A1A33;      /* Lapis Night: background */
  --lapis: #0D2A57;      /* Deep Lapis: cards, surfaces */
  --cobalt: #1266B2;     /* Kashi Cobalt: primary blue */
  --sky: #7AAFDB;        /* Sky Glaze: secondary, links */
  --gold: #E0A548;       /* Saffron Gold: accent, CTAs */
  --brass: #B8894A;      /* Brass Finial: fine lines */
  --pearl: #F2EFE8;      /* Pearl Tile: text */

  --deep: #0C2147;       /* between night and lapis, for alternating sections */
  --muted: #AEBBD0;      /* body copy on dark */
  --faint: #7E91AE;      /* captions */
  --line: rgba(122, 175, 219, 0.16);
  --line-strong: rgba(122, 175, 219, 0.34);
  --gold-soft: rgba(224, 165, 72, 0.14);

  --f-display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --f-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1180px;
  --gutter: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23E0A548' stroke-width='1.6'%3E%3Crect x='4.5' y='4.5' width='11' height='11'/%3E%3Crect x='4.5' y='4.5' width='11' height='11' transform='rotate(45 10 10)'/%3E%3C/g%3E%3C/svg%3E");

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--night);
  background-image:
    linear-gradient(rgba(122, 175, 219, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 175, 219, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--pearl);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.35rem, 5.2vw, 4rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: var(--sky); }
b, strong { color: var(--pearl); font-weight: 700; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }
.gold { color: var(--gold); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: var(--night); padding: 8px 14px; font-weight: 700; }
.skip:focus { left: 12px; }

/* ---------- Chamfered (octagonal) shapes, from the SGP chip logo ---------- */
.oct {
  --c: 18px;
  --edge: var(--line-strong);
  --fill: var(--lapis);
  --shape: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  position: relative;
  isolation: isolate;
  clip-path: var(--shape);
  background-color: var(--edge);
  transition: background-color .35s var(--ease);
}
.oct::before, .oct::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: var(--shape);
  pointer-events: none;
}
.oct::before { background: var(--fill); }
.oct::after {
  background: radial-gradient(120% 90% at 0% 0%, rgba(224, 165, 72, 0.16), transparent 55%);
  opacity: 0;
  transition: opacity .35s var(--ease);
}

/* ---------- Labels ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
}
.star { width: 14px; height: 14px; flex: none; background: var(--star) center / contain no-repeat; display: inline-block; }

.tag {
  font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--sky); border: 1px solid var(--line-strong); padding: 3px 8px; border-radius: 3px; white-space: nowrap;
}
.tag-live { color: var(--gold); border-color: rgba(224, 165, 72, 0.45); }
.tag-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 7px; vertical-align: 1px; }

/* ---------- Buttons ---------- */
.btn {
  --c: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px;
  font-family: var(--f-display); font-weight: 600; font-size: 1rem; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; border: 0;
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: none; box-shadow: none; filter: drop-shadow(0 0 6px rgba(224,165,72,.8)); }
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: #EDB65F; }
.btn-line { position: relative; isolation: isolate; background: var(--sky); color: var(--pearl); }
.btn-line::before {
  content: ""; position: absolute; inset: 1px; z-index: -1; background: var(--night);
  clip-path: inherit; transition: background-color .25s var(--ease);
}
.btn-line:hover::before { background: #10284D; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 0.92rem; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 20px;
  font-family: var(--f-display); font-weight: 600; color: var(--gold); text-decoration: none;
}
.link-arrow::after { content: "→"; transition: transform .25s var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(10, 26, 51, 0.78);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); background: rgba(10, 26, 51, 0.92); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--pearl); }
.brand img { width: 38px; height: 38px; }
.brand-name { font-family: var(--f-display); font-size: 1.28rem; font-weight: 600; letter-spacing: 0.02em; }
.brand-name b { color: var(--gold); font-weight: 700; letter-spacing: 0.06em; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a:not(.btn) { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.98rem; transition: color .2s; }
.nav a:not(.btn):hover { color: var(--pearl); }
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--line-strong); background: transparent; border-radius: 6px; cursor: pointer; padding: 0; position: relative; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--pearl); transition: transform .25s var(--ease), top .25s var(--ease); }
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 25px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: 64px 72px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero-copy { display: flex; flex-direction: column; gap: 24px; }
.lede { color: var(--muted); font-size: 1.16rem; max-width: 34em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--muted); font-size: 0.98rem; }
.hero-points li, .ticks li { display: flex; gap: 12px; align-items: baseline; }
.hero-points li::before, .ticks li::before {
  content: ""; width: 12px; height: 12px; flex: none; background: var(--star) center / contain no-repeat; transform: translateY(1px);
}

.trace { position: absolute; z-index: 0; pointer-events: none; overflow: visible; }
.trace path { fill: none; stroke: var(--gold); stroke-width: 1.4; opacity: .6; }
.trace.sky path { stroke: var(--sky); opacity: .4; }
.trace circle { fill: var(--night); stroke: var(--gold); stroke-width: 1.4; opacity: .8; }
.trace.sky circle { stroke: var(--sky); }
.tr-l1 { right: 100%; top: 16%; width: 60px; height: 120px; }
.tr-l2 { right: 100%; bottom: 20%; width: 44px; height: 110px; }
.tr-t1 { bottom: 100%; left: 18%; width: 150px; height: 50px; }
.tr-t2 { bottom: 100%; left: 72%; width: 10px; height: 36px; }
.tr-r1 { left: 100%; top: 28%; width: 50px; height: 130px; }
.tr-r2 { left: 100%; bottom: 26%; width: 44px; height: 10px; }
.tr-b1 { top: 100%; left: 24%; width: 150px; height: 46px; }
.tr-b2 { top: 100%; left: 70%; width: 100px; height: 42px; }
.demo { --c: 22px; --fill: #0E2750; margin: 0; z-index: 1; }
.demo-stage { position: relative; }
.demo-inner { display: flex; flex-direction: column; }
.demo-top { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.demo-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--cobalt); color: var(--pearl); font-family: var(--f-display); font-weight: 700; font-size: 0.9rem;
}
.demo-name { font-weight: 700; font-size: 0.98rem; }
.demo-status { font-size: 0.8rem; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.demo-status i { width: 7px; height: 7px; border-radius: 50%; background: #5BD18B; display: inline-block; }
.demo-top .tag { margin-left: auto; }

.chat { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; min-height: 318px; font-size: 0.95rem; }
.msg { max-width: 82%; padding: 10px 14px; line-height: 1.45; border-radius: 14px; }
.msg.in { align-self: flex-start; background: #17335F; color: var(--pearl); border-top-left-radius: 4px; }
.msg.out { align-self: flex-end; background: rgba(18, 102, 178, 0.42); border: 1px solid rgba(122, 175, 219, 0.28); color: var(--pearl); border-top-right-radius: 4px; }
.msg-time { display: block; font-size: 0.7rem; color: var(--faint); margin-top: 4px; text-align: right; font-family: var(--f-mono); }
.typing { align-self: flex-end; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 14px; border-top-right-radius: 4px; background: rgba(18, 102, 178, 0.3); }
.typing.from-in { align-self: flex-start; background: #17335F; border-radius: 14px; border-top-left-radius: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--sky); animation: dot 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.demo-log { display: flex; flex-direction: column; gap: 8px; padding: 16px 22px 20px; border-top: 1px dashed var(--line-strong); background: rgba(10, 26, 51, 0.35); }
.log-title { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.log-item { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--muted); }
.log-item::before { content: "✓"; width: 18px; height: 18px; flex: none; display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; color: var(--night); background: var(--gold); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.demo-replay { align-self: flex-start; margin-top: 4px; background: none; border: 0; padding: 0; color: var(--sky); font: 500 0.8rem var(--f-mono); letter-spacing: 0.06em; cursor: pointer; }
.demo-replay:hover { color: var(--pearl); }

/* ---------- Industries ---------- */
.industries { padding-block: 8px 40px; }
.mini-title { font-family: var(--f-mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-bottom: 16px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  --c: 8px;
  padding: 9px 16px; font-size: 0.95rem; color: var(--pearl);
  background: rgba(13, 42, 87, 0.6); border: 1px solid var(--line);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
}

/* ---------- Sections ---------- */
.section { padding-block: 96px; position: relative; }
.section-alt { background: linear-gradient(180deg, var(--deep), rgba(12, 33, 71, 0.7)); border-block: 1px solid var(--line); }
.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 720px; margin-bottom: 48px; }
.section-lede { color: var(--muted); font-size: 1.1rem; }

/* Cards */
.card { padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.card p { color: var(--muted); }
.card:hover { --edge: rgba(224, 165, 72, 0.55); }
.card:hover::after { opacity: 1; }
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 0.97rem; color: var(--pearl); }

/* Services */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.svc-main { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 48px; padding: 38px; --fill: linear-gradient(135deg, #0F3066 0%, #0D2A57 60%); }
.svc-main .svc-intro { display: flex; flex-direction: column; gap: 14px; }
.svc-main h3 { font-size: 1.8rem; }
.svc-main .ticks { align-self: center; gap: 12px; font-size: 1.02rem; }
.svc-kicker { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold) !important; }
.svc-icon { width: 44px; height: 44px; color: var(--gold); }
.svc-icon svg { width: 100%; height: 100%; }

/* Labs */
.labs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.lab-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lab-code { font-family: var(--f-mono); font-size: 0.8rem; color: var(--brass); letter-spacing: 0.12em; }
.specs { margin: 4px 0 0; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.specs div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.specs dt { color: var(--faint); }
.specs dd { margin: 0; text-align: right; color: var(--pearl); }
.lab-fit { font-size: 0.88rem; color: var(--faint) !important; margin-top: auto; }

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.8rem; font-family: var(--f-mono); }
.flow span { padding: 5px 9px; border: 1px solid var(--line-strong); color: var(--sky); border-radius: 3px; transition: color .3s, border-color .3s, background-color .3s; }
.flow span.on { color: var(--night); background: var(--gold); border-color: var(--gold); }
.flow em { color: var(--brass); font-style: normal; }

.lead-card { border: 1px solid var(--line-strong); background: rgba(10, 26, 51, 0.5); padding: 4px 14px; border-radius: 4px; font-size: 0.88rem; }
.lead-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lead-row:last-child { border-bottom: 0; }
.lead-row span { color: var(--faint); }
.lead-row b { text-align: right; font-weight: 500; }
.score { padding: 10px 0 8px; display: flex; flex-direction: column; gap: 6px; }
.score-top { display: flex; justify-content: space-between; font-size: 0.8rem; }
.score-top span { color: var(--faint); }
.score-top b { color: var(--gold); font-family: var(--f-mono); font-weight: 500; }
.score-bar { height: 6px; background: rgba(122, 175, 219, 0.15); border-radius: 3px; overflow: hidden; }
.score-fill { height: 100%; width: 86%; background: linear-gradient(90deg, var(--cobalt), var(--gold)); border-radius: 3px; }

.lab-next { --fill: #0B2350; --edge: var(--line); }
.phone {
  width: 150px; align-self: center; margin: 6px 0 4px; padding: 12px 10px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 22px; background: var(--night);
  display: flex; flex-direction: column; gap: 7px;
}
.phone-notch { width: 44px; height: 5px; border-radius: 3px; background: var(--line-strong); align-self: center; margin-bottom: 4px; }
.phone-row { display: flex; align-items: center; gap: 7px; padding: 6px; border-radius: 6px; background: #12305C; font-size: 0.64rem; color: var(--pearl); }
.phone-row i { width: 20px; height: 20px; border-radius: 5px; flex: none; background: var(--brass); opacity: .8; }
.phone-row em { margin-left: auto; font-style: normal; color: var(--gold); font-family: var(--f-mono); }
.phone-pay { margin-top: 3px; padding: 7px; text-align: center; font-size: 0.66rem; font-weight: 700; color: var(--night); background: var(--gold); border-radius: 6px; }

/* Audit */
.audit { padding-block: 24px 96px; }
.audit-box { --c: 26px; --edge: rgba(224, 165, 72, 0.6); --fill: linear-gradient(120deg, #0F3066 0%, #0D2A57 55%, #0B2148 100%); display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; padding: 48px 52px; overflow: hidden; }
.audit-copy { display: flex; flex-direction: column; gap: 14px; max-width: 640px; position: relative; z-index: 1; }
.audit-copy p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; }
.audit-box .btn { position: relative; z-index: 1; }
.audit-star { position: absolute; right: -60px; top: 50%; width: 300px; height: 300px; transform: translateY(-50%); opacity: .1; pointer-events: none; }
.audit-star rect { fill: none; stroke: var(--gold); stroke-width: 1; }

/* Process */
.steps-wrap { position: relative; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; position: relative; }
.steps-line { position: absolute; left: 23px; right: calc(20% - 42px); top: 22px; height: 2px; background: var(--line-strong); }
.steps-line i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 1)); background: var(--gold); }
.step { position: relative; display: flex; flex-direction: column; gap: 10px; }
.step-no {
  --c: 10px;
  width: 46px; height: 46px; display: grid; place-items: center; position: relative; z-index: 1;
  font-family: var(--f-mono); font-size: 0.9rem; font-weight: 500; color: var(--gold);
  background: var(--gold); isolation: isolate;
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  margin-bottom: 8px;
}
.step-no::before { content: ""; position: absolute; inset: 1.5px; z-index: -1; background: var(--night); clip-path: inherit; }
.step p { color: var(--muted); font-size: 0.96rem; }

/* Why */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.why { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; border-top: 1px solid var(--brass); }
.why h3 { font-size: 1.15rem; }
.why p { color: var(--muted); font-size: 0.97rem; }

/* FAQ */
.faq-wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 48px; align-items: start; }
.faq-wrap .section-head { margin-bottom: 0; position: sticky; top: 110px; }
.faq { border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 20px 2px; font-family: var(--f-display); font-weight: 600; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); font-size: 1.3rem; color: var(--gold); transition: transform .25s var(--ease); flex: none; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 2px 22px; max-width: 62ch; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: start; }
.contact-copy { display: flex; flex-direction: column; gap: 18px; }
.contact-copy > p:not(.eyebrow) { color: var(--muted); font-size: 1.08rem; }
.contact-alt { display: flex; flex-direction: column; gap: 10px; padding-block: 8px; }
.contact-label { font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.contact-email { color: var(--pearl); font-size: 1.05rem; text-decoration: none; border-bottom: 1px solid var(--brass); align-self: flex-start; }
.contact-email:hover { color: var(--gold); }
.contact-ticks { margin-top: 6px; }

.form { --c: 22px; --fill: var(--lapis); padding: 34px; }
.form-body { display: flex; flex-direction: column; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { font-size: 0.9rem; font-weight: 500; color: var(--pearl); }
.opt { color: var(--faint); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--pearl);
  background: var(--night); border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 128px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input::placeholder, .field textarea::placeholder { color: #5E7291; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(224, 165, 72, 0.18); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #E07A6A; }
.field-msg { font-size: 0.82rem; color: #F09C8E; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.turnstile-box { min-height: 0; }
.form-error { background: rgba(224, 122, 106, 0.12); border: 1px solid rgba(224, 122, 106, 0.5); color: #F6C3BA; padding: 12px 14px; border-radius: 4px; font-size: 0.94rem; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.form-note { font-size: 0.85rem; color: var(--faint); flex: 1 1 220px; }
.form-done { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 0; }
.form-done img { width: 56px; height: 56px; }
.form-done h3 { font-size: 1.6rem; }
.form-done p { color: var(--muted); }

/* Footer */
.site-footer { padding-block: 56px 40px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 32px 48px; align-items: start; }
.footer-brand { display: flex; flex-direction: column; gap: 14px; }
.footer-brand img { width: 170px; height: auto; }
.footer-brand p { color: var(--faint); font-size: 0.95rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.footer-links a:hover { color: var(--gold); }
.copy { grid-column: 1 / -1; font-family: var(--f-mono); font-size: 0.78rem; color: var(--faint); letter-spacing: 0.04em; padding-top: 20px; border-top: 1px solid var(--line); }

/* Floating chat button */
.wa-float {
  --c: 10px;
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: none; align-items: center; gap: 8px; padding: 12px 16px;
  background: var(--gold); color: var(--night); text-decoration: none; font-family: var(--f-display); font-weight: 700;
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--c), 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--c)), 0 var(--c));
  transition: opacity .3s, transform .3s var(--ease);
}
.wa-float svg { width: 20px; height: 20px; }
.wa-float.hide { opacity: 0; transform: translateY(12px); pointer-events: none; }

/* ---------- Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

.js .trace path { stroke-dasharray: var(--len, 300); stroke-dashoffset: var(--len, 300); }
.js .draw .trace path { animation: draw 1.4s var(--ease) forwards; animation-delay: var(--d, 0s); }
.js .trace circle { opacity: 0; }
.js .draw .trace circle { animation: node .4s ease forwards; animation-delay: calc(var(--d, 0s) + 1.1s); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes node { to { opacity: .8; } }

.chat .msg.pop, .demo-log .log-item.pop { animation: pop .45s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.js .score-fill { width: 0; transition: width 1.6s var(--ease); }
.js .score-fill.go { width: 86%; }
.js .score-top b { transition: color .3s; }

.hero .eyebrow, .hero h1, .hero .lede, .hero .hero-ctas, .hero .hero-points { animation: rise .8s var(--ease) both; }
.hero h1 { animation-delay: .08s; }
.hero .lede { animation-delay: .16s; }
.hero .hero-ctas { animation-delay: .24s; }
.hero .hero-points { animation-delay: .32s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .trace path { stroke-dashoffset: 0; }
  .js .trace circle { opacity: .8; }
  .js .score-fill { width: 86%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .demo-stage { max-width: 560px; }
  .svc-grid, .labs-grid { grid-template-columns: 1fr 1fr; }
  .labs-grid .lab-next { grid-column: 1 / -1; }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 28px; padding-left: 0; }
  .steps-line { left: 22px; right: auto; top: 22px; bottom: 22px; width: 2px; height: auto; }
  .steps-line i { transform-origin: top; transform: scaleY(var(--p, 1)); }
  .step { display: grid; grid-template-columns: 46px 1fr; column-gap: 20px; row-gap: 4px; }
  .step-no { grid-row: span 2; margin-bottom: 0; }
  .faq-wrap, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .faq-wrap .section-head { position: static; }
}

@media (max-width: 800px) {
  .nav {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px; background: rgba(10, 26, 51, 0.98); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .nav .btn { margin-top: 16px; }
  .menu-btn { display: block; }
  .wa-float { display: inline-flex; }
  .svc-main { grid-template-columns: 1fr; padding: 30px; }
  .audit-box { grid-template-columns: 1fr; padding: 36px 28px; }
  .audit-box .btn { justify-self: start; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .section { padding-block: 72px; }
  .hero { padding-block: 40px 56px; }
  .svc-grid, .labs-grid, .why-grid, .field-row { grid-template-columns: 1fr; }
  .card { padding: 26px 22px; }
  .form { padding: 26px 20px; --c: 16px; }
  .chat { padding: 18px 16px; min-height: 0; }
  .demo-top, .demo-log { padding-inline: 16px; }
  .msg { max-width: 88%; }
  .trace { display: none; }
  .hero-ctas .btn { flex: 1 1 100%; }
}
