:root {
  --bg: #0a0e14;
  --bg-alt: #0f1420;
  --surface: #131926;
  --border: #1f2937;
  --text: #e6e9ef;
  --text-dim: #93a0b4;
  --accent: #7c8cff;
  --accent-2: #4fd6c4;
  --radius: 14px;
  --max-width: 1000px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.accent { color: var(--accent); }

/* Background glow */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px circle at 15% 10%, rgba(124, 140, 255, 0.16), transparent 60%),
    radial-gradient(500px circle at 85% 30%, rgba(79, 214, 196, 0.10), transparent 60%),
    var(--bg);
}

/* Header / Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 20, 0.7);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text) !important;
}

.nav-cta:hover {
  border-color: var(--accent);
  background: rgba(124, 140, 255, 0.08);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hero */
.hero {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 40px;
}

.eyebrow {
  color: var(--accent-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 4.2rem);
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-sub {
  max-width: 560px;
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #0a0e14;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(124, 140, 255, 0.6);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Sections */
.section {
  padding: 100px 24px;
  border-top: 1px solid var(--border);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 1.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.section-title .tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
}

.section-sub {
  color: var(--text-dim);
  margin-bottom: 44px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.about-text p {
  color: var(--text-dim);
  margin: 0 0 16px;
}

.about-facts {
  display: grid;
  gap: 14px;
  align-content: start;
}

.fact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.fact-card h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
}

.fact-card p {
  margin: 0;
  font-weight: 500;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 999px;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 140, 255, 0.4);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.5);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-icon { font-size: 1.6rem; }

.card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0 0 16px;
}

.card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

/* Contact */
.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}

.contact-box p {
  color: var(--text-dim);
  margin: 0 0 24px;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}

.footer-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 0.82rem;
  transition: color 0.2s ease;
}

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

/* Cookie notice */
.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

.cookie-banner p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.88rem;
  flex: 1 1 320px;
}

.cookie-banner a {
  color: var(--accent);
  font-weight: 600;
}

.btn-small {
  padding: 9px 18px;
  font-size: 0.85rem;
}

/* Legal pages */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

.legal-content h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.legal-content .updated {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin-bottom: 36px;
}

.legal-content h2 {
  font-size: 1.3rem;
  margin: 36px 0 12px;
}

.legal-content p,
.legal-content li {
  color: var(--text-dim);
  margin: 0 0 14px;
}

.legal-content ul {
  padding-left: 22px;
}

.legal-content a {
  color: var(--accent);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--text);
}

/* Homelab status dashboard */
.status-updated {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.stale-notice {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #eab308;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.host-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.host-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.host-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.host-card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.host-card-value {
  font-weight: 600;
  font-size: 1rem;
}

.host-card-uptime {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.host-card-uptime .host-card-value {
  font-size: 1.05rem;
}

.host-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
}

.host-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.host-bar-low {
  background: #22c55e;
}

.host-bar-mid {
  background: #eab308;
}

.host-bar-high {
  background: #ef4444;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-up {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.status-down {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.status-unknown {
  background: #6b7280;
}

.status-info h3 {
  font-size: 1rem;
  margin-bottom: 2px;
}

.status-info p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.status-error {
  color: var(--text-dim);
}

/* Scroll fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .about-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}
