/* =========================================================
   SYFER // ТЕРМИНАЛ // ХАБ_УСЛУГ v.4.0
   Cyberpunk Terminal UI Styles
   ========================================================= */

:root {
  --bg-deep: #060606;
  --bg-body: #0a0a0a;
  --text-main: #e0e0e0;
  --text-dim: #888888;
  --accent-green: #00ff00;
  --accent-green-dim: #00aa00;
  --accent-orange: #ff8800;
  --accent-blue: #00ccff;
  --accent-blue-dim: #0099bb;
  --border-color: #333333;
  --border-light: #444444;
  --font-mono: 'Fira Code', 'Roboto Mono', 'Courier New', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.35;
  height: 100dvh;
  overflow: hidden;
  cursor: crosshair;
  position: relative;
}

/* Background noise */
.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
  background-image:
    url('assets/circuit-pattern.svg'),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,255,0,0.4) 2px 3px),
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0,255,0,0.25) 2px 3px),
    radial-gradient(circle at 20% 30%, rgba(0,204,255,0.15) 0%, transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(255,136,0,0.12) 0%, transparent 60%);
  background-size: 200px 200px, 100% 100%, 100% 100%, 200% 200%, 200% 200%;
}

/* Main container: single-screen grid */
.container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 14px 10px;
  display: grid;
  grid-template-columns: 1fr 340px;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  height: 100dvh;
  overflow: hidden;
}

/* Explicit grid rows for layout stability */
.site-header { grid-row: 1; grid-column: 1 / -1; }
.main-area {
  grid-row: 2; grid-column: 1 / 2; overflow: hidden;
  border: 1px solid var(--accent-green);
  border-radius: 6px;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.35) 100%);
  box-shadow: 0 0 18px rgba(0,255,0,0.08), inset 0 0 20px rgba(0,255,0,0.03);
}
.side-panel  { grid-row: 2; grid-column: 2 / 3; overflow: hidden; }
.terminal-footer { grid-row: 3; grid-column: 1 / -1; flex-shrink: 0; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.brand {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-main);
  white-space: nowrap;
}
.brand .bracket { color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.6); }
.brand .sep { color: var(--accent-blue); text-shadow: 0 0 4px rgba(0,204,255,0.5); opacity: 0.7; }
.brand .version { color: var(--text-dim); font-size: 11px; margin-left: 4px; }

.main-nav ul { list-style: none; display: flex; gap: 14px; flex-wrap: wrap; }
.main-nav a {
  text-decoration: none; color: var(--text-main); font-size: 13px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; position: relative;
  transition: color .2s ease, text-shadow .2s ease; padding: 2px 0;
}
.main-nav a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
  background: var(--accent-green); transition: width .25s ease; box-shadow: 0 0 6px var(--accent-green);
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--accent-green); text-shadow: 0 0 8px rgba(0,255,0,0.8); outline: none; cursor: pointer; }
.main-nav a:hover::after, .main-nav a:focus-visible::after { width: 100%; }
.main-nav .nav-active { color: var(--accent-green); text-shadow: 0 0 8px rgba(0,255,0,0.8); }
.main-nav .nav-active::after { width: 100%; }

/* =========================================================
   MAIN AREA & VIEWS
   ========================================================= */
.view { display: none; }
.view.active {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
  animation: fadeIn .25s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.welcome-block { margin-bottom: 14px; flex-shrink: 0; }
.welcome-title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.5); margin-bottom: 6px;
}
.welcome-desc { font-size: 11px; color: var(--text-dim); letter-spacing: 0.02em; line-height: 1.45; }

.section-title {
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.5); margin-bottom: 10px;
  flex-shrink: 0;
}

/* Services grid */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  align-content: start;
}

/* =========================================================
   SERVICE CARDS (identical height / neon green / equal footer)
   ========================================================= */
.service-card {
  border: 1px solid rgba(0,255,0,0.35); border-radius: 6px; padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.35) 100%);
  position: relative; overflow: hidden; transition: border-color .3s ease, box-shadow .3s ease;
  display: flex; flex-direction: column;
}
.service-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-green); opacity: .9;
  box-shadow: 0 0 10px var(--accent-green), 0 0 20px rgba(0,255,0,0.5);
}
.service-card:hover { border-color: var(--accent-green); box-shadow: 0 0 15px rgba(0,255,0,0.15); }
.service-card .card-header { margin-bottom: 8px; flex-shrink: 0; }
.service-card .card-header h3 { font-size: 12px; font-weight: 700; letter-spacing: 0.03em; line-height: 1.25; color: var(--text-main); min-height: 2.6em; }
.service-card .card-body { flex: 1 1 auto; }
.service-card .card-body p { font-size: 11px; color: #cfcfcf; letter-spacing: 0.02em; line-height: 1.35; }

.service-card .card-footer {
  margin-top: auto; padding-top: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.service-card .label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; white-space: nowrap; }
.service-card .price { color: var(--accent-orange); text-shadow: 0 0 3px rgba(255,136,0,0.6); }

.btn-order {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border: 1px solid var(--accent-green); border-radius: 4px;
  color: var(--accent-green); text-decoration: none; font-weight: 700; font-size: 10px;
  letter-spacing: 0.04em; transition: background .2s ease, box-shadow .2s ease, color .2s ease;
}
.btn-order:hover, .btn-order:focus-visible {
  background: rgba(0,255,0,0.15); box-shadow: 0 0 12px rgba(0,255,0,0.35); color: #fff; outline: none;
}

/* =========================================================
   CONTACT HQ
   ========================================================= */
.contact-hq {
  border: 1px solid var(--border-color); border-radius: 6px; padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.3) 100%);
  position: relative;
}
.contact-hq::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-blue), var(--accent-orange));
  box-shadow: 0 0 10px var(--accent-green), 0 0 20px rgba(0,204,255,0.4); opacity: .9;
}
.contact-hq h2 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 8px;
  color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.5);
}
.terminal-textarea {
  width: 100%; background: rgba(0,0,0,0.5); border: 1px solid var(--border-color);
  border-radius: 4px; padding: 8px 10px; color: var(--accent-green); font-family: var(--font-mono);
  font-size: 12px; resize: none; min-height: 46px; max-height: 60px; outline: none;
  transition: border-color .25s ease, box-shadow .25s ease; caret-color: var(--accent-green);
}
.terminal-textarea:focus { border-color: var(--accent-green); box-shadow: 0 0 12px rgba(0,255,0,0.25), inset 0 0 8px rgba(0,255,0,0.05); }
.terminal-textarea::placeholder { color: rgba(0,255,0,0.35); }

.contact-row {
  margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.btn-telegram {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  background: linear-gradient(135deg, rgba(0,204,255,0.08), rgba(0,255,0,0.05));
  border: 1px solid rgba(0,255,0,0.35); border-radius: 4px; color: var(--text-main);
  text-decoration: none; font-weight: 700; font-size: 11px; letter-spacing: 0.03em;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, color .25s ease;
}
.btn-telegram span { color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.7); }
.btn-telegram:hover, .btn-telegram:focus-visible {
  background: linear-gradient(135deg, rgba(0,255,0,0.15), rgba(0,204,255,0.15));
  border-color: var(--accent-green); box-shadow: 0 0 18px rgba(0,255,0,0.35), 0 0 6px rgba(0,255,0,0.2); color: var(--accent-green); outline: none;
}

.social-icons { display: flex; gap: 14px; flex-wrap: wrap; }
.social-link {
  display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); text-decoration: none;
  font-size: 11px; letter-spacing: 0.03em; transition: color .2s ease, text-shadow .2s ease;
}
.social-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: .8; }
.social-link:hover, .social-link:focus-visible { color: var(--accent-blue); text-shadow: 0 0 6px rgba(0,204,255,0.6); outline: none; }
.social-link:hover svg { filter: drop-shadow(0 0 4px var(--accent-blue)); }

/* =========================================================
   SIDEBAR
   ========================================================= */
.side-panel { display: flex; flex-direction: column; gap: 10px; min-width: 0; overflow: hidden; }

.system-status {
  border: 1px solid var(--border-color); border-radius: 6px; padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.3) 100%);
  flex-shrink: 0;
}
.system-status h3, .connection-log h3 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 6px;
  color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.5);
}
.status-grid { display: flex; flex-direction: column; gap: 4px; }
.stat-item { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; border-bottom: 1px dashed rgba(255,255,255,0.06); padding-bottom: 4px; }
.stat-label { color: var(--text-dim); letter-spacing: 0.05em; }
.stat-value { color: var(--text-main); font-weight: 600; }

.connection-log {
  flex: 1 1 auto; border: 1px solid var(--border-color); border-radius: 6px; padding: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.3) 100%);
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
}

.log-window {
  flex: 1 1 auto; overflow-y: auto; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 4px; padding: 6px 8px; min-height: 0;
}
.log-line {
  display: block; padding: 2px 0; font-size: 10px; color: #88aa88; text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.04); transition: color .15s ease, text-shadow .15s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.log-line:hover, .log-line:focus-visible { color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.7); outline: none; cursor: pointer; }

.log-window::-webkit-scrollbar { width: 6px; }
.log-window::-webkit-scrollbar-track { background: transparent; }
.log-window::-webkit-scrollbar-thumb { background: var(--accent-green); border-radius: 3px; opacity: .6; }
.log-window::-webkit-scrollbar-thumb:hover { opacity: 1; }

.contacts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-content: start; }
.contact-block {
  border: 1px solid rgba(0,255,0,0.35); border-radius: 6px; padding: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.35) 100%);
  box-shadow: 0 0 10px rgba(0,255,0,0.08);
}
.contact-block h3 { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.5); margin-bottom: 6px; }
.contact-block p { font-size: 13px; color: var(--text-main); }
.contact-link { color: var(--accent-blue); text-decoration: none; text-shadow: 0 0 4px rgba(0,204,255,0.5); transition: color .2s; }
.contact-link:hover { color: var(--accent-green); text-shadow: 0 0 8px rgba(0,255,0,0.7); }

/* =========================================================
   PROJECTS GRID
   ========================================================= */
.projects-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  align-content: start;
}
.project-card {
  border: 1px solid rgba(0,255,0,0.35); border-radius: 6px; padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0.35) 100%);
  position: relative; overflow: hidden; transition: border-color .3s ease, box-shadow .3s ease;
  display: flex; flex-direction: column;
}
.project-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent-green); opacity: .9;
  box-shadow: 0 0 10px var(--accent-green), 0 0 20px rgba(0,255,0,0.5);
}
.project-card:hover { border-color: var(--accent-green); box-shadow: 0 0 15px rgba(0,255,0,0.15); }
.project-card .card-header h3 { font-size: 12px; font-weight: 700; letter-spacing: 0.03em; color: var(--text-main); line-height: 1.2; }
.project-card .card-body p { font-size: 11px; color: #cfcfcf; letter-spacing: 0.02em; line-height: 1.35; }
.project-card .card-footer { margin-top: auto; padding-top: 10px; }
.project-card .label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent-green); text-shadow: 0 0 4px rgba(0,255,0,0.6); }

.project-image {
  width: 100%; height: 120px; object-fit: cover;
  border: 1px solid var(--accent-green); border-radius: 4px;
  margin-bottom: 10px; flex-shrink: 0; display: block;
  filter: drop-shadow(0 0 6px rgba(0,255,0,0.25));
  background: rgba(0,255,0,0.04);
}

.project-icon {
  width: 100%; height: 120px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.project-icon svg { width: 60px; height: 60px; color: var(--accent-green); filter: drop-shadow(0 0 8px var(--accent-green)); opacity: .9; }

/* =========================================================
   TERMINAL SCREEN
   ========================================================= */
.terminal-screen {
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--accent-green);
  border-radius: 6px;
  padding: 14px;
  flex: 1 1 auto; min-height: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 0 20px rgba(0,255,0,0.08), inset 0 0 20px rgba(0,255,0,0.03);
}
.terminal-title {
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--accent-green); text-shadow: 0 0 8px rgba(0,255,0,0.8);
  margin-bottom: 10px; flex-shrink: 0;
}
.terminal-output {
  flex: 1 1 auto; overflow-y: auto; min-height: 0;
  font-size: 12px; line-height: 1.35;
  color: #88aa88; background: rgba(0,255,0,0.02);
  border: 1px solid rgba(0,255,0,0.1); border-radius: 4px; padding: 8px 10px;
}
.terminal-line { display: block; padding: 1px 0; font-family: var(--font-mono); }
.terminal-output::-webkit-scrollbar { width: 6px; }
.terminal-output::-webkit-scrollbar-track { background: transparent; }
.terminal-output::-webkit-scrollbar-thumb { background: var(--accent-green); border-radius: 3px; opacity: 0.5; }
.terminal-output::-webkit-scrollbar-thumb:hover { opacity: 1; }

.terminal-bottom {
  margin-top: 8px; flex-shrink: 0;
  font-size: 12px; color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.6);
}
.terminal-bottom .cursor { animation: blink 1s step-end infinite; color: var(--accent-green); text-shadow: 0 0 8px rgba(0,255,0,0.8); font-weight: 700; }

/* =========================================================
   FOOTER
   ========================================================= */
.terminal-footer {
  border-top: 1px solid var(--border-color); padding-top: 6px; margin-top: 4px;
}
.terminal-inner { font-size: 13px; color: var(--text-main); }
.prompt { color: var(--accent-green); text-shadow: 0 0 6px rgba(0,255,0,0.5); letter-spacing: 0.03em; }
.cursor { color: var(--accent-green); animation: blink 1s step-end infinite; text-shadow: 0 0 8px rgba(0,255,0,0.8); font-weight: 700; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .container { grid-template-columns: 1fr; padding: 10px 16px 10px; }
  .side-panel { grid-row: 3; grid-column: 1; min-height: auto; overflow-y: auto; }
  .main-area { grid-row: 2; grid-column: 1; }
  .services-grid { grid-template-columns: 1fr; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .main-nav ul { gap: 14px; }
}

@media (max-width: 600px) {
  body { font-size: 13px; }
  .brand { font-size: 11px; }
  .service-card { padding: 10px; }
  .contact-hq { padding: 10px; }
  .btn-telegram { width: 100%; justify-content: center; }
  .contact-row { flex-direction: column; align-items: stretch; }
  .social-icons { justify-content: center; }
  .main-nav ul { gap: 10px; }
  .main-nav a { font-size: 11px; }
}
@media (max-width: 340px) { .brand { word-break: break-word; } }
