:root {
  --bg: #050517;
  --bg-alt: #070821;
  --bg-card: #101225;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --text: #f5f7ff;
  --text-muted: #a7a9c5;
  --accent: #9b5cff;
  --accent-soft: rgba(155, 92, 255, 0.25);
  --accent-strong: #34d0ff;
  --danger: #ff4b81;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow-soft: 0 22px 60px rgba(0, 0, 0, 0.6);
  --max-width: 1120px;
  --transition-fast: 0.18s ease-out;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Inter", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top left, #20154b 0, #050517 40%);
  color: var(--text);
  font-family: var(--font-sans);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Light theme overrides */
body.theme-light {
  --bg: #f5f5fb;
  --bg-alt: #ffffff;
  --bg-card: #ffffff;
  --border-subtle: rgba(10, 12, 31, 0.08);
  --text: #111322;
  --text-muted: #52557a;
  --accent: #7a3cff;
  --accent-soft: rgba(122, 60, 255, 0.16);
  --accent-strong: #0066ff;
  --danger: #e5484d;
  background: radial-gradient(circle at top left, #eef0ff 0, #f5f5fb 40%);
  color: var(--text);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 23, 0.97),
    rgba(5, 5, 23, 0.88),
    transparent
  );
  border-bottom: 1px solid var(--border-subtle);
}
body.theme-light .site-header {
  background: linear-gradient(
    to bottom,
    rgba(245, 245, 251, 0.98),
    rgba(245, 245, 251, 0.94),
    transparent
  );
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: contain;
  background: radial-gradient(circle at center, #321a72, #050517 55%);
  border: 1px solid var(--accent-soft);
}
body.theme-light .logo {
  background: radial-gradient(circle at center, #ece8ff, #f5f5fb 55%);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.brand {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 0.95rem;
}

.tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.nav a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  transition: color var(--transition-fast),
    background-color var(--transition-fast);
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
body.theme-light .nav a:hover {
  background: rgba(10, 12, 31, 0.06);
}

/* Theme toggle button */
.theme-toggle {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast),
    border-color var(--transition-fast), transform var(--transition-fast);
}
body.theme-light .theme-toggle {
  border-color: rgba(10, 12, 31, 0.15);
  background: rgba(255, 255, 255, 0.8);
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

/* Hero */
.hero {
  padding: 3.5rem 0 3rem;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 3.1vw + 1.2rem, 3.2rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.accent {
  color: var(--accent-strong);
  text-shadow: 0 0 16px rgba(52, 208, 255, 0.5);
}
body.theme-light .accent {
  text-shadow: none;
}

.hero-subtitle {
  margin: 0 0 1.4rem;
  color: var(--text-muted);
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.hero-footnote {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast),
    border-color var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-small {
  padding-inline: 0.85rem;
  padding-block: 0.35rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #050517;
  box-shadow: 0 10px 30px rgba(52, 208, 255, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(52, 208, 255, 0.55);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
body.theme-light .btn-ghost {
  border-color: rgba(10, 12, 31, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

/* Hero right side */
.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.terminal-card {
  background: radial-gradient(circle at top left, #1d1a36, #101225);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
body.theme-light .terminal-card {
  background: radial-gradient(circle at top left, #f2efff, #ffffff);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.15);
}

.term-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(to right, #15162a, #101225);
  font-size: 0.7rem;
  color: var(--text-muted);
}
body.theme-light .term-header {
  background: linear-gradient(to right, #e0ddff, #f5f5fb);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.red { background: var(--danger); }
.yellow { background: #ffcc3b; }
.green { background: #39d98a; }

.term-title {
  margin-left: 0.35rem;
}

.term-body {
  padding: 0.8rem 0.9rem 1rem;
  font-family: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.75rem;
  color: #c4f0ff;
}
body.theme-light .term-body {
  color: #1b2559;
}

.term-body pre {
  margin: 0;
  white-space: pre-wrap;
}

/* Orbital card */
.orbital-card {
  position: relative;
  padding: 1.4rem 1.3rem 1.2rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--accent-soft);
  background: radial-gradient(circle at center, #151735, #050517);
  overflow: hidden;
}
body.theme-light .orbital-card {
  background: radial-gradient(circle at center, #ece9ff, #f5f5fb);
}

.orbital-core {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: radial-gradient(circle at center, var(--accent-strong), #050517);
  box-shadow: 0 0 45px rgba(52, 208, 255, 0.8);
  position: relative;
  z-index: 2;
}
body.theme-light .orbital-core {
  background: radial-gradient(circle at center, var(--accent-strong), #f5f5fb);
}

.orbital-ring {
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 999px;
  border: 2px dashed rgba(155, 92, 255, 0.45);
  top: -10px;
  right: -30px;
  transform: rotate(-15deg);
  filter: drop-shadow(0 0 20px rgba(155, 92, 255, 0.6));
  animation: spin-slow 20s linear infinite;
}

.orbital-caption {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 3rem 0;
}

.section-alt {
  background: radial-gradient(circle at top right, #171a3c 0, #050517 60%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
body.theme-light .section-alt {
  background: radial-gradient(circle at top right, #eef0ff 0, #f5f5fb 60%);
}

/* Fade-in animation */
.fade-in-up {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.7s ease-out forwards;
}

/* Cards grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.1rem 1rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
body.theme-light .card {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.card p {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card li::before {
  content: "▹";
  color: var(--accent-strong);
  margin-right: 0.35rem;
}

/* Timeline */
.timeline {
  border-left: 1px solid var(--accent-soft);
  margin-top: 1.5rem;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.timeline-item {
  position: relative;
}

.timeline-badge {
  position: absolute;
  left: -1.8rem;
  top: 0;
  transform: translateX(-50%);
  background: #050517;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--accent-soft);
  font-size: 0.7rem;
  color: var(--accent-strong);
}
body.theme-light .timeline-badge {
  background: #f5f5fb;
}

.timeline h3 {
  margin: 0 0 0.25rem;
}

.timeline p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* About */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.5rem;
}

.about-layout p {
  color: var(--text-muted);
}

.fact-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1rem;
  border: 1px solid var(--border-subtle);
}

.fact-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.fact-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.fact-card li::before {
  content: "●";
  font-size: 0.55rem;
  margin-right: 0.3rem;
  color: var(--accent);
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 1.7rem;
  align-items: start;
}

.contact-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.1rem 1rem;
  border: 1px solid var(--border-subtle);
}

.contact-card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.contact-card a {
  color: var(--accent-strong);
  text-decoration: none;
}

.contact-card a:hover {
  text-decoration: underline;
}

.contact-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.85rem;
}

.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.contact-form input,
.contact-form textarea {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 5, 23, 0.5);
  padding: 0.45rem 0.6rem;
  color: var(--text);
  font: inherit;
  resize: vertical;
}
body.theme-light .contact-form input,
body.theme-light .contact-form textarea {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(10, 12, 31, 0.2);
}

.contact-form select {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(5, 5, 23, 0.5);
  padding: 0.45rem 0.6rem;
  color: var(--text);
  font: inherit;
}
body.theme-light .contact-form select {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(10, 12, 31, 0.2);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.contact-form button {
  margin-top: 0.3rem;
}

.contact-hint {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* UniFi lead qualifier layout */
.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 180px);
  gap: 0.55rem;
}
.form-row.single {
  grid-template-columns: minmax(0, 1fr);
}

/* Honeypot field hidden visually */
.hp-field {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

/* Footer */
.site-footer {
  padding: 1.4rem 0 1.6rem;
  border-top: 1px solid var(--border-subtle);
  background: radial-gradient(circle at bottom right, #181832, #050517 60%);
}
body.theme-light .site-footer {
  background: radial-gradient(circle at bottom right, #e4e6ff, #f5f5fb 60%);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent-strong);
}

/* Animations */
@keyframes spin-slow {
  0% { transform: rotate(-15deg); }
  100% { transform: rotate(345deg); }
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-panel { order: -1; }
  .about-layout, .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .header-inner { flex-wrap: wrap; }
  .nav { font-size: 0.8rem; }
}

@media (max-width: 600px) {
  .hero { padding-top: 2.5rem; }
  .header-inner { align-items: flex-start; }
  .logo-text .tagline { display: none; }
  .hero-copy h1 { font-size: 1.85rem; }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
