/* ==========================================================================
   HamachiInfo — main.css
   Основные стили, переменные, сброс
   ========================================================================== */

/* Custom Properties */
:root {
  --bg-primary: #0d0f14;
  --bg-secondary: #131620;
  --bg-card: #1a1d2e;
  --bg-card-hover: #1f2338;
  --accent-primary: #00d4ff;
  --accent-secondary: #7b5ea7;
  --accent-warning: #f0a500;
  --accent-success: #00c897;
  --text-primary: #e8eaf0;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;
  --border-subtle: #1e2235;
  --border-active: #00d4ff33;
  --shadow-glow: 0 0 20px #00d4ff15;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 8px;
  --radius-lg: 16px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --container-width: 1200px;
  --header-height: 64px;
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-primary: #f0f2f8;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f7ff;
  --text-primary: #1a1d2e;
  --text-secondary: #4a5568;
  --text-muted: #8892a4;
  --border-subtle: #e0e4f0;
  --border-active: #00d4ff66;
  --shadow-glow: 0 0 20px #00d4ff25;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.08);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  /* Dot pattern background */
  background-image: radial-gradient(circle, #1e2235 1px, transparent 1px);
  background-size: 32px 32px;
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00b8d9;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent-primary);
  color: #000;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: #33ddff;
  text-decoration: underline;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

em {
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-card);
  color: var(--accent-primary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

pre {
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

ul, ol {
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.5rem;
}

img, svg {
  max-width: 100%;
  height: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

mark {
  background: #00d4ff33;
  color: var(--accent-primary);
  border-radius: 2px;
  padding: 0 2px;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* Selection */
::selection {
  background: #00d4ff33;
  color: var(--accent-primary);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Section spacing */
.section {
  padding: 5rem 0;
}

.section--sm {
  padding: 3rem 0;
}

.section-title {
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* Divider */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  margin: 3rem 0;
}

/* Text utilities */
.text-accent { color: var(--accent-primary); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }

.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

/* Inline icon */
.icon-inline {
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.35rem;
}

/* Content prose */
.prose {
  max-width: 72ch;
}

.prose h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.prose h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.25rem;
}

.prose li {
  margin-bottom: 0.6rem;
}

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 15, 20, 0.95);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.search-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.search-box {
  width: 100%;
  max-width: 600px;
  padding: 0 1.5rem;
}

.search-input-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 2px solid var(--accent-primary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.25rem;
  padding: 1rem 1.25rem 1rem 3.5rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-close {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.search-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 1rem;
}
