/* ==========================================================================
   Lintratech — design tokens
   ink     #0B0E11  base background
   panel   #12171D  surface / cards
   line    #262E36  borders, hairlines
   ash     #6B7580  muted text, labels
   fog     #DCE1E6  primary text
   ember   #E8A33D  primary accent (phosphor amber)
   signal  #4FBFB8  secondary accent (muted cyan)
   alert   #D9584B  rare, offline/error state only
   ========================================================================== */

:root {
  --ink: #0B0E11;
  --panel: #12171D;
  --panel-2: #171D24;
  --line: #262E36;
  --ash: #6B7580;
  --fog: #DCE1E6;
  --ember: #E8A33D;
  --signal: #4FBFB8;
  --alert: #D9584B;

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max: 1180px;
  --gap: clamp(1.25rem, 3vw, 2rem);
}

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

html {
  background: var(--ink);
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--ink);
  color: var(--fog);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; }

::selection { background: var(--ember); color: var(--ink); }

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

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

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ember);
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1rem;
}

h1, h2, h3 {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--fog);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.12; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.2; }
h3 { font-size: 1.05rem; }

p.lede {
  font-size: clamp(1.02rem, 1.6vw, 1.15rem);
  color: var(--ash);
  max-width: 46ch;
}

.section-head {
  max-width: 58ch;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head p { color: var(--ash); margin-top: 0.75rem; }

section { padding: clamp(4rem, 9vw, 7rem) 0; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ember);
  display: inline-block;
  flex-shrink: 0;
  animation: pulse 2.6s ease-in-out infinite;
}

.status-dot.signal { background: var(--signal); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 163, 61, 0.35); }
  50% { box-shadow: 0 0 0 4px rgba(232, 163, 61, 0); }
}

/* ---- buttons: bracket style, no gradients, no rounded pill shadows ---- */
.btn {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fog);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn .bracket { color: var(--ash); }

.btn-primary {
  border-color: var(--ember);
  color: var(--ember);
}
.btn-primary:hover {
  background: var(--ember);
  color: var(--ink);
}
.btn-primary:hover .bracket { color: var(--ink); }

.btn-ghost { border-color: var(--line); color: var(--ash); }
.btn-ghost:hover { border-color: var(--ash); color: var(--fog); }

/* ==========================================================================
   Header
   ========================================================================== */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(11, 14, 17, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem var(--gap);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--fog);
  display: flex;
  align-items: center;
}

.logo .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  background: var(--ember);
  margin-left: 0.15em;
  animation: blink 1.1s step-end infinite;
}

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

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.88rem;
}

.nav-links a { color: var(--ash); transition: color 0.15s ease; }
.nav-links a:hover { color: var(--ember); }

.nav-right { display: flex; align-items: center; gap: 1rem; }

.lang-toggle {
  font-family: var(--mono);
  font-size: 0.8rem;
  border: 1px solid var(--line);
  display: flex;
}
.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--ash);
  padding: 0.35rem 0.6rem;
}
.lang-toggle button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--signal);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--fog);
  font-family: var(--mono);
  font-size: 1.4rem;
  line-height: 1;
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  nav.open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 1.25rem var(--gap);
    gap: 1.1rem;
  }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  padding-top: clamp(7rem, 14vw, 9.5rem);
  padding-bottom: clamp(3.5rem, 8vw, 5rem);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* status panel: systemd-style readout, no window chrome */
.status-panel {
  font-family: var(--mono);
  font-size: 0.88rem;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.4rem 1.5rem;
}

.status-panel .unit {
  display: flex;
  align-items: center;
  gap: 0.6em;
  color: var(--fog);
  font-weight: 600;
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.status-panel dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
}

.status-panel dt { color: var(--ash); }
.status-panel dd { color: var(--fog); text-align: right; }
.status-panel dd.accent { color: var(--ember); }

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Services
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.service {
  background: var(--ink);
  padding: 2rem;
}

.service .unit-name {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ash);
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 1rem;
}

.service h3 { margin-bottom: 0.75rem; font-size: 1.2rem; }
.service p { color: var(--ash); font-size: 0.95rem; margin-bottom: 1.1rem; }

.service ul { list-style: none; font-size: 0.9rem; }
.service li {
  padding-left: 1.1em;
  position: relative;
  color: var(--fog);
  margin-bottom: 0.4rem;
}
.service li::before {
  content: '\00bb';
  position: absolute;
  left: 0;
  color: var(--ember);
}

@media (max-width: 860px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   About / metrics
   ========================================================================== */
.about .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about p.lede { max-width: 60ch; margin-bottom: 0; color: var(--fog); }
.about p.lede + p { color: var(--ash); margin-top: 1rem; max-width: 58ch; }

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
}

.metric {
  padding: 1.5rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric:nth-child(2n) { border-right: none; }
.metric:nth-last-child(-n+2) { border-bottom: none; }

.metric .value {
  font-family: var(--mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--ember);
  display: block;
}
.metric .label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ash);
  text-transform: lowercase;
}

@media (max-width: 860px) {
  .about .container { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Ecosystem — routing table
   ========================================================================== */
.route-table { border: 1px solid var(--line); }

.route-head, .route {
  display: grid;
  grid-template-columns: 1.1fr 2.4fr 0.7fr 0.4fr;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
}

.route-head {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ash);
  border-bottom: 1px solid var(--line);
}

.route {
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.route:last-child { border-bottom: none; }
.route:hover { background: var(--panel); }

.route .name {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--fog);
}
.route .name span {
  display: block;
  font-weight: 400;
  color: var(--signal);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}
.route .desc { color: var(--ash); font-size: 0.92rem; }
.route .status {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--signal);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.route .arrow { color: var(--ash); font-family: var(--mono); text-align: right; }
.route:hover .arrow { color: var(--ember); }

@media (max-width: 700px) {
  .route-head { display: none; }
  .route {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .route .status { order: 3; }
  .route .arrow { display: none; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
}

form { display: flex; flex-direction: column; gap: 1.4rem; }

.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--signal);
  margin-bottom: 0.5rem;
}

.field input, .field textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--fog);
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.5rem 0.1rem;
  transition: border-color 0.15s ease;
}

.field input:focus, .field textarea:focus {
  border-color: var(--ember);
  outline: none;
}

.field textarea { resize: vertical; min-height: 90px; }

.contact-direct {
  border: 1px solid var(--line);
  padding: 1.6rem;
  height: fit-content;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.contact-direct .k { color: var(--ash); font-size: 0.8rem; margin-top: 1rem; }
.contact-direct .k:first-child { margin-top: 0; }
.contact-direct a { color: var(--fog); }
.contact-direct a:hover { color: var(--ember); }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 6vw, 3.5rem) 0;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

footer .logo { margin-bottom: 0.5rem; }
footer p { color: var(--ash); font-size: 0.88rem; max-width: 40ch; }

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.footer-links a { color: var(--ash); }
.footer-links a:hover { color: var(--signal); }

.footer-bottom {
  max-width: var(--max);
  margin: 2rem auto 0;
  padding: 1.25rem var(--gap) 0;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ash);
}

/* ==========================================================================
   Scroll reveal
   Visible by default. JS opts an element INTO the hidden pre-animation
   state by adding .armed — so any script failure leaves content showing
   rather than stuck invisible.
   ========================================================================== */
.reveal.armed {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.armed.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal.armed { opacity: 1; transform: none; }
}

/* ==========================================================================
   i18n — dual-span language toggle
   `data-lang` lives ONLY on <html> (current UI language, set by JS).
   `data-tr` lives on the per-language content spans/li/etc.
   Keeping these as two different attributes avoids the bare selector
   below ever matching <html> itself and hiding the whole document.
   Default (before any JS runs): English shows.
   ========================================================================== */
[data-tr="es"] { display: none; }

:root[data-lang="es"] [data-tr="en"] { display: none; }
:root[data-lang="es"] [data-tr="es"] { display: inline; }
:root[data-lang="es"] li[data-tr="es"],
:root[data-lang="es"] .field[data-tr="es"],
:root[data-lang="es"] .metric[data-tr="es"] { display: block; }
