/* CajaLocal — catálogo de herramientas locales.
   CSS plano, sin build y sin recursos de terceros (compatible con CSP 'self'). */

@font-face {
  font-family: "Atkinson Next";
  src: url("fonts/atkinson-next-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Mono";
  src: url("fonts/atkinson-mono-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0b0a;
  --raise: #15130f;
  --ink: #ede9e0;
  --muted: #a8a295;
  --line: rgba(237, 233, 224, 0.14);
  --line-strong: rgba(237, 233, 224, 0.3);
  --signal: #ff4d00;
  --paper: #f4f1ea;
  --sans: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

/* Escala por rem: la interfaz crece en QHD / UHD en lugar de quedarse pequeña */
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
@media (min-width: 1920px) { html { font-size: 112.5%; } }
@media (min-width: 2560px) { html { font-size: 137.5%; } }
@media (min-width: 3200px) { html { font-size: 175%; } }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(237, 233, 224, 0.07) 1px, transparent 1px);
  background-size: 1.5rem 1.5rem;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--signal); color: var(--bg); }

a { color: inherit; }

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

.wrap { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--signal);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ── Cabecera ─────────────────────────────────────────── */
.top { border-bottom: 1px solid var(--line); }
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand svg { display: block; }
.byline {
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.2s, border-color 0.2s;
}
.byline strong { color: var(--ink); font-weight: 600; }
.byline:hover { color: var(--ink); border-color: var(--signal); }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding-block: clamp(3rem, 8vw, 7rem) clamp(2.5rem, 6vw, 5rem);
}
@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: end; gap: 4.5rem; }
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.4rem;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  background: var(--signal);
}
h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.15rem, 1.1rem + 4vw, 4.4rem);
  line-height: 1.03;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
h1 span { color: var(--muted); }
.lede {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  color: var(--muted);
}

/* Ficha técnica con marcas de corte */
.spec {
  position: relative;
  padding: 1.5rem 1.5rem 1.1rem;
  border: 1px solid var(--line);
  background: rgba(21, 19, 15, 0.7);
}
.spec::before,
.spec::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--signal);
}
.spec::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.spec::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.spec__title {
  margin: 0 0 0.6rem;
  font: 600 0.72rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.spec dl { margin: 0; }
.spec dl div {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 0.75rem 0;
  border-top: 1px dashed var(--line);
}
.spec dt {
  font: 500 0.72rem/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.spec dd {
  margin: 0;
  text-align: right;
  font: 500 0.9rem/1.5 var(--mono);
}

/* ── Catálogo ─────────────────────────────────────────── */
.catalog-wrap { padding-bottom: clamp(3rem, 7vw, 6rem); }
.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.25rem;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.catalog {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: tool;
  border-bottom: 1px solid var(--line);
}
.tool {
  counter-increment: tool;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem 2rem;
  padding: 1.5rem 0.75rem;
  border-top: 1px solid var(--line);
  transition: background-color 0.25s;
}
.tool::before {
  content: "0" counter(tool, decimal-leading-zero);
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
}
@media (min-width: 52rem) {
  .tool {
    grid-template-columns: 3.25rem minmax(14rem, 19rem) minmax(0, 1fr) auto;
    align-items: center;
    padding: 1.9rem 1rem;
  }
  .tool::before { align-self: start; padding-top: 0.4rem; }
}

.thumb {
  aspect-ratio: 8 / 5;
  border: 1px solid var(--line);
  background: #100f0d;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.25s;
}
.thumb svg { display: block; width: 100%; height: 100%; }

.tool__body h3 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tool__body h3 a { text-decoration: none; }
.tool__body h3 a::after { content: ""; position: absolute; inset: 0; }
.tool__body p { margin: 0 0 1.1rem; max-width: 48ch; color: var(--muted); }

.io {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
  font: 500 0.78rem/1 var(--mono);
}
.io li { padding: 0.32rem 0.6rem; border: 1px solid var(--line-strong); }
.io li.arrow { border: 0; padding-inline: 0.1rem; color: var(--signal); }
.terms { margin: 0; font: 400 0.78rem/1.5 var(--mono); color: var(--muted); }

.tool__aside {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
@media (min-width: 52rem) {
  .tool__aside { flex-direction: column; align-items: flex-end; justify-content: center; gap: 1.6rem; min-width: 9rem; }
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font: 600 0.72rem/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 0.22rem rgba(255, 77, 0, 0.2);
}
.go {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line-strong);
  font: 600 0.85rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s;
}
.go svg { transition: transform 0.25s; }

@media (hover: hover) {
  .tool:not(.tool--soon):hover { background: rgba(237, 233, 224, 0.035); }
  .tool:not(.tool--soon):hover .go { color: var(--signal); border-color: var(--signal); }
  .tool:not(.tool--soon):hover .go svg { transform: translateX(0.3rem); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tool:not(.tool--soon):hover .thumb { transform: translateY(-4px) rotate(-0.6deg); border-color: var(--line-strong); }
}
@supports selector(:has(*)) {
  .tool a:focus-visible { outline: none; }
  .tool:has(a:focus-visible) { outline: 2px solid var(--signal); outline-offset: -2px; }
}

.tool--soon .status::before { background: transparent; border: 1px solid var(--muted); box-shadow: none; }
.tool--soon .status { color: var(--muted); }
.tool--soon h3 { color: var(--muted); }

/* ── Pie ──────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); }
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 2rem;
}
.foot p { margin: 0; max-width: 46ch; font-size: 0.9rem; color: var(--muted); }
.foot p strong { color: var(--ink); font-weight: 600; }
.maker {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  transition: transform 0.25s;
}
.maker img { display: block; height: 2.6rem; width: auto; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .maker:hover { transform: translateY(-2px) rotate(-1deg); }
}

/* ── Entrada suave (se desactiva con prefers-reduced-motion) ── */
@keyframes rise { from { opacity: 0; transform: translateY(0.8rem); } }
@media (prefers-reduced-motion: no-preference) {
  .hero > div > *, .spec, .tool { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .spec { animation-delay: 0.12s; }
  .tool:nth-child(1) { animation-delay: 0.2s; }
  .tool:nth-child(2) { animation-delay: 0.3s; }
  .tool:nth-child(3) { animation-delay: 0.4s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
