/* CdeA · carlosdeanta.net — misma paleta que las webs docentes */
:root {
  --navy: #052A64;
  --navy2: #113F86;
  --navy-deep: #031a40;
  --gold: #DBB246;
  --gold-dark: #9A7A1E;
  --gold-soft: #F7EDD2;
  --ink: #1B2430;
  --ink2: #5B6470;
  --line: #E2E6EB;
  --soft: #F4F6F9;
  --paper: #FFFFFF;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; font-family: var(--sans); font-size: 18px; line-height: 1.65; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--navy2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .6em; color: var(--gold-dark); }
p { margin: 0 0 1em; }

.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: .9rem; display: flex; align-items: center; gap: .7rem; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--gold); }
.intro { max-width: 68ch; color: var(--ink2); font-size: 1.1rem; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--navy); white-space: nowrap; }
.menu { display: flex; align-items: center; gap: 1.6rem; }
.menu a { text-decoration: none; font-size: .95rem; color: var(--ink); font-weight: 500; }
.menu a:hover { color: var(--gold-dark); }
.menu .menu-cta { border: 1px solid var(--navy); padding: .45rem 1.1rem; border-radius: var(--radius); color: var(--navy); }
.menu .menu-cta:hover { background: var(--navy); color: #fff; }
.nav-right { display: flex; align-items: center; gap: 1.2rem; }
.lang { position: relative; }
.lang summary { list-style: none; display: flex; align-items: center; gap: .45rem; cursor: pointer; font-size: .82rem; font-weight: 600; letter-spacing: .06em; color: var(--navy); padding: .35rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); user-select: none; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: .1rem; }
.lang summary:hover, .lang[open] summary { border-color: var(--gold); }
.lang img { outline: 1px solid var(--line); }
.lang-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px; background: #fff; border: 1px solid var(--line); border-top: 2px solid var(--gold); box-shadow: 0 10px 30px rgba(5,42,100,.12); padding: .4rem 0; z-index: 20; }
.lang-list a { display: flex; align-items: center; gap: .7rem; padding: .5rem 1rem; text-decoration: none; color: var(--ink); font-size: .95rem; }
.lang-list a:hover { background: var(--soft); color: var(--navy); }
.lang-list a[aria-current="true"] { font-weight: 600; color: var(--navy); background: var(--gold-soft); }
.menu-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); margin: 5px 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem 1.6rem; border-radius: var(--radius); text-decoration: none; font-weight: 600; font-size: .98rem; transition: background .2s, color .2s; }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: #e6c46b; }
.btn-ghost { border: 1px solid var(--navy); color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }

/* Hero */
.hero { padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem); background: linear-gradient(180deg, var(--soft), var(--paper)); }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.lead { font-size: 1.2rem; color: var(--ink2); max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 2rem 0 2.8rem; }
.stats { list-style: none; padding: 1.6rem 0 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; border-top: 1px solid var(--line); }
.stats strong { display: block; font-family: var(--serif); font-size: 1.9rem; color: var(--navy); line-height: 1.1; }
.stats span { font-size: .85rem; color: var(--ink2); line-height: 1.35; display: block; }
.hero-photo { margin: 0; position: relative; isolation: isolate; }
.hero-photo::before { content: ""; position: absolute; inset: 22px 22px -22px -22px; border: 1px solid var(--gold); z-index: -1; }
.hero-photo img { aspect-ratio: 4 / 5; max-height: min(620px, 74vh); object-fit: cover; object-position: center 30%; width: 100%; height: auto; }

/* Sections */
.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section-tint { background: var(--soft); }
.section-navy { background: var(--navy); color: #dbe3f1; }
.section-navy h2, .section-navy h3, .section-navy strong { color: #fff; }
.section-navy h4, .section-navy .eyebrow { color: var(--gold); }
.two-col { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.prose p:first-child { font-size: 1.18rem; color: var(--navy); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 2.5rem; }
.card { background: #fff; padding: 2rem 1.8rem; }
.card h3 { font-size: 1.45rem; position: relative; padding-top: 1rem; }
.card h3::before { content: ""; position: absolute; top: 0; left: 0; width: 32px; height: 2px; background: var(--gold); }
.card p { color: var(--ink2); font-size: .98rem; margin: 0; }

.chips { list-style: none; padding: 0; margin: 2rem 0 3rem; display: flex; flex-wrap: wrap; gap: .6rem; }
.chips li { border: 1px solid var(--navy); color: var(--navy); padding: .45rem 1rem; border-radius: 999px; font-size: .92rem; font-weight: 500; background: #fff; }

.feature { display: grid; grid-template-columns: auto 1fr; gap: 2rem; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 2.2rem; }
.feature-mark { font-family: var(--serif); font-size: 2.6rem; color: var(--gold-dark); line-height: 1; }
.feature p { margin: 0; color: var(--ink2); }

/* Docencia */
.side-photo { margin: 0; }
.side-photo img { aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; width: 100%; height: auto; }
.teach { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; padding-top: 1.8rem; border-top: 1px solid rgba(255,255,255,.15); }
.teach ul, .plain { list-style: none; padding: 0; margin: 0; }
.teach li, .plain li { padding: .3rem 0; font-size: .98rem; }
.mt { margin-top: 2rem; }

/* Infraestructura docente */
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2.5rem 0 3.5rem; }
.stack div { background: #fff; border: 1px solid var(--line); padding: 1.3rem 1.2rem; }
.stack strong { display: block; font-family: var(--serif); font-size: 1.3rem; color: var(--navy); line-height: 1.2; margin-bottom: .3rem; }
.stack span { font-size: .9rem; color: var(--ink2); line-height: 1.45; display: block; }
.sub { font-family: var(--serif); font-size: 1.8rem; margin: 0 0 1.2rem; }
.courses { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem; margin-bottom: 3.5rem; }
.course { display: flex; flex-direction: column; background: var(--navy); color: #dbe3f1; padding: 2rem 1.8rem; text-decoration: none; border-top: 3px solid var(--gold); transition: transform .2s, background .2s; }
.course:hover { background: var(--navy2); transform: translateY(-3px); }
.course h3 { color: #fff; font-size: 1.6rem; margin-bottom: .2rem; }
.course .alt { font-size: .9rem; color: var(--gold); margin-bottom: 1rem; }
.course p { font-size: .95rem; margin: 0 0 1.4rem; flex: 1; }
.course .go { font-size: .85rem; font-weight: 600; color: var(--gold); letter-spacing: .04em; overflow-wrap: anywhere; }
.course.soon { background: var(--navy2); cursor: default; }
.course.soon:hover { transform: none; }
.soon-tag { display: inline-block; margin-top: .3rem; padding: .1rem .6rem; border-radius: 999px; background: var(--gold); color: var(--navy-deep); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.tool { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); padding: 2rem 1.8rem; text-decoration: none; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.tool:hover { border-color: var(--gold); box-shadow: 0 8px 24px rgba(5,42,100,.08); }
.tool-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; margin-bottom: 1.2rem; }
.tool h3 { font-size: 1.55rem; margin-bottom: .1rem; }
.tool .url { font-size: .82rem; color: var(--gold-dark); margin-bottom: 1rem; }
.tool p { font-size: .95rem; color: var(--ink2); margin: 0 0 1rem; flex: 1; }
.tag { align-self: flex-start; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .25rem .7rem; border-radius: 999px; background: var(--gold-soft); color: #6B5314; }
.tag.lock { background: var(--soft); color: var(--navy); border: 1px solid var(--line); }

/* Publicaciones */
.books { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.1rem; margin-top: 2.5rem; }
.book { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 260px; background: var(--navy); color: #fff; padding: 1.8rem 1.3rem 1.3rem 1.6rem; text-decoration: none; box-shadow: inset 7px 0 0 var(--navy-deep); transition: transform .2s; }
.book:hover { transform: translateY(-4px); }
.book::after { content: ""; position: absolute; top: 0; right: 1.2rem; width: 12px; height: 32px; background: var(--gold); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.book h3 { color: #fff; font-size: 1.35rem; margin: 0 1.2rem .6rem 0; }
.book small { display: block; color: var(--gold); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; margin-bottom: .7rem; }
.book span { font-size: .82rem; color: #b9c6de; }
.book.featured { background: var(--gold); box-shadow: inset 7px 0 0 var(--gold-dark); }
.book.featured::after { background: var(--navy); }
.book.featured h3 { color: var(--navy-deep); }
.book.featured small { color: var(--navy); }
.book.featured span { color: #4a3b10; }
.more { margin-top: 2rem; }

/* Credenciales */
.creds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin-top: 1rem; }
.creds div { border-top: 2px solid var(--navy); padding-top: 1rem; }
.creds strong { display: block; color: var(--navy); font-size: 1.02rem; line-height: 1.3; }
.creds span { font-size: .9rem; color: var(--ink2); }

/* Contacto */
.contact-card { font-style: normal; display: flex; flex-direction: column; gap: .2rem; background: #fff; border: 1px solid var(--line); padding: 2.2rem; }
.contact-card strong { font-family: var(--serif); font-size: 1.6rem; color: var(--navy); margin-bottom: .4rem; }
.contact-card hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 1rem 0; }
.contact-card a { text-decoration: none; }
.contact-card a:hover { color: var(--gold-dark); }
.contact-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.site-footer { background: var(--navy-deep); color: #a9b6cf; padding: 2.2rem 0; font-size: .88rem; }
.footer-grid { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.footer-grid p { margin: 0; flex: 1; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-links a { color: #d6deec; text-decoration: none; }
.footer-links a:hover { color: var(--gold); }

/* Responsive */
@media (max-width: 1080px) {
  .books { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1000px) {
  .menu-toggle { display: block; }
  .menu { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--line); display: none; padding: .5rem 16px 1rem; }
  .menu.open { display: flex; }
  .menu a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .menu .menu-cta { margin-top: .8rem; text-align: center; border-bottom: 1px solid var(--navy); }
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .hero-photo { max-width: 380px; margin-left: 22px; }
  .cards, .courses, .tools, .stack, .creds { grid-template-columns: 1fr 1fr; }
  .side-photo { max-width: 360px; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .brand { font-size: 1.2rem; }
  .cards, .courses, .tools, .creds, .teach, .stack { grid-template-columns: 1fr; }
  .books { grid-template-columns: 1fr 1fr; }
  .book { min-height: 210px; }
  .stats { grid-template-columns: 1fr; gap: 1rem; }
  .hero-photo { max-width: 300px; }
  .feature { grid-template-columns: 1fr; gap: 1rem; padding: 1.6rem; }
  .footer-grid { flex-direction: column; text-align: center; }
}
