:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --muted: #475569;
  --primary: #2563EB;
  --secondary: #16A34A;
  --accent: #F97316;
  --border: rgba(15, 23, 42, 0.12);
  --terminal-bg: #0a0f0a;
  --terminal-green: #33ff66;
  --terminal-dim: #1a8f3a;
  --hacker-glow: rgba(51, 255, 102, 0.15);
  --code-line: rgba(15, 23, 42, 0.015);
  --linux-shell: #0a0f0a;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Monaco, Consolas, monospace;
  background: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
    linear-gradient(225deg, rgba(22, 163, 74, 0.05) 0%, transparent 40%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, var(--code-line) 2px, var(--code-line) 4px);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.03) 0px,
    rgba(0, 0, 0, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.4;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.15) 100%);
}

.matrix-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.06;
}

.matrix-rain span {
  position: absolute;
  top: -20%;
  color: var(--secondary);
  font-size: 14px;
  animation: matrix-fall linear infinite;
  text-shadow: 0 0 8px var(--terminal-green);
}

@keyframes matrix-fall {
  0% { transform: translateY(-100%); opacity: 1; }
  100% { transform: translateY(110vh); opacity: 0.2; }
}

.disclosure-banner {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.15);
  position: relative;
  z-index: 10;
  background: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--linux-shell);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  height: 58px;
  box-shadow: 0 0 20px var(--hacker-glow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-link img {
  height: 36px;
  width: auto;
}

.logo-terminal {
  color: var(--terminal-green);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.logo-terminal .cursor-blink {
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.nav-desktop {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-desktop a {
  color: var(--terminal-green);
  text-decoration: none;
  font-size: 12px;
  padding: 6px 8px;
  position: relative;
  transition: color 0.2s;
}

.nav-desktop a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-desktop a:hover::after {
  transform: scaleX(1);
}

.nav-desktop a:hover {
  color: #fff;
}

.burger-btn {
  display: none;
  background: none;
  border: 1px solid rgba(51, 255, 102, 0.3);
  color: var(--terminal-green);
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 18px;
}

.nav-drawer {
  display: none;
  position: fixed;
  top: 58px;
  left: 0;
  width: 280px;
  height: calc(100vh - 58px);
  background: var(--terminal-bg);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  border-right: 1px solid rgba(51, 255, 102, 0.15);
}

.nav-drawer.open {
  transform: translateX(0);
}

.nav-drawer a {
  display: block;
  color: var(--terminal-green);
  text-decoration: none;
  padding: 14px 20px;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.nav-drawer a:hover {
  border-left-color: var(--accent);
  background: rgba(51, 255, 102, 0.05);
}

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 58px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.drawer-overlay.visible {
  display: block;
}

.site-footer {
  background: var(--terminal-bg);
  color: var(--terminal-green);
  padding: 48px 24px 32px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-tree {
  font-size: 13px;
  margin-bottom: 24px;
}

.footer-tree .tree-root {
  color: var(--accent);
  margin-bottom: 8px;
}

.footer-tree .tree-item {
  padding-left: 20px;
  position: relative;
}

.footer-tree .tree-item::before {
  content: "├── ";
  color: var(--terminal-dim);
  position: absolute;
  left: 0;
}

.footer-tree .tree-item:last-child::before {
  content: "└── ";
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-bottom: 24px;
}

.footer-links a {
  color: var(--terminal-green);
  text-decoration: none;
  font-size: 13px;
  position: relative;
}

.footer-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s;
}

.footer-links a:hover::after {
  transform: scaleX(1);
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.footer-badges a,
.footer-badges span {
  display: block;
}

.footer-badges img {
  height: 48px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  filter: grayscale(20%);
}

.footer-nz-disclosure {
  font-size: 11px;
  color: rgba(51, 255, 102, 0.6);
  line-height: 1.7;
  max-width: 800px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
}

.footer-nz-disclosure a {
  color: var(--terminal-green);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--terminal-bg);
  border: 2px solid var(--terminal-green);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 30px rgba(51, 255, 102, 0.2);
}

.modal-box h2 {
  color: var(--terminal-green);
  font-size: 18px;
  margin-bottom: 12px;
}

.modal-box p {
  color: rgba(51, 255, 102, 0.8);
  font-size: 13px;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-terminal {
  font-family: inherit;
  font-size: 13px;
  padding: 10px 24px;
  cursor: pointer;
  border: 1px solid var(--terminal-green);
  background: transparent;
  color: var(--terminal-green);
  transition: background 0.2s, color 0.2s;
}

.btn-terminal:hover {
  background: var(--terminal-green);
  color: var(--terminal-bg);
}

.btn-terminal.accent {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-terminal.accent:hover {
  background: var(--accent);
  color: var(--terminal-bg);
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--terminal-bg);
  border-top: 2px solid var(--terminal-green);
  padding: 16px 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-banner.hidden {
  display: none;
}

.cookie-banner p {
  color: rgba(51, 255, 102, 0.85);
  font-size: 12px;
  max-width: 700px;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  position: relative;
  z-index: 1;
}

.legal-content h1 {
  font-size: 28px;
  color: var(--text);
  margin-bottom: 24px;
  border-left: 4px solid var(--accent);
  padding-left: 16px;
}

.legal-content h2 {
  font-size: 20px;
  color: var(--text);
  margin: 28px 0 12px;
}

.legal-content h3 {
  font-size: 16px;
  color: var(--muted);
  margin: 20px 0 8px;
}

.legal-content p {
  color: var(--muted);
  margin-bottom: 14px;
  font-size: 14px;
}

.legal-content ul {
  margin: 0 0 16px 24px;
  color: var(--muted);
  font-size: 14px;
}

.legal-content li {
  margin-bottom: 6px;
}

.contact-form {
  margin-top: 32px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.contact-form label {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

.form-error {
  color: #dc2626;
  font-size: 12px;
  margin: -12px 0 12px;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-success {
  display: none;
  padding: 24px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid var(--secondary);
  color: var(--text);
  font-size: 14px;
}

.form-success.visible {
  display: block;
}

.decor-wrap {
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 900px) {
  .nav-desktop {
    display: none;
  }

  .burger-btn {
    display: block;
  }

  .nav-drawer {
    display: block;
  }
}

@media (max-width: 600px) {
  .header-inner {
    padding: 0 16px;
  }

  .logo-terminal {
    display: none;
  }
}
