/* ============================================================
   esp32-wol  —  Shared stylesheet
   ============================================================ */

:root {
  --bg:           #09090b;
  --surface:      #18181b;
  --surface-2:    #27272a;
  --border:       #3f3f46;
  --primary:      #22d3ee;
  --primary-dim:  rgba(34, 211, 238, 0.12);
  --primary-glow: rgba(34, 211, 238, 0.25);
  --green:        #4ade80;
  --green-dim:    rgba(74, 222, 128, 0.12);
  --amber:        #fbbf24;
  --text:         #f4f4f5;
  --muted:        #a1a1aa;
  --subtle:       #71717a;
  --code-bg:      #0d1117;
  --radius:       8px;
  --radius-lg:    12px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:         'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ── Animated background ──────────────────────────────────── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(34,211,238,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(74,222,128,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(34,211,238,0.03) 0%, transparent 70%);
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.3;
  mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,0,0,0.4) 10%,
    rgba(0,0,0,0.6) 30%,
    rgba(0,0,0,0.4) 70%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0%,
    rgba(0,0,0,0.4) 10%,
    rgba(0,0,0,0.6) 30%,
    rgba(0,0,0,0.4) 70%,
    transparent 100%
  );
  pointer-events: none;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navigation ────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.nav-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--primary-dim);
  border: 1px solid var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

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

.nav-links .btn-nav {
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: background 0.15s;
}

.nav-links .btn-nav:hover { background: var(--primary-dim); text-decoration: none; }

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--primary);
  color: #09090b;
}

.btn-primary:hover { background: #67e8f9; }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted); }

/* ── Code & Pre ─────────────────────────────────────────────── */

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  position: relative;
}

pre code {
  display: block;
  padding: 20px;
  background: none;
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code-label {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Footer ─────────────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--subtle);
  font-size: 0.85rem;
}

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

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ── Utility ────────────────────────────────────────────────── */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-cyan  { background: var(--primary-dim); color: var(--primary); border: 1px solid rgba(34,211,238,0.3); }
.badge-green { background: var(--green-dim);   color: var(--green);   border: 1px solid rgba(74,222,128,0.3); }

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 640px) {
  .nav-links .hide-mobile { display: none; }
  .nav-links { gap: 12px; }
  .footer-inner { flex-direction: column; text-align: center; }

  pre code {
    font-size: 0.78rem;
    padding: 14px;
    word-break: break-all;
    white-space: pre-wrap;
  }
}
