/* ============================================================
   style2.css — the /v2 landing page ("engineering datasheet").
   Self-contained: index2.html links only fonts.css + this file.
   Aesthetic rules: dark ground, hairline borders, numbered
   sections, no shadows, no gradients, no rounded corners.
   "paper" is the page ground, "ink" the text color.
   ============================================================ */

:root {
  --paper:  #030303;
  --panel:  #111111;
  --ink:    #ece7db;
  --muted:  #8f8a7d;
  --line:   #242424;
  --copper: #b98f62;
  --sans:   "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --brand:  "Chakra Petch", var(--sans);
  --head:   "Asta Sans", var(--sans);
  --wrap:   1440px;

  /* --- Type scale: 4 fixed tiers; display sizes use clamp() --- */
  --fs-meta: 13px;
  --fs-body: 16px;
  --fs-lede: 18px;
  --fs-sub:  20px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: var(--fs-lede); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* Micro-label — uppercase technical caption used throughout */
.micro {
  font-family: var(--brand); font-size: var(--fs-meta); font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--copper);
}
.mono-cap { font-family: var(--brand); font-size: var(--fs-meta); letter-spacing: 0.06em; color: var(--muted); }

/* "galvano" wordmark in running text */
.g { font-family: var(--brand); font-weight: 700; letter-spacing: -0.01em; color: var(--copper); }
/* Nexar API references */
.nx { color: var(--copper); }

/* Buttons — square, flat */
.b {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px; font-size: var(--fs-body); font-weight: 600; letter-spacing: 0.02em;
  line-height: 1.2; border: 1px solid var(--ink); cursor: pointer; font-family: var(--sans);
  background: transparent; color: var(--ink);
  transition: background .15s ease, color .15s ease;
}
.b-solid { background: var(--ink); color: var(--paper); }
.b-solid:hover { background: var(--copper); border-color: var(--copper); color: var(--paper); }
.b-line:hover { background: var(--copper); border-color: var(--copper); color: var(--paper); }
.b-paper { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.b-paper:hover { background: var(--copper); border-color: var(--copper); color: var(--paper); }

/* Top bar */
.bar { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 40; }
.bar .wrap { display: flex; align-items: center; gap: 36px; height: 60px; }
.brand2 { display: inline-flex; align-items: center; }
.brand2 img { display: block; height: 24px; width: auto; }
.bar nav { display: flex; gap: 26px; margin-left: auto; }
.bar nav a {
  font-size: var(--fs-meta); font-weight: 500; color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.bar nav a:hover { color: var(--ink); }
.bar .b { padding: 9px 18px; font-size: var(--fs-body); }
.bar-cta { display: flex; align-items: center; gap: 12px; }
@media (max-width: 900px) { .bar nav { display: none; } }

/* Section scaffolding — numbered header row with a rule */
section { scroll-margin-top: 76px; }
.sec { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--line); }
.sec-head {
  display: flex; align-items: baseline; gap: 18px;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.sec-head h2 {
  font-family: var(--head); font-size: clamp(26px, 3vw, 38px);
  font-weight: 700; letter-spacing: -0.02em; margin: 0;
}
.sec-head .rule { display: none; }

/* Hero */
.hero2 { padding: clamp(72px, 9vw, 140px) 0 clamp(110px, 15vw, 210px); }
.hero2-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 40%);
  gap: clamp(32px, 5vw, 80px); align-items: stretch;
}
.hero2-backed {
  display: flex; align-items: center; justify-content: flex-start; gap: 0;
  margin: 0 0 36px; color: var(--muted); font-size: 18px;
}
.hero2-backed a { display: inline-flex; }
.hero2-backed img {
  width: 190px; height: auto; margin-left: -10px;
  transition: opacity .15s ease;
}
.hero2-backed a:hover img { opacity: 0.65; }
.hero2-visual { position: relative; }
.hero2-visual img,
.hero2-visual video {
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 30px rgba(185, 143, 98, 0.10), 0 0 70px rgba(236, 231, 219, 0.05);
  user-select: none; -webkit-user-drag: none;
}
.hero2-visual img {
  display: block; height: auto; max-height: 480px; width: auto; max-width: 100%;
  margin-left: auto; object-fit: contain;
}
/* Absolutely positioned so the copy column sets the row height; the video
   spans from the backed-by line down to the CTA row. */
.hero2-visual video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none;
}
@media (max-width: 900px) {
  .hero2-wrap { grid-template-columns: 1fr; }
  .hero2-visual { display: none; }
}
.hero2 h1 {
  font-family: var(--head); font-size: clamp(32px, 4.6vw, 60px);
  line-height: 1.05; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 24px;
  color: var(--ink);
}
.hero2 h1 em { font-style: normal; color: var(--copper); }
.hero2-sub { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); margin: 0 0 36px; max-width: 54ch; }
.hero2-list {
  list-style: none; margin: 0 0 36px; padding: 0;
  display: flex; flex-direction: column; gap: 14px;
  color: var(--muted); font-size: clamp(17px, 1.6vw, 20px);
}
.hero2-list li { position: relative; padding-left: 16px; }
.hero2-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 2px; background: var(--copper);
}
.hero2-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Generation animation — four panels play in sequence (orchestrated by
   script.js toggling .on): chat typing, component search, block diagram,
   schematic draw. All state changes are CSS transitions. */
.ga-section { padding-bottom: clamp(28px, 4vw, 48px); }
.ga-flow { display: flex; align-items: stretch; gap: 10px; }
.ga-cell { flex: 1; min-width: 0; margin: 0; }
.ga-cell svg { display: block; width: 100%; height: auto; }
.ga-cell figcaption {
  margin-top: 12px; text-align: center;
  font-family: var(--brand); font-size: var(--fs-meta);
  color: var(--muted); letter-spacing: 2px;
}
#genAnim text { fill: #ece7db; font-family: var(--brand); font-size: 13px; letter-spacing: 1px; }
.ga-panel { fill: #0b0b0b; stroke: #5a564c; stroke-width: 1; }
.ga-muted { fill: var(--muted) !important; }
#gaP2 .ga-muted { opacity: 0; transition: opacity .3s ease; }
#gaP2.on .ga-muted { opacity: 1; }
.ga-arrow {
  flex: none; width: 34px; align-self: center;
  fill: none; stroke: #3a372f; stroke-width: 1; transition: stroke .4s ease;
}
.ga-arrow path { fill: none; stroke: inherit; }
.ga-arrow.on { stroke: var(--copper); }
@media (max-width: 900px) {
  .ga-flow { gap: 5px; }
  .ga-arrow { width: 14px; }
  .ga-cell figcaption { font-size: 9px; letter-spacing: 0.5px; margin-top: 6px; }
}

/* 1 · chat */
.ga-reply { fill: var(--copper) !important; opacity: 0; transition: opacity .4s ease; }
.ga-reply.on { opacity: 1; }

/* 2 · component search */
.ga-row { opacity: 0; transform: translateX(-6px); transition: opacity .35s ease, transform .35s ease; }
#gaP2.on .r1 { transition-delay: 0s; }
#gaP2.on .r2 { transition-delay: .18s; }
#gaP2.on .r3 { transition-delay: .36s; }
#gaP2.on .r4 { transition-delay: .54s; }
#gaP2.on .ga-row { opacity: 1; transform: none; }
.ga-ok { fill: var(--copper) !important; }
.ga-hl { fill: var(--copper); opacity: 0; }
#gaP2.on .ga-hl { animation: ga-scan 1s steps(1) .1s forwards; }
@keyframes ga-scan {
  0%   { opacity: .10; transform: translateY(0); }
  25%  { transform: translateY(24px); }
  50%  { transform: translateY(48px); }
  75%  { transform: translateY(72px); }
  100% { opacity: 0; transform: translateY(72px); }
}
.ga-res { fill: var(--muted) !important; opacity: 0; transition: opacity .4s ease; }
#gaP2.on .ga-res { opacity: 1; transition-delay: 1s; }

/* 3 · block diagram */
.ga-blk { opacity: 0; transform: translateY(5px); transition: opacity .3s ease, transform .3s ease; }
.ga-blk rect { fill: none; stroke: #ece7db; stroke-width: 1; }
.ga-blk text { text-anchor: middle; }
#gaP3.on .k1 { transition-delay: 0s; }
#gaP3.on .k2 { transition-delay: .15s; }
#gaP3.on .k3 { transition-delay: .3s; }
#gaP3.on .k4 { transition-delay: .45s; }
#gaP3.on .k5 { transition-delay: .6s; }
#gaP3.on .ga-blk { opacity: 1; transform: none; }
.ga-con {
  fill: none; stroke: var(--copper); stroke-width: 1;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .3s ease;
}
#gaP3.on .c1 { stroke-dashoffset: 0; transition-delay: .85s; }
#gaP3.on .c2 { stroke-dashoffset: 0; transition-delay: .97s; }
#gaP3.on .c3 { stroke-dashoffset: 0; transition-delay: 1.09s; }
#gaP3.on .c4 { stroke-dashoffset: 0; transition-delay: 1.21s; }

/* 4 · schematic */
.ga-sch {
  fill: none; stroke: #ece7db; stroke-width: 1;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  transition: stroke-dashoffset .3s ease;
}
.ga-sch.ga-wire { stroke: var(--copper); }
.ga-ic {
  fill: #101010; stroke: #ece7db; stroke-width: 1;
  opacity: 0; transition: opacity .35s ease;
}
#gaP4.on .ga-ic { opacity: 1; }
#gaP4.on .s1  { transition-delay: 0s; }
#gaP4.on .s2  { stroke-dashoffset: 0; transition-delay: .13s; }
#gaP4.on .s3  { transition-delay: .26s; }
#gaP4.on .s4  { stroke-dashoffset: 0; transition-delay: .39s; }
#gaP4.on .s5  { transition-delay: .52s; }
#gaP4.on .s6  { stroke-dashoffset: 0; transition-delay: .65s; }
#gaP4.on .s7  { stroke-dashoffset: 0; transition-delay: .78s; }
#gaP4.on .s8  { stroke-dashoffset: 0; transition-delay: .91s; }
#gaP4.on .s9  { stroke-dashoffset: 0; transition-delay: 1.04s; }
#gaP4.on .s17 { stroke-dashoffset: 0; transition-delay: 1.17s; }
#gaP4.on .s10 { stroke-dashoffset: 0; transition-delay: 1.3s; }
#gaP4.on .s11 { stroke-dashoffset: 0; transition-delay: 1.43s; }
#gaP4.on .s12 { stroke-dashoffset: 0; transition-delay: 1.56s; }
#gaP4.on .s13 { stroke-dashoffset: 0; transition-delay: 1.69s; }
#gaP4.on .s15 { stroke-dashoffset: 0; transition-delay: 1.82s; }
#gaP4.on .s16 { stroke-dashoffset: 0; transition-delay: 1.95s; }
.ga-schlbl { opacity: 0; transition: opacity .4s ease; }
.ga-schlbl text { fill: var(--muted); font-size: 11px; }
#gaP4.on .s14 { opacity: 1; transition-delay: 2.15s; }

/* static fallback (reduced motion): everything shown, nothing moves */
#genAnim.static *, #genAnim.static { transition: none !important; animation: none !important; }
#genAnim.static .ga-hl { opacity: 0; }

/* Products */
.prod + .prod { margin-top: clamp(64px, 8vw, 110px); }
.prod-head { margin-bottom: 22px; }
.prod-head h3 { font-family: var(--head); font-size: clamp(21px, 2.2vw, 28px); letter-spacing: -0.02em; margin: 0 0 8px; }
.prod-head h3 .g { font-size: inherit; }
.prod-head p { margin: 0; font-size: var(--fs-body); color: var(--muted); }

/* Capability grid — hairline internal borders; tolerates a partial last row */
.caps {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.cap {
  background: var(--paper); padding: 28px 26px 32px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cap .micro { display: block; margin-bottom: 14px; color: var(--muted); }
.cap h3 { font-size: var(--fs-sub); margin: 0 0 10px; letter-spacing: -0.01em; }
.cap p { margin: 0; font-size: var(--fs-body); color: var(--muted); }
.cap-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  font-size: var(--fs-body); color: var(--muted);
}
.cap-list li { position: relative; padding-left: 14px; }
.cap-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 2px; background: var(--copper);
}
.tag {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  font-family: var(--brand); font-size: var(--fs-meta); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--copper); border: 1px solid var(--copper);
  vertical-align: 2px;
}
@media (max-width: 900px) { .caps { grid-template-columns: 1fr; } }

/* Audience pitch — borderless two-column, headline-sized titles */
.pitch-section { padding-top: clamp(110px, 15vw, 210px); padding-bottom: clamp(110px, 15vw, 210px); }
.pitch { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); }
.pitch h3 {
  font-family: var(--head); font-size: clamp(26px, 3vw, 38px);
  font-weight: 700; letter-spacing: -0.02em; margin: 0 0 22px;
}
.pitch .cap-list { font-size: clamp(17px, 1.6vw, 20px); gap: 14px; }
@media (max-width: 900px) { .pitch { grid-template-columns: 1fr; } }


/* Figure */
.fig { margin: 0; }
.fig img { width: 100%; border: 1px solid var(--line); }
.fig figcaption { padding: 12px 2px 0; }

/* Process rows */
.proc { border-top: 1px solid var(--line); }
.proc-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 50%);
  gap: clamp(28px, 4vw, 56px); padding: 34px 0; border-bottom: 1px solid var(--line); align-items: center;
}
.proc-row h3 { margin: 0 0 8px; font-size: var(--fs-sub); letter-spacing: -0.01em; }
.proc-row p { margin: 0; font-size: var(--fs-body); color: var(--muted); max-width: 62ch; }
.proc-row img {
  border: 1px solid rgba(255, 255, 255, 0.2); width: 100%;
  box-shadow: 0 0 30px rgba(185, 143, 98, 0.10), 0 0 70px rgba(236, 231, 219, 0.05);
  pointer-events: none; user-select: none; -webkit-user-drag: none;
}
@media (max-width: 900px) {
  .proc-row { grid-template-columns: 1fr; }
}

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 0;
  font-size: var(--fs-lede); font-weight: 600; letter-spacing: -0.01em;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--brand); color: var(--copper); font-size: var(--fs-sub); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 22px; font-size: var(--fs-body); color: var(--muted); max-width: 70ch; }

/* CTA band — solid light, inverse of the dark page */
.cta2 { background: var(--ink); color: var(--paper); padding: clamp(56px, 8vw, 104px) 0; }
.cta2 .micro { color: #96703f; }
.cta2 h2 {
  font-family: var(--head); font-size: clamp(28px, 3.6vw, 48px);
  letter-spacing: -0.02em; font-weight: 700; margin: 14px 0 12px;
}
.cta2 p { color: #4d483c; margin: 0 0 34px; font-size: var(--fs-lede); max-width: 52ch; }
.cta2-cta { display: flex; gap: 12px; flex-wrap: wrap; }
/* on the light band the outline button must flip to dark ink */
.cta2 .b-line { border-color: var(--paper); color: var(--paper); }
.cta2 .b-line:hover { background: var(--copper); border-color: var(--copper); color: var(--paper); }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 48px 0 0; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 44px; }
.foot h4 {
  font-family: var(--brand); font-size: var(--fs-meta); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px; font-weight: 600;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.foot ul a { font-size: var(--fs-body); color: var(--ink); }
.foot ul a:hover { color: var(--copper); }
.foot .soon { color: #5a564c; cursor: default; }
.foot .soon:hover { color: #5a564c; }
.foot-legal {
  border-top: 1px solid var(--line); padding: 18px 0;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: var(--fs-meta); color: var(--muted);
}
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }

/* Contact modal + toast (same markup/IDs as index.html, light theme) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 60;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 440px; margin: 20px; padding: 32px;
  background: var(--panel); border: 1px solid var(--line); position: relative;
}
.modal h2 { font-family: var(--head); margin: 0 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.modal-sub { margin: 0 0 22px; color: var(--muted); font-size: var(--fs-body); }
.modal-close {
  position: absolute; top: 10px; right: 14px; background: none; border: none;
  font-size: 28px; color: var(--muted); cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--ink); }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal label { font-size: var(--fs-meta); font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.modal .opt { color: var(--muted); font-weight: 400; }
.modal input, .modal textarea {
  font-family: var(--sans); font-size: var(--fs-body); padding: 10px 12px;
  background: #0c0c0c; color: var(--ink); border: 1px solid var(--line); border-radius: 0;
}
.modal input:focus, .modal textarea:focus { outline: none; border-color: var(--copper); }
.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.b-block { width: 100%; margin-top: 6px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--paper); padding: 12px 20px; font-size: var(--fs-body);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  z-index: 70; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #7c2d2d; }
