/* ============================================================
   KERNEL LAB — shared design tokens & components
   ============================================================ */

:root {
  /* Color tokens */
  --red:           #E8001D;
  --red-deep:      #B80018;
  --red-glow:      rgba(232,0,29,0.25);
  --red-tint:      rgba(232,0,29,0.10);
  --red-border:    rgba(232,0,29,0.25);
  --red-border-strong: rgba(232,0,29,0.50);
  --red-grid:      rgba(232,0,29,0.025);

  --bg:            #020202;
  --surface:       #0D0D0D;
  --surface-raised:#141414;
  --border:        rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.10);
  --divider:       rgba(255,255,255,0.05);

  --text:          #FFFFFF;
  --text-2:        #8A8A8A;
  --text-3:        #4A4A4A;

  /* Type scale */
  --display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --mono:    'JetBrains Mono', 'Fira Code', ui-monospace, Menlo, monospace;
}

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

/* Hide scrollbar visually, keep scroll functional */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--display);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "ss02";
  letter-spacing: -0.005em;
  line-height: 1.5;
  min-height: 100vh;
}

body {
  background-image:
    linear-gradient(var(--red-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--red-grid) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: -1px -1px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }

::selection { background: var(--red); color: #fff; }

/* ============================================================
   Typography helpers
   ============================================================ */

.label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-2);
  font-weight: 500;
}
.label-red { color: var(--red); }

.h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.92;
  letter-spacing: -0.035em;
}
.h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.025em;
}
.h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.015em;
}
.red-italic { color: var(--red); font-style: italic; font-weight: 800; }

.mono { font-family: var(--mono); }
.caps { text-transform: uppercase; letter-spacing: 0.2em; }

/* ============================================================
   Skewed parallelogram button (core brand element)
   ============================================================ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 32px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: skewX(-12deg);
  transition: all 180ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
}
.btn > * { transform: skewX(12deg); display: inline-flex; align-items: center; gap: 8px; }
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 0 1px var(--red), 0 0 24px rgba(232,0,29,0.35);
}
.btn-primary:hover {
  background: #ff0822;
  box-shadow: 0 0 0 1px var(--red), 0 0 36px rgba(232,0,29,0.55);
  transform: skewX(-12deg) translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}
.btn-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.05);
  transform: skewX(-12deg) translateY(-1px);
}
.btn-red-outline {
  background: transparent;
  color: var(--red);
  border-color: var(--red-border-strong);
}
.btn-red-outline:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transform: skewX(-12deg) translateY(-1px);
}
.btn-sm { height: 36px; padding: 0 18px; font-size: 11px; }

/* Login pulse */
.btn-pulse {
  animation: pulseGlow 2.5s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 1px var(--red-border), 0 0 0 0 rgba(232,0,29,0); }
  50%      { box-shadow: 0 0 0 1px var(--red-border-strong), 0 0 28px rgba(232,0,29,0.45); }
}

/* ============================================================
   Cards & surfaces
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}
.card:hover {
  border-color: rgba(232,0,29,0.30);
  box-shadow: 0 0 32px rgba(232,0,29,0.10);
}
.card-raised { background: var(--surface-raised); }

/* Quarter-circle red corner accent */
.corner-accent::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 56px; height: 56px;
  background: radial-gradient(circle at top right, var(--red) 0, var(--red) 1px, transparent 1.5px),
              linear-gradient(225deg, rgba(232,0,29,0.18), transparent 60%);
  pointer-events: none;
}
.corner-accent::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 56px;
  background: linear-gradient(180deg, var(--red), transparent);
}

/* ============================================================
   Badges & pills
   ============================================================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--red-tint);
  border: 1px solid var(--red-border);
  border-radius: 999px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}
.pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid rgba(232,0,29,0.20);
  border-radius: 2px;
  color: var(--red);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tag-neutral {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
}

/* ============================================================
   Logo
   ============================================================ */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: #fff;
}
.logo-mark {
  width: 22px;
  height: 22px;
  position: relative;
  display: inline-block;
  transform: rotate(45deg);
}
.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--red);
}
.logo-mark::after {
  inset: 5px;
  border-width: 1.5px;
  background: var(--red);
  box-shadow: 0 0 12px rgba(232,0,29,0.6);
}
.logo-text-accent { color: var(--red); }

/* ============================================================
   Top header (sticky, glassmorphic)
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2,2,2,0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--divider);
}
.site-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-link {
  position: relative;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-2);
  font-weight: 500;
  padding: 4px 0;
  transition: color 180ms ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  height: 1px; width: 0;
  background: var(--red);
  transition: width 220ms ease;
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: #fff; }
.nav-link.active::after { width: 100%; }

/* ============================================================
   Layout helpers
   ============================================================ */

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}
.section { padding: 120px 0; position: relative; }
.section-tight { padding: 80px 0; }

.section-title-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 72px;
  text-align: center;
}

.divider-line {
  width: 128px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--divider);
  background: #050505;
  padding: 80px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-col-title {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--red);
  margin-bottom: 20px;
  font-weight: 500;
}
.footer-link {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-2);
  transition: color 180ms ease;
}
.footer-link:hover { color: #fff; }

.footer-bottom {
  max-width: 1440px;
  margin: 64px auto 0;
  padding: 24px 48px 0;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-3);
}

/* ============================================================
   Forms
   ============================================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-2);
}
.field-input {
  height: 44px;
  padding: 0 14px;
  background: #060606;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.field-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(232,0,29,0.15);
}

/* ============================================================
   Drop zone
   ============================================================ */

.dropzone {
  position: relative;
  padding: 64px 32px;
  background: rgba(232,0,29,0.02);
  border: 2px dashed rgba(232,0,29,0.35);
  text-align: center;
  transition: background 220ms ease, border-color 220ms ease;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.dragover {
  background: rgba(232,0,29,0.07);
  border-color: var(--red);
}
.dropzone-icon {
  font-size: 48px;
  color: var(--red);
  line-height: 1;
  margin-bottom: 18px;
}

/* ============================================================
   Terminal block
   ============================================================ */

.terminal {
  background: linear-gradient(180deg, #060606, #020202);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 64px rgba(232,0,29,0.10), 0 0 0 1px rgba(232,0,29,0.12);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--mono);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
  background: rgba(255,255,255,0.02);
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dot { width: 11px; height: 11px; border-radius: 50%; }
.terminal-dot.r1 { background: #E8001D; }
.terminal-dot.r2 { background: #FFB300; }
.terminal-dot.r3 { background: #E8001D; opacity: 0.55; }
.terminal-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
  flex: 1;
  text-align: center;
}
.terminal-body {
  padding: 24px 28px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--text);
}
.term-prompt { color: var(--red); margin-right: 8px; }
.term-muted  { color: var(--text-2); }
.term-warn   { color: var(--red); font-weight: 600; }
.term-ok     { color: #fff; }
.term-ok::before { content: "✓ "; color: var(--red); margin-right: 4px; }
.term-warn::before { content: "⚠ "; }
.cursor {
  display: inline-block;
  width: 9px;
  height: 16px;
  background: var(--red);
  vertical-align: -3px;
  animation: blink 800ms steps(2) infinite;
  box-shadow: 0 0 6px var(--red);
}
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   Animations
   ============================================================ */

.fade-up { opacity: 0; transform: translateY(20px); transition: opacity 700ms ease, transform 700ms ease; }
.fade-up.in { opacity: 1; transform: none; }

.scan-line {
  position: relative;
  height: 2px;
  background: rgba(232,0,29,0.10);
  overflow: hidden;
}
.scan-line::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  width: 30%;
  animation: scan 1.4s ease-in-out infinite;
}
@keyframes scan {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* ============================================================
   Utilities
   ============================================================ */

.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-red { color: var(--red); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mt-12 { margin-top: 48px; }
.mt-16 { margin-top: 64px; }
.mt-24 { margin-top: 96px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.gap-12 { gap: 48px; }
.flex-col { flex-direction: column; }
.w-full { width: 100%; }
.text-center { text-align: center; }
