/* ====== Base theme tokens ====== */
:root {
  --bg: #0d0d0d;
  --bg-2: #1a1a1a;
  --text: #dcddde;
  --line: #2e2e2e;
  --link: #13a1ff;
  --primary: rgb(48, 165, 255);
  --accent: #071bd2;
  --surface: #262626;
  --muted: #9c9c9c;
  --steel: #9c9c9c;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  --font-ui: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  --font-tech: "Ubuntu Mono", "Consolas", ui-monospace, SFMono-Regular, Menlo, Monaco, "Liberation Mono", monospace;
}

/* ====== Global resets ====== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {  
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { 
  max-width: 100%; 
  height: auto;
  display: block; 
}

a { 
  color: var(--text); 
  text-decoration: none; 
  text-underline-offset: 7px;
}
a:hover { color: var(--link); }

::selection { 
  background: var(--primary); 
  color: black; 
}

/* ============ HEADER ============ */
.banner {
  position: sticky;
  top: 0;
  width: 100%;
  height: 65px;
  z-index: 60;
  border-bottom: 1px solid transparent;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 0 2rem;
  box-shadow: none;
  transition: border-bottom-color var() ease, box-shadow var() ease;
}

.banner.scrolled {
  background-color: var(--bg);
  border-bottom-color: var(--line);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo {
  position: relative;
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-family: var(--font-tech);
  letter-spacing: 0.08em;
  color: var(--text);
}

.logo::after {
  content: "_";
  animation: caret 1.4s steps(1) infinite;
}
.logo:hover{
  color: var(--text);
}
.logo img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

@keyframes caret { 
  50% { opacity: 0; } 
}
nav {
  display: flex; 
  gap: 8px; 
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-weight: 600; 
  color: var(--text);
  padding: 8px 14px; 
  border-radius: 6px;
  display: block;
  transition: all var() ease;
}

.nav-link:hover {
  background: var(--surface);
  color: white;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var() ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 100;
  margin-top: 1px;
}

.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  color: var(--text);
  border-radius: 6px;
  transition: all var() ease;
  font-size: 14px;
}

.dropdown a:hover {
  background: var(--surface);
  color: var(--primary);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 70;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px; 
  border-radius: 6px;
  color: var(--text);
  border: 1px solid var(--line);
  transition: all var() ease;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
}

.btn:hover {
  background-color: var(--surface);
  color: white;
  border-color: var(--primary);
}
  
nav .btn {
  display: none;
}

nav.active .btn {
  display: block;
  margin: 14px 0;
}

/* ====== Footer ====== */
footer {
  padding: 2rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--text);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  background-color: var(--bg);
  justify-content: center;
  align-items: center;
  margin-top: 4rem;
}

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

footer button {
  background: none;
  border: none;
  cursor: pointer;
}

footer #back {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 40px;
  color: var(--text);
  display: none;
  z-index: 50;
}

footer #back:hover {
  color: var(--primary);
  text-shadow: 0 0 3px var(--accent);
  transform: translateY(-4px);
}

#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
  pointer-events: none;
}

/* ====== Mobile Responsive ====== */
@media (max-width: 720px) {
  .banner {
    grid-template-columns: 1fr auto;
    padding: 0 1rem;
  }

  .hamburger {
    display: flex;
  }

  #nav {
    position: fixed;
    top: 65px;
    left: 0;
    width: 100%;
    height: calc(100vh - 65px);
    background: var(--bg);
    backdrop-filter: blur(10px);
    flex-direction: column;
    gap: 0;
    padding: 20px 20px 80px 20px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    border-right: 1px solid var(--line);
  }

  #nav.active {
    transform: translateX(0);
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }

  .nav-link {
    padding: 16px;
    font-size: 16px;
    margin: 8px 0;
  }

  .actions .btn {
    display: none;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    background: var(--surface);
    border-radius: 0;
    margin: 0;
    box-shadow: none;
  }

  .nav-item.active .dropdown {
    max-height: 500px;
    padding: 8px 0;
  }

  .dropdown a {
    padding: 12px 24px;
    font-size: 14px;
  }

  footer #back {
    bottom: 15px;
    right: 15px;
    font-size: 35px;
  }
}

/* ====== Cookie banner ====== */
.cookie-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 22px;
  background: linear-gradient(180deg, rgba(38,38,38,0.98), rgba(26,26,26,0.98));
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  padding: 14px 16px;
  border-radius: 12px;
  max-width: 960px;
  width: calc(100% - 48px);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cookie-banner[hidden] { display: none; }
.cookie-content { display: flex; gap: 12px; align-items: center; width: 100%; }
.cookie-content p { margin: 0; font-size: 14px; color: var(--text); flex: 1; }
.cookie-link { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.cookie-actions { display: flex; gap: 8px; }
.cookie-accept { background: var(--primary); color: black; border-color: transparent; }
.cookie-reject { background: transparent; color: var(--text); border-color: var(--line); }

@media (max-width: 520px) {
  .cookie-content { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: stretch; }
}