/* ============================================
   Бюро Кострубина — Demoscene Retro Theme
   Amiga / 8-bit / 16-bit / Sega / Premium
   ============================================ */

:root {
  --bg: #111113;
  --bg-panel: #1a1a1e;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #72cc96;
  --accent-dark: #399f62;
  --border: #4d4d4d;
  --border-light: #666;
  --card-bg: rgba(114, 204, 150, 0.04);
  --card-hover: rgba(114, 204, 150, 0.1);
  --amiga-blue: #0055aa;
  --amiga-orange: #ff8800;
  --sega-magenta: #ff00ff;
  --copper-1: #ff6600;
  --copper-2: #ffcc00;
  --copper-3: #00ccff;
  --copper-4: #ff00ff;
  --font-pixel: 'Press Start 2P', monospace;
  --font-mono: 'Share Tech Mono', monospace;
}

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

html { font-size: 26px; scroll-behavior: smooth; overflow-x: hidden; }

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

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #fff; border-bottom: 1px dotted var(--accent); }

/* ============================================
   BOOT SCREEN
   ============================================ */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 20px;
  transition: opacity 0.6s ease;
}

.boot-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.boot-line {
  opacity: 0;
  margin-bottom: 4px;
  white-space: pre;
}

.boot-line.visible {
  opacity: 1;
}

.boot-progress {
  width: 300px;
  height: 16px;
  border: 1px solid var(--accent);
  margin-top: 12px;
  padding: 2px;
  opacity: 0;
}

.boot-progress.visible { opacity: 1; }

.boot-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}

.boot-cursor {
  animation: blink 0.6s step-end infinite;
}

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

/* ============================================
   START SCREEN — "PRESS ANY KEY"
   ============================================ */
.start-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.5s ease;
  overflow: hidden;
}

.start-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.start-text {
  font-family: var(--font-pixel);
  font-size: 22px;
  color: var(--accent);
  letter-spacing: 2px;
  animation: startBlink 1.2s steps(1) infinite;
  text-shadow: 0 0 20px rgba(114, 204, 150, 0.5);
  text-align: center;
  padding: 0 20px;
  word-break: break-word;
  width: 100%;
  display: block;
}

.start-sub {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 20px;
  letter-spacing: 1px;
  text-align: center;
  width: 100%;
  display: block;
}

@keyframes startBlink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0; }
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.page-exit {
  animation: pageFadeOut 0.4s ease forwards;
}

.page-enter {
  animation: pageFadeIn 0.4s ease;
}

@keyframes pageFadeOut {
  to { opacity: 0; filter: blur(4px); }
}

@keyframes pageFadeIn {
  from { opacity: 0; filter: blur(4px); }
}

/* ============================================
   SCANLINE OVERLAY (CRT)
   ============================================ */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  /* Classic CRT scanlines — dark lines with gaps */
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.12) 0px,
    rgba(0, 0, 0, 0.12) 1px,
    transparent 1px,
    transparent 3px
  );
  /* Subtle horizontal movement animation */
  animation: scanlineShift 0.05s steps(1) infinite;
}

@keyframes scanlineShift {
  0% { background-position: 0 0; }
  50% { background-position: 0 1px; }
  100% { background-position: 0 0; }
}

.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Vignette — darkened edges like CRT curvature */
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.25) 80%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* Extra: bright scanline pass (every 3rd line glows slightly) */
.scanlines::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(114, 204, 150, 0.015) 0px,
    rgba(114, 204, 150, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: screen;
}

/* ============================================
   CRT MONITOR FILTER (Soft)
   ============================================ */
.crt-active .site-wrapper {
  border-radius: 42px;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(114, 204, 150, 0.05);
}

/* RGB phosphor grid */
.crt-active .scanlines::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255, 0, 0, 0.02) 0px,
      rgba(255, 0, 0, 0.02) 1px,
      rgba(0, 255, 0, 0.02) 1px,
      rgba(0, 255, 0, 0.02) 2px,
      rgba(0, 100, 255, 0.02) 2px,
      rgba(0, 100, 255, 0.02) 3px,
      transparent 3px,
      transparent 4px
    );
  background-size: 4px 1px;
  z-index: 1;
}

/* Rolling bar */
.crt-rolling-bar {
  position: fixed;
  inset: 0;
  z-index: 9997;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.015) 45%,
    rgba(255, 255, 255, 0.03) 50%,
    rgba(255, 255, 255, 0.015) 55%,
    transparent 100%
  );
  background-size: 100% 300%;
  animation: rollingBar 8s linear infinite;
  display: none;
}

.crt-active .crt-rolling-bar { display: block; }

@keyframes rollingBar {
  0% { background-position: 0% 0%; }
  100% { background-position: 0% 300%; }
}

/* Flicker */
.crt-flicker {
  position: fixed;
  inset: 0;
  z-index: 9996;
  pointer-events: none;
  animation: crtFlicker 0.15s infinite;
  opacity: 0;
  display: none;
}

.crt-active .crt-flicker { display: block; }

@keyframes crtFlicker {
  0% { opacity: 0; }
  5% { opacity: 0.01; background: rgba(255,255,255,0.01); }
  10% { opacity: 0; }
  15% { opacity: 0.005; background: rgba(255,255,255,0.005); }
  20% { opacity: 0; }
  100% { opacity: 0; }
}

/* Noise overlay */
.crt-noise {
  position: fixed;
  inset: 0;
  z-index: 9995;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  display: none;
}

.crt-active .crt-noise { display: block; }

.crt-noise svg { width: 100%; height: 100%; }

/* Screen glow */
.crt-active::after {
  content: '';
  position: fixed;
  inset: -2px;
  z-index: 9994;
  pointer-events: none;
  border-radius: 42px;
  box-shadow:
    inset 0 0 80px rgba(114, 204, 150, 0.03),
    inset 0 0 160px rgba(0, 0, 0, 0.15);
}

/* Chromatic aberration on scroll */
.chromatic-active h1,
.chromatic-active h2,
.chromatic-active h3 {
  text-shadow: -0.5px 0 rgba(255, 0, 50, 0.15), 0.5px 0 rgba(0, 200, 255, 0.15);
  transition: text-shadow 0.3s;
}

/* CRT toggle button */
.crt-toggle {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px 10px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}

.crt-toggle:hover {
  border-color: var(--accent);
  background: rgba(114, 204, 150, 0.1);
}

.crt-toggle.off {
  color: var(--text-dim);
  border-color: transparent;
}

.crt-toggle.off:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.03);
}

/* iOS Toggle Switch */
.ios-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

.ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 22px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  background: #666;
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
}

.ios-toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.ios-toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #fff;
}

/* ============================================
   STARFIELD CANVAS
   ============================================ */
.starfield-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   COPPER BARS (Amiga classic)
   ============================================ */
.copper-bar {
  width: 100%;
  height: 4px;
  margin: 40px 0;
  background: linear-gradient(
    90deg,
    var(--copper-1),
    var(--copper-2),
    var(--copper-3),
    var(--copper-4),
    var(--copper-1)
  );
  background-size: 200% 100%;
  animation: copperScroll 3s linear infinite;
  opacity: 0.7;
}

@keyframes copperScroll {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* ============================================
   GLITCH EFFECT
   ============================================ */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.glitch.active::before {
  animation: glitch-1 0.3s linear;
  color: var(--sega-magenta);
  z-index: -1;
}

.glitch.active::after {
  animation: glitch-2 0.3s linear;
  color: var(--copper-3);
  z-index: -2;
}

@keyframes glitch-1 {
  0% { opacity: 0.8; clip-path: inset(20% 0 60% 0); transform: translate(-3px, 1px); }
  25% { opacity: 0.8; clip-path: inset(60% 0 10% 0); transform: translate(3px, -1px); }
  50% { opacity: 0.8; clip-path: inset(40% 0 30% 0); transform: translate(-2px, 2px); }
  75% { opacity: 0.8; clip-path: inset(10% 0 70% 0); transform: translate(2px, -2px); }
  100% { opacity: 0; clip-path: inset(0); transform: translate(0); }
}

@keyframes glitch-2 {
  0% { opacity: 0.8; clip-path: inset(70% 0 10% 0); transform: translate(3px, -1px); }
  25% { opacity: 0.8; clip-path: inset(10% 0 70% 0); transform: translate(-3px, 1px); }
  50% { opacity: 0.8; clip-path: inset(50% 0 20% 0); transform: translate(2px, -2px); }
  75% { opacity: 0.8; clip-path: inset(30% 0 40% 0); transform: translate(-2px, 2px); }
  100% { opacity: 0; clip-path: inset(0); transform: translate(0); }
}

/* ============================================
   SCROLLTEXT (Demoscene)
   ============================================ */
.scrolltext-wrap {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  margin-top: 40px;
  background: var(--bg-panel);
}

.scrolltext {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1px;
  animation: scrollText 25s linear infinite;
  padding-left: 100%;
}

@keyframes scrollText {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Sound toggle in sidebar — наследует .crt-toggle */
.sound-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(114, 204, 150, 0.1);
}



/* ============================================
   FAQ — YandexGPT / Голосовой поиск
   ============================================ */
#faq { margin-bottom: 60px; }

.faq-list { max-width: 100%; }

.faq-item {
  border: 1px solid var(--border);
  margin-bottom: 8px;
  background: var(--bg-panel);
  transition: border-color 0.2s;
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-item summary {
  font-family: var(--font-pixel);
  font-size: 14px;
  color: var(--accent);
  padding: 14px 18px;
  cursor: pointer;
  letter-spacing: 0.5px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::before {
  content: '[+]';
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 16px;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  content: '[-]';
  color: var(--accent);
}

.faq-item summary:hover {
  background: var(--card-hover);
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
}

.faq-item [itemprop="text"] {
  font-size: 20px;
  color: var(--text-dim);
  padding: 14px 18px 18px;
  line-height: 1.7;
}

/* ============================================
   PIXEL DIVIDER
   ============================================ */
.pixel-divider {
  width: 100%;
  height: 8px;
  margin: 30px 0;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0px,
    var(--accent) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.3;
}

/* ============================================
   LAYOUT
   ============================================ */
.site-wrapper {
  min-height: 100vh;
}

.block-left {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 320px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  /* Amiga Workbench-style dot pattern */
  background-image: radial-gradient(
    rgba(114, 204, 150, 0.03) 1px,
    transparent 1px
  );
  background-size: 8px 8px;
  z-index: 10;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none; /* Firefox */
}
.sidebar-content::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.block-right {
  margin-left: 320px;
  padding: 0 5% 60px;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

/* ============================================
   SIDEBAR COLLAPSE (Rail)
   ============================================ */

/* Menu icon/text wrappers */
.menu-icon { /* default: inline */ }
.menu-text { /* default: inline */ }

/* Rail state (collapsed) */
.block-left.is-collapsed {
  width: 72px;
  max-width: 72px;
  padding: 20px 8px;
}
.block-left.is-collapsed ~ .block-right {
  margin-left: 72px;
}
.block-left.is-collapsed .logo-box,
.block-left.is-collapsed .search-box,
.block-left.is-collapsed .sys-info,
.block-left.is-collapsed .sys-status {
  opacity: 0;
  width: 0;
  overflow: hidden;
  height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.block-left.is-collapsed .menu-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}
.block-left.is-collapsed .nav-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 2px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.logo-box { margin-bottom: 20px; }

.ascii-art {
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1.2;
  color: var(--accent);
  white-space: pre;
  margin-bottom: 16px;
  text-shadow: 0 0 8px rgba(114, 204, 150, 0.3);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { text-shadow: 0 0 8px rgba(114, 204, 150, 0.3); }
  50% { text-shadow: 0 0 16px rgba(114, 204, 150, 0.6), 0 0 32px rgba(114, 204, 150, 0.2); }
}

.sys-status {
  font-family: var(--font-pixel);
  font-size: 8px;
  color: var(--text-dim);
  line-height: 1.8;
  letter-spacing: 0.5px;
}

/* Navigation */
.nav-menu { list-style: none; margin-bottom: 20px; }
.nav-menu li { margin-bottom: 4px; }

.nav-menu a {
  display: block;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text-dim);
  padding: 8px 10px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  text-decoration: none;
}

.search-box {
  margin-bottom: 10px;
}

.search-label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.search-input {
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 17px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(114, 204, 150, 0.15);
}

.search-input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}

.search-results {
  display: none;
  margin-top: 4px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  max-height: 260px;
  overflow-y: auto;
}

.search-results.visible {
  display: block;
}

.search-result-item {
  padding: 8px 10px;
  font-size: 16px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.6;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--accent);
  color: var(--bg);
}

.search-result-item .match {
  color: var(--accent);
  font-weight: normal;
}

.search-result-item:hover .match {
  color: var(--bg);
}

.search-no-results {
  padding: 14px 10px;
  font-size: 16px;
  color: var(--text-dim);
  text-align: center;
}

.sys-info {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 2;
  margin-top: 16px;
}

/* ============================================
   SIDEBAR AMIGA EFFECTS (5 random effects)
   ============================================ */

/* 1. Color Cycle — перелив цветов */
.fx-color-cycle {
  animation: colorCycle 2s linear;
}

@keyframes colorCycle {
  0%   { color: #72cc96; }
  20%  { color: #00ccff; }
  40%  { color: #ff8800; }
  60%  { color: #ff00ff; }
  80%  { color: #ffcc00; }
  100% { color: #72cc96; }
}

/* 2. Glitch Scramble — замена символов на случайные */
.fx-glitch-scramble {
  animation: glitchScramble 0.4s steps(2);
}

@keyframes glitchScramble {
  0%   { opacity: 1; filter: blur(0); }
  25%  { opacity: 0.7; filter: blur(1px); letter-spacing: 3px; }
  50%  { opacity: 0.4; filter: blur(2px); letter-spacing: -1px; }
  75%  { opacity: 0.8; filter: blur(0.5px); letter-spacing: 2px; }
  100% { opacity: 1; filter: blur(0); letter-spacing: normal; }
}

/* 3. Blink Flash — быстрое мигание */
.fx-blink {
  animation: blinkFx 0.3s steps(1) 3;
}

@keyframes blinkFx {
  0%   { opacity: 1; }
  50%  { opacity: 0; }
  100% { opacity: 1; }
}

/* 4. Retype — стирание и повторная печать */
.fx-retype {
  animation: retypeFx 0.8s ease-out;
}

@keyframes retypeFx {
  0%   { clip-path: inset(0 100% 0 0); }
  50%  { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

/* 5. RGB Split — разделение цветов */
.fx-rgb-split {
  animation: rgbSplit 0.5s ease-out;
}

@keyframes rgbSplit {
  0%   { text-shadow: 0 0 0 transparent; }
  30%  { text-shadow: -2px 0 #ff0040, 2px 0 #00ccff; }
  60%  { text-shadow: -1px 0 #ff0040, 1px 0 #00ccff; }
  100% { text-shadow: 0 0 0 transparent; }
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.content-inner { max-width: 100%; }

.hero {
  position: relative;
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 60px;
  overflow: hidden;
}

.hero h1 {
  font-family: var(--font-pixel);
  font-size: 27px;
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

.hero-desc {
  font-size: 22px;
  color: var(--text-dim);
  margin-bottom: 30px;
  line-height: 1.8;
  max-width: 75%;
  min-height: 86px;
  position: relative;
  z-index: 1;
}

.cta-group { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }

/* Блок-курсор для печатной машинки */
.typing-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: cursor-blink 0.4s step-end infinite;
}
@keyframes cursor-blink {
  50% { opacity: 0; }
}

.btn {
  font-family: var(--font-pixel);
  font-size: 13px;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.btn-outline { border-color: var(--border-light); color: var(--text-dim); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

/* Section titles */
.section-title {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 30px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--border);
  letter-spacing: 0.5px;
}

/* ============================================
   SERVICES GRID
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 60px;
}

.service-card {
  border: 1px solid var(--border);
  padding: 20px;
  background: var(--card-bg);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--sega-magenta), var(--copper-3));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.service-card:hover::before { transform: scaleX(1); }

.service-card:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.service-card h3 {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.service-card p {
  font-size: 20px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================
   TECH STACK
   ============================================ */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 60px;
}

.stack-item {
  border: 1px solid var(--border);
  padding: 20px;
  background: var(--card-bg);
}

.stack-item .tag {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.stack-item h4 {
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}

.stack-item p {
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-section { margin-bottom: 60px; }
.contact-info { margin-bottom: 30px; }
.contact-info p { font-size: 21px; color: var(--text-dim); margin-bottom: 8px; }
.contact-info a { color: var(--accent); }

/* CTA Block (compact contact on homepage) */
.cta-section { margin-bottom: 60px; }
.cta-block {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
}
.cta-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
}
.cta-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.cta-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(114, 204, 150, 0.15);
}
.cta-prefix {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--accent);
  padding: 10px 0 10px 12px;
  user-select: none;
}
.cta-input {
  font-family: var(--font-mono);
  font-size: 24px;
  padding: 10px 12px 10px 4px;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
  min-width: 180px;
}
.cta-input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}
.cta-btn {
  white-space: nowrap;
  animation: cta-pulse 2s infinite;
}

@keyframes cta-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(114, 204, 150, 0.5); }
  50% { transform: scale(1.03); box-shadow: 0 0 12px 4px rgba(114, 204, 150, 0.3); }
}

/* CTA Full-screen Success Overlay */
.cta-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.cta-overlay.visible {
  opacity: 1;
  visibility: visible;
}
.cta-overlay-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 10px;
  transition: all 0.2s;
}
.cta-overlay-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.cta-overlay-content {
  text-align: center;
  animation: ctaFadeIn 0.6s ease;
}
.cta-timer-label {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.cta-timer-value {
  font-family: var(--font-pixel);
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(114, 204, 150, 0.5);
}
.cta-overlay-title {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--text);
  margin-bottom: 16px;
}
.cta-overlay-text {
  font-family: var(--font-mono);
  font-size: 21px;
  color: var(--text-dim);
  line-height: 1.8;
}
@keyframes ctaFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.retro-form {
  border: 1px solid var(--border);
  padding: 24px;
  background: var(--bg-panel);
  max-width: 500px;
}

.input-group { margin-bottom: 20px; }

.input-group label {
  display: block;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.input-group input,
.input-group textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 20px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus,
.input-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(114, 204, 150, 0.15);
}

.input-group textarea { min-height: 100px; resize: vertical; }

.map-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--border);
  background: var(--card-bg);
  flex-wrap: wrap;
}

.map-coords {
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.map-link {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.map-link:hover {
  background: var(--accent);
  color: var(--bg);
  border-bottom: 1px solid var(--accent);
}

.legal-info {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  background: var(--card-bg);
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1.8;
}

.legal-header {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.form-submit {
  font-family: var(--font-pixel);
  font-size: 13px;
  padding: 10px 24px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.form-submit:hover { background: #fff; }

/* ============================================
   ABOUT PAGE
   ============================================ */
.about-content { padding: 60px 0; }

.about-content h2 {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--text);
  margin: 40px 0 20px;
  line-height: 1.8;
}

.about-content h3 {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--accent);
  margin: 30px 0 16px;
}

.about-content p {
  font-size: 21px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.8;
}

.about-content strong { color: var(--text); }

.about-content ul {
  list-style: square;
  padding-left: 24px;
  margin-bottom: 16px;
}

.about-content li {
  font-size: 21px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.6;
}

.about-content hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 40px 0;
}

.about-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 20px;
}

.about-table th,
.about-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}

.about-table th {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  background: var(--bg-panel);
  text-transform: uppercase;
}

.about-table td { color: var(--text-dim); }

.back-link {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 30px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.back-link:hover { background: var(--accent); color: var(--bg); }

/* ============================================
   PROJECTS & BLOG
   ============================================ */
h1 {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--text);
  margin-bottom: 20px;
}

.project-list, .blog-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
  margin-top: 24px;
}

.project-card, .blog-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 24px;
  transition: border-color 0.2s;
}

.project-card:hover, .blog-card:hover {
  border-color: var(--accent);
}

.project-card-header, .blog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.project-card h2, .blog-card h2 {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--text);
  margin: 0;
  line-height: 1.8;
  flex: 1;
}

.project-date, .blog-date {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
}

.project-tags, .blog-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.project-tag, .blog-tag {
  background: rgba(114, 204, 150, 0.1);
  border: 1px solid var(--accent-dark);
  padding: 2px 8px;
  font-size: 15px;
  color: var(--accent);
}

.project-card p, .blog-card p {
  font-size: 21px;
  color: var(--text-dim);
  line-height: 1.8;
  margin: 0;
}

.project-content, .blog-content {
  padding: 60px 0;
}

.project-content h1, .blog-content h1 {
  font-family: var(--font-pixel);
  font-size: 17px;
  color: var(--accent);
  margin-bottom: 16px;
}

.project-content h2, .blog-content h2 {
  font-family: var(--font-pixel);
  font-size: 20px;
  color: var(--text);
  margin: 40px 0 20px;
  line-height: 1.8;
}

.project-content h3, .blog-content h3 {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--accent);
  margin: 30px 0 16px;
}

.project-content h4, .blog-content h4 {
  font-size: 13px;
  color: var(--text-dim);
  margin: 24px 0 12px;
}

.project-content p, .blog-content p {
  font-size: 21px;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.8;
}

.project-content strong, .blog-content strong { color: var(--text); }

.project-content ul, .blog-content ul {
  list-style: square;
  padding-left: 24px;
  margin-bottom: 16px;
}

.project-content li, .blog-content li {
  font-size: 21px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.6;
}

.project-content ol, .blog-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.project-content ol li, .blog-content ol li {
  font-size: 21px;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.6;
}

.project-content hr, .blog-content hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 40px 0;
}

.project-content table, .blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 20px;
}

.project-content th, .blog-content th {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  text-transform: uppercase;
}

.project-content td, .blog-content td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  color: var(--text-dim);
}

.project-content tr:hover td, .blog-content tr:hover td {
  background: var(--card-hover);
}

.project-content code, .blog-content code {
  background: rgba(114, 204, 150, 0.08);
  border: 1px solid var(--border);
  padding: 2px 6px;
  font-size: 17px;
  color: var(--accent);
  border-radius: 3px;
}

.project-content pre, .blog-content pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

.project-content pre code, .blog-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 17px;
}

.project-content blockquote, .blog-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 16px 0;
  color: var(--text-dim);
  font-style: italic;
  background: var(--card-bg);
}

.project-content img, .blog-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  margin: 16px 0;
  display: block;
}

.tags-inline {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.demo-btn {
  display: inline-block;
  font-family: var(--font-pixel);
  font-size: 13px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  animation: demo-pulse 2s infinite;
}

.demo-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

@keyframes demo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(114, 204, 150, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(114, 204, 150, 0); }
}

.demo-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.demo-modal-overlay.visible {
  display: flex;
}

.demo-modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  padding: 24px;
  max-width: 400px;
  width: 90%;
}

.demo-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.demo-modal-header h3 {
  font-family: var(--font-pixel);
  font-size: 15px;
  color: var(--accent);
  margin: 0;
}

.demo-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 30px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.demo-modal-close:hover {
  color: var(--accent);
}

.project-content hr, .blog-content hr {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 32px 0;
}

.empty-state {
  color: var(--text-dim);
  font-style: italic;
  padding: 40px 0;
  text-align: center;
}

/* ============================================
   FLOATING WIDGET (CRT, Music, Contact)
   ============================================ */
.floating-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.widget-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  min-width: 170px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.widget-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.widget-label {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.widget-divider {
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

.widget-contact {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  font-family: var(--font-pixel);
  font-size: 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: border-color 0.15s, background 0.15s;
}

.widget-contact:hover {
  border-color: var(--accent);
  background: rgba(114, 204, 150, 0.1);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  font-size: 17px;
  color: var(--text-dim);
}

.site-footer a { color: var(--accent); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media screen and (max-width: 1919px) {
  .ascii-art { font-size: 16px; }
  .nav-menu a { font-size: 10px; padding: 6px 8px; }
  .search-label { font-size: 9px; }
  .search-input { font-size: 13px; padding: 6px 8px; }
  .crt-toggle, .sound-toggle { font-size: 9px; }
}

@media screen and (max-width: 768px) {
  .site-wrapper {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }
  .block-left {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 280px;
    height: 100dvh;
    z-index: 200;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: none;
  }
  .block-left.is-open {
    transform: translateX(100%);
  }
  .block-left.is-collapsed {
    width: 280px;
    max-width: 280px;
    padding: 20px 24px;
  }
  .block-left.is-collapsed .logo-box,
  .block-left.is-collapsed .search-box,
  .block-left.is-collapsed .sys-info,
  .block-left.is-collapsed .sys-status,
  .block-left.is-collapsed .menu-text {
    opacity: 1;
    width: auto;
    height: auto;
    overflow: visible;
    pointer-events: auto;
  }
  .block-left.is-collapsed .nav-menu a {
    text-align: left;
    padding: 8px 10px;
    flex-direction: row;
  }
  .block-left.is-collapsed .crt-toggle,
  .block-left.is-collapsed .sound-toggle {
    font-size: inherit;
    text-align: left;
    padding: 8px 10px;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
  }
  .sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .mobile-header-logo {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.5px;
  }
  .btn-hamburger {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--accent);
    font-size: 20px;
    padding: 6px 10px;
    cursor: pointer;
    line-height: 1;
    transition: border-color 0.15s;
  }
  .btn-hamburger:hover {
    border-color: var(--accent);
  }
  .block-right {
    margin-left: 0;
    padding: 0 20px 40px;
  }
  body.sidebar-open {
    overflow: hidden;
  }
  .hero h1 { font-size: 22px; }
  .services-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr; }
  .cta-group { flex-direction: column; }
  .starfield-canvas { display: none; }
}
@media screen and (min-width: 769px) {
  .mobile-header { display: none; }
  .sidebar-overlay { display: none !important; }
}

@media screen and (max-width: 640px) {
  .hero { padding: 40px 0 30px; }
  .hero h1 { font-size: 20px; }
  .section-title { font-size: 13px; }
  .scrolltext { font-size: 11px; }
  .start-text { font-size: 16px; letter-spacing: 1px; }
  .start-sub { font-size: 11px; }
}

/* ============================================
   MODAL WINDOW — Amiga Workbench Style
   ============================================ */
.modal-overlay {
  display: flex;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(2px);
}
.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  position: relative;
  background: var(--bg-panel);
  border: 2px solid var(--accent);
  padding: 0;
  max-width: 480px;
  width: 90%;
  box-shadow:
    0 0 0 3px #000,
    0 0 0 5px var(--accent-dark),
    0 8px 32px rgba(0,0,0,0.8);
  transform: scale(0.85) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.visible .modal-box {
  transform: scale(1) translateY(0);
}

.modal-border {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0px,
    var(--accent) 4px,
    var(--bg-panel) 4px,
    var(--bg-panel) 8px
  );
}
.modal-success .modal-border {
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0px,
    var(--accent) 4px,
    var(--bg-panel) 4px,
    var(--bg-panel) 8px
  );
}
.modal-error .modal-border {
  background: repeating-linear-gradient(
    90deg,
    var(--amiga-orange) 0px,
    var(--amiga-orange) 4px,
    var(--bg-panel) 4px,
    var(--bg-panel) 8px
  );
}

.modal-content {
  padding: 32px 24px 24px;
  text-align: center;
}

.modal-icon {
  font-size: 62px;
  line-height: 1;
  margin-bottom: 16px;
}
.modal-success .modal-icon { color: var(--accent); }
.modal-error .modal-icon { color: var(--amiga-orange); }

.modal-message {
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 24px;
}

.modal-ok {
  font-family: var(--font-pixel);
  font-size: 16px;
  color: #000;
  background: var(--accent);
  border: none;
  padding: 10px 32px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background 0.2s ease;
  box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--accent);
}
.modal-ok:hover,
.modal-ok:focus {
  background: var(--accent-dark);
  outline: none;
}

/* ============================================
   HONEYPOT — invisible to humans, visible to bots
   ============================================ */
.honeypot-field {
  position: absolute !important;
  left: -99999px !important;
  top: -99999px !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
