/* ============================================================
   HSEI.IO — globals.css
   CSS Custom Properties (SPECIFICATION v1.2 · Section 1.1)
   + CSS reset. Single source of truth for all colour tokens.
   ============================================================ */

:root {
  /* === ФОНЫ === */
  --bg-main:          #032A30; /* Основной фон — Soft Premium Deep Teal */
  --bg-surface:       #011E22; /* Карточки, контейнеры, глубина */
  --bg-surface-light: #063A42; /* Hover, тултипы, активные блоки */
  --sf:               var(--bg-surface); /* Surface / window chrome */

  /* === АКЦЕНТЫ === */
  --rose:        #E4B8AE; /* Тёплый rose-peach */
  --gold:        var(--rose); /* alias: тёплые акценты, бордеры, текст */
  --gold-dim:    rgba(228, 184, 174, 0.12);
  --gold-dim2:   rgba(228, 184, 174, 0.06);
  --teal-accent: #0ECFB4; /* CTA, LIVE, интерактив */
  --teal-dark:   #0A3033; /* Текст на teal-кнопках */
  --teal-dim:    rgba(14, 207, 180, 0.08);
  --teal-dim2:   rgba(14, 207, 180, 0.04);
  --btn-bg:      var(--teal-accent);
  --btn-fg:      var(--teal-dark);
  --brand-metal-fallback: #c49888;
  --red-signal:  #E05A2A; /* Сигнальный элемент логотипа, фаза Угасания */
  --red-dim:     rgba(224, 90, 42, 0.12);

  /* === ТЕКСТ === */
  --text-main:  #E8E5DE;
  --text-muted: rgba(232, 229, 222, 0.74);
  --text-ghost: rgba(232, 229, 222, 0.28);
  --text-micro: rgba(232, 229, 222, 0.10);

  /* === БОРДЕРЫ === */
  --border-gold:       rgba(228, 184, 174, 0.12);
  --border-gold-md:    rgba(228, 184, 174, 0.22);
  --border-neutral:    rgba(255, 255, 255, 0.07);
  --border-neutral-md: rgba(255, 255, 255, 0.12);

  /* === ПРОСТРАНСТВО / GRID (Section 1.3) === */
  --container:   1080px;
  --container-wide: 1280px;
  --nav-height:  46px;
  --pad-desktop: 28px;
  --pad-tablet:  24px;
  --pad-mobile:  16px;

  /* === RADIUS === */
  --radius-card:   4px;
  --radius-card-lg: 6px;
  --radius-btn:    3px;

  /* === NAV background (rgba of --bg-main) === */
  --nav-bg: rgba(3, 42, 48, 0.92);

  /* === AMBIENT BACKGROUND (mesh + dot-grid) === */
  --bg-grid-size:   28px;
  --bg-grid-dot:    rgba(255, 255, 255, 0.072);
  --bg-mesh-teal:   rgba(14, 207, 180, 0.085);
  --bg-mesh-gold:   rgba(228, 184, 174, 0.065);
  --bg-mesh-depth:  rgba(1, 30, 34, 0.75);
  --bg-mesh-lift:   rgba(6, 58, 66, 0.28);

  /* === Global watermark (bottom-right logo) === */
  --watermark-logo:         #0f5560;
  --watermark-logo-opacity: 0.38;
  --watermark-text-opacity: 0.16;

  /* === TYPOGRAPHY === */
  --font-tech:    'JetBrains Mono', 'SF Mono', 'Courier New', monospace;
  --font-sans:    'Inter', 'SF Pro Display', -apple-system, sans-serif;
  --font-display: var(--font-sans);
}

/* ============================================================
   CSS RESET
   ============================================================ */

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

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

body {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  color: var(--text-main);
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Nav safety net — prevents drawer/links blowout if nav.css fails to load */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-drawer[hidden] {
  display: none !important;
}

/* Ambient mesh blobs — drift animated in animations.css */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-mesh__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.bg-mesh__blob--teal {
  width: min(72vw, 720px);
  height: min(52vh, 520px);
  top: -8%;
  left: -10%;
  background: radial-gradient(
    ellipse at center,
    rgba(14, 207, 180, 0.14) 0%,
    rgba(14, 207, 180, 0.05) 42%,
    transparent 72%
  );
}

.bg-mesh__blob--gold {
  width: min(62vw, 640px);
  height: min(48vh, 480px);
  right: -12%;
  bottom: -6%;
  background: radial-gradient(
    ellipse at center,
    rgba(228, 184, 174, 0.11) 0%,
    rgba(228, 184, 174, 0.04) 45%,
    transparent 72%
  );
}

.bg-mesh__blob--lift {
  width: min(80vw, 800px);
  height: min(38vh, 380px);
  top: -14%;
  left: 22%;
  background: radial-gradient(
    ellipse at center,
    rgba(6, 58, 66, 0.55) 0%,
    rgba(6, 58, 66, 0.18) 50%,
    transparent 75%
  );
}

.bg-mesh__blob--depth {
  width: min(90vw, 900px);
  height: min(55vh, 560px);
  left: 10%;
  bottom: -22%;
  background: radial-gradient(
    ellipse at center,
    rgba(1, 30, 34, 0.85) 0%,
    rgba(1, 30, 34, 0.35) 48%,
    transparent 78%
  );
}

/* Engineering dot-grid — fades toward viewport edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--bg-grid-dot) 1px, transparent 1px);
  background-size: var(--bg-grid-size) var(--bg-grid-size);
  background-attachment: fixed;
  mask-image: radial-gradient(
    ellipse 100% 95% at 50% 42%,
    #000 32%,
    transparent 92%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 100% 95% at 50% 42%,
    #000 32%,
    transparent 92%
  );
}

body > main,
body > footer {
  position: relative;
  z-index: 2;
}

/* HSEI watermark — viewport background, bottom-right only */
.site-brand-watermark {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 0;
  display: block;
  width: 148px;
  max-width: 28vw;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  user-select: none;
  opacity: var(--watermark-logo-opacity);
}

/* Diagonal text watermark — tiled, subtler than logo */
.site-text-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 220vmax;
  height: 220vmax;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
  user-select: none;
  opacity: var(--watermark-text-opacity);
  transform: translate(-50%, -50%) rotate(-32deg);
  background-image: url("../svg/hsei-text-watermark.svg");
  background-repeat: repeat;
  background-size: 520px 168px;
  background-position: center center;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 300;
}

:focus-visible {
  outline: 1px solid var(--teal-accent);
  outline-offset: 2px;
}

/* Shared layout helpers */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--pad-desktop);
  padding-right: var(--pad-desktop);
}

/* Button system (Section 7.1) — radius fixed at 3px */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-btn);
  padding: 10px 20px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.btn-primary:hover {
  opacity: 0.88;
  filter: brightness(1.04);
}

.btn-outline-g {
  background: transparent;
  color: var(--gold);
  border: 0.5px solid var(--border-gold-md);
}
.btn-outline-g:hover { background: var(--gold-dim); }

.btn-outline-t {
  background: transparent;
  color: var(--teal-accent);
  border: 0.5px solid rgba(14, 207, 180, 0.4);
}
.btn-outline-t:hover { background: var(--teal-dim); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--gold); }

.btn-sm { padding: 8px 16px; }
.btn-md { padding: 10px 20px; }
.btn-lg { padding: 10px 20px; }

/* Circular avatar with photo */
.avatar-photo {
  overflow: hidden;
  padding: 0;
}
.avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

@media (max-width: 767px) {
  .container {
    padding-left: var(--pad-mobile);
    padding-right: var(--pad-mobile);
  }

  body,
  body::before {
    background-attachment: scroll;
  }
}
