:root {
  --accent: #1F5EFF;
  --accent-soft: #E8EFFF;
  --ink: #111620;
  --ink-2: #4A5361;
  --paper: #FFFFFF;
  --mist: #F4F6F9;
  --line: #DFE3E8;
  --sans: 'Archivo', Arial, sans-serif;
  --mono: 'IBM Plex Mono', Consolas, monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 68px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }

.eyebrow { font: 500 13px/1.4 var(--mono); letter-spacing: .03em; color: var(--accent); }

h2 {
  margin-top: 10px;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600; line-height: 1.12; letter-spacing: -.022em;
  text-wrap: balance;
}

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in { position: relative; display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: inline-flex; }
.brand img { display: block; width: 228px; height: auto; }
.nav nav { display: flex; align-items: center; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav nav a { font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink-2); transition: color .15s; }
.nav nav a:hover { color: var(--ink); }
.nav .nav-cta {
  color: #fff; background: var(--ink); padding: 8px 16px; border-radius: 8px;
  white-space: nowrap; transition: background .2s;
}
.nav .nav-cta:hover { color: #fff; background: var(--accent); }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; padding: 0; margin: -4px -6px -4px 0;
  background: none; border: 0; cursor: pointer; color: var(--ink);
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 22px;
  color: #fff; background: var(--accent);
  font-weight: 600; text-decoration: none;
  border-radius: 8px; border: 1.5px solid var(--accent);
  transition: background .2s, border-color .2s, color .2s;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-line { color: var(--ink); background: var(--paper); border-color: var(--line); }
.btn-big { min-height: 58px; padding: 0 28px; font-size: 18px; }

/* Hero */
.hero { position: relative; overflow: hidden; }
#dots {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(100deg, transparent 28%, #000 72%);
  mask-image: linear-gradient(100deg, transparent 28%, #000 72%);
}
.hero-in { position: relative; padding: 112px 0 120px; pointer-events: none; }
.hero-in a { pointer-events: auto; }
.hero h1 {
  max-width: 760px; margin: 14px 0 18px;
  font-size: clamp(40px, 6.2vw, 72px);
  font-weight: 700; line-height: 1.04; letter-spacing: -.03em;
  text-wrap: balance;
}
.lede { max-width: 580px; font-size: 19px; color: var(--ink-2); text-wrap: pretty; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* Sections */
.services, .projects { padding: 96px 0; }
.section-head { max-width: 720px; margin-bottom: 36px; }

/* Services tabs */
.tabs {
  display: grid; grid-template-columns: 270px 1fr; gap: 24px;
  align-items: stretch;
}
.tablist { display: flex; flex-direction: column; gap: 4px; }
.tablist button {
  min-height: 56px; padding: 0 18px;
  text-align: left; font-size: 18px; font-weight: 500; color: var(--ink-2);
  background: none; border: 0; border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s;
}
.tablist button:hover { color: var(--ink); background: var(--mist); }
.tablist button[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.panel {
  display: grid; grid-template-columns: 1fr 240px; gap: 32px; align-items: center;
  min-height: 300px; padding: 36px 40px;
  background: var(--mist); border-radius: var(--radius);
}
.js .panel { animation: fade .3s ease; }
.panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.panel h3 { font-size: 26px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.panel p { margin: 8px 0 16px; color: var(--ink-2); }
.panel ul { list-style: none; }
.panel li { position: relative; padding: 3px 0 3px 22px; }
.panel li::before {
  content: ''; position: absolute; left: 2px; top: 13px;
  width: 8px; height: 8px; border-radius: 2px; background: var(--accent);
}
.panel img { display: block; width: 100%; height: auto; }

/* About */
.about { padding: 96px 0; background: var(--mist); }
.about-in { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about-lead { margin-top: 16px; font-size: 18px; color: var(--ink-2); text-wrap: pretty; }
.steps { list-style: none; counter-reset: step; }
.steps li {
  position: relative; counter-increment: step;
  padding: 16px 0 16px 58px;
  border-top: 1px solid var(--line);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 16px;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  font: 500 15px var(--mono); color: var(--accent); background: var(--paper);
  transition: background .2s, color .2s;
}
.steps li:hover::before { color: #fff; background: var(--accent); }
.steps b { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.steps span { color: var(--ink-2); }

/* Project buttons */
.rows { display: grid; gap: 14px; }
.row {
  display: grid; grid-template-columns: 1fr auto 48px; align-items: center; gap: 24px;
  padding: 24px 28px;
  color: var(--ink); text-decoration: none;
  background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  transition: background .2s, border-color .2s, color .2s;
}
.row b { display: block; font-size: 23px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; }
.row-text span { color: var(--ink-2); transition: color .2s; }
.row-tag { font: 400 13px var(--mono); color: var(--ink-2); white-space: nowrap; transition: color .2s; }
.row-go {
  display: grid; place-items: center; width: 48px; height: 48px;
  font-size: 20px; color: #fff; background: var(--accent); border-radius: 10px;
  transition: transform .2s, background .2s, color .2s;
}
.row:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.row:hover .row-text span, .row:hover .row-tag { color: #E8EFFF; }
.row:hover .row-go { color: var(--accent); background: #fff; transform: translateX(4px); }

/* Contact */
.contact { padding: 96px 0; text-align: center; color: #fff; background: var(--ink); }
.contact h2 { margin: 0 auto 12px; }
.contact p { margin-bottom: 28px; font-size: 18px; color: #C8CED6; }
.contact .btn:hover { color: var(--ink); background: #fff; border-color: #fff; }

.foot { padding: 24px 0; font-size: 14px; color: var(--ink-2); }
.foot-in { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 32px; }

/* Project pages */
.back { font-size: 15px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--accent); }

/* Scroll reveal, only when JS is running */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s ease, transform .55s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .tabs { grid-template-columns: 1fr; }
  .tablist { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .tablist button { min-height: 44px; padding: 0 14px; font-size: 16px; background: var(--mist); }
  .about-in { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .brand img { width: 186px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    min-width: 210px; padding: 10px;
    background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 16px 40px -20px rgba(16, 20, 26, .4);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; border-radius: 8px; }
  .nav-links a:not(.nav-cta):hover { background: var(--mist); }
  .nav .nav-cta { font-size: 15px; text-align: center; margin-top: 4px; }
  #dots {
    -webkit-mask-image: linear-gradient(180deg, transparent 58%, #000);
    mask-image: linear-gradient(180deg, transparent 58%, #000);
  }
  .hero-in { padding: 64px 0 96px; }
  .lede { font-size: 17px; }
  .hero-btns .btn { flex: 1 1 100%; }
  .services, .projects, .about, .contact { padding: 68px 0; }
  .panel { grid-template-columns: 1fr; gap: 20px; padding: 26px 22px; min-height: 0; }
  .panel img { max-width: 200px; }
  .row { grid-template-columns: 1fr 44px; gap: 6px 14px; padding: 20px; }
  .row b { font-size: 20px; }
  .row-tag { grid-row: 2; grid-column: 1; }
  .row-go { grid-row: 1 / 3; grid-column: 2; width: 44px; height: 44px; }
  .btn-big { font-size: 16px; padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .panel { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Project page: S2000 cluster ---- */
.proj-hero { padding: 40px 0 56px; background: var(--mist); border-bottom: 1px solid var(--line); }
.proj-hero .back { display: inline-block; margin-bottom: 24px; }
.proj-hero .tag { margin-bottom: 12px; }

/* Status tag + live pulse dot */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 13px/1 var(--mono); color: var(--accent);
}
.pulse {
  position: relative; flex: none;
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}
.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: currentColor; animation: pulse 2s ease-out infinite;
}
@keyframes pulse { to { transform: scale(3.4); opacity: 0; } }

/* Roadmap stepper */
.track { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 28px; }
.track li { position: relative; padding: 20px 16px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.track li::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--line); }
.track li::after {
  content: ''; position: absolute; top: -4px; left: 0;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 3px solid var(--line); box-sizing: border-box;
}
.track b { display: block; font-size: 16px; font-weight: 600; color: var(--ink); }
.track span { color: var(--ink-2); }
.track .done::before { background: var(--accent); }
.track .done::after { background: var(--accent); border-color: var(--accent); }
.track .now::before { background: linear-gradient(90deg, var(--accent) 50%, var(--line) 50%); }
.track .now::after { border-color: var(--accent); background: #fff; }
.proj-hero h1 {
  font-size: clamp(36px, 5.4vw, 60px); font-weight: 700;
  line-height: 1.04; letter-spacing: -.03em; text-wrap: balance;
}
.proj-hero .lede { max-width: 680px; margin-top: 16px; font-size: 19px; color: var(--ink-2); text-wrap: pretty; }
.spec-strip { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.spec-strip div {
  flex: 1 1 120px; padding: 16px 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.spec-strip b { display: block; font-size: clamp(20px, 6.5vw, 26px); font-weight: 700; letter-spacing: -.02em; }
.spec-strip span { font: 400 13px var(--mono); color: var(--ink-2); }

.proj-section { padding: 80px 0; }
.proj-section.alt { background: var(--mist); }
.proj-section .sub { max-width: 640px; margin-top: 14px; font-size: 18px; color: var(--ink-2); text-wrap: pretty; }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.features article {
  padding: 26px 28px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}
.proj-section.alt .features article { background: var(--paper); }
.features article:hover { border-color: var(--accent); transform: translateY(-3px); }
.features h3 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; }
.features p { margin-top: 8px; font-size: 16px; color: var(--ink-2); }

.track.wide li { font-size: 14px; }
.track.wide b { font-size: 16px; }

@media (max-width: 720px) {
  .track { grid-template-columns: 1fr; }
  .track li { padding: 0 0 20px 26px; }
  .track li::before { top: 0; bottom: 0; left: 4px; right: auto; width: 4px; height: auto; }
  .track li:last-child::before { bottom: 50%; }
  .track li::after { top: 2px; }
  .track .now::before { background: linear-gradient(180deg, var(--accent) 50%, var(--line) 50%); }
}

.editor-wrap {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 20px 50px -30px rgba(16,20,26,.5);
}
.editor-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; font: 500 14px var(--mono); color: #C8CED6;
  background: var(--ink);
}
.editor-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: #8A94A3; }
.editor-open { margin-left: auto; color: #fff; text-decoration: none; font-weight: 600; }
.editor-open:hover { color: var(--accent); }
.editor-wrap iframe {
  display: block; width: 100%; height: 900px; border: 0; background: #0b0f14;
}

@media (max-width: 720px) {
  .proj-section { padding: 60px 0; }
  .features { grid-template-columns: 1fr; }
  .spec-strip div { flex-basis: calc(50% - 7px); }
  .editor-wrap iframe { height: 760px; }
}

/* ---- Project page: scan/figure visuals (lidar) ---- */
.shots { display: grid; gap: 20px; }
.shot { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0b0f14; }
.shot img { display: block; width: 100%; height: auto; }
.shot.light { background: #fff; }
.shot figcaption { padding: 12px 18px; font: 400 13px/1.5 var(--mono); color: #AEB6C1; background: var(--ink); }
.shots-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 720px) {
  .shots-two { grid-template-columns: 1fr; }
}

/* ---- Embedded 3D assembly viewer ---- */
.embed3d { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #f2f5f3; }
.embed3d iframe { display: block; width: 100%; height: 560px; border: 0; }
@media (max-width: 720px) { .embed3d iframe { height: 440px; } }

/* ---- Click-to-load 3D poster ---- */
.poster3d {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 14px;
  height: 560px; text-align: center;
  background: #f2f5f3;
  background-image: linear-gradient(#e3e8e4 1px, transparent 1px), linear-gradient(90deg, #e3e8e4 1px, transparent 1px);
  background-size: 26px 26px;
}
.poster3d svg { width: 44px; height: 44px; color: var(--accent); }
.poster3d-note { font: 500 13px var(--mono); color: var(--ink-2); }
@media (max-width: 720px) { .poster3d { height: 440px; } }

/* ---- Contact form ---- */
.cform { max-width: 520px; margin: 0 auto; text-align: left; display: grid; gap: 14px; }
.cfield { display: grid; gap: 6px; }
.cfield label { font: 500 14px var(--sans); color: #C8CED6; }
.cform input, .cform textarea {
  font: inherit; padding: 12px 14px; color: var(--ink); background: #fff;
  border: 1px solid #39414c; border-radius: 8px; width: 100%; box-sizing: border-box;
}
.cform input:focus, .cform textarea:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.cform textarea { resize: vertical; min-height: 110px; }
.cform .cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; }
.cform .btn { justify-self: start; }
.contact .cform-status { min-height: 1.2em; margin: 2px 0 0; font-size: 15px; color: #C8CED6; }
.cform-status.ok { color: #8fe3b0; }
.cform-status.err { color: #ff9b8c; }
.contact .cform-status a, .contact .cform-alt a { color: #fff; }
.contact .cform-alt { margin: 0; font-size: 14px; color: #93a0b0; }
@media (max-width: 720px) { .cform .btn { justify-self: stretch; } }
