*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #060810;
  --bg2: #0c0f1a;
  --fg: #e8eaf2;
  --fg-muted: rgba(232, 234, 242, 0.45);
  --accent: #00f5c3;
  --accent-dim: rgba(0, 245, 195, 0.12);
  --accent2: #0088ff;
  --border: rgba(232, 234, 242, 0.08);
  --card-bg: rgba(255,255,255,0.03);
  --radius: 4px;
  --nav-bg: rgba(6, 8, 16, 0.75);
  --mobile-menu-bg: rgba(6, 8, 16, 0.97);
}

[data-theme="light"] {
  --bg: #f0f2f8;
  --bg2: #e4e7f2;
  --fg: #0c0f1a;
  --fg-muted: rgba(12, 15, 26, 0.55);
  --accent: #009d82;
  --accent-dim: rgba(0, 157, 130, 0.12);
  --accent2: #0060cc;
  --border: rgba(12, 15, 26, 0.1);
  --card-bg: rgba(0, 0, 0, 0.03);
  --nav-bg: rgba(240, 242, 248, 0.85);
  --mobile-menu-bg: rgba(240, 242, 248, 0.97);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 300;
  overflow-x: hidden;
  cursor: none;
}

/* ============================
   CURSOR
   ============================ */
.cursor {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s;
  box-shadow: 0 0 8px 2px var(--accent), 0 0 20px 6px var(--accent-dim);
}

.cursor-ring {
  display: none;
}

.cursor-trail {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9997;
  box-shadow: 0 0 4px 1px var(--accent-dim);
}

/* ============================
   SCANLINES
   ============================ */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.03) 3px,
    rgba(0,0,0,0.03) 4px
  );
}

/* ============================
   NAV
   ============================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  background: var(--nav-bg);
  transition: background 0.3s;
}

.nav-logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--fg);
  text-decoration: none;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: color 0.2s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.25s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.65rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================
   THEME TOGGLE
   ============================ */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  color: var(--fg-muted);
  font-size: 0.85rem;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ============================
   BURGER BUTTON
   ============================ */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: none;
  padding: 0;
  z-index: 101;
}

.nav-burger span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--fg);
  transition: transform 0.3s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-burger.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  background: var(--accent);
}

.nav-burger.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-burger.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  background: var(--accent);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,245,195,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(0,245,195,0); }
}

/* ============================
   HERO
   ============================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 3rem;
  padding-top: 8rem;
  padding-bottom: 5rem;
  position: relative;
  overflow: hidden;
}

/* Animated grid background */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,245,195,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,195,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridMove 20s linear infinite;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 100%);
}

@keyframes gridMove {
  0% { background-position: 0 0; }
  100% { background-position: 0 60px; }
}

/* Glow blob */
.hero::before {
  content: '';
  position: absolute;
  top: 10%; right: 10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(0,245,195,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 20%; left: 5%;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(0,136,255,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  animation: fadeUp 0.9s ease both;
}

.hero-tag {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.6s 0.1s ease forwards;
}

.hero-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(4rem, 10vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.hero-title .line-1 {
  display: block;
  color: var(--fg);
  opacity: 0;
  animation: fadeUp 0.7s 0.2s ease forwards;
}

.hero-title .line-2 {
  display: block;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(232,234,242,0.3);
  opacity: 0;
  animation: fadeUp 0.7s 0.35s ease forwards;
}

.accent { color: var(--accent); -webkit-text-stroke: 0; }

.hero-sub {
  font-size: 0.8rem;
  color: var(--fg-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.5s ease forwards;
}

.hero-cta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.7s 0.65s ease forwards;
}

.hero-counter-col {
  position: absolute;
  right: 3rem;
  bottom: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1s 1s ease forwards;
}

.counter-item {
  text-align: right;
}

.counter-num {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.counter-label {
  font-size: 0.6rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.counter-divider {
  height: 1px;
  background: var(--border);
  width: 100%;
}

.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fg-muted);
  opacity: 0;
  animation: fadeIn 1s 1.2s ease forwards;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 1.5s ease infinite;
}

@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================
   BUTTONS
   ============================ */
.btn-primary {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--accent);
  color: var(--bg);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  cursor: none;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 20px rgba(0,245,195,0.2);
}

.btn-primary:hover {
  background: #00ffcc;
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0,245,195,0.4);
}

.btn-ghost {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: transparent;
  color: var(--fg);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.btn-full {
  width: 100%;
  text-align: center;
}

/* ============================
   TICKER
   ============================ */
.ticker-wrap {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
  background: var(--bg2);
}

.ticker {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: ticker 20s linear infinite;
  width: max-content;
}

.ticker span {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.ticker-dot {
  color: var(--accent) !important;
  font-size: 0.5rem !important;
  display: flex;
  align-items: center;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================
   SECTIONS SHARED
   ============================ */
.section-tag {
  display: block;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 3rem;
  letter-spacing: -0.01em;
}

/* ============================
   SERVICES
   ============================ */
.services {
  padding: 7rem 3rem;
  position: relative;
}

.section-header {
  margin-bottom: 4rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5px;
  background: var(--border);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.service-card {
  background: var(--card-bg);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: background 0.3s;
}

.service-card::before {
  content: attr(data-num);
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.4s ease;
}

.service-card:hover {
  background: rgba(0,245,195,0.04);
}

.service-card:hover::after {
  width: 100%;
}

.service-card.featured {
  background: rgba(0,245,195,0.05);
  border-left: 2px solid var(--accent);
}

.service-card.featured::after {
  width: 100%;
}

.featured-badge {
  display: inline-block;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 1rem;
}

.service-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.service-card h3 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  letter-spacing: 0.02em;
}

.service-card p {
  font-size: 0.8rem;
  line-height: 1.8;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}

.service-tags {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.service-tags li {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  padding-left: 1rem;
  position: relative;
}

.service-tags li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ============================
   ABOUT
   ============================ */
.about {
  padding: 7rem 3rem;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.about-left .section-title {
  margin-bottom: 1.5rem;
}

.about-text {
  font-size: 0.85rem;
  line-height: 1.9;
  color: var(--fg-muted);
  margin-bottom: 1.25rem;
}

.about-text strong {
  color: var(--fg);
  font-weight: 500;
}

.about-left .btn-primary {
  margin-top: 1.5rem;
}

/* Terminal */
.terminal {
  background: #0d1117;
  border: 1px solid rgba(0,245,195,0.2);
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 0 40px rgba(0,245,195,0.08),
    0 20px 60px rgba(0,0,0,0.5);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #161b22;
  border-bottom: 1px solid rgba(0,245,195,0.1);
}

.t-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.t-dot.red { background: #ff5f57; }
.t-dot.yellow { background: #febc2e; }
.t-dot.green { background: #28c840; }

.terminal-title {
  margin-left: auto;
  font-size: 0.65rem;
  color: rgba(232,234,242,0.3);
  letter-spacing: 0.05em;
}

.terminal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.t-line {
  font-size: 0.78rem;
  line-height: 1.5;
  animation: typeIn 0.1s ease both;
}

.t-prompt {
  color: var(--accent);
  margin-right: 0.5rem;
}

.t-output {
  padding-left: 1.25rem;
  color: var(--fg-muted);
}

.t-accent {
  color: var(--accent) !important;
  opacity: 0.85;
}

.t-green {
  color: #28c840 !important;
}

.blink-cursor {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ============================
   CONTACT
   ============================ */
.contact {
  padding: 7rem 3rem;
}

.contact-inner {
  max-width: 680px;
  margin: 0 auto;
}

.contact-sub {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.8;
  margin-bottom: 3rem;
}

.mail-link {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  text-decoration: none;
  color: var(--fg);
  font-family: 'IBM Plex Mono', monospace;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.2s;
  cursor: none;
}

.mail-link:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 30px rgba(0,245,195,0.12);
  transform: translateY(-2px);
}

.mail-icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.mail-icon svg {
  width: 100%;
  height: 100%;
}

.mail-address {
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: var(--fg);
  transition: color 0.2s;
}

.mail-link:hover .mail-address {
  color: var(--accent);
}

.mail-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--fg-muted);
  transition: transform 0.25s, color 0.2s;
}

.mail-link:hover .mail-arrow {
  transform: translateX(6px);
  color: var(--accent);
}

/* ============================
   FOOTER
   ============================ */
footer {
  border-top: 1px solid var(--border);
  padding: 3rem;
  background: var(--bg2);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer-logo {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--fg);
}

.footer-logo span { color: var(--accent); }

.footer-loc {
  font-size: 0.7rem;
  color: var(--fg-muted);
  letter-spacing: 0.1em;
}

.footer-copy {
  font-size: 0.65rem;
  color: rgba(232,234,242,0.2);
  letter-spacing: 0.05em;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}

.footer-legal a {
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-legal a:hover { color: var(--accent); }

.footer-legal span { color: rgba(232,234,242,0.2); }

/* ============================
   ANIMATIONS
   ============================ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.service-card.fade-up:nth-child(2) { transition-delay: 0.1s; }
.service-card.fade-up:nth-child(3) { transition-delay: 0.2s; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
  nav {
    padding: 1rem 1.5rem;
  }

  .nav-burger { display: flex; }

  .nav-status { display: none; }

  .nav-links {
    display: none;
  }

  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 57px;
    left: 0; right: 0;
    background: var(--mobile-menu-bg);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    z-index: 99;
    animation: fadeIn 0.2s ease both;
  }

  .nav-links.is-open li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links.is-open li:first-child {
    border-top: 1px solid var(--border);
  }

  .nav-links.is-open a {
    display: block;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
  }

  .hero {
    padding: 2rem 1.5rem;
    padding-top: 6rem;
    padding-bottom: 8rem;
  }

  .hero-counter-col {
    right: 1.5rem;
    bottom: 3rem;
  }

  .services {
    padding: 5rem 1.5rem;
  }

  .about {
    padding: 5rem 1.5rem;
  }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .contact {
    padding: 5rem 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  footer {
    padding: 2rem 1.5rem;
  }
}

/* ============================
   LIGHT MODE OVERRIDES
   ============================ */
[data-theme="light"] .hero-title .line-2 {
  -webkit-text-stroke: 1.5px rgba(12, 15, 26, 0.3);
}

[data-theme="light"] body {
  background: var(--bg);
}

@media (max-width: 600px) {
  .hero-counter-col {
    display: none;
  }

  .hero-title {
    font-size: clamp(3rem, 15vw, 5rem);
  }
}
