/*
Theme Name:  Teacher Dev
Theme URI:   https://github.com/your-repo/teacher-dev
Description: Современная, гибкая и настраиваемая тема для сайта преподавателя/специалиста в IT-сфере. Три цветовые схемы (тёмная, светлая, для слабовидящих), полная настройка через WordPress Customizer, адаптивный дизайн.
Version:     1.0.0
Author:      teacher.dev
Author URI:  #
License:     GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: teacher-dev
Tags:        dark, one-page, custom-colors, custom-logo, responsive-layout, accessibility-ready, threaded-comments
*/

/* ============================================================
   CSS CUSTOM PROPERTIES  (переопределяются через Customizer)
   ============================================================ */
:root {
  /* --- тёмная тема (по умолчанию) --- */
  --td-bg:           220 30% 6%;
  --td-fg:           210 20% 90%;
  --td-card:         220 25% 10%;
  --td-card-fg:      210 20% 90%;
  --td-primary:      160 100% 50%;
  --td-primary-fg:   220 30% 6%;
  --td-secondary:    195 100% 50%;
  --td-secondary-fg: 220 30% 6%;
  --td-muted:        220 20% 16%;
  --td-muted-fg:     215 15% 55%;
  --td-accent:       270 80% 65%;
  --td-accent-fg:    220 30% 6%;
  --td-border:       220 20% 18%;
  --td-destructive:  0 84% 60%;
  --td-radius:       0.75rem;

  /* glows */
  --td-glow-p: 0 0 30px hsl(160 100% 50% / 0.3);
  --td-glow-s: 0 0 30px hsl(195 100% 50% / 0.3);
  --td-glow-a: 0 0 30px hsl(270 80%  65% / 0.3);

  /* shadows */
  --td-shadow-card: 0 4px 24px -4px hsl(220 40% 4% / 0.5);
  --td-shadow-p:    0 10px 40px -12px hsl(160 100% 50% / 0.15);

  /* misc */
  --td-scrollbar-track: hsl(220 25% 6%);
  --td-scrollbar-thumb: hsl(220 20% 18%);
}

.light {
  --td-bg:           210 20% 96%;
  --td-fg:           220 25% 12%;
  --td-card:         0 0% 100%;
  --td-card-fg:      220 25% 12%;
  --td-primary:      160 80% 38%;
  --td-primary-fg:   0 0% 100%;
  --td-secondary:    195 80% 40%;
  --td-secondary-fg: 0 0% 100%;
  --td-muted:        210 15% 90%;
  --td-muted-fg:     215 15% 45%;
  --td-accent:       270 60% 55%;
  --td-accent-fg:    0 0% 100%;
  --td-border:       210 15% 85%;
  --td-destructive:  0 84% 50%;
  --td-glow-p: 0 0 20px hsl(160 80% 38% / 0.15);
  --td-glow-s: 0 0 20px hsl(195 80% 40% / 0.15);
  --td-glow-a: 0 0 20px hsl(270 60% 55% / 0.15);
  --td-shadow-card: 0 4px 24px -4px hsl(220 20% 80% / 0.3);
  --td-shadow-p:    0 10px 40px -12px hsl(160 80% 38% / 0.1);
  --td-scrollbar-track: hsl(210 15% 96%);
  --td-scrollbar-thumb: hsl(210 15% 80%);
}

.accessible {
  --td-bg:           0 0% 100%;
  --td-fg:           0 0% 0%;
  --td-card:         0 0% 100%;
  --td-card-fg:      0 0% 0%;
  --td-primary:      220 90% 40%;
  --td-primary-fg:   0 0% 100%;
  --td-secondary:    220 90% 40%;
  --td-secondary-fg: 0 0% 100%;
  --td-muted:        0 0% 93%;
  --td-muted-fg:     0 0% 20%;
  --td-accent:       220 90% 40%;
  --td-accent-fg:    0 0% 100%;
  --td-border:       0 0% 0%;
  --td-destructive:  0 100% 40%;
  --td-glow-p: none;
  --td-glow-s: none;
  --td-glow-a: none;
  --td-shadow-card: 0 2px 8px hsl(0 0% 0% / 0.15);
  --td-shadow-p:    0 2px 8px hsl(0 0% 0% / 0.1);
  --td-scrollbar-track: hsl(0 0% 95%);
  --td-scrollbar-thumb: hsl(0 0% 50%);
}

/* ============================================================
   CUSTOM CURSOR (pixel-art XP style, только на десктопе)
   ============================================================ */
@media (pointer: fine) {
  * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M2 2 L2 18 L7 13 L12 20 L15 18 L10 11 L17 11 Z' fill='%2300ff88' stroke='%23001a0d' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, auto !important;
  }
  a, button, [role="button"], input, textarea, select, label,
  .td-dot-btn, .mg-tab, .btn-primary, .btn-ghost,
  .td-theme-btn, .td-mobile-menu-btn, [data-nav],
  .ms-cell, .chess-cell, .td-nav-links a {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='28' viewBox='0 0 24 28'%3E%3Cpath d='M8 1 L8 16 L12 13 L15 20 L18 19 L15 12 L20 12 Z' fill='%2300d4ff' stroke='%23001a0d' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 8 1, pointer !important;
  }
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: auto;
  font-size: 16px;
}

/* html provides the real page background so canvas (z-index:0) can float above it */
html {
  background-color: hsl(var(--td-bg));
}
body {
  background-color: transparent; /* transparent so canvas layer is visible below #main */
  color: hsl(var(--td-fg));
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  text-wrap: balance;
  line-height: 1.1;
}
p { text-wrap: pretty; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

code, pre, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

::selection {
  background: hsl(var(--td-primary) / 0.3);
  color: hsl(var(--td-fg));
}

/* scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--td-scrollbar-track); }
::-webkit-scrollbar-thumb {
  background: var(--td-scrollbar-thumb);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--td-primary) / 0.5);
}

/* accessible mode overrides */
.accessible * {
  animation-duration: 0s !important;
  transition-duration: 0s !important;
}
.accessible .glass-card {
  backdrop-filter: none;
  border-width: 2px;
  box-shadow: none;
  background: hsl(var(--td-card));
}
.accessible .noise-bg::after  { display: none; }
.accessible .text-glow        { text-shadow: none; }
.accessible .spotlight::before { display: none; }
.accessible body { font-size: 18px; line-height: 1.8; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* Весь контент поверх canvas (z-index:0) */
#main   { position: relative; z-index: 1; }
section { padding-block: 7rem; position: relative; }

.section-divider {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    hsl(var(--td-primary) / 0.2),
    transparent);
}
.section-divider--secondary {
  background: linear-gradient(90deg,
    transparent,
    hsl(var(--td-secondary) / 0.2),
    transparent);
}
.section-divider--accent {
  background: linear-gradient(90deg,
    transparent,
    hsl(var(--td-accent) / 0.2),
    transparent);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (min-width: 640px) {
  .grid-3--sm2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid-3--sm2 { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.section-label__num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: hsl(var(--td-primary));
}
.section-label h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.section-rule {
  height: 1px;
  background: linear-gradient(90deg, hsl(var(--td-primary) / 0.35), transparent);
  margin-block: 0.5rem 1.5rem;
}
.section-desc {
  color: hsl(var(--td-muted-fg));
  max-width: 55ch;
  margin-bottom: 3.5rem;
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
  background: hsl(var(--td-card) / 0.6);
  backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid hsl(var(--td-border) / 0.6);
  box-shadow: var(--td-shadow-card), inset 0 1px 0 0 hsl(220 20% 25% / 0.15);
  border-radius: var(--td-radius);
}
/* In light theme the dark inset highlight is wrong — replace with a subtle light sheen */
.light .glass-card {
  box-shadow: var(--td-shadow-card), inset 0 1px 0 0 hsl(0 0% 100% / 0.7);
}

.spotlight {
  position: relative;
  overflow: hidden;
}
.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    hsl(var(--td-primary) / 0) 0%,
    hsl(var(--td-primary) / 0) 40%,
    hsl(var(--td-primary) / 0.3) 50%,
    hsl(var(--td-primary) / 0) 60%,
    hsl(var(--td-primary) / 0) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.spotlight:hover::before { opacity: 1; }

/* ============================================================
   NOISE BACKGROUND
   ============================================================ */
.noise-bg { position: relative; }
.noise-bg::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* ============================================================
   CIRCUIT BACKGROUND (SVG canvas layer)
   ============================================================ */
/*
 * Correct visual stack:
 *   html background (dark)   ← deepest
 *   canvas#td-circuit z:0    ← neural network animation
 *   #main             z:1    ← all page content
 *   #td-nav           z:100  ← navigation (already set)
 */
#td-circuit {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 1;
  /* canvas draws transparent (clearRect) — html bg shows through */
  /* nodes + lines are drawn with explicit rgba colours           */
}
.light #td-circuit      { opacity: 0.85; }
.accessible #td-circuit { opacity: 0.08; }

/* ============================================================
   SKIP TO CONTENT
   ============================================================ */
.skip-to-content {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
.skip-to-content:focus {
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 200;
  width: auto; height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: hsl(var(--td-primary));
  color: hsl(var(--td-primary-fg));
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-family: monospace;
  font-size: 0.875rem;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
#td-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg,
    hsl(var(--td-primary)),
    hsl(var(--td-secondary)),
    hsl(var(--td-accent)));
  z-index: 200;
  transition: width 0.1s linear;
}

/* ============================================================
   NAVBAR
   ============================================================ */
#td-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.4s, box-shadow 0.4s, border-color 0.4s;
}
#td-nav.scrolled {
  background: hsl(var(--td-bg) / 0.85);
  backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid hsl(var(--td-border) / 0.5);
  box-shadow: 0 4px 20px -4px hsl(220 40% 4% / 0.4);
}
.light #td-nav.scrolled {
  box-shadow: 0 4px 20px -4px hsl(210 20% 70% / 0.3);
}
.td-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.75rem;
}
.td-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.875rem;
  color: hsl(var(--td-primary));
  text-shadow: 0 0 20px hsl(var(--td-primary) / 0.5);
  transition: opacity 0.2s;
}
.td-nav-logo:hover { opacity: 0.8; }
.td-nav-logo svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

.td-nav-links {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  list-style: none;
}
@media (max-width: 900px) { .td-nav-links { display: none; } }

.td-nav-links a {
  position: relative;
  padding: 0.5rem 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
  border-radius: 0.375rem;
  transition: color 0.2s, background 0.2s;
}
.td-nav-links a:hover,
.td-nav-links a.active {
  color: hsl(var(--td-primary));
  background: hsl(var(--td-primary) / 0.08);
}

/* theme & mobile buttons */
.td-theme-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
  border: 1px solid hsl(var(--td-border) / 0.6);
  border-radius: 0.375rem;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-left: 0.75rem;
}
.td-theme-btn:hover {
  color: hsl(var(--td-fg));
  border-color: hsl(var(--td-primary) / 0.4);
}
.td-theme-btn svg { width: 1rem; height: 1rem; }
@media (max-width: 1280px) { .td-theme-btn span { display: none; } }

.td-mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: hsl(var(--td-fg));
  padding: 0.375rem;
}
.td-mobile-menu-btn svg { width: 1.5rem; height: 1.5rem; }
@media (max-width: 900px) { .td-mobile-menu-btn { display: block; } }

/* mobile nav */
#td-nav-mobile {
  display: none;
  background: hsl(var(--td-card) / 0.97);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid hsl(var(--td-border));
  padding: 0.25rem 1.5rem 1rem;
  list-style: none;
}
#td-nav-mobile.open { display: block; }
#td-nav-mobile a {
  display: block;
  padding: 0.625rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: hsl(var(--td-muted-fg));
  transition: color 0.2s;
}
#td-nav-mobile a.active,
#td-nav-mobile a:hover { color: hsl(var(--td-primary)); }

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 5rem;
  /* No solid background — canvas (#td-circuit, position:fixed, z-index:0) is visible
     through the transparent sections. The html element provides the page colour. */
  background: radial-gradient(ellipse 80% 60% at 50% -10%,
    hsl(var(--td-primary) / 0.08),
    transparent 70%);
}

.hero-grid {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4rem;
}
@media (max-width: 900px) {
  .hero-grid { flex-direction: column; align-items: flex-start; }
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}
.hero-badge svg { width: 0.875rem; height: 0.875rem; color: hsl(var(--td-primary)); }

.hero-name {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.88;
  margin-bottom: 2rem;
}
.hero-name__last {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: hsl(var(--td-primary));
  text-shadow: 0 0 30px hsl(var(--td-primary) / 0.4),
               0 0 60px hsl(var(--td-primary) / 0.15);
  display: block;
}
.hero-name__first { color: hsl(var(--td-fg)); display: block; }
.hero-name__patronymic {
  color: hsl(var(--td-fg) / 0.6);
  display: block;
  font-size: 0.6em;
  margin-top: 0.25em;
}

.hero-typewriter {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  height: 2.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: hsl(var(--td-muted-fg));
  margin-bottom: 3.5rem;
}
.hero-typewriter__arrow { color: hsl(var(--td-primary)); }
.hero-typewriter__text { color: hsl(var(--td-fg) / 0.8); }
.hero-typewriter__cursor {
  color: hsl(var(--td-primary));
  animation: blink 0.8s step-end infinite;
}

.hero-buttons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 5rem;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: hsl(var(--td-primary));
  color: hsl(var(--td-primary-fg));
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.3s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px hsl(var(--td-primary) / 0.25);
}
.btn-primary:active { transform: scale(0.97) translateY(1px); }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: transform 0.2s, border-color 0.2s;
}
.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: hsl(var(--td-primary) / 0.4);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}
.hero-stat__value {
  font-weight: 700;
  font-size: 1.125rem;
  color: hsl(var(--td-primary));
}
.hero-stat__label {
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}
.hero-stat-divider {
  width: 1px;
  height: 2rem;
  background: hsl(var(--td-border));
}

/* scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.scroll-indicator span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}
.scroll-mouse {
  width: 1.25rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--td-border) / 0.6);
  display: flex;
  justify-content: center;
  padding-top: 0.375rem;
}
.scroll-mouse__dot {
  width: 0.25rem;
  height: 0.375rem;
  background: hsl(var(--td-primary));
  border-radius: 999px;
  animation: scrollDot 1.8s ease-in-out infinite;
}

/* ============================================================
   TERMINAL WIDGET
   ============================================================ */
.terminal-wrap {
  flex-shrink: 0;
  width: 26rem;
}
@media (max-width: 900px) { .terminal-wrap { display: none; } }

.terminal {
  border-radius: 1rem;
  overflow: hidden;
  height: 28rem;
  display: flex;
  flex-direction: column;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid hsl(var(--td-border) / 0.3);
  flex-shrink: 0;
}
.terminal-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
}
.terminal-dot--red    { background: hsl(var(--td-destructive) / 0.7); }
.terminal-dot--yellow { background: hsl(45 90% 55% / 0.7); }
.terminal-dot--green  { background: hsl(var(--td-primary) / 0.7); }
.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
  margin-left: 0.5rem;
}
.terminal-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: hsl(var(--td-primary) / 0.6);
}
.terminal-status__dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: hsl(var(--td-primary));
}
.terminal-status__dot--running {
  background: hsl(45 90% 55%);
  animation: pulse 1s ease-in-out infinite;
}

.terminal-body {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.8;
  cursor: text;
  scrollbar-width: none;
}
.terminal-body::-webkit-scrollbar { display: none; }

.terminal-line { display: flex; min-height: 1.2em; }
.terminal-line-num {
  width: 1.25rem;
  text-align: right;
  margin-right: 0.75rem;
  color: hsl(var(--td-muted-fg) / 0.4);
  user-select: none;
  flex-shrink: 0;
}
.terminal-line-num--blank { width: 1.25rem; margin-right: 0.75rem; flex-shrink: 0; }

.terminal-input-row {
  display: flex;
  align-items: center;
}
.terminal-prompt {
  color: hsl(var(--td-accent));
  margin-right: 0.25rem;
}
.terminal-input-field {
  background: transparent;
  border: none;
  outline: none;
  color: hsl(var(--td-fg));
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  flex: 1;
  caret-color: hsl(var(--td-primary));
}

/* text colours in terminal */
.tc-primary   { color: hsl(var(--td-primary)); }
.tc-secondary { color: hsl(var(--td-secondary)); }
.tc-accent    { color: hsl(var(--td-accent)); }
.tc-fg        { color: hsl(var(--td-fg)); }
.tc-muted     { color: hsl(var(--td-muted-fg)); }
.tc-red       { color: hsl(var(--td-destructive)); }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 3.5rem;
}
@media (max-width: 900px) { .about-layout { flex-direction: column; } }

/* ═══ ABOUT PHOTO GLITCH ══════════════════════════════════════ */
.about-photo {
  flex-shrink: 0;
  width: 220px;
  position: relative;
  cursor: pointer;
}
@media (max-width: 900px) { .about-photo { display: none; } }

/* Внешнее свечение */
.about-photo-glow {
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--td-radius) + 4px);
  background: linear-gradient(135deg,
    hsl(var(--td-primary)/.3),
    hsl(var(--td-secondary)/.2),
    hsl(var(--td-accent)/.3));
  filter: blur(6px);
  opacity: .6;
  transition: opacity .5s;
  z-index: 0;
}
.about-photo:hover .about-photo-glow { opacity: 1; }

/* Основной контейнер-рамка */
.about-photo-frame {
  position: relative;
  z-index: 1;
  border-radius: var(--td-radius);
  overflow: hidden;
  border: 1px solid hsl(var(--td-border));
  background: hsl(var(--td-card));
}

/* Терминальная шапка */
.about-photo-bar {
  display: flex;
  align-items: center;
  gap: .375rem;
  padding: .45rem .75rem;
  border-bottom: 1px solid hsl(var(--td-border)/.4);
  background: hsl(0 0% 0%/.3);
  backdrop-filter: blur(8px);
}
.about-photo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.about-photo-dot--r { background: hsl(0 60% 55%/.7); }
.about-photo-dot--y { background: hsl(45 80% 55%/.7); }
.about-photo-dot--g { background: hsl(var(--td-primary)/.7); }
.about-photo-filename {
  margin-left: .4rem;
  font-size: .6rem;
  font-family: monospace;
  color: hsl(var(--td-fg)/.45);
}
.about-photo-blink {
  margin-left: auto;
  font-size: .55rem;
  color: hsl(var(--td-primary)/.5);
  animation: apBlink 1s step-end infinite;
}
@keyframes apBlink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Фото-область: aspect-ratio 3/4, строго */
.about-photo-img-wrap {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
}
.about-photo-img {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(20%) contrast(1.05);
  transition: filter .4s;
}
.about-photo:hover .about-photo-img { filter: grayscale(0%) contrast(1.1); }

/* Цветовые каналы — стандартный CSS filter (без SVG) */
.about-photo-ch {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
/* Красный канал: sepia + hue-rotate даёт насыщенный красный */
.about-photo-ch--red  { mix-blend-mode: screen; filter: sepia(1) saturate(6) hue-rotate(-55deg); }
/* Голубой канал: sepia + hue-rotate 140° даёт циановый */
.about-photo-ch--cyan { mix-blend-mode: screen; filter: sepia(1) saturate(6) hue-rotate(140deg); }

/* Глитч запускается классом .glitching, добавляемым через JS */
.about-photo.glitching .about-photo-ch--red  { animation: apGlitchR 0.45s ease-in-out forwards; }
.about-photo.glitching .about-photo-ch--cyan { animation: apGlitchC 0.45s ease-in-out forwards 0.05s; }
.about-photo.glitching .about-photo-img-wrap {
  filter: drop-shadow(4px 0 rgba(255,0,100,.55)) drop-shadow(-4px 0 rgba(0,210,255,.55));
}

@keyframes apGlitchR {
  0%   { transform:translateX(0);   opacity:0; }
  20%  { transform:translateX(5px);  opacity:.9; }
  45%  { transform:translateX(-3px); opacity:.7; }
  70%  { transform:translateX(6px);  opacity:.85; }
  100% { transform:translateX(0);   opacity:0; }
}
@keyframes apGlitchC {
  0%   { transform:translateX(0);    opacity:0; }
  20%  { transform:translateX(-5px); opacity:.7; }
  45%  { transform:translateX(3px);  opacity:.5; }
  70%  { transform:translateX(-6px); opacity:.7; }
  100% { transform:translateX(0);    opacity:0; }
}

/* Глитч-слайсы */
.about-photo-slices {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
.about-photo-slice {
  position: absolute;
  left: 0; right: 0;
  top: var(--top, 15%);
  height: 6%;
  overflow: hidden;
  opacity: 0;
  animation-name: apSlice;
  animation-duration: 0.5s;
  animation-timing-function: step-end;
  animation-fill-mode: forwards;
  animation-play-state: paused;
}
/* Слайсы активируются классом .glitching */
.about-photo.glitching .about-photo-slice {
  animation-play-state: running;
  animation-delay: var(--delay, 0s);
}
.about-photo-slice img {
  position: absolute;
  left: 0;
  top: var(--neg-top, -250%);
  width: 100%;
  height: 1667%;
  object-fit: cover;
}
@keyframes apSlice {
  0%   { transform:translateX(0);              opacity:0; }
  15%  { transform:translateX(var(--ofs,-8px));  opacity:1; filter:hue-rotate(var(--hue,90deg)) saturate(2.5); }
  40%  { transform:translateX(calc(var(--ofs,-8px)*-0.6)); opacity:.8; filter:hue-rotate(var(--hue,90deg)) saturate(2); }
  70%  { transform:translateX(var(--ofs,-8px));  opacity:.6; filter:hue-rotate(var(--hue,90deg)) saturate(2); }
  100% { transform:translateX(0);              opacity:0; }
}

/* Сканлайны */
.about-photo-scanlines {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(0,0,0,.15) 2px, rgba(0,0,0,.15) 4px
  );
  opacity: .3;
  transition: opacity .3s;
}
.about-photo:hover .about-photo-scanlines { opacity: .5; }

/* Бегущая линия (сканбим) */
.about-photo-scanbeam {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, hsl(var(--td-primary)/.6), transparent);
  animation: apScanbeam 3s linear infinite;
}
@keyframes apScanbeam { from{top:-2px} to{top:100%} }

/* Шум */
.about-photo-noise {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: .03;
  transition: opacity .3s;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.about-photo:hover .about-photo-noise { opacity: .08; }

/* Нижняя инфополоса */
.about-photo-infobar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .65rem;
  background: linear-gradient(to top, hsl(0 0% 0%/.85), transparent);
  font-family: monospace;
  font-size: .6rem;
  pointer-events: none;
}
.about-photo-infobar span:first-child { color: hsl(var(--td-primary)/.7); }
.about-photo-infobar span:last-child  { color: hsl(var(--td-fg)/.4); }

/* Угловые акценты */
.about-photo-corner {
  position: absolute;
  width: 16px; height: 16px;
  z-index: 7;
  pointer-events: none;
  border-color: hsl(var(--td-primary)/.4);
  border-style: solid;
  transition: border-color .3s;
}
.about-photo:hover .about-photo-corner { border-color: hsl(var(--td-primary)/.85); }
.about-photo-corner--tl { top:-1px; left:-1px; border-width:2px 0 0 2px; border-radius:var(--td-radius) 0 0 0; }
.about-photo-corner--tr { top:-1px; right:-1px; border-width:2px 2px 0 0; border-radius:0 var(--td-radius) 0 0; }
.about-photo-corner--bl { bottom:-1px; left:-1px; border-width:0 0 2px 2px; border-radius:0 0 0 var(--td-radius); }
.about-photo-corner--br { bottom:-1px; right:-1px; border-width:0 2px 2px 0; border-radius:0 0 var(--td-radius) 0; }

.about-card-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid hsl(var(--td-border) / 0.6);
}
.about-card-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}
.about-card-dot--r { background: hsl(var(--td-destructive) / 0.7); }
.about-card-dot--y { background: hsl(45 90% 55% / 0.7); }
.about-card-dot--g { background: hsl(var(--td-primary) / 0.7); }
.about-card-filename {
  margin-left: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}

.about-card-body {
  padding: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.8;
}
.about-card-body p { color: hsl(var(--td-muted-fg)); margin-bottom: 0.75rem; }
.about-card-body .hl-p { color: hsl(var(--td-primary)); }
.about-card-body .hl-s { color: hsl(var(--td-secondary)); }
.about-card-body .hl-a { color: hsl(var(--td-accent)); }
.about-card-body .hl-h2 { color: hsl(var(--td-secondary)); }

.about-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.about-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}
.about-badge svg { width: 0.875rem; height: 0.875rem; }

/* documents grid */
.about-docs-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--td-muted-fg));
  margin-bottom: 1.5rem;
}

.doc-group { border-radius: var(--td-radius); overflow: hidden; }
.doc-group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--td-border) / 0.4);
}
.doc-group-header svg { width: 1rem; height: 1rem; }
.doc-group-header span { font-size: 0.875rem; font-weight: 600; }
.doc-group-count {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg) / 0.5);
}
.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  transition: background 0.15s;
  border-top: 1px solid hsl(var(--td-border) / 0.3);
}
.doc-item:hover { background: hsl(var(--td-muted) / 0.15); }
.doc-item:first-child { border-top: none; }
.doc-item svg { width: 0.875rem; height: 0.875rem; color: hsl(var(--td-muted-fg) / 0.4); margin-top: 0.125rem; flex-shrink: 0; transition: color 0.15s; }
.doc-item:hover svg { color: hsl(var(--td-primary) / 0.6); }
.doc-item__title { font-size: 0.875rem; color: hsl(var(--td-fg) / 0.9); }
.doc-item__detail {
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg) / 0.6);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 0.125rem;
}
.doc-item__ext { margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.doc-item:hover .doc-item__ext { opacity: 0.5; }
.doc-item__ext svg { width: 0.75rem; height: 0.75rem; margin-top: 0.125rem; }
.doc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
  background: transparent;
  border: none;
  border-top: 1px solid hsl(var(--td-border) / 0.3);
  cursor: pointer;
  transition: color 0.2s;
}
.doc-toggle:hover { color: hsl(var(--td-fg)); }
.doc-toggle svg { width: 0.875rem; height: 0.875rem; transition: transform 0.25s; }
.doc-toggle.open svg { transform: rotate(180deg); }

/* ============================================================
   DISCIPLINES
   ============================================================ */
.discipline-card {
  padding: 1.5rem;
  border-radius: var(--td-radius);
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.2s;
  cursor: default;
}
.discipline-card:hover { transform: translateY(-2px); }
.discipline-card--primary:hover  { border-color: hsl(var(--td-primary) / 0.4);   box-shadow: 0 4px 30px hsl(var(--td-primary) / 0.1); }
.discipline-card--secondary:hover{ border-color: hsl(var(--td-secondary) / 0.4); box-shadow: 0 4px 30px hsl(var(--td-secondary) / 0.1); }
.discipline-card--accent:hover   { border-color: hsl(var(--td-accent) / 0.4);    box-shadow: 0 4px 30px hsl(var(--td-accent) / 0.1); }

.disc-icon {
  display: inline-flex;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: hsl(var(--td-muted) / 0.35);
  flex-shrink: 0;
  transition: transform 0.25s, background 0.2s;
}
.discipline-card:hover .disc-icon { transform: scale(1.1); background: hsl(var(--td-muted) / 0.55); }
.disc-icon svg { width: 1.5rem; height: 1.5rem; }
.disc-icon--primary   svg { color: hsl(var(--td-primary)); }
.disc-icon--secondary svg { color: hsl(var(--td-secondary)); }
.disc-icon--accent    svg { color: hsl(var(--td-accent)); }

.disc-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.disc-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex: 1;
  gap: 0.5rem;
}
.disc-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--td-fg));
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.disc-arrow {
  width: 1rem;
  height: 1rem;
  color: hsl(var(--td-muted-fg) / 0.3);
  flex-shrink: 0;
  margin-top: 0.125rem;
  transition: color 0.2s, transform 0.2s;
}
.discipline-card:hover .disc-arrow {
  color: hsl(var(--td-fg) / 0.5);
  transform: translate(2px, -2px);
}
.disc-desc { font-size: 0.875rem; color: hsl(var(--td-muted-fg)); margin-bottom: 1rem; line-height: 1.6; }
.disc-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  border: 1px solid;
}
.tag--primary   { background: hsl(var(--td-primary) / 0.08);   color: hsl(var(--td-primary));   border-color: hsl(var(--td-primary) / 0.15); }
.tag--secondary { background: hsl(var(--td-secondary) / 0.08); color: hsl(var(--td-secondary)); border-color: hsl(var(--td-secondary) / 0.15); }
.tag--accent    { background: hsl(var(--td-accent) / 0.08);    color: hsl(var(--td-accent));    border-color: hsl(var(--td-accent) / 0.15); }

/* ============================================================
   MATERIALS
   ============================================================ */
.material-card { padding: 1.5rem; }
.material-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.material-icon {
  display: inline-flex;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background: hsl(var(--td-muted) / 0.35);
}
.material-icon svg { width: 1.25rem; height: 1.25rem; color: hsl(var(--td-primary)); }
.material-card-title { font-weight: 600; }
.material-card-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}
.material-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.25rem;
}
.material-item:hover { background: hsl(var(--td-muted) / 0.2); }
.material-item svg { width: 1rem; height: 1rem; color: hsl(var(--td-muted-fg) / 0.5); margin-top: 0.125rem; flex-shrink: 0; transition: color 0.15s; }
.material-item:hover svg { color: hsl(var(--td-primary)); }
.material-item__title { font-size: 0.875rem; line-height: 1.3; }
.material-item__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}
.material-item__dl {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
}
.material-item:hover .material-item__dl { opacity: 0.5; }
.material-item__dl svg { width: 0.875rem; height: 0.875rem; }

/* ============================================================
   PROJECTS
   ============================================================ */
.project-card {
  padding: 1.5rem;
  transition: box-shadow 0.3s, border-color 0.3s, transform 0.2s;
}
.project-card:hover { transform: translateY(-2px); }
.project-card--primary:hover   { border-color: hsl(var(--td-primary) / 0.4);   box-shadow: 0 4px 30px hsl(var(--td-primary) / 0.1); }
.project-card--secondary:hover { border-color: hsl(var(--td-secondary) / 0.4); box-shadow: 0 4px 30px hsl(var(--td-secondary) / 0.1); }
.project-card--accent:hover    { border-color: hsl(var(--td-accent) / 0.4);    box-shadow: 0 4px 30px hsl(var(--td-accent) / 0.1); }

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.project-type-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  background: hsl(var(--td-muted) / 0.35);
  color: hsl(var(--td-muted-fg));
}
.project-arrow {
  width: 1rem;
  height: 1rem;
  color: hsl(var(--td-muted-fg) / 0.3);
  transition: color 0.2s, transform 0.2s;
}
.project-card:hover .project-arrow {
  color: hsl(var(--td-fg) / 0.5);
  transform: translate(2px, -2px);
}
.project-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.project-desc {
  font-size: 0.875rem;
  color: hsl(var(--td-muted-fg));
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* ============================================================
   NEWS
   ============================================================ */
.news-featured {
  padding: 2rem;
  margin-bottom: 2rem;
  cursor: pointer;
  transition: border-color 0.4s, box-shadow 0.4s;
  position: relative;
  overflow: hidden;
}
.news-featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    hsl(var(--td-primary)),
    hsl(var(--td-secondary)),
    hsl(var(--td-accent)));
  opacity: 0.6;
}
.news-featured:hover {
  border-color: hsl(var(--td-primary) / 0.4);
  box-shadow: 0 8px 40px hsl(var(--td-primary) / 0.08);
}
.news-featured-inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
}
@media (max-width: 640px) { .news-featured-inner { flex-direction: column; } }

.news-date-card {
  padding: 0.75rem 1.25rem;
  text-align: center;
  min-width: 80px;
  flex-shrink: 0;
}
.news-date-day {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--td-primary));
}
.news-date-month {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
  letter-spacing: 0.1em;
}
.news-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid;
}
.news-tag--championship { background: hsl(var(--td-primary) / 0.1);   color: hsl(var(--td-primary));   border-color: hsl(var(--td-primary) / 0.2); }
.news-tag--conference   { background: hsl(var(--td-secondary) / 0.1); color: hsl(var(--td-secondary)); border-color: hsl(var(--td-secondary) / 0.2); }
.news-tag--project      { background: hsl(var(--td-accent) / 0.1);    color: hsl(var(--td-accent));    border-color: hsl(var(--td-accent) / 0.2); }
.news-tag--event        { background: hsl(var(--td-primary) / 0.1);   color: hsl(var(--td-primary));   border-color: hsl(var(--td-primary) / 0.2); }

.news-featured-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  transition: color 0.2s;
  line-height: 1.3;
}
.news-featured:hover .news-featured-title { color: hsl(var(--td-primary)); }
.news-featured-summary {
  color: hsl(var(--td-muted-fg));
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 65ch;
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}
.news-meta svg { width: 1rem; height: 1rem; }

.news-card {
  padding: 1.5rem;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  border-color: hsl(var(--td-primary) / 0.3);
  box-shadow: 0 4px 25px hsl(var(--td-primary) / 0.06);
}
.news-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.news-card-date {
  text-align: right;
}
.news-card-day {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.125rem;
  font-weight: 700;
  color: hsl(var(--td-fg) / 0.8);
  line-height: 1;
}
.news-card-month {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  color: hsl(var(--td-muted-fg));
  letter-spacing: 0.1em;
}
.news-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  transition: color 0.2s;
  line-height: 1.4;
  flex: 1;
}
.news-card:hover .news-card-title { color: hsl(var(--td-primary)); }
.news-card-summary {
  font-size: 0.875rem;
  color: hsl(var(--td-muted-fg));
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--td-border) / 0.3);
  margin-top: auto;
}
.news-card-footer-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
}
.news-card-arrow {
  width: 1rem;
  height: 1rem;
  color: transparent;
  transition: color 0.2s, transform 0.2s;
}
.news-card:hover .news-card-arrow {
  color: hsl(var(--td-primary) / 0.6);
  transform: translateX(4px);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-card {
  padding: 1.25rem;
  display: block;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-card--phone:hover   { border-color: hsl(var(--td-primary) / 0.4);   box-shadow: 0 4px 25px hsl(var(--td-primary) / 0.08); }
.contact-card--email:hover   { border-color: hsl(var(--td-secondary) / 0.4); box-shadow: 0 4px 25px hsl(var(--td-secondary) / 0.08); }
.contact-card--telegram:hover{ border-color: hsl(var(--td-secondary) / 0.4); box-shadow: 0 4px 25px hsl(var(--td-secondary) / 0.08); }
.contact-card--address:hover { border-color: hsl(var(--td-accent) / 0.4);    box-shadow: 0 4px 25px hsl(var(--td-accent) / 0.08); }
.contact-card--max:hover     { border-color: hsl(var(--td-accent) / 0.4);    box-shadow: 0 4px 25px hsl(var(--td-accent) / 0.08); }

.contact-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.contact-card-top svg { width: 1.25rem; height: 1.25rem; color: hsl(var(--td-muted-fg)); transition: color 0.2s; }
.contact-card:hover .contact-card-top svg { color: hsl(var(--td-primary)); }
.contact-card-ext { width: 0.875rem; height: 0.875rem; opacity: 0; transition: opacity 0.2s; }
.contact-card:hover .contact-card-ext { opacity: 0.5; }
.contact-card-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
  margin-bottom: 0.25rem;
}
.contact-card-value {
  font-size: 0.875rem;
  color: hsl(var(--td-fg));
  word-break: break-all;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  position: relative;
  border-top: 1px solid hsl(var(--td-border) / 0.4);
  padding-block: 2.5rem;
}
footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsl(var(--td-primary) / 0.2), transparent);
}
.footer-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
@media (max-width: 640px) { .footer-inner { flex-direction: column; text-align: center; } }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  color: hsl(var(--td-muted-fg));
}
.footer-brand svg { width: 1rem; height: 1rem; color: hsl(var(--td-primary)); }
.footer-brand-sep { color: hsl(var(--td-border)); margin-inline: 0.25rem; }

.footer-copy {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.footer-copy .hl { color: hsl(var(--td-primary)); }
.footer-heart {
  display: inline-block;
  color: hsl(var(--td-destructive));
  fill: hsl(var(--td-destructive));
  animation: pulse 1s ease-in-out infinite;
}

/* ============================================================
   ANIMATIONS (fade on scroll via .td-reveal)
   Progressive enhancement: content is visible by default.
   JS adds .td-js to <html>, then sections animate in on scroll.
   ============================================================ */

/* Default: always visible (no JS / slow JS / bots) */
.td-reveal {
  opacity: 1;
  transform: none;
}

/* JS is active — hide elements until IntersectionObserver reveals them */
.td-js .td-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.td-js .td-reveal.visible {
  opacity: 1;
  transform: none;
}

/* Hero is always visible even when JS is active */
.td-js #hero.td-reveal {
  opacity: 1;
  transform: none;
}

.td-js .td-reveal-delay-1 { transition-delay: 0.1s; }
.td-js .td-reveal-delay-2 { transition-delay: 0.2s; }
.td-js .td-reveal-delay-3 { transition-delay: 0.3s; }
.td-js .td-reveal-delay-4 { transition-delay: 0.4s; }
.td-js .td-reveal-delay-5 { transition-delay: 0.5s; }

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes blink {
  0%, 50%  { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@keyframes scrollDot {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes bgGrid {
  0%   { background-position: 0 0; }
  100% { background-position: 60px 60px; }
}

/* ============================================================
   BG GRID (hero)
   ============================================================ */
.bg-grid-dots {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(hsl(var(--td-border) / 0.4) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--td-border) / 0.4) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.12;
  pointer-events: none;
  animation: bgGrid 8s linear infinite;
}

/* ============================================================
   CONTACT LAYOUT  (контакты + игры)
   ============================================================ */
.contact-layout {
  display: flex;
  flex-direction: row;
  gap: 2.5rem;
  align-items: flex-start;
  margin-top: 0;
}
.contact-left { flex: 1; min-width: 0; }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 640px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .contact-layout { flex-direction: column; }
  .minigames-wrap { width: 100%; }
}

/* ============================================================
   MINIGAMES
   ============================================================ */
.minigames-wrap {
  width: 22rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@media (max-width: 1024px) { .minigames-wrap { display: none; } }

.mg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.mg-tab {
  flex: 1 1 auto;
  min-width: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  padding: 0.3rem 0.4rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  background: transparent;
  color: hsl(var(--td-muted-fg));
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.mg-tab:hover {
  color: hsl(var(--td-fg));
}
.mg-tab--active {
  background: hsl(var(--td-primary) / 0.12);
  color: hsl(var(--td-primary));
  border-color: hsl(var(--td-primary) / 0.25);
}

.mg-canvas-wrap {
  position: relative;
  height: 22rem;
  border-radius: var(--td-radius);
  overflow: hidden;
}
#td-mg-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background-color: hsl(222 20% 12%); /* games always render on dark bg */
}

/* Оверлей «Нажми Играть» */
.mg-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: hsl(var(--td-bg) / 0.8);
  backdrop-filter: blur(6px);
  border-radius: var(--td-radius);
  gap: 0.25rem;
  transition: opacity 0.3s;
}
.mg-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.mg-overlay-emoji {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.mg-overlay-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: hsl(var(--td-fg));
  margin-bottom: 0.5rem;
}
.mg-overlay-inst {
  text-align: center;
  margin-bottom: 1rem;
}
.mg-overlay-inst p {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: hsl(var(--td-muted-fg));
  line-height: 1.8;
}
.mg-start-btn {
  background: hsl(var(--td-primary) / 0.15);
  border: 1px solid hsl(var(--td-primary) / 0.35);
  color: hsl(var(--td-primary));
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}
.mg-start-btn:hover {
  background: hsl(var(--td-primary) / 0.25);
}

/* ============================================================
   DOTS NAV (точки-якоря справа)
   ============================================================ */
#td-dots-nav {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}
@media (max-width: 900px) { #td-dots-nav { display: none; } }

.td-dot-btn {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid hsl(var(--td-fg) / 0.35);
  background: transparent;
  cursor: pointer;
  pointer-events: all;
  padding: 0;
  transition: transform 0.25s, background 0.25s, border-color 0.25s;
  position: relative;
}
.td-dot-btn:hover {
  transform: scale(1.5);
  border-color: hsl(var(--td-fg) / 0.6);
  background: hsl(var(--td-fg) / 0.2);
}
.td-dot-btn.active {
  background: hsl(var(--td-primary));
  border-color: hsl(var(--td-primary));
  transform: scale(1.2);
}
/* Всплывающий тултип (название секции) */
.td-dot-btn::before {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.6rem;
  font-family: 'JetBrains Mono', monospace;
  color: hsl(var(--td-fg) / 0.8);
  background: hsl(var(--td-card));
  border: 1px solid hsl(var(--td-border) / 0.5);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.td-dot-btn:hover::before { opacity: 1; }

/* ============================================================
   WORDPRESS ADMIN BAR ADJUSTMENT
   ============================================================ */
.admin-bar #td-nav { top: 32px; }
@media (max-width: 782px) { .admin-bar #td-nav { top: 46px; } }
