:root {
  color-scheme: dark;
  --bg: #0b0b0d;
  --surface: #151518;
  --surface-soft: #1b1b20;
  --line: #303036;
  --text: #f5f4ef;
  --muted: #adaab2;
  --accent: #ffe19a;
  --accent-text: #f9dda0;
  --accent-wash: #30271b;
  --circuit-gold: #a88d5c;
  --circuit-glow: #3a2e1e66;
  --monogram-gold: #e6cf9c;
  --frame-gold: #ad884f;
  --frame-glow: #f4c47640;
  --frame-glint: #e9c77b;
  --panel-sheen: #292321;
  --panel-shade: #121113;
  --panel-shadow: #0005;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3eb;
  --surface: #fffdfa;
  --surface-soft: #f4efe6;
  --line: #dcd2bf;
  --text: #25221d;
  --muted: #655f55;
  --accent: #795e2e;
  --accent-text: #684d20;
  --accent-wash: #eee3cb;
  --circuit-gold: #8a6d39;
  --circuit-glow: #d9b77535;
  --monogram-gold: #9a763b;
  --frame-gold: #ac915b;
  --frame-glow: #a88d5c3d;
  --frame-glint: #b18a43;
  --panel-sheen: #fffdf7;
  --panel-shade: #f3ede2;
  --panel-shadow: #50371512;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

:root:not([data-theme="light"]) body::before,
:root:not([data-theme="light"]) body::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: clamp(32rem, 67vw, 54rem);
  pointer-events: none;
}
:root:not([data-theme="light"]) body::before {
  z-index: -2;
  background-image:
    linear-gradient(180deg, #0b0b0d14 0%, #0b0b0d00 42%, var(--bg) 100%),
    url("/assets/design/grafito.webp");
  background-position: center, 64% 0;
  background-size: cover;
}
:root:not([data-theme="light"]) body::after {
  z-index: -1;
  background: linear-gradient(126deg, transparent 33%, #f6d79719 49%, transparent 65%) 100% 0 / 240% 100%;
  opacity: 0;
}

h1, h2, h3, p, dl, dd { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.shell { width: min(100% - 2rem, 65rem); margin-inline: auto; }
.skip-link { position: fixed; z-index: 2; left: 1rem; top: 1rem; transform: translateY(-200%); padding: .8rem; border-radius: .5rem; background: var(--surface); }
.skip-link:focus { transform: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding-block: 1.1rem; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: .65rem; align-items: center; text-decoration: none; font-size: 1.14rem; font-weight: 700; letter-spacing: -.035em; }
.brand img { border-radius: .65rem; border: 1px solid #aa925c66; }
.brand strong { color: var(--accent-text); }
.button-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--surface-soft);
  transition: background .18s, border-color .18s;
}
.button-icon:hover { background: var(--accent-wash); border-color: var(--accent); }
.theme { color: var(--accent-text); }

.hero {
  display: grid;
  align-items: center;
  padding-block: clamp(2.25rem, 5vw, 4.25rem) clamp(.65rem, 2.5vw, 1.75rem);
}
.eyebrow {
  display: inline-block;
  padding-inline-start: .72rem;
  border-inline-start: 1px solid var(--accent);
  color: var(--accent-text);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: .73rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.hero h1 { font-size: clamp(2.45rem, 7.4vw, 5rem); line-height: 1.01; margin-block: .85rem .9rem; font-weight: 680; letter-spacing: -.062em; }
.hero h1 span { display: block; color: var(--accent-text); }
.hero p { font-size: clamp(.96rem, 2vw, 1.125rem); color: var(--muted); }
.hero-circuit {
  display: block;
  justify-self: end;
  width: min(100%, 31rem);
  height: clamp(7rem, 34vw, 11rem);
  color: var(--circuit-gold);
  stroke-width: 1;
  background: radial-gradient(ellipse, var(--circuit-glow), transparent 68%);
}
.circuit-grid { opacity: .17; }
.circuit-branches { opacity: .52; }
.circuit-monogram { stroke: none; }
.monogram-posts { fill: var(--circuit-gold); }
.monogram-diagonals { fill: var(--monogram-gold); }
.circuit-nodes { fill: var(--bg); stroke: var(--circuit-gold); stroke-width: 1.35; }
.circuit-flow { opacity: 0; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 12 100; }

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-theme="light"]) body::after { animation: graphite-light 3.2s ease-out both; }
  .circuit-flow { animation: circuit-signal 3.6s ease-in-out .15s both; }
  .circuit-flow-branch { animation-duration: 2.8s; animation-delay: 1.5s; }
  .card:not(.optional) { animation: frame-light 1.8s ease-in-out .25s; }
  .card.compact:not(.optional) { animation-delay: .5s; }
  .card.compact:not(.optional) + .card.compact:not(.optional) { animation-delay: .75s; }
}
@keyframes graphite-light {
  0% { opacity: 0; background-position: 100% 0; }
  38% { opacity: .85; }
  100% { opacity: 0; background-position: 0 0; }
}
@keyframes circuit-signal {
  0% { opacity: 0; stroke-dashoffset: 12; }
  15%, 82% { opacity: 1; }
  100% { opacity: 0; stroke-dashoffset: -100; }
}
@keyframes frame-light {
  45% {
    border-color: var(--accent);
    box-shadow: 0 0 24px var(--frame-glow), inset 0 0 14px var(--frame-glow);
  }
}

.notice { display: flex; gap: .65rem; align-items: center; background: var(--accent-wash); color: var(--accent-text); border: 1px solid var(--line); border-radius: .75rem; padding: .8rem .95rem; font-size: .86rem; }
.notice span { width: .45rem; height: .45rem; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }
.methods { padding-block: 1.65rem 3.4rem; }
.methods > h2 { margin-block-end: .8rem; font-size: 1.18rem; letter-spacing: -.025em; }
.grid { display: grid; gap: .85rem; }
.card {
  min-width: 0;
  padding: clamp(1rem, 2.7vw, 1.65rem);
  border: 1px solid transparent;
  border-radius: .65rem;
  background:
    linear-gradient(136deg, var(--panel-sheen), var(--surface) 50%, var(--panel-shade)) padding-box,
    linear-gradient(122deg, var(--frame-glint), var(--frame-gold) 34%, var(--line) 75%, var(--frame-gold)) border-box;
  box-shadow: 0 12px 28px var(--panel-shadow);
}
.transfer { --panel-sheen: #302822; }
:root[data-theme="light"] .transfer { --panel-sheen: #fffaf0; }
.card-heading { display: flex; align-items: center; gap: .8rem; }
.method-icon { display: grid; flex: 0 0 auto; place-items: center; width: 29px; height: 34px; color: var(--accent-text); }
.card h3 { font-size: 1.07rem; line-height: 1.2; letter-spacing: -.02em; }
.card-heading p { color: var(--muted); font-size: .86rem; margin-top: .26rem; }
.fields { margin-top: .95rem; }
.field { display: grid; min-height: 3.7rem; align-items: center; grid-template-columns: minmax(4.65rem, .9fr) minmax(0, 2fr); gap: .45rem; border-bottom: 1px solid var(--line); }
.field dt { color: var(--muted); font-size: .79rem; overflow-wrap: anywhere; }
.field dd { display: flex; align-items: center; justify-content: flex-end; text-align: right; gap: .32rem; font-size: .9rem; min-width: 0; }
.field input { min-width: 0; width: 100%; text-align: right; padding: .35rem .1rem; border: 0; border-radius: .2rem; background: transparent; color: var(--text); }
.digits { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: clamp(.72rem, 2.55vw, .94rem); letter-spacing: -.015em; }
.copy { background: transparent; border-color: transparent; color: var(--accent-text); }
.copy-status { min-height: 1.25em; margin-top: .75rem; color: var(--accent-text); font-size: .81rem; }
.availability { color: var(--muted); font-size: .83rem; margin-top: .85rem; }
.qr-disclosure { margin-top: .85rem; }
.qr-disclosure summary { display: inline-flex; cursor: pointer; color: var(--accent-text); list-style: none; }
.qr-disclosure summary::-webkit-details-marker { display: none; }
.qr-disclosure summary::after { content: ""; width: .45rem; height: .45rem; margin-inline: .25rem; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.qr-disclosure[open] summary::after { transform: translateY(2px) rotate(225deg); }
.qr-content { display: grid; gap: 1rem; margin-top: .85rem; }
.qr-frame { width: min(100%, 15rem); margin-inline: auto; padding: .5rem; border-radius: .2rem; background: white; }
.qr-frame img {
  width: 100%;
  height: auto;
  /* La barra de la captura ocupa el último 1.6%, fuera de los módulos del código. */
  clip-path: inset(0 1.6% 0 0);
}
.qr-guide, .qr-reminders { display: grid; gap: 1rem; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.qr-guide h4 { margin: 0 0 .3rem; font-size: .9rem; color: var(--text); }
.qr-guide ol { display: grid; gap: .3rem; margin: 0; padding-inline-start: 1.25rem; }
.qr-guide strong { color: var(--text); }
.qr-guide section + section, .qr-reminders { padding-top: .85rem; border-top: 1px solid var(--line); }
.qr-guide p { margin-top: .4rem; }
.qr-reminders { gap: .45rem; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.action { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); text-decoration: none; font-size: .86rem; font-weight: 650; transition: border-color .18s, background .18s; }
.action:hover { border-color: var(--accent); background: var(--accent-wash); }
.primary { color: var(--accent-text); }
.card > .action { margin-top: .85rem; }
.services {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  padding: .2rem 0 .2rem .8rem;
  margin-bottom: .85rem;
  border-inline-start: 1px solid var(--frame-gold);
}
.services-copy h2 { font-size: .9rem; font-weight: 600; line-height: 1.3; color: var(--text); }
.services-link { color: var(--accent-text); border-color: transparent; background: transparent; padding-inline: .55rem; font-size: .78rem; }
.services-link svg { width: 17px; height: 17px; flex: 0 0 auto; fill: currentColor; stroke: none; }
.services-note { margin-top: .2rem; font-size: .72rem; }
@media (prefers-reduced-motion: no-preference) {
  .services-link:is(:hover, :focus-visible) svg { animation: whatsapp-nudge .38s ease-out; }
}
@keyframes whatsapp-nudge {
  45% { transform: translateY(-2px) scale(1.12); }
}
.footer { padding-block: .85rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.footer-credit { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .35rem 1rem; }
.footer strong { color: var(--accent-text); font-weight: 600; }

dialog { width: min(100% - 1.5rem, 37rem); max-height: calc(100% - 1.5rem); padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); color: var(--text); }
dialog::backdrop { background: #000b; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.dialog-heading h2 { font-size: 1.15rem; }
.dialog-heading button { font-size: 1.45rem; }
#qr-dialog .qr-frame { width: min(100%, 32rem, 68vh); }

@media (max-width: 25rem) {
  .field { grid-template-columns: 4.45rem minmax(0, 1fr); gap: .25rem; }
  .field input:not(.digits) { font-size: .82rem; text-overflow: ellipsis; }
}
@media (min-width: 44rem) {
  .shell { width: min(100% - 4rem, 65rem); }
  .hero { grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); gap: 1rem; padding-block-end: clamp(2rem, 5vw, 4rem); }
  .hero-circuit { height: auto; }
  .grid { grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); }
  .transfer { grid-row: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
