/* =========================================================
   razonamientomatematico.com · Mates Ágil
   HTML5 + CSS3 · sin dependencias
   ========================================================= */

:root {
  --ink: #14213D;
  --ink-2: #26365C;
  --paper: #FFFDF7;
  --tint: #F3F6FF;
  --line: #E2E7F3;
  --muted: #5B6478;
  --coral: #FF6B4A;
  --coral-d: #E5502F;
  --sun: #FFC94A;
  --teal: #1FB5A3;
  --violet: #6C5CE7;
  --sky: #3FA7F5;

  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 10px 30px -12px rgba(20, 33, 61, .25);
  --shadow-lg: 0 30px 60px -20px rgba(20, 33, 61, .35);

  --f-head: "Bricolage Grotesque", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--coral-d); }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(820px, 100% - 2.5rem); }
.center { text-align: center; margin-top: 2.5rem; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--coral-d);
  margin-bottom: .9rem;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .95rem 1.6rem;
  font-family: var(--f-body); font-weight: 600; font-size: 1rem;
  border-radius: 999px; text-decoration: none;
  border: 2px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 10px 24px -10px var(--coral); }
.btn-primary:hover { background: var(--coral-d); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { box-shadow: var(--shadow); }
.btn-ghost-light { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); }
.btn-small { padding: .6rem 1.1rem; font-size: .92rem; background: var(--ink); color: #fff !important; }
.btn-small:hover { background: var(--coral); }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 247, .85);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 1rem; }
.brand a { display: inline-flex; }
.brand img { height: 38px; width: auto; }
.brand-sep { width: 1px; height: 30px; background: var(--line); }
@media (max-width: 1180px) and (min-width: 1041px) {
  .brand img { height: 32px; }
  .main-nav ul { gap: 1.1rem; }
}
@media (max-width: 560px) {
  .brand { gap: .55rem; }
  .brand img { height: 24px; }
  .brand-sep { height: 20px; }
}

.main-nav ul { list-style: none; display: flex; align-items: center; gap: 1.6rem; margin: 0; padding: 0; }
.main-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .97rem; white-space: nowrap; }
.main-nav a:not(.btn):hover { color: var(--coral-d); }

.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(3.5rem, 7vw, 6rem);
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 110% -10%, rgba(255, 201, 74, .35), transparent 60%),
    radial-gradient(40rem 30rem at -10% 110%, rgba(31, 181, 163, .18), transparent 60%),
    var(--paper);
}
/* papel cuadriculado */
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 85%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 85%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.highlight {
  background: linear-gradient(transparent 62%, var(--sun) 62%, var(--sun) 92%, transparent 92%);
  padding: 0 .1em;
}
.lead { font-size: clamp(1.08rem, 1.6vw, 1.25rem); color: var(--ink-2); max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin: 1.8rem 0 1.6rem; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; margin: 0; }
.hero-badges li {
  font-size: .88rem; font-weight: 500;
  padding: .4rem .85rem; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
}
.hero-badges li::before { content: "✓ "; color: var(--teal); font-weight: 700; }

/* Pizarra ilustrada */
.hero-visual { position: relative; min-height: 420px; display: grid; place-items: center; }
.board {
  position: relative;
  width: min(420px, 100%);
  padding: 2rem;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: rotate(-3deg);
  animation: bob 6s ease-in-out infinite;
}
.board-row { display: flex; align-items: center; justify-content: center; gap: .6rem; font-family: var(--f-head); font-weight: 800; font-size: 2.2rem; }
.board-row.small { font-size: 1.4rem; gap: 1rem; color: var(--muted); margin-top: 1.4rem; }
.op { color: var(--muted); }
.chip { display: inline-grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 16px; color: #fff; }
.board-row.small .chip { width: 2.6rem; height: 2.6rem; border-radius: 12px; font-size: 1.2rem; }
.c1 { background: var(--sky); }
.c2 { background: var(--coral); animation: pulse 2.4s ease-in-out infinite; }
.c3 { background: var(--teal); }
.c4 { background: var(--violet); }
.board-note {
  margin: 1.2rem auto 0; width: max-content; max-width: 100%;
  font-size: .95rem; font-weight: 600;
  background: var(--sun); padding: .45rem .9rem; border-radius: 12px 12px 12px 2px;
}
.shapes { display: flex; justify-content: center; gap: 1.2rem; margin-top: 1.4rem; }
.shape { width: 46px; height: 46px; }
.sq { background: var(--violet); border-radius: 10px; transform: rotate(12deg); }
.ci { background: var(--sun); border-radius: 50%; }
.tr { width: 0; height: 0; border-left: 26px solid transparent; border-right: 26px solid transparent; border-bottom: 46px solid var(--teal); }

.float {
  position: absolute; font-family: var(--f-head); font-weight: 800;
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px;
  background: #fff; box-shadow: var(--shadow); font-size: 1.8rem;
  animation: bob 7s ease-in-out infinite;
}
.f1 { top: 4%; left: 6%; color: var(--coral); animation-delay: -1s; }
.f2 { top: 10%; right: 2%; color: var(--violet); animation-delay: -3s; }
.f3 { bottom: 8%; left: 0; color: var(--teal); animation-delay: -2s; }
.f4 { bottom: 2%; right: 10%; color: var(--sky); animation-delay: -4s; }

@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes pulse { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }

/* ---------- Secciones ---------- */
.section { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.section-tint { background: var(--tint); }
.section-head { max-width: 760px; margin: 0 auto 3rem; text-align: center; }
.section-head p:last-child { color: var(--muted); }

.two-col { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); }

/* Resumen + ficha */
.section-summary { padding-top: clamp(3rem, 6vw, 4.5rem); }
.summary-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.ai-summary {
  background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--teal);
  border-radius: var(--radius-lg); padding: clamp(1.6rem, 4vw, 2.6rem);
}
.ai-summary p { color: var(--ink-2); }
.ai-summary p:last-child { margin-bottom: 0; }
.facts table, .compare {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font-size: .95rem;
}
.facts caption, .compare caption {
  caption-side: top; text-align: left; font-family: var(--f-head); font-weight: 700; font-size: 1.15rem;
  padding: 0 0 .8rem;
}
.facts th, .facts td, .compare th, .compare td { padding: .7rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.facts tr:last-child th, .facts tr:last-child td, .compare tr:last-child td { border-bottom: 0; }
.facts th { width: 34%; font-weight: 600; color: var(--muted); background: var(--tint); }
.facts a { color: var(--ink); }
.compare { margin-top: 1.6rem; }
.compare thead th { background: var(--ink); color: #fff; font-weight: 600; }
.compare thead th:last-child { background: var(--teal); }
.compare td:first-child { color: var(--muted); }
.compare td:last-child { font-weight: 500; }

/* Estrategias */
.tips { list-style: none; counter-reset: tip; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.tips li {
  counter-increment: tip; position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.6rem 1.4rem 4.6rem;
}
.tips li::before {
  content: counter(tip); position: absolute; left: 1.4rem; top: 1.5rem;
  display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 12px;
  background: var(--sun); font-family: var(--f-head); font-weight: 800;
}
.tips h3 { font-size: 1.08rem; margin-bottom: .35rem; }
.tips p { color: var(--muted); font-size: .96rem; margin: 0; }

/* Tarjetas método */
.cards-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; }
.card {
  background: #fff; border-radius: var(--radius); padding: 1.8rem;
  border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card p { color: var(--muted); font-size: .98rem; margin: 0; }
.card-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  font-family: var(--f-head); font-weight: 800; font-size: 1.4rem; color: #fff; margin-bottom: 1.2rem;
}
.i1 { background: var(--coral); }
.i2 { background: var(--teal); }
.i3 { background: var(--violet); font-size: 1.1rem; }
.i4 { background: var(--sun); color: var(--ink); font-size: 1.9rem; }

/* Pasos */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; counter-reset: none; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 28px; left: 8%; right: 8%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 18px);
}
.steps li { position: relative; text-align: center; padding: 0 .5rem; }
.steps p { color: var(--muted); font-size: .98rem; }
.step-n {
  position: relative; display: inline-grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--ink); color: #fff; font-family: var(--f-head); font-weight: 800; font-size: 1.3rem;
  margin-bottom: 1rem; box-shadow: 0 0 0 8px var(--paper);
}

/* Cursos */
.section-dark { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.section-dark::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image:
    linear-gradient(#fff 1px, transparent 1px),
    linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 32px 32px;
}
.section-dark .container { position: relative; }
.section-dark .eyebrow { color: var(--sun); }
.section-dark .section-head p:last-child { color: rgba(255,255,255,.75); }

.courses { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.2rem; }
.course {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius); padding: 1.1rem 1.1rem 1.3rem;
  transition: transform .25s ease, background-color .25s ease;
}
.course:hover { transform: translateY(-6px); background: rgba(255,255,255,.1); }
.course h3 { font-size: 1.02rem; margin: 1rem 0 .4rem; }
.isbn { font-size: .78rem; color: rgba(255,255,255,.7); margin: 0 0 .2rem; }
.cover {
  aspect-ratio: 3 / 4; border-radius: 12px;
  display: grid; place-items: center; position: relative; overflow: hidden;
  font-family: var(--f-head); font-weight: 800; font-size: 2.6rem; color: #fff;
  box-shadow: 0 18px 30px -16px rgba(0,0,0,.6);
}
.cover::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 14px 14px;
}
.cover::after {
  content: "Mates Ágil"; position: absolute; bottom: 10px; left: 0; right: 0; text-align: center;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; font-family: var(--f-body); font-weight: 600;
}
.cover span { position: relative; }
.k1 .cover { background: var(--coral); }
.k2 .cover { background: var(--sun); color: var(--ink); }
.k2 .cover::after { color: var(--ink); }
.k3 .cover { background: var(--teal); }
.k4 .cover { background: var(--sky); }
.k5 .cover { background: var(--violet); }
.k6 .cover { background: #E84393; }

/* Vídeos */
.videos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem 1.4rem; }
.video-card h3 { font-size: 1.02rem; margin: .9rem 0 .1rem; }
.video-meta { font-size: .88rem; color: var(--muted); margin: 0; }
.video-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-link {
  position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none;
  background-image:
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 22px 22px;
}
.video-frame.k1 { background: var(--coral); }
.video-frame.k2 { background: var(--sun); }
.video-frame.k3 { background: var(--teal); }
.video-frame.k4 { background: var(--sky); }
.video-frame.k5 { background: var(--violet); }
.video-frame.k6 { background: #E84393; }
.play {
  width: 72px; height: 72px; border-radius: 50%; background: #fff; position: relative;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.45);
  transition: transform .25s ease;
}
.play::after {
  content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
  border-left: 22px solid var(--ink); border-top: 14px solid transparent; border-bottom: 14px solid transparent;
}
.video-link:hover .play { transform: scale(1.1); }
.video-course {
  position: absolute; left: 1rem; bottom: .6rem;
  font-family: var(--f-head); font-weight: 800; font-size: 2.2rem; color: #fff; line-height: 1;
}
.k2 .video-course { color: var(--ink); }

/* Recursos */
.resources { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.resource {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 4vw, 2.8rem);
}
.resource > p { color: var(--muted); }
.resource-accent { background: linear-gradient(140deg, #FFF4D6, #FFE7E0); border-color: transparent; }
.checklist { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .7rem; }
.checklist li { position: relative; padding-left: 2rem; font-weight: 500; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: .1rem;
  display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--teal); color: #fff; font-size: .75rem; font-weight: 700;
}

/* FAQ */
.faq { display: grid; gap: .9rem; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.4rem; transition: box-shadow .2s ease;
}
.faq details[open] { box-shadow: var(--shadow); }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 600; font-size: 1.05rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%; background: var(--tint);
  font-size: 1.3rem; font-weight: 500; transition: transform .25s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--sun); }
.faq details p { margin: .9rem 0 0; color: var(--ink-2); }

/* CTA */
.cta { padding-top: 0; }
.cta-box {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center;
  background: linear-gradient(130deg, var(--coral) 0%, #FF8A5B 45%, var(--violet) 120%);
  color: #fff; border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3.5rem);
  box-shadow: var(--shadow-lg);
}
.cta-box h2 { margin-bottom: .4rem; }
.cta-box p { margin: 0; opacity: .92; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-end; }
.cta-actions .btn-primary { background: var(--ink); box-shadow: none; }
.cta-actions .btn-primary:hover { background: #000; }

/* ---------- Pie ---------- */
.site-footer { background: #0E1830; color: rgba(255,255,255,.78); padding: 4rem 0 1.5rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 1.6rem; margin-bottom: 1.4rem; }
.footer-logos a { display: inline-flex; opacity: .95; transition: opacity .2s ease; }
.footer-logos a:hover { opacity: 1; }
.footer-logos img { height: 36px; width: auto; }
.footer-title { font-family: var(--f-body); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 1rem; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.site-footer a { color: rgba(255,255,255,.85); text-decoration: none; }
.site-footer a:hover { color: var(--sun); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .85rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom ul { list-style: none; display: flex; gap: 1.2rem; margin: 0; padding: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .courses { grid-template-columns: repeat(3, 1fr); }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .videos, .tips { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  .hero-grid, .two-col, .resources, .cta-box, .summary-grid { grid-template-columns: 1fr; }
  .hero-visual { min-height: 340px; }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
  .steps::before { display: none; }
  .cta-actions { justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }

}

@media (max-width: 560px) {
  .container, .narrow { width: calc(100% - 2rem); }
  .courses { grid-template-columns: repeat(2, 1fr); }
  .cards-4, .steps, .videos, .tips { grid-template-columns: 1fr; }
  .facts th, .facts td, .compare th, .compare td { padding: .6rem .7rem; }
  .float { width: 48px; height: 48px; font-size: 1.3rem; border-radius: 14px; }
  .board { padding: 1.4rem; }
  .chip { width: 3rem; height: 3rem; }
  .board-row { font-size: 1.7rem; }
  .hero-cta .btn { flex: 1 1 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Menú hamburguesa en tablet y móvil */
@media (max-width: 1040px) {
  /* Menú móvil (CSS puro) */
  .nav-toggle-label {
    display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; border-radius: 12px;
  }
  .nav-toggle-label span,
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; position: relative;
    transition: transform .25s ease, background-color .25s ease;
  }
  .nav-toggle-label span::before, .nav-toggle-label span::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-label span::before { top: -7px; }
  .nav-toggle-label span::after { top: 7px; }
  .nav-toggle:checked + .nav-toggle-label span { background: transparent; }
  .nav-toggle:checked + .nav-toggle-label span::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked + .nav-toggle-label span::after { transform: translateY(-7px) rotate(-45deg); }

  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav-toggle:checked ~ .main-nav { max-height: 420px; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1.25rem 1.25rem; }
  .main-nav li a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .main-nav li:last-child a { margin-top: 1rem; border: 0; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
