:root {
  --bg:       #030912;
  --bg2:      #060f1e;
  --bg3:      #0a1628;
  --line:     rgba(0,180,255,0.08);
  --line2:    rgba(0,180,255,0.15);
  --blue:     #00b4ff;
  --blue2:    #0066cc;
  --cyan:     #00e5ff;
  --green:    #00ff88;
  --orange:   #ff6b35;
  --red:      #ff2d55;
  --yellow:   #ffd60a;
  --dim:      rgba(255,255,255,0.35);
  --dimmer:   rgba(255,255,255,0.18);
  --text:     #e8f4fd;
  --mono:     'IBM Plex Mono', monospace;
  --sans:     'IBM Plex Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow-x: hidden;
  cursor: crosshair;
}

/* ── SCAN LINE OVERLAY ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
}

/* ── GLOBAL GRID BACKGROUND ── */
.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
}

.grid-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 70% at 50% 20%, rgba(0,100,255,0.06) 0%, transparent 70%);
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: 48px;
  background: rgba(3,9,18,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line2);
  display: flex; align-items: center;
  padding: 0 2rem; gap: 0;
}

.nav-id {
  font-family: var(--mono);
  font-size: 0.6875rem; letter-spacing: 0.14em;
  color: var(--blue); margin-right: 2rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.nav-id::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.nav-divider { width: 1px; height: 24px; background: var(--line2); margin: 0 1rem; }

.nav-item {
  font-family: var(--mono);
  font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dimmer); text-decoration: none;
  padding: 0 0.875rem; height: 48px; line-height: 48px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav-item:hover { color: var(--blue); background: rgba(0,180,255,0.04); }

.nav-spacer { flex: 1; }

.nav-status {
  font-family: var(--mono); font-size: 0.625rem;
  color: var(--dimmer); letter-spacing: 0.08em;
  display: flex; gap: 1rem;
}

.status-dot { color: var(--green); }

/* ── HERO ── */
.hero {
  min-height: 100vh; padding-top: 48px;
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

/* Particle canvas */
#particle-canvas {
  position: absolute; inset: 0; z-index: 0;
}

.hero-left {
  padding: 5rem 3rem 5rem 4rem;
  display: flex; flex-direction: column; justify-content: center;
  position: relative; z-index: 2;
}

.hero-terminal {
  font-family: var(--mono); font-size: 0.6875rem;
  color: var(--green); letter-spacing: 0.06em;
  margin-bottom: 2rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}

.terminal-line { display: flex; gap: 0.5rem; }
.terminal-prompt { color: var(--blue); }
.terminal-cmd { color: var(--text); }
.terminal-out { color: var(--dim); padding-left: 1rem; }
.terminal-cursor {
  display: inline-block; width: 7px; height: 12px;
  background: var(--green);
  animation: cursor-blink 1s step-end infinite;
  vertical-align: middle;
}
@keyframes cursor-blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-title {
  font-family: var(--mono);
  font-size: clamp(2rem, 3.5vw, 3.5rem);
  font-weight: 300; line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.hero-title .hl-blue { color: var(--blue); font-weight: 400; }
.hero-title .hl-green { color: var(--green); font-weight: 400; }

.hero-subtitle {
  font-size: 0.9375rem; font-weight: 300;
  color: var(--dim); line-height: 1.8;
  max-width: 30rem; margin-bottom: 2.5rem;
}

.hero-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--line2);
  border: 1px solid var(--line2);
  margin-bottom: 2.5rem;
}

.metric-box {
  background: var(--bg);
  padding: 1rem; display: flex; flex-direction: column; gap: 0.25rem;
}

.metric-val {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 300;
  color: var(--blue); line-height: 1;
}
.metric-val .unit { font-size: 0.7em; color: var(--dim); }
.metric-label { font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.12em; color: var(--dimmer); text-transform: uppercase; }

.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-sci {
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.75rem 1.5rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  position: relative; overflow: hidden;
  transition: color 0.2s;
}

.btn-sci-primary {
  background: transparent;
  color: var(--bg); 
}
.btn-sci-primary::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--blue);
  transition: transform 0.2s;
  transform-origin: left;
}
.btn-sci-primary:hover::before { transform: scaleX(0); }
.btn-sci-primary:hover { color: var(--blue); }
.btn-sci-primary span { position: relative; z-index: 1; }

.btn-sci-outline {
  color: var(--blue); border: 1px solid var(--blue);
  background: transparent;
}
.btn-sci-outline:hover { background: rgba(0,180,255,0.08); }

/* ── HERO RIGHT: DATA VISUALIZATION ── */
.hero-right {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--line2);
}

.data-panel {
  flex: 1; padding: 1.5rem;
  border-bottom: 1px solid var(--line2);
  position: relative;
}

.panel-header {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dimmer); margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: space-between;
}

.panel-header .ph-status {
  color: var(--green); display: flex; align-items: center; gap: 0.375rem;
}
.panel-header .ph-status::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px var(--green);
  animation: blink 1.5s infinite;
}

canvas { display: block; }

/* ── SECTION STRUCTURE ── */
.lab-section { position: relative; z-index: 1; }

.section-ruler {
  height: 32px; border-bottom: 1px solid var(--line2);
  display: flex; align-items: center; padding: 0 2rem;
  gap: 1rem; overflow: hidden;
}

.ruler-ticks {
  flex: 1; display: flex; align-items: flex-end; gap: 0; height: 100%;
}

.tick {
  width: 1px; background: var(--line2); flex-shrink: 0;
  transition: background 0.2s;
}
.tick:nth-child(10n) { background: var(--line2); height: 60%; }
.tick:nth-child(5n)  { height: 40%; }
.tick { height: 25%; }

.ruler-label {
  font-family: var(--mono); font-size: 0.5625rem; color: var(--dimmer);
  letter-spacing: 0.1em; white-space: nowrap;
}

/* ── SERVICES ── */
.services-header {
  display: grid; grid-template-columns: 280px 1fr;
  border-bottom: 1px solid var(--line2);
}

.sh-left {
  padding: 3rem 2rem;
  border-right: 1px solid var(--line2);
  display: flex; flex-direction: column; gap: 1rem;
}

.sh-tag {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--blue);
}

.sh-title {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 300; line-height: 1.2;
  color: var(--text);
}

.sh-desc {
  font-size: 0.8125rem; font-weight: 300; color: var(--dim); line-height: 1.7;
}

.sh-right {
  padding: 2rem; display: flex; align-items: center;
}

/* Spectrum bar viz */
.spectrum {
  width: 100%; display: flex; align-items: flex-end; gap: 3px; height: 80px;
}

.spec-bar {
  flex: 1; background: var(--blue2); min-height: 4px;
  position: relative; transition: height 0.5s ease;
}
.spec-bar::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--blue);
}

.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
}

.svc-card {
  padding: 2rem 1.75rem;
  border-right: 1px solid var(--line2);
  border-bottom: 1px solid var(--line2);
  position: relative; overflow: hidden;
  transition: background 0.2s;
}
.svc-card:nth-child(3n) { border-right: none; }
.svc-card:hover { background: rgba(0,180,255,0.03); }
.svc-card:hover .svc-line { width: 100%; }

.svc-line {
  position: absolute; top: 0; left: 0; height: 1px;
  background: var(--blue); width: 0;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px var(--blue);
}

.svc-index {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.12em;
  color: var(--dimmer); margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.svc-index::before {
  content: ''; width: 20px; height: 1px; background: var(--line2);
}

/* Mini SVG diagram per card */
.svc-diagram {
  width: 48px; height: 48px; margin-bottom: 1.25rem;
}

.svc-name {
  font-family: var(--mono); font-size: 0.875rem; font-weight: 500;
  color: var(--text); margin-bottom: 0.625rem; line-height: 1.3;
}

.svc-desc {
  font-size: 0.8125rem; font-weight: 300; color: var(--dim); line-height: 1.65;
}

.svc-tags {
  margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.375rem;
}

.tag {
  font-family: var(--mono); font-size: 0.5rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line2); color: var(--dimmer);
}

/* ── DATA DASHBOARD ROW ── */
.dashboard-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--line2);
}

.dash-panel {
  padding: 2rem 1.75rem;
  border-right: 1px solid var(--line2);
}
.dash-panel:last-child { border-right: none; }

.dp-title {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--dimmer); margin-bottom: 1.25rem;
}

/* Oscilloscope */
.oscilloscope { width: 100%; height: 80px; position: relative; }

/* Radar chart label */
.radar-wrap { display: flex; align-items: center; justify-content: center; padding: 0.5rem 0; }

/* Heatmap */
.heatmap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.hm-cell {
  aspect-ratio: 1; border-radius: 1px;
  background: var(--line2);
  transition: background 0.3s;
}

/* ── WHY ── */
.why-section {
  display: grid; grid-template-columns: 400px 1fr;
  border-top: 1px solid var(--line2);
}

.why-left {
  padding: 3rem 2.5rem;
  border-right: 1px solid var(--line2);
  background: rgba(0,180,255,0.03);
  display: flex; flex-direction: column; gap: 2rem;
}

.big-number {
  font-family: var(--mono); font-size: 5rem; font-weight: 300;
  color: var(--blue); opacity: 0.25; line-height: 1;
  letter-spacing: -0.04em;
}

.why-claim {
  font-family: var(--mono); font-size: 1.25rem; font-weight: 300;
  color: var(--text); line-height: 1.3;
}

.why-claim em { color: var(--blue); font-style: normal; }

.why-body {
  font-size: 0.875rem; font-weight: 300; color: var(--dim); line-height: 1.7;
}

.why-right {
  display: grid; grid-template-columns: 1fr 1fr;
}

.why-item {
  padding: 2rem 1.75rem;
  border-bottom: 1px solid var(--line2);
  border-right: 1px solid var(--line2);
}
.why-item:nth-child(even) { border-right: none; }
.why-item:nth-child(n+5) { border-bottom: none; }

.wi-num {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.12em;
  color: var(--blue); margin-bottom: 0.75rem;
}

.wi-title {
  font-family: var(--mono); font-size: 0.875rem; font-weight: 500;
  color: var(--text); margin-bottom: 0.5rem;
}

.wi-desc {
  font-size: 0.8125rem; font-weight: 300; color: var(--dim); line-height: 1.65;
}

/* Progress bar */
.wi-bar { margin-top: 1rem; height: 2px; background: var(--line2); position: relative; }
.wi-bar-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: var(--blue);
  box-shadow: 0 0 6px var(--blue);
  transition: width 1.5s ease;
}

/* ── CONTACT ── */
.contact-section {
  border-top: 1px solid var(--line2);
  display: flex; justify-content: center; align-items: center;
  padding: 5rem 2rem;
}

.contact-terminal {
  font-family: var(--mono); font-size: 0.75rem;
  background: var(--bg2); border: 1px solid var(--line2);
  padding: 2rem 2.5rem; margin-top: 2rem; line-height: 2;
  width: 100%; max-width: 560px;
}

.ct-line { display: flex; gap: 0.75rem; align-items: flex-start; }
.ct-key { color: var(--blue); width: 110px; flex-shrink: 0; }
.ct-val { color: var(--text); font-weight: 300; }
.ct-val a { color: var(--cyan); text-decoration: none; transition: color 0.15s; }
.ct-val a:hover { color: var(--white); text-decoration: underline; }

.contact-inner {
  width: 100%; max-width: 560px;
  display: flex; flex-direction: column; align-items: flex-start;
}

.mail-link-block {
  margin-top: 2rem; width: 100%; max-width: 560px;
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line2); padding: 1.25rem 1.5rem;
  background: var(--bg2); gap: 1rem;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.mail-link-block:hover {
  border-color: var(--blue);
  background: rgba(0,180,255,0.05);
}
.mail-link-block:hover .mail-arrow { transform: translateX(4px); }

.mail-label {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--dimmer); margin-bottom: 0.25rem;
}

.mail-address {
  font-family: var(--mono); font-size: 1rem; color: var(--cyan); font-weight: 400;
}

.mail-arrow {
  font-size: 1.25rem; color: var(--blue);
  transition: transform 0.2s;
  flex-shrink: 0;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--line2);
  padding: 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  position: relative; z-index: 1;
  background: var(--bg);
}

.footer-sig {
  font-family: var(--mono); font-size: 0.625rem; letter-spacing: 0.1em;
  color: var(--dimmer);
}

.footer-sig strong { color: var(--blue); }

.footer-nav { display: flex; gap: 2rem; }
.footer-nav a {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dimmer); text-decoration: none; transition: color 0.15s;
}
.footer-nav a:hover { color: var(--blue); }

.footer-hash {
  font-family: var(--mono); font-size: 0.5625rem; color: rgba(255,255,255,0.1);
}

/* ── REVEAL ── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  nav .nav-status { display: none; }
  .services-header { grid-template-columns: 1fr; }
  .sh-right { display: none; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .services-grid .svc-card:nth-child(2n) { border-right: none; }
  .services-grid .svc-card:nth-child(3n) { border-right: 1px solid var(--line2); }
  .dashboard-row { grid-template-columns: 1fr; }
  .dash-panel { border-right: none; }
  .why-section { grid-template-columns: 1fr; }
  .why-left { border-right: none; border-bottom: 1px solid var(--line2); }
  .contact-section { padding: 3rem 1.5rem; }
  footer { flex-direction: column; gap: 1rem; text-align: center; }
}
@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
  .svc-card { border-right: none !important; }
  .why-right { grid-template-columns: 1fr; }
  .why-item { border-right: none !important; }

}
