/* ============================================
   saltykov.tech — Design System (Palantir-style)
   ============================================ */

/* --- Tokens --- */
:root {
  --bg-primary: #101214;
  --bg-secondary: #1a1d21;
  --bg-tertiary: #22262b;
  --text-primary: #F5F5F5;
  --text-secondary: #94979b;
  --text-muted: #5c6066;
  --accent: #4A90D9;
  --accent-dim: rgba(74, 144, 217, 0.12);
  --accent-glow: rgba(74, 144, 217, 0.15);
  --green: #43BF6D;
  --green-dim: rgba(67, 191, 109, 0.12);
  --red: #E55B5B;
  --purple: #9D7BEA;
  --border: #2a2d32;
  --glass-bg: rgba(16, 18, 20, 0.8);
  --glass-border: rgba(255, 255, 255, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- Dot Grid Background --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, #ffffff06 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* --- Typography --- */
h1, h2, h3 {
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.125rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover { opacity: 0.8; }

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

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

/* --- Glassmorphism --- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

/* --- Language visibility --- */
.lang-ru { display: none; }
html[lang="ru"] .lang-en { display: none; }
html[lang="ru"] .lang-ru { display: block; }
html[lang="ru"] li.lang-ru { display: list-item; }
html[lang="ru"] span.lang-ru { display: inline; }
html[lang="ru"] h1.lang-ru,
html[lang="ru"] h2.lang-ru,
html[lang="ru"] h3.lang-ru { display: block; }

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(16, 18, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--accent);
}

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

/* ============================================
   Hero
   ============================================ */
.hero {
  padding: 160px 0 100px;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-mono);
  margin-bottom: 20px;
  min-height: 1.2em;
}

.hero h1 .cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 14px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(74, 144, 217, 0.3);
  border-radius: 100px;
  letter-spacing: 0.05em;
}

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* ============================================
   Section Headers
   ============================================ */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.section-title {
  margin-bottom: 48px;
}

/* ============================================
   Case Cards
   ============================================ */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent);
  -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);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: background 0.3s;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.card:hover::before {
  background: linear-gradient(135deg, var(--accent-dim), transparent);
}

.card-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.card h3 {
  margin-bottom: 10px;
}

.card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.card-tags {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  opacity: 0.85;
}

/* ============================================
   Deliverable
   ============================================ */
.deliverable-content {
  max-width: 700px;
}

.deliverable-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.8;
}

.deliverable-link {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ============================================
   Process Steps
   ============================================ */
.process-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.process-step {
  display: flex;
  gap: 24px;
  padding: 28px 0;
  border-left: 2px solid var(--border);
  padding-left: 24px;
  position: relative;
  transition: border-color 0.3s;
}

.process-step:hover {
  border-left-color: var(--accent);
}

.process-step::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 34px;
  width: 8px;
  height: 8px;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: 50%;
  transition: border-color 0.3s, background 0.3s;
}

.process-step:hover::before {
  border-color: var(--accent);
  background: var(--accent);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 28px;
  padding-top: 2px;
}

.step-content h3 {
  margin-bottom: 6px;
}

.step-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ============================================
   Terminal
   ============================================ */
.terminal-section {
  padding: 60px 0 100px;
}

.terminal {
  background: rgba(16, 18, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 680px;
  margin: 0 auto;
  overflow: hidden;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.terminal-body {
  padding: 20px;
  min-height: 280px;
  max-height: 450px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
}

.terminal-body::-webkit-scrollbar {
  width: 4px;
}

.terminal-body::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.terminal-line {
  color: var(--text-secondary);
  word-break: break-word;
}

.terminal-line.system {
  color: var(--green);
}

.terminal-line.error {
  color: var(--red);
}

.terminal-line.user {
  color: var(--text-primary);
}

.terminal-line.user::before {
  content: '> ';
  color: var(--accent);
}

.terminal-line.assistant {
  color: var(--text-secondary);
  padding-left: 16px;
  border-left: 2px solid var(--border);
  margin: 8px 0;
}

.terminal-thinking {
  color: var(--text-muted);
}

.terminal-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  align-items: center;
}

.terminal-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
}

.terminal-input:focus {
  border-color: var(--accent);
}

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

.terminal-submit {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.terminal-submit:hover {
  opacity: 0.9;
}

.terminal-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
   Status Bar
   ============================================ */
.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 8px 0;
  background: rgba(16, 18, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.status-bar .container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.status-bar a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.status-bar a:hover {
  color: var(--accent);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  position: relative;
  z-index: 1;
  padding: 40px 0 60px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer a {
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* ============================================
   Report Page
   ============================================ */
.report-banner {
  text-align: center;
  padding: 12px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: sticky;
  top: 56px;
  z-index: 99;
}

.report {
  padding: 40px 0 100px;
  max-width: 800px;
  margin: 0 auto;
}

.report h1 {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.report-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.report h2 {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--accent);
}

.report h3 {
  font-size: 1rem;
  margin-top: 24px;
  margin-bottom: 10px;
}

.report p, .report li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.report ul, .report ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.report li {
  margin-bottom: 6px;
}

.report pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.redacted {
  font-family: var(--font-mono);
  background: var(--red);
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.severity-critical {
  color: var(--red);
  font-weight: 600;
}

.severity-high {
  color: #E5933B;
  font-weight: 600;
}

.severity-medium {
  color: #D4B84A;
  font-weight: 600;
}

.severity-low {
  color: var(--text-muted);
}

.report .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

/* ============================================
   GSAP Reveal Base
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(15px);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .cases-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero {
    padding: 130px 0 70px;
  }

  section {
    padding: 60px 0;
  }

  .process-step {
    gap: 16px;
  }

  .terminal {
    border-radius: var(--radius);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .card {
    padding: 20px;
  }

  .terminal-body {
    font-size: 0.8rem;
    min-height: 220px;
    padding: 16px;
  }

  .terminal-input-area {
    padding: 10px 16px 14px;
  }

  .status-bar .container {
    gap: 12px;
    font-size: 0.65rem;
  }
}
