/* Sua Geometry — página oficial. MIT — Copyright (c) 2026 Carlos N. Perez-Montenegro (DonatellaTech) */

:root {
  --teal: #12343B;
  --teal-2: #1C4A53;
  --gold: #E8B04A;
  --gold-dark: #B7791F;
  --cream: #F4E9D8;
  --green: #8CC084;
  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --text: #1D2A2E;
  --muted: #55666B;
  --line: #E3DCD0;
  --code: #F3EFE6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 52, 59, .06), 0 6px 24px rgba(18, 52, 59, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", "DejaVu Sans Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E2328;
    --surface: #143039;
    --text: #E8EEEF;
    --muted: #A9BCC0;
    --line: #24464F;
    --code: #1B3B44;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--gold-dark); text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { a { color: var(--gold); } }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
code, kbd { font-family: var(--mono); font-size: .9em; background: var(--code); padding: .1em .35em; border-radius: 5px; }
pre { font-family: var(--mono); font-size: .88em; background: var(--code); padding: 1rem; border-radius: 10px; overflow-x: auto; }
pre code { background: none; padding: 0; }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 1.65rem; margin-top: 2.6rem; }
h3 { font-size: 1.2rem; margin-top: 1.8rem; }

.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2.5rem); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #000; padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* ---------- cabecera ---------- */
.site-header { background: var(--teal); color: var(--cream); position: sticky; top: 0; z-index: 5; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.header-row { display: flex; align-items: center; gap: 1.2rem; min-height: 64px; flex-wrap: wrap; padding-block: .4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--cream); text-decoration: none; font-size: 1.15rem; }
.brand img { border-radius: 9px; }
.brand strong { color: var(--gold); }
.main-nav { flex: 1; }
.main-nav ul, .lang-switch, .site-footer ul { list-style: none; margin: 0; padding: 0; }
.main-nav ul { display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
.main-nav a { color: var(--cream); text-decoration: none; font-size: .95rem; padding: .3rem .1rem; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.header-tools { display: flex; align-items: center; gap: .9rem; }
.lang-switch { display: flex; gap: .15rem; }
.lang-switch a { color: var(--cream); text-decoration: none; font-size: .82rem; padding: .15rem .45rem; border-radius: 6px; border: 1px solid rgba(244,233,216,.25); }
.lang-switch a[aria-current="true"] { background: var(--gold); color: var(--teal); border-color: var(--gold); font-weight: 700; }
.gh { color: var(--cream); font-size: .9rem; }

/* ---------- portada ---------- */
.hero { background: linear-gradient(160deg, var(--teal) 0%, var(--teal-2) 100%); color: var(--cream); padding: 4rem 0 4.5rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -180px; bottom: -260px; width: 620px; height: 620px; border-radius: 50%; border: 3px solid rgba(232,176,74,.12); box-shadow: 0 0 0 90px rgba(232,176,74,.03); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); margin: 0 0 .3rem; }
.hero .lead { font-size: 1.3rem; color: var(--gold); margin: 0 0 1rem; }
.hero p { max-width: 38rem; }
.hero-art { justify-self: center; width: min(320px, 70vw); }
.badge { display: inline-block; font-size: .82rem; padding: .2rem .65rem; border-radius: 99px; background: rgba(232,176,74,.16); color: var(--gold); margin-bottom: 1rem; }
.buttons { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 .8rem; }
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .75rem 1.25rem; border-radius: 10px; font-weight: 650; text-decoration: none; border: 2px solid var(--gold); }
.btn-primary { background: var(--gold); color: var(--teal); }
.btn-primary:hover { background: #F0C068; }
.btn-ghost { color: var(--cream); border-color: rgba(244,233,216,.45); }
.btn-ghost:hover { border-color: var(--cream); }
.section .btn-ghost { color: var(--text); border-color: var(--line); }
.small { font-size: .9rem; }
.hero .small a { color: var(--gold); }

.section { padding: 3.2rem 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section h2:first-child { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin-top: 1.6rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.3rem; box-shadow: var(--shadow); }
.section.alt .card { background: var(--bg); }
.card h3 { margin: .2rem 0 .4rem; font-size: 1.08rem; }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }
.card .ico { font-size: 1.5rem; }
.checks { padding-left: 1.2rem; }
.checks li { margin: .35rem 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.stat { border-left: 4px solid var(--gold); padding: .3rem 0 .3rem .9rem; }
.stat b { display: block; font-size: 1.5rem; }
.stat span { color: var(--muted); font-size: .92rem; }

/* ---------- páginas de texto ---------- */
.page-head { background: var(--teal); color: var(--cream); padding: 2.6rem 0 2.2rem; }
.page-head h1 { margin: 0 0 .4rem; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.page-head p { margin: 0; color: #CFD8DC; max-width: 46rem; }
.doc { padding: 2rem 0 3.5rem; }
.doc-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.toc { position: sticky; top: 88px; font-size: .92rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; max-height: calc(100vh - 110px); overflow: auto; }
.toc strong { display: block; margin-bottom: .4rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: .25rem 0; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--gold-dark); }
.prose { min-width: 0; }
.prose > h2 { scroll-margin-top: 84px; border-bottom: 2px solid var(--gold); padding-bottom: .25rem; }
.prose h3 { scroll-margin-top: 84px; }
.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: .9rem 1.1rem; margin: 1.2rem 0; }
.note.warn { border-left-color: #C0392B; }
.code-ref { font-size: .88rem; color: var(--muted); }

math[display="block"] { display: block; margin: 1.1rem 0; padding: .7rem .5rem; overflow-x: auto; overflow-y: hidden; font-size: 1.12em; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
math { font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", math; }

figure { margin: 1.6rem 0; }
figure svg { display: block; width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
figcaption { font-size: .9rem; color: var(--muted); margin-top: .5rem; }
.fig-text { fill: var(--text); font-family: var(--font); }
.fig-muted { fill: var(--muted); font-family: var(--font); }
.fig-line { stroke: var(--muted); }

table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .94rem; }
.table-wrap { overflow-x: auto; }
th, td { text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface); }
td code { white-space: nowrap; }

ol.refs li { margin: .55rem 0; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding-left: 2.8rem; margin: 1.1rem 0; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: .05rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--gold); color: var(--teal); font-weight: 700; display: grid; place-items: center; }
.download-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.download-box .btn-ghost { color: var(--text); border-color: var(--line); }
.hash { font-family: var(--mono); font-size: .82rem; word-break: break-all; }
.mv { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }

/* ---------- pie ---------- */
.site-footer { background: var(--teal); color: #CFD8DC; padding: 2.4rem 0 1.2rem; margin-top: 0; font-size: .93rem; }
.site-footer a { color: var(--cream); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; }
.footer-brand { font-size: 1.1rem; color: var(--cream); margin: 0 0 .3rem; }
.footer-brand strong { color: var(--gold); }
.site-footer li { margin: .2rem 0; }
.copyright { border-top: 1px solid rgba(244,233,216,.15); margin-top: 1.6rem; padding-top: 1rem; font-size: .85rem; }

@media (max-width: 900px) {
  .hero-grid, .doc-grid, .footer-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; width: 180px; }
  .toc { position: static; max-height: none; }
  .main-nav { order: 3; flex-basis: 100%; }
  .site-header { position: static; }
  .prose > h2, .prose h3 { scroll-margin-top: 12px; }
}
@media print {
  .site-header, .site-footer, .toc { display: none; }
  .doc-grid { display: block; }
}
