/* Components
   Reusable UI components: header, footer, backgrounds, corners
*/

/* ===== BACKGROUNDS ===== */

/* Grid background */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}

/* Noise texture */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* Soft accent glow */
.glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 255, 90, 0.08) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  top: -200px;
  right: -200px;
  animation: drift 20s ease-in-out infinite;
}

/* ===== HEADER ===== */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  gap: 24px;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s ease;
}

.logo-mark:hover {
  color: var(--accent);
}

.logo-mark svg {
  width: 14px;
  height: 14px;
}

.meta-right {
  text-align: right;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  line-height: 1;
  white-space: nowrap;
}

.meta-right span {
  color: var(--accent);
}

.header-location,
.header-status {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.header-status {
  gap: 14px;
  color: var(--ink-dim);
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
  flex: 0 0 auto;
}

/* Theme switcher button */
.theme-switcher {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(235, 231, 221, 0.02);
  border: 1px solid var(--line-strong);
  color: var(--ink-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  border-radius: 0;
}

.theme-switcher:hover {
  background: rgba(235, 231, 221, 0.04);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-switcher:active {
  transform: scale(0.95);
}

/* Main navigation */
.main-nav {
  display: flex;
  gap: 8px;
  font-size: 11px;
  margin-left: auto;
}

.main-nav a {
  padding: 12px 18px;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.3s ease, background 0.3s ease;
  border: 1px solid transparent;
}

.main-nav a:hover {
  color: var(--accent);
  background: rgba(216, 255, 90, 0.03);
  border-color: var(--line);
}

.main-nav a.active {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(216, 255, 90, 0.02);
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 16px;
  font-size: 11px;
  margin-top: 0;
}

.lang-switcher a {
  width: 54px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(235, 231, 221, 0.02);
}

.lang-switcher a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.lang-switcher a.active {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===== FOOTER ===== */

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line-strong);
  opacity: 0;
  animation: fadeUp 1s ease-out 0.8s forwards;
}

.contact-block {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.contact-block .label {
  margin-bottom: 6px;
}

.contact-block a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
  transition: color 0.3s ease;
}

.contact-block a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
}

.contact-block a:hover {
  color: var(--accent);
}

.contact-block a:hover::after {
  transform: scaleX(1);
}

.contact-block a .arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.3s ease;
}

.contact-block a:hover .arrow {
  transform: translate(3px, -3px);
}

.center-mark {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
}

.right-block {
  text-align: right;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.right-block .v {
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  text-transform: none;
  letter-spacing: 0;
}

/* ===== CORNER BRACKETS ===== */

.corner {
  position: fixed;
  width: 16px;
  height: 16px;
  z-index: 3;
  pointer-events: none;
}

.corner::before, .corner::after {
  content: '';
  position: absolute;
  background: var(--ink-dim);
}

.corner::before { width: 100%; height: 1px; }
.corner::after { width: 1px; height: 100%; }

.corner.tl { top: 16px; left: 16px; }
.corner.tl::before { top: 0; left: 0; }
.corner.tl::after { top: 0; left: 0; }

.corner.tr { top: 16px; right: 16px; }
.corner.tr::before { top: 0; right: 0; }
.corner.tr::after { top: 0; right: 0; }

.corner.bl { bottom: 16px; left: 16px; }
.corner.bl::before { bottom: 0; left: 0; }
.corner.bl::after { bottom: 0; left: 0; }

.corner.br { bottom: 16px; right: 16px; }
.corner.br::before { bottom: 0; right: 0; }
.corner.br::after { bottom: 0; right: 0; }

/* ===== HAMBURGER MENU ===== */

.hamburger-menu {
  display: none;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(235, 231, 221, 0.02);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  padding: 0;
  gap: 5px;
  transition: border-color 0.2s ease;
}

.hamburger-menu span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--ink-dim);
  transition: all 0.3s ease;
}

.hamburger-menu:hover {
  border-color: var(--accent);
}

.hamburger-menu:hover span {
  background: var(--accent);
}

.hamburger-menu.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

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

.hamburger-menu.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile navigation overlay */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  backdrop-filter: blur(10px);
  z-index: 999;
  padding: 80px 40px 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

.mobile-nav-links a {
  display: block;
  padding: 20px 24px;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(235, 231, 221, 0.02);
  transition: all 0.3s ease;
  text-align: center;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(216, 255, 90, 0.03);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 720px) {
  header {
    flex-direction: row;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
  }

  /* Hide logo on mobile */
  .logo-mark {
    display: none;
  }

  /* Hide desktop navigation on mobile */
  .main-nav {
    display: none;
  }

  /* Show hamburger menu on mobile */
  .hamburger-menu {
    display: flex;
  }

  /* Show mobile navigation */
  .mobile-nav {
    display: block;
  }

  /* Hide location and status on mobile */
  .header-location,
  .header-status {
    display: none;
  }

  .meta-right {
    text-align: right;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 12px;
    white-space: nowrap;
  }

  .theme-switcher {
    width: 40px;
    height: 40px;
  }

  .lang-switcher {
    gap: 8px;
  }

  .lang-switcher a {
    width: 48px;
    height: 40px;
  }

  footer {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .center-mark, .right-block {
    text-align: left;
  }

  .corner {
    display: none;
  }
}
