/* La Cueva Dev — landing styles. Tokens derived from brand/README.md */
:root {
  --ground: #090d21;
  --panel: #0b1026;
  --footer: #070a1a;
  --border: #262c4a;
  --border-amber: #3f3a2a;
  --border-amber-strong: #5a4a22;
  --text: #f4f1ea;
  --text-soft: #b7bdd6;
  --text-muted: #9aa3c2;
  --text-dim: #7a83a8; /* 5.0:1 on panel, the floor for 12–13px text */
  --amber: #ffb02e;
  --amber-soft: #ffc45c;
  --orange: #ff8c1a;
  --cyan: #5fd8ff;
  --violet: #c98bff;
  --green: #5cff8a;
  --ink: #0a0a10;
  --font-display: 'Chakra Petch', sans-serif;
  --font-pixel: 'Press Start 2P', monospace;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Inter', system-ui, sans-serif;
  --glow-amber: 0 0 22px rgba(255, 176, 46, 0.4);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); }
a:hover { color: #ffd27a; }
img { max-width: 100%; height: auto; }
/* `hidden` must win over the display rules below (sections kept in the markup until their content is real) */
[hidden] { display: none !important; }
::selection { background: var(--amber); color: var(--ink); }

.container { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.grid-bg {
  background-image:
    linear-gradient(to right, rgba(255, 176, 46, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 176, 46, 0.07) 1px, transparent 1px);
  background-size: 40px 40px;
}
.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px 4px);
}
.section { padding: 88px 0; border-bottom: 1px solid var(--border); }
/* Anchor targets land below the sticky header */
[id] { scroll-margin-top: 96px; }

/* Type */
.eyebrow {
  font-family: var(--font-pixel); font-size: 12px; letter-spacing: 0.1em;
  color: var(--amber); text-shadow: 0 0 10px rgba(255, 176, 46, 0.45);
}
.h1 {
  margin: 0; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 5vw, 60px); line-height: 1.02; letter-spacing: -0.01em; text-wrap: balance;
}
.h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; }
.h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.lead { margin: 0; font-size: 18px; color: var(--text-soft); max-width: 560px; }
.muted { color: var(--text-soft); }
.glow { color: var(--amber); text-shadow: 0 0 18px rgba(255, 176, 46, 0.45); }
.mono { font-family: var(--font-mono); letter-spacing: 0.06em; }
.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.section-head p { margin: 0; font-size: 17px; color: var(--text-soft); }

/* Buttons & chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 24px;
  border-radius: 4px; font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; cursor: pointer; border: 0;
}
.btn-primary { background: var(--amber); color: var(--ink); box-shadow: var(--glow-amber); }
.btn-primary:hover { background: #ffc45c; color: var(--ink); }
.btn-ghost { background: rgba(255, 176, 46, 0.06); color: var(--amber-soft); border: 1px solid var(--border-amber-strong); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-soft); }
.btn-sm { min-height: 40px; padding: 8px 18px; font-size: 13px; }
.chip {
  display: inline-block; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; color: var(--text-muted);
}
.tag {
  display: inline-block; padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
.pill {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; padding: 8px 14px;
  border: 1px solid var(--border-amber); border-radius: 999px; background: rgba(255, 176, 46, 0.08);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.12em; color: var(--amber-soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--border); background: rgba(9, 13, 33, 0.92); backdrop-filter: blur(8px); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; padding-block: 14px; }
.nav-logo img { height: 56px; width: auto; display: block; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.04em; }
.nav-links a { color: #c9cde0; text-decoration: none; padding: 8px 0; }
.nav-links a:hover { color: var(--amber-soft); }
/* `.nav-links a` outranks `.btn-primary`: the CTA would take the link color (amber on amber) */
.nav-links a.btn-primary, .nav-links a.btn-primary:hover { color: var(--ink); padding: 8px 18px; }

/* Hero */
.hero { padding: 72px 0 56px; border-bottom: 1px solid var(--border); }
.hero-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 8px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 12px; }
.hero-visual { flex: 1 1 420px; min-width: 0; display: flex; justify-content: center; }
.crt-frame {
  position: relative; width: 100%; max-width: 560px; border: 2px solid rgba(255, 176, 46, 0.55); border-radius: 10px;
  overflow: hidden; background: var(--ground);
  box-shadow: 0 0 40px rgba(255, 176, 46, 0.18), inset 0 0 30px rgba(0, 0, 0, 0.5);
}
.crt-frame img { display: block; width: 100%; }
.crt-bar {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 10px 14px;
  background: rgba(9, 13, 33, 0.85); border-top: 1px solid rgba(255, 176, 46, 0.35);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--amber-soft);
}
.crt-bar span:last-child { color: var(--text-muted); }

/* Badge strip */
.badge-strip { border-bottom: 1px solid var(--border); }
.badge-strip .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 32px; padding-block: 22px; }
.badge-strip img { height: 54px; width: auto; }

/* Services */
.services { display: flex; flex-direction: column; gap: 48px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--ground); color: inherit; text-decoration: none;
}
.card:hover { border-color: var(--border-amber-strong); color: inherit; }
.card-icon { width: 96px; height: 96px; object-fit: contain; display: block; }
.card p { margin: 0; font-size: 15px; color: var(--text-soft); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-foot { margin-top: auto; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; }
.c-amber { color: var(--amber-soft); } .c-cyan { color: var(--cyan); } .c-violet { color: var(--violet); } .c-green { color: var(--green); }

/* Process */
.process { display: flex; flex-direction: column; gap: 20px; padding-top: 16px; }
.process-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.process-head h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 24px; }
.process-head span { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; color: var(--text-muted); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps li { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; background: var(--panel); border-left: 2px solid var(--amber); border-radius: 0 6px 6px 0; }
.steps li:nth-child(2) { border-color: var(--cyan); } .steps li:nth-child(3) { border-color: var(--violet); } .steps li:nth-child(4) { border-color: var(--green); }
.step-when { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; }
.step-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.steps p { margin: 0; font-size: 14px; color: var(--text-soft); }

/* Lab */
.lab { display: flex; flex-direction: column; gap: 40px; }
.lab-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; }
.link-arrow { font-family: var(--font-mono); font-size: 15px; letter-spacing: 0.06em; color: var(--amber-soft); text-decoration: none; border-bottom: 1px solid var(--border-amber-strong); padding-bottom: 2px; }
.repo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.repo-head img { width: 64px; height: 64px; object-fit: contain; }
.status { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; }
.repo-id { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.1em; }
.card-featured { border-color: var(--border-amber); box-shadow: 0 0 18px rgba(255, 176, 46, 0.12); }

/* Guarida */
.guarida { position: relative; min-height: 520px; overflow: hidden; border-bottom: 1px solid var(--border); }
.guarida-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.guarida-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(9, 13, 33, 0.92) 0%, rgba(9, 13, 33, 0.7) 45%, rgba(9, 13, 33, 0.15) 100%); }
.guarida-copy { position: relative; display: flex; flex-direction: column; gap: 20px; padding-block: 88px; }
.guarida-copy .h2, .guarida-copy p { max-width: 560px; }
.guarida-copy p { margin: 0; font-size: 17px; color: #d2d6e8; }
.facts { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 10px; }
.fact { display: flex; flex-direction: column; gap: 4px; min-width: 180px; padding: 14px 18px; border-radius: 6px; background: rgba(9, 13, 33, 0.75); border: 1px solid rgba(255, 176, 46, 0.35); }
.fact:nth-child(2) { border-color: rgba(95, 216, 255, 0.35); } .fact:nth-child(3) { border-color: rgba(92, 255, 138, 0.35); }
.fact strong { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.fact span { font-size: 13px; color: var(--text-soft); }

/* Contact */
.contact { padding: 96px 0; }
.contact-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.contact-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.contact-copy img { width: 88px; height: 88px; object-fit: contain; }
/* While the form is hidden the copy stands alone: center it */
.contact-grid:has(> .form[hidden]) { justify-content: center; }
.contact-grid:has(> .form[hidden]) .contact-copy { flex: 0 1 760px; align-items: center; text-align: center; }
.contact-grid:has(> .form[hidden]) .h2 { text-wrap: balance; }
.contact-grid:has(> .form[hidden]) .contact-links { justify-content: center; }
.contact-copy .h2 { font-size: clamp(32px, 3.6vw, 44px); line-height: 1.05; }
.contact-copy p { margin: 0; max-width: 480px; font-size: 17px; color: var(--text-soft); }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px 24px; font-family: var(--font-mono); font-size: 14px; }
.contact-links a { color: var(--amber-soft); text-decoration: none; }
.form {
  flex: 1 1 400px; min-width: 0; max-width: 520px; display: flex; flex-direction: column; gap: 16px; padding: 28px;
  border: 1px solid var(--border-amber); border-radius: 8px; background: rgba(9, 13, 33, 0.9); box-shadow: 0 0 30px rgba(255, 176, 46, 0.12);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; color: var(--amber-soft); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--panel);
  color: var(--text); font-family: var(--font-mono); font-size: 15px;
}
.field input { height: 46px; padding-block: 0; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber); }
.field ::placeholder { color: var(--text-dim); }
.form-note { margin: 0; font-size: 12px; color: var(--text-dim); }

/* Footer */
.site-footer { padding: 40px 0 48px; background: var(--footer); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 32px; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.footer-brand img { height: 64px; width: auto; }
.footer-brand span { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; color: var(--text-dim); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.06em; }
.footer-links a { color: var(--text-muted); text-decoration: none; padding: 8px 0; }
.footer-links a:hover { color: var(--amber-soft); }

@media (max-width: 640px) {
  .section { padding: 64px 0; }
  .hero { padding: 48px 0 40px; }
  /* Header: not sticky on phones (it would eat a fifth of the viewport); CTA lives in the hero */
  .site-header { position: static; backdrop-filter: none; }
  .nav { padding-block: 10px; gap: 10px 16px; }
  .nav-logo img { height: 44px; }
  .nav-links { gap: 4px 18px; font-size: 14px; }
  .nav .btn { display: none; }
  [id] { scroll-margin-top: 16px; }
  .badge-strip img { height: 40px; }
  /* Text spans the full width on phones: flatten the shade so bright monitors never sit behind it */
  .guarida-shade { background: rgba(9, 13, 33, 0.86); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
