:root {
  --bg: #FFFFFF;
  --text: #1F2A30;
  --muted: #5B6770;
  --primary: #B54A24;
  --on-primary: #FFFFFF;
  --border: #E3E6E8;
  --surface: #F7F4F2;
  --mark: #FFE9A8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111B21;
    --text: #E9EDEF;
    --muted: #9AA7AE;
    --primary: #E8734A;
    --on-primary: #111B21;
    --border: #26343C;
    --surface: #18242B;
    --mark: #6B5200;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: var(--primary); }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.wrap.narrow { max-width: 760px; }

/* Barra superior */

.topbar { border-bottom: 1px solid var(--border); }

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img { width: 36px; height: 36px; border-radius: 9px; }

.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .95rem; }

.topbar nav a { color: var(--muted); text-decoration: none; }

.topbar nav a:hover { color: var(--primary); }

/* Portada */

.hero { padding: 64px 0 56px; }

.hero .wrap {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 16px;
  text-wrap: balance;
}

.hero p.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 24px; max-width: 34em; }

.pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-weight: 600;
  font-size: .95rem;
}

.hero-art {
  justify-self: center;
  width: min(260px, 60vw);
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  box-shadow: 0 24px 60px rgba(181, 74, 36, .28);
}

/* Secciones */

section { padding: 48px 0; }

section.alt { background: var(--surface); }

section h2 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }

section .intro { color: var(--muted); margin: 0 0 28px; max-width: 40em; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.card h3 { font-size: 1.05rem; margin: 0 0 6px; color: var(--primary); }

.card p { margin: 0; color: var(--muted); font-size: .97rem; }

.contact-list { list-style: none; padding: 0; margin: 0; }

.contact-list li { margin: 6px 0; }

.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
}

/* Páginas de texto */

.doc { padding-top: 32px; padding-bottom: 64px; }

.doc header { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 8px; }

.doc h1 { font-size: 1.8rem; line-height: 1.25; margin: 0 0 8px; }

.doc h2 { font-size: 1.2rem; margin: 36px 0 8px; color: var(--primary); }

.doc h3 { font-size: 1rem; margin: 20px 0 4px; }

.doc p, .doc ul, .doc ol { margin: 8px 0; }

.doc ul, .doc ol { padding-left: 22px; }

.doc li { margin: 4px 0; }

.meta { color: var(--muted); font-size: .92rem; margin: 0; }

.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
}

.box p:first-child { margin-top: 0; }

.box p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 12px 0; }

table { border-collapse: collapse; width: 100%; font-size: .95rem; }

th, td { text-align: left; vertical-align: top; padding: 8px 10px; border: 1px solid var(--border); }

th { background: var(--surface); }

mark { background: var(--mark); color: inherit; padding: 0 3px; border-radius: 3px; }

/* Pie */

.footer { border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: .9rem; }

.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

.footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }

.footer a { color: var(--muted); }

@media (max-width: 720px) {
  .hero { padding: 40px 0; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; width: 120px; justify-self: start; }
}
