:root {
  --bg: #060608;
  --surface: rgba(12, 12, 16, 0.97);
  --surface-hover: rgba(20, 20, 28, 0.97);
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text-primary: #f0f0f4;
  --text-secondary: #8b8b9e;
  --text-muted: #52526a;
  --brand: #2563eb;
  --brand-bright: #3b82f6;
  --brand-glow: rgba(37, 99, 235, 0.35);
  --brand-soft: rgba(37, 99, 235, 0.12);
  --green: #22c55e;
  --blue: var(--brand-bright);
  --orange: #f97316;
  --purple: #a855f7;
  --red: #ef4444;
  --yellow: #eab308;
  --dot-red: #ff5f57;
  --dot-yellow: #ffbd2e;
  --dot-green: #28c840;
  --font-mono: "Space Mono", monospace;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-terminal: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 80px var(--brand-soft);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 95% 85% at 50% 0%, black 15%, transparent 72%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 48% at 12% 18%, rgba(37, 99, 235, 0.16), transparent 68%),
    radial-gradient(ellipse 45% 38% at 88% 78%, rgba(34, 197, 94, 0.06), transparent 70%),
    radial-gradient(ellipse 35% 30% at 50% 55%, rgba(168, 85, 247, 0.04), transparent 65%);
}

::selection {
  background: rgba(37, 99, 235, 0.35);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Fejléc / brand ---- */

.site-header {
  border-bottom-color: rgba(37, 99, 235, 0.12) !important;
}

.site-home {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s var(--ease);
}

.site-home:hover {
  opacity: 0.92;
}

.site-home:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

.site-home__logo {
  width: clamp(32px, 5vw, 38px);
  height: clamp(32px, 5vw, 38px);
  border-radius: 11px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px var(--brand-glow);
}

.site-home__text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.site-home__name {
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.site-home__sub {
  font-family: var(--font-mono);
  font-size: clamp(0.58rem, 1.5vw, 0.65rem);
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease);
}

.site-home:hover .site-home__sub {
  color: var(--brand-bright);
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .site-header__nav {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-home__sub {
    display: none;
  }
}

/* ---- Státusz banner ---- */

.site-status-banner-slot {
  position: fixed;
  left: 50%;
  top: calc(clamp(0.75rem, 2vw, 1.25rem) + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 110;
  max-width: min(72vw, 28rem);
  pointer-events: none;
}

.site-status-banner-slot:not([hidden]) {
  animation: banner-in 0.45s var(--ease) both;
}

@keyframes banner-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.site-status-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 1.6vw, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    opacity 0.2s var(--ease),
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.site-status-banner:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.site-status-banner:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.site-status-banner__dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.site-status-banner__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-status-banner--degraded {
  color: var(--orange);
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.28);
}

.site-status-banner--outage {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}

.site-status-banner--maintenance {
  color: var(--brand-bright);
  background: var(--brand-soft);
  border-color: rgba(37, 99, 235, 0.35);
}

.site-status-banner--unknown {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 520px) {
  .site-status-banner-slot {
    max-width: min(58vw, 14rem);
  }
  .site-status-banner {
    padding: 0.35rem 0.65rem;
    letter-spacing: 0.02em;
  }
}

/* ---- Fő tartalom ---- */

main[aria-label="Fő tartalom"] {
  position: relative;
  z-index: 1;
}

/* ---- Dock ---- */

.dock-root--site {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  overflow: visible;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.dock-root--site .dock-panel {
  pointer-events: auto;
}

.dock-panel,
.dock-site-panel {
  align-items: flex-end !important;
  overflow: visible;
  box-sizing: border-box;
  flex-shrink: 0;
  background: rgba(10, 10, 14, 0.92) !important;
  border-color: rgba(37, 99, 235, 0.2) !important;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(37, 99, 235, 0.08) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dock-item {
  box-sizing: border-box;
  will-change: width, height;
  transition: box-shadow 0.2s var(--ease);
}

.dock-item:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.2) !important;
}

.dock-icon-inner {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.dock-icon-glyph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 0;
  text-align: center;
}

.dock-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.dock-label {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

@media (max-width: 640px) {
  .dock-panel {
    gap: 0.5rem !important;
    padding: 0.35rem 0.65rem !important;
  }
}

/* ---- Spotlight kártyák ---- */

.spotlight-card {
  isolation: isolate;
  border-radius: var(--radius-sm);
  transition: transform 0.25s var(--ease);
}

.spotlight-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.spotlight-card__glow {
  border-radius: inherit;
}

.tool-spotlight-card {
  border-radius: var(--radius-sm);
}

.tool-spotlight-card article {
  border-radius: inherit;
}

/* ---- Terminál hero (React inline stílusok kiegészítése) ---- */

#tools-section {
  scroll-margin-top: 5rem;
}
