/* ===== Design tokens =====
   Color:  --bg #0B1220 (deep navy)  --surface #121B2E  --surface-alt #17233A
           --text #E7ECF3  --muted #8A96AC  --accent #2DD4BF (signal teal)
           --warn #F5A623 (amber, prices/CTAs)  --border #223050  --danger #F05656
   Type:   'JetBrains Mono' for headings/labels/nav (root & terminal identity)
           'Inter' for body copy (readability)
   Layout: left-aligned content, max 1120px container, one hero terminal-card motif
*/

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0B1220;
  --surface: #121B2E;
  --surface-alt: #17233A;
  --text: #E7ECF3;
  --muted: #8A96AC;
  --accent: #2DD4BF;
  --accent-dim: #1B4F49;
  --warn: #F5A623;
  --border: #223050;
  --danger: #F05656;
  --radius: 10px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4, .mono, nav, .btn, .tag, .price, code, .terminal {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: 68ch; color: var(--text); }
p.lead { color: var(--muted); font-size: 1.05rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

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

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}
.brand .prompt { color: var(--accent); }
.brand:hover { text-decoration: none; }

.main-nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.main-nav a { color: var(--muted); font-size: 0.92rem; }
.main-nav a.active, .main-nav a:hover { color: var(--accent); text-decoration: none; }

.nav-auth { display: flex; gap: 12px; align-items: center; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color .15s, transform .04s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #06201C; font-weight: 700; }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; text-align: center; }

/* ---- Hero (terminal motif - the one bold moment) ---- */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero .grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 860px) { .hero .grid { grid-template-columns: 1fr; } }

.hero .tagline { color: var(--accent); font-size: 0.85rem; margin-bottom: 10px; }
.hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

.terminal {
  background: #0A0F1C;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.6);
}
.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #34405C; }
.terminal-body { padding: 18px 20px; font-size: 0.86rem; color: #C9D3E0; }
.terminal-body .line { margin-bottom: 8px; white-space: pre-wrap; }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .out { color: var(--muted); }
.terminal-body .ok { color: var(--accent); }

/* ---- Sections ---- */
section { padding: 56px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 34px; }

/* ---- Cards / grids ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); margin-bottom: 0; }
.card .icon { color: var(--accent); font-size: 1.4rem; margin-bottom: 10px; display: block; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

/* ---- Blog ---- */
.post-list { display: flex; flex-direction: column; gap: 22px; }
.post-item { padding: 20px 0; border-bottom: 1px solid var(--border); }
.post-item:last-child { border-bottom: none; }
.post-item .meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 6px; }
.post-item h3 a { color: var(--text); }
.post-body { max-width: 72ch; }
.post-body p, .post-body { line-height: 1.75; }
.post-cover { width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid var(--border); }

/* ---- Software store ---- */
.software-card { display: flex; flex-direction: column; height: 100%; }
.price { color: var(--warn); font-weight: 700; font-size: 1.05rem; margin: 10px 0; }
.price.free { color: var(--accent); }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.form-card { max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; margin: 0 auto; }
.form-hint { color: var(--muted); font-size: 0.8rem; margin-top: -10px; margin-bottom: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; border: 1px solid; }
.alert-success { background: rgba(45,212,191,0.1); border-color: var(--accent); color: var(--accent); }
.alert-error { background: rgba(240,86,86,0.1); border-color: var(--danger); color: var(--danger); }
.field-errors { color: var(--danger); font-size: 0.8rem; margin: -6px 0 14px; }

/* ---- Tables (admin) ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---- Admin layout ---- */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; gap: 30px; }
@media (max-width: 860px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a { padding: 9px 12px; border-radius: 8px; color: var(--muted); font-size: 0.88rem; }
.admin-nav a.active { background: var(--surface-alt); color: var(--accent); text-decoration: none; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.stat-card .num { font-family: 'JetBrains Mono', monospace; font-size: 1.8rem; color: var(--accent); }
.stat-card .label { color: var(--muted); font-size: 0.82rem; }
.badge { font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); }
.badge-pending { color: var(--warn); border-color: var(--warn); }
.badge-paid { color: var(--accent); border-color: var(--accent); }
.badge-cancelled { color: var(--danger); border-color: var(--danger); }

/* ---- Remote access ---- */
.machine-row { display: flex; align-items: center; justify-content: space-between; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.machine-row .os-tag { color: var(--muted); font-size: 0.8rem; }
.guac-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius); background: #000; }

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.85rem;
}
footer .row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
footer a { color: var(--muted); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
