:root {
  --bg-deep: #05070f;
  --bg-secondary: #0a1128;
  --accent-glow: #2e5cff;
  --accent-glow-soft: rgba(46, 92, 255, 0.35);
  --accent-cyan: #4de5ff;
  --text-primary: #eaf0ff;
  --text-muted: #7c88b8;
  --border-glow: rgba(77, 229, 255, 0.25);
  --surface: rgba(8, 14, 29, 0.76);
  --surface-strong: rgba(11, 18, 42, 0.92);
  --font-main: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

#bg-canvas,
#star-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#bg-canvas { z-index: -2; opacity: 0.7; }
#star-canvas { z-index: -1; }

.page-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 64px;
}

.section-shell {
  position: relative;
  padding: 28px;
  margin: 18px 0;
  border: 1px solid rgba(124, 136, 184, 0.16);
  background: linear-gradient(180deg, rgba(10, 17, 40, 0.72), rgba(5, 7, 15, 0.6));
  overflow: hidden;
}

.section-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-glow) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-glow) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow-soft), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}
.glow-orb--top-left { top: -110px; left: -120px; }
.glow-orb--bottom-right { right: -120px; bottom: -120px; }

.hero { padding-top: 22px; }
.hero-topline,
.hero-grid,
.about-grid,
.services-grid,
.timeline-grid,
.contact-row,
.section-head,
.portfolio-viewport {
  position: relative;
  z-index: 1;
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
}

.status-pill,
.hero-links a,
.system-label,
.service-index,
.section-kicker,
.meta-line strong,
.metric-label,
.timeline-item span {
  font-family: var(--font-mono);
}

.status-pill {
  padding: 8px 12px;
  border: 1px solid rgba(77, 229, 255, 0.24);
  background: rgba(6, 13, 31, 0.74);
  color: var(--accent-cyan);
  font-size: 12px;
}

.hero-links { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-links a {
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
}

.hero-title {
  margin: 0;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 0.96;
  max-width: 12ch;
}

.hero-lead {
  max-width: 60ch;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.magnetic-btn,
.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid rgba(124, 136, 184, 0.22);
  background: rgba(8, 14, 29, 0.72);
  color: var(--text-primary);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.primary {
  background: linear-gradient(135deg, rgba(46, 92, 255, 0.95), rgba(77, 229, 255, 0.72));
  color: #04101f;
  font-weight: 700;
}
.secondary:hover,
.contact-btn:hover,
.hero-links a:hover {
  border-color: rgba(77, 229, 255, 0.42);
  color: var(--text-primary);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.metric-card,
.panel-card,
.info-card,
.service-card,
.timeline-item {
  border: 1px solid rgba(124, 136, 184, 0.18);
  background: var(--surface);
  backdrop-filter: blur(14px);
}
.metric-card {
  padding: 18px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}
.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.hero-panel {
  display: grid;
  gap: 14px;
}
.panel-card {
  padding: 18px;
}
.avatar-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
}
.avatar-frame {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(77, 229, 255, 0.25);
}
.avatar-meta,
.system-card {
  display: grid;
  gap: 10px;
}
.meta-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
}
.meta-line strong,
.system-row strong {
  color: var(--text-primary);
  font-weight: 600;
}
.system-card { background: var(--surface-strong); }
.system-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid rgba(124, 136, 184, 0.14);
  color: var(--text-muted);
  font-size: 13px;
}

.section-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}
.section-head h2,
.glitch-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.04;
}

.about-grid,
.services-grid,
.timeline-grid {
  display: grid;
  gap: 14px;
}
.about-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-card,
.service-card,
.timeline-item {
  padding: 18px;
}
.info-card h3,
.service-card h3,
.timeline-item strong {
  margin: 0 0 10px;
  font-size: 18px;
}
.info-card p,
.service-card p,
.timeline-item p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.service-card {
  position: relative;
  min-height: 180px;
  transform-style: preserve-3d;
}
.service-index {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent-cyan);
  font-size: 12px;
}

.portfolio-viewport {
  overflow: hidden;
}
.portfolio-track {
  display: flex;
  gap: 18px;
  width: max-content;
  padding: 6px 0;
}
.portfolio-card {
  width: 280px;
  flex: 0 0 auto;
  border: 1px solid rgba(124, 136, 184, 0.18);
  background: rgba(7, 12, 26, 0.8);
}
.portfolio-thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}
.portfolio-caption {
  margin: 0;
  padding: 12px 14px 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 42px;
}

.timeline-wrap {
  position: relative;
}
.timeline-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 240px;
  pointer-events: none;
  opacity: 0.85;
}
.timeline-path {
  fill: none;
  stroke: rgba(77, 229, 255, 0.76);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0;
  stroke-dashoffset: 0;
}
.timeline-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 70px;
}
.timeline-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-cyan);
}
.timeline-item strong {
  display: block;
  line-height: 1.2;
}

.contact-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.contact-btn { min-width: 140px; }

.glitch-title {
  position: relative;
  display: inline-block;
}
.glitch-title:hover::before,
.glitch-title:hover::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
}
.glitch-title:hover::before {
  color: var(--accent-cyan);
  clip-path: inset(0 0 50% 0);
  animation: glitch-top 0.4s infinite;
}
.glitch-title:hover::after {
  color: var(--accent-glow);
  clip-path: inset(50% 0 0 0);
  animation: glitch-bottom 0.4s infinite;
}

@keyframes glitch-top {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-3px, -1px); }
  100% { transform: translate(0, 0); }
}
@keyframes glitch-bottom {
  0% { transform: translate(0, 0); }
  50% { transform: translate(3px, 1px); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 1024px) {
  .hero-grid,
  .about-grid,
  .services-grid,
  .timeline-grid {
    grid-template-columns: 1fr 1fr;
  }
  .hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .page-shell { width: min(100vw - 20px, 1200px); padding-top: 10px; }
  .section-shell { padding: 18px; }
  .hero-topline,
  .hero-grid,
  .about-grid,
  .services-grid,
  .timeline-grid {
    grid-template-columns: 1fr;
  }
  .hero-topline { flex-direction: column; align-items: flex-start; }
  .hero-metrics { grid-template-columns: 1fr; }
  .avatar-card { grid-template-columns: 1fr; }
  .timeline-grid { padding-top: 34px; }
  .portfolio-card { width: 240px; }
}
