/* ============================================================
   KORO.SYSTEMS — stylesheet
   ============================================================ */

:root {
  --bg: #0b0f14;
  --bg-2: #0f141b;
  --bg-3: #131a22;
  --line: #1c2530;
  --line-2: #2a3543;
  --text: #e6edf3;
  --text-dim: #9aa7b5;
  --text-mute: #5e6c7a;
  --accent: #34d399;        /* emerald-400 */
  --accent-dim: #10b981;
  --warn: #fbbf24;
  --info: #60a5fa;
  --danger: #f87171;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --container: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ------------------ Тонкая сетка-фон ------------------ */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 50%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 50%, transparent 100%);
}

main, header, footer { position: relative; z-index: 1; }

/* ------------------ HEADER ------------------ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 15, 20, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
  gap: 16px;
}

.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

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

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: blink 1.6s ease-in-out infinite;
}

.status-sep { color: var(--text-mute); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ------------------ HERO ------------------ */
.hero {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--line);
}

.hero-meta {
  color: var(--text-mute);
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-bottom: 28px;
}

.hero-title {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 24px;
  max-width: 920px;
}

.hero-sub {
  color: var(--text-dim);
  font-size: clamp(15px, 1.4vw, 18px);
  max-width: 720px;
  margin-bottom: 40px;
  line-height: 1.65;
}

/* ------------------ Кнопка ------------------ */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-dim);
  padding: 13px 22px;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.25);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------ Заголовки секций ------------------ */
section { padding: 80px 0; border-bottom: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 48px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line-2);
}

.section-id { font-size: 12px; color: var(--text-mute); }

.section-head h2 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 28px);
  letter-spacing: -0.005em;
}

/* ------------------ About ------------------ */
.log-quote {
  border-left: 2px solid var(--accent-dim);
  background: var(--bg-2);
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 56px;
}

.log-prefix {
  display: block;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.directions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.direction {
  border: 1px solid var(--line);
  padding: 24px;
  background: var(--bg-2);
  transition: border-color 200ms ease, transform 200ms ease;
}

.direction:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
}

.direction-idx {
  color: var(--accent);
  font-size: 12px;
  margin-bottom: 16px;
  letter-spacing: 0.08em;
}

.direction h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 10px;
}

.direction p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
}

/* ------------------ Projects / cards ------------------ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 200ms ease;
}

.card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 14px; height: 14px;
  border-top: 1px solid var(--accent-dim);
  border-left: 1px solid var(--accent-dim);
}

.card::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 14px; height: 14px;
  border-bottom: 1px solid var(--accent-dim);
  border-right: 1px solid var(--accent-dim);
}

.card:hover { border-color: var(--line-2); }

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.card-idx { color: var(--text-mute); }

.badge {
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  letter-spacing: 0.08em;
}

.badge-stable { color: var(--accent); }
.badge-alpha  { color: var(--warn); }
.badge-test   { color: var(--info); }

.card h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 18px;
  margin-bottom: 12px;
}

.card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.specs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  border-top: 1px dashed var(--line-2);
  padding-top: 14px;
}

.specs > div {
  display: flex;
  justify-content: space-between;
  color: var(--text-mute);
}

.specs dt { letter-spacing: 0.06em; }
.specs dd { color: var(--text-dim); }

/* ------------------ Terminal ------------------ */
.terminal {
  border: 1px solid var(--line-2);
  background: #06090d;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.04), 0 20px 60px rgba(0,0,0,0.4);
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 11px;
  color: var(--text-mute);
}

.terminal-dots { display: inline-flex; gap: 6px; }
.terminal-dots i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-2);
  display: inline-block;
}

.terminal-body {
  padding: 20px 22px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-dim);
  height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--line-2); }

.term-line { display: block; }
.term-line .t-prompt { color: var(--accent); }
.term-line .t-ok     { color: var(--accent); }
.term-line .t-warn   { color: var(--warn); }
.term-line .t-info   { color: var(--info); }
.term-line .t-dim    { color: var(--text-mute); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: cursor-blink 1s steps(2, start) infinite;
}

@keyframes cursor-blink {
  to { visibility: hidden; }
}

/* ------------------ Contact form ------------------ */
.contact-lead {
  color: var(--text-dim);
  max-width: 640px;
  margin-bottom: 40px;
  font-size: 15px;
}

.form { max-width: 640px; }

.field {
  margin-bottom: 28px;
}

.field label {
  display: block;
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 10px 2px;
  outline: none;
  resize: vertical;
  transition: border-color 160ms ease;
}

.field input:focus,
.field textarea:focus {
  border-bottom-color: var(--accent);
}

.field textarea { font-family: var(--font-mono); font-size: 13px; }

.form-status {
  margin-top: 18px;
  font-size: 12px;
  min-height: 18px;
}

.form-status.ok   { color: var(--accent); }
.form-status.err  { color: var(--danger); }

/* ------------------ Footer ------------------ */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  color: var(--text-mute);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.footer-sep { color: var(--line-2); }

/* ------------------ Responsive ------------------ */
@media (max-width: 860px) {
  .directions { grid-template-columns: 1fr; }
  .cards      { grid-template-columns: 1fr; }
  .hero       { padding: 64px 0 56px; }
  section     { padding: 56px 0; }
}

@media (max-width: 540px) {
  .header-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .status       { font-size: 11px; }
  .terminal-body { height: 240px; font-size: 12px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .status-dot, .cursor { animation: none; }
  html { scroll-behavior: auto; }
}
