/* ============================================================
   Brisvia — hoja de estilos
   Identidad "tecnología austral sobria". Paleta y tipografía
   definidas en el debate de identidad visual (2026-07-05).
   Editable: los colores viven en variables (:root).
   ============================================================ */

/* --- Tokens de color: modo oscuro (por defecto) --- */
:root,
:root[data-theme="dark"] {
  --bg: #0B1117;
  --surface: #131D26;
  --surface-2: #1A2732;
  --border: #263642;
  --text: #F2F6F8;
  --text-dim: #9DAEB9;
  --brand: #35BFC5;      /* turquesa de viento */
  --ok: #76C7A0;         /* verde mineral */
  --arena: #D5A66F;      /* arena portuaria */
  --error: #D96C70;

  --brand-soft: rgba(53, 191, 197, 0.12);
  --arena-soft: rgba(213, 166, 111, 0.12);
  --shadow: 0 1px 0 rgba(255,255,255,0.02), 0 10px 30px -20px rgba(0,0,0,0.6);
}

/* --- Modo claro --- */
:root[data-theme="light"] {
  --bg: #F4F7F8;
  --surface: #FFFFFF;
  --surface-2: #EAF0F2;
  --border: #D4E0E4;
  --text: #111A21;
  --text-dim: #586A75;
  --brand: #168E96;
  --ok: #3E916B;
  --arena: #A9743F;
  --error: #B94B50;

  --brand-soft: rgba(22, 142, 150, 0.10);
  --arena-soft: rgba(169, 116, 63, 0.10);
  --shadow: 0 1px 0 rgba(0,0,0,0.02), 0 12px 30px -22px rgba(20,40,60,0.35);
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace; }
.muted { color: var(--text-dim); }
.small { font-size: .84rem; }
.ok { color: var(--ok); }
.arena { color: var(--arena); }

h1, h2, h3 { font-family: "Manrope", sans-serif; line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-weight: 800; font-size: clamp(2.1rem, 5.2vw, 4rem); }
h2 { font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-weight: 600; font-size: 1.18rem; }

.container { width: min(1120px, 92vw); margin-inline: auto; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

/* --- Eyebrow / cabeceras de sección --- */
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  color: var(--brand);
  margin: 0 0 1rem;
}
.section-head { max-width: 640px; margin-bottom: 2.6rem; }
.section-sub { color: var(--text-dim); font-size: 1.02rem; }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: "Manrope", sans-serif; font-weight: 600; font-size: 1rem;
  padding: .8rem 1.4rem; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: .55rem 1rem; font-size: .92rem; }
.btn-primary { background: var(--brand); color: #04191b; }
.btn-primary:hover { background: #46cfd4; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* --- Banner de etapa --- */
.stage-banner {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  background: var(--arena-soft); color: var(--text);
  border-bottom: 1px solid var(--border);
  font-size: .82rem; padding: .55rem 1rem; text-align: center;
}
.stage-banner strong { color: var(--arena); font-weight: 600; }
.stage-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--arena); flex: none; }

/* --- Header --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem 0; width: min(1120px, 92vw); margin-inline: auto;
}
.site-header::before {
  content: ""; position: absolute; inset: 0 -100vw;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); z-index: -1;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-name { font-family: "Manrope", sans-serif; font-size: 1.15rem; }
.brand-ticker {
  font-family: "IBM Plex Mono", monospace; font-size: .66rem; letter-spacing: .1em;
  color: var(--brand); border: 1px solid var(--border); border-radius: 5px; padding: .1rem .35rem;
}
.nav { display: flex; gap: 1.4rem; margin-left: auto; }
.nav a { color: var(--text-dim); font-size: .93rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: .7rem; }
.theme-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--brand); border-color: var(--brand); }

/* --- Hero --- */
.hero { position: relative; overflow: hidden; padding: clamp(4rem, 12vh, 8rem) 0 clamp(3rem, 8vh, 6rem); }
.breeze { position: absolute; inset: 0; color: var(--brand); opacity: .5; pointer-events: none; }
.breeze svg { width: 100%; height: 100%; }
.breeze .stream {
  stroke-dasharray: 8 14; opacity: .55;
  animation: drift 26s linear infinite;
}
.breeze .stream:nth-child(2) { animation-duration: 34s; opacity: .4; }
.breeze .stream:nth-child(3) { animation-duration: 30s; opacity: .3; }
.breeze .nodes circle { opacity: .8; animation: pulse 6s ease-in-out infinite; }
@keyframes drift { to { stroke-dashoffset: -220; } }
@keyframes pulse { 0%,100% { opacity: .25; } 50% { opacity: .9; } }

.hero-content { position: relative; max-width: 780px; }
.hero h1 { margin-bottom: .6rem; }
.lede { font-size: clamp(1.05rem, 1.8vw, 1.28rem); color: var(--text-dim); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 1.1rem; }
.hero-note { font-size: .86rem; color: var(--text-dim); }

/* --- Secciones --- */
.section { padding: clamp(3.2rem, 8vh, 5.5rem) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

/* --- Cards de principios --- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.6rem; box-shadow: var(--shadow); position: relative;
}
.section-alt .card { background: var(--surface-2); }
.card-mark {
  font-family: "IBM Plex Mono", monospace; font-size: 1rem; font-weight: 500;
  color: var(--brand); background: var(--brand-soft);
  display: inline-grid; place-items: center; min-width: 2.6rem; height: 2.6rem; padding: 0 .5rem;
  border-radius: 8px; margin-bottom: 1rem;
}
.card p { color: var(--text-dim); margin: 0; }

/* --- Pasos --- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; counter-reset: none; }
.step { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem; }
.section-alt .step { background: var(--bg); }
.step-n {
  font-family: "IBM Plex Mono", monospace; font-size: .8rem; color: var(--brand);
  border: 1px solid var(--brand); border-radius: 50%; width: 2rem; height: 2rem;
  display: grid; place-items: center; margin-bottom: 1rem;
}
.step h3 { font-size: 1.05rem; }
.step p { color: var(--text-dim); margin: 0; font-size: .95rem; }

.callout {
  margin-top: 2rem; padding: 1rem 1.2rem; border-radius: 10px; font-size: .92rem;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
}
.callout-warn { border-left: 3px solid var(--arena); }

/* --- Estado de la red --- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.stat { background: var(--surface); padding: 1.4rem 1.3rem; display: flex; flex-direction: column; gap: .35rem; }
.stat-label { font-size: .82rem; color: var(--text-dim); }
.stat-value { font-size: 1.15rem; color: var(--text); }
.stat-value.mono { color: var(--text-dim); font-size: .95rem; }

/* --- Fair launch (signature) --- */
.fair-wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 2.8rem; align-items: center; }
.fair-intro p { color: var(--text-dim); }
.fair-intro p:first-of-type { color: var(--text); }
.fair-panel {
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow);
}
.section-alt .fair-panel { background: var(--bg); }
.fair-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .85rem 1.2rem; border-bottom: 1px solid var(--border); font-size: .95rem;
}
.fair-row:last-child { border-bottom: none; }
.fair-row > span:first-child { color: var(--text-dim); }
.fair-row .mono { color: var(--text); font-weight: 500; }

/* --- Minero --- */
.miner-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 2.8rem; align-items: center; }
.feature-list { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: .6rem; }
.feature-list li { padding-left: 1.4rem; position: relative; color: var(--text-dim); }
.feature-list li::before { content: "→"; position: absolute; left: 0; color: var(--brand); }

.miner-mock { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.mock-bar { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mock-title { font-family: "Manrope", sans-serif; font-weight: 600; font-size: .92rem; }
.mock-status { margin-left: auto; font-size: .8rem; color: var(--ok); display: inline-flex; align-items: center; gap: .4rem; }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: soft 3s ease-in-out infinite; }
@keyframes soft { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.mock-body { padding: 1.6rem; display: grid; gap: 1.3rem; }
.mock-mine { background: var(--brand); color: #04191b; border: none; border-radius: 10px; padding: 1rem; font-family: "Manrope", sans-serif; font-weight: 700; font-size: 1.05rem; cursor: default; }
.mock-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: center; }
.mock-metrics > div { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: .9rem .4rem; display: grid; gap: .2rem; }
.mono.big { font-size: 1.3rem; color: var(--text); }
.mock-unit { font-size: .72rem; color: var(--text-dim); }
.mock-profiles { display: flex; gap: .4rem; flex-wrap: wrap; }
.mock-profiles span { font-size: .78rem; color: var(--text-dim); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .7rem; }
.mock-profiles .active { color: #04191b; background: var(--brand); border-color: var(--brand); }

/* --- Tecnología --- */
.tech-chips { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tech-chips li { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.section-alt .tech-chips li { background: var(--bg); }
.tech-chips .mono { color: var(--brand); font-size: .98rem; }
.tech-chips small { color: var(--text-dim); }

/* --- Origen --- */
.origin { background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--arena) 6%, var(--bg))); position: relative; overflow: hidden; }
.origin-wrap { position: relative; max-width: 700px; }
.origin-line { position: absolute; inset: 0; background:
  repeating-linear-gradient(115deg, transparent 0 38px, color-mix(in srgb, var(--arena) 22%, transparent) 38px 39px);
  opacity: .5; mask-image: linear-gradient(90deg, transparent, #000 40%, #000 70%, transparent); pointer-events: none; }
.origin-copy { position: relative; }
.origin-copy p { color: var(--text-dim); font-size: 1.08rem; }
.origin-copy strong { color: var(--arena); }

/* --- Descargas / comunidad --- */
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.dl { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem 1.3rem; display: flex; align-items: center; justify-content: space-between; }
.dl-os { font-family: "Manrope", sans-serif; font-weight: 600; }
.dl-state { color: var(--text-dim); font-size: .85rem; }
.community { display: flex; flex-wrap: wrap; gap: .8rem; }
.chip-link { border: 1px solid var(--border); border-radius: 999px; padding: .5rem 1rem; color: var(--text); font-size: .9rem; display: inline-flex; gap: .5rem; align-items: baseline; }
.chip-link small { color: var(--text-dim); font-size: .72rem; }
.chip-link[aria-disabled="true"] { opacity: .7; cursor: default; }
.chip-link[aria-disabled="true"]:hover { text-decoration: none; border-color: var(--border); }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 2.6rem 0 1.6rem; }
.footer-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 2rem; padding-bottom: 1.6rem; }
.footer-brand .brand { margin-bottom: .6rem; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 1.2rem; border-top: 1px solid var(--border); gap: 1rem; flex-wrap: wrap; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .cards-3, .steps, .stats-grid, .tech-chips, .downloads { grid-template-columns: repeat(2, 1fr); }
  .fair-wrap, .miner-wrap, .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards-3, .steps, .stats-grid, .tech-chips, .downloads { grid-template-columns: 1fr; }
  .header-actions .btn { display: none; }
  .footer-bottom { justify-content: flex-start; }
}

/* --- Accesibilidad: menos movimiento --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
