@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("assets/chakra-petch-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("assets/chakra-petch-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("assets/instrument-serif.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #100e1d;
  --card: #1c192e;
  --ink: #f3edf8;
  --night: #171325;
  --muted: #bbb0cb;
  --line: #514363;
  --control-line: #8d75a4;
  --gold: #ffd28c;
  --plum: #c4a2eb;
  --accent-fill: #6d4c8a;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --display: "Chakra Petch", "DM Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.58 var(--sans); }
main { display: grid; flex: 1; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #b576d9; outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font: 700 clamp(2.4rem, 4.3vw, 4.05rem)/1.05 var(--display); letter-spacing: -.035em; text-wrap: balance; }
h1 em { color: var(--plum); font-style: normal; }
.wrap { width: min(1216px, calc(100% - 104px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 12px; left: 12px; z-index: 5; background: var(--card); padding: 10px; }
svg { display: block; }

.step-icon svg, .empty-icon svg { width: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hero { min-height: max(480px, 100vh); min-height: max(480px, 100svh); isolation: isolate; position: relative; display: flex; align-items: center; background: #151225; color: #fff9ee; overflow: hidden; }
.hero-image, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-image { z-index: -2; object-fit: cover; object-position: center 62%; }
.hero-shade { z-index: -1; background: linear-gradient(180deg, #0d0a18a0, transparent 27%), linear-gradient(90deg, #100d20a1, #100d2020 41%, transparent 64%); }
.hero-content { padding-block: 84px 58px; }
.hero h1 { font: 700 clamp(4.3rem, 8vw, 9.3rem)/.96 var(--display); letter-spacing: -.046em; }
.hero-tagline { font: 500 clamp(1.55rem, 2.8vw, 2.7rem)/1.12 var(--display); color: var(--gold); margin: 12px 0 30px; }
.hero .button { font: 700 1.07rem/1 var(--display); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 21px; border: 1px solid transparent; border-radius: 4px; text-decoration: none; font-size: .94rem; font-weight: 700; text-align: center; line-height: 1.25; transition: background-color .18s, color .18s; }
.button-gold { background: var(--gold); color: #271b20; padding-inline: 27px; }
.button-gold:hover { background: #ffe6bc; }
.hero-store { min-width: 142px; }
.map-access { width: min(400px, 100%); margin-top: 25px; padding-top: 20px; border-top: 1px solid #ffd28c45; }
.map-access h2 { font: 700 1.35rem/1.2 var(--display); letter-spacing: -.015em; margin-bottom: 15px; }
.map-access label { display: block; margin-bottom: 7px; font-size: .875rem; color: #f6e9d7; }
.access-code-row { display: flex; align-items: stretch; gap: 8px; }
.access-code-row input { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #d9c4ba80; border-radius: 4px; background: #171325e8; color: #fff9ee; font: 500 1rem/1.3 var(--sans); padding: 11px 13px; }
.access-code-row input::placeholder { color: #d6c8d3; opacity: 1; }
.access-code-row input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-color: var(--gold); }
.access-code-row input[aria-invalid="true"] { border-color: #ffb3a2; }
.hero .button-access { flex: none; min-height: 48px; padding-inline: 19px; border-color: #ffd28c90; background: #392b3be8; color: var(--gold); }
.button-access:hover { background: #594153; border-color: var(--gold); }
.access-hint, .access-message { font: 400 .875rem/1.45 var(--sans); }
.access-hint { color: #d6c8d3; margin-top: 10px; }
.access-hint code { font: inherit; color: #ffdcab; white-space: nowrap; }
.access-message:not(:empty) { color: #ffbfae; margin-top: 9px; }
.access-message[data-state="success"] { color: #b5e4c3; }
.button-dark { background: var(--accent-fill); color: #fff; border-color: var(--control-line); }
.button-dark:hover { background: #805ba0; }
.button-outline { border-color: var(--control-line); background: transparent; }
.button-outline:hover { background: #30263f; border-color: #b28dd2; }
.button:disabled { opacity: .54; cursor: default; }
.text-link { font-weight: 700; color: var(--plum); text-underline-offset: 5px; }
.text-link:hover { color: #e4c7ff; }

.about { padding-block: clamp(62px, 8vw, 116px); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(44px, 9vw, 140px); }
.eyebrow { font-size: .83rem; color: var(--plum); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 14px; }
.about-intro > p:not(.eyebrow) { color: var(--muted); max-width: 43ch; margin-block: 24px 20px; }
.how-list { list-style: none; margin: 0; padding: 0; }
.how-list li { display: flex; gap: 17px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.how-list li:last-child { border: 0; }
.how-list h2 { font: 700 1.05rem/1.4 var(--sans); letter-spacing: normal; margin-bottom: 4px; }
.how-list p { color: var(--muted); }
.step-icon, .empty-icon { display: grid; place-content: center; flex: none; background: #30233e; color: var(--plum); width: 45px; height: 45px; border-radius: 6px; }

.catalog { background: radial-gradient(ellipse at 12% 0, #35204460, transparent 65%), var(--paper); padding-block: 28px clamp(55px, 7vw, 86px); }
.section-back { margin-bottom: 32px; }
.back-button { color: #e1c6fb; background: #211a31; padding-inline: 20px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head h1 { font-size: clamp(2.35rem, 4.1vw, 3.8rem); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { min-height: 44px; border: 1px solid var(--control-line); border-radius: 4px; padding: 5px 12px; background: #1b1629; font-size: .88rem; }
.filters button:hover { border-color: var(--plum); }
.filters [aria-pressed="true"] { background: var(--accent-fill); color: white; border-color: #b98de0; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.product { display: flex; flex-direction: column; background: var(--card); border: 1px solid #443650; border-radius: 7px; overflow: hidden; box-shadow: 0 10px 24px #08061024; }
.product-body { display: flex; flex: 1; flex-direction: column; padding: 21px; }
.product-format { font-size: .85rem; font-weight: 700; color: var(--plum); }
.product h2 { font: 700 clamp(1.35rem, 2vw, 1.7rem)/1.15 var(--display); margin-block: 5px 9px; }
.product-body > p:not(.product-format) { color: var(--muted); margin-bottom: 20px; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #43364f; padding-top: 15px; margin-top: auto; }
.price { font-size: 1.07rem; white-space: nowrap; font-weight: 700; }
.artwork { aspect-ratio: 1.65; background: var(--art-background); display: grid; place-items: center; overflow: hidden; }
.artwork-cuaderno { --art-background: radial-gradient(ellipse at 55% 30%, #344638, #18251f); }
.artwork-mapas { --art-background: radial-gradient(ellipse at 55% 30%, #493354, #221a31); }
.artwork-tarjetas { --art-background: radial-gradient(ellipse at 55% 30%, #5b3a2c, #2b1d24); }
.art-cover { position: relative; display: grid; align-content: space-between; width: 36%; aspect-ratio: .78; border-radius: 2px 5px 5px 2px; background: #313a2f; color: #f5e7bc; padding: 8% 5% 7%; transform: rotate(-13deg); box-shadow: 4px 6px 0 #f6e6c7, 6px 10px 18px #241c1e49; }
.art-cover i { position: absolute; inset: 0 auto 0 8%; width: 1px; background: #ece1a450; }
.art-cover b, .art-flash b { font: 400 clamp(1.05rem, 2.25vw, 2rem)/.92 var(--serif); }
.art-cover span { font-size: .68rem; font-weight: 700; letter-spacing: .1em; }
.art-sheet { width: 57%; height: auto; background: #29213d; color: #f0dcff; border: 1px solid #8a6b9a; border-radius: 4px; transform: rotate(8deg); box-shadow: 0 8px 19px #100c204a; padding: 3% 7% 5%; }
.art-sheet b { font: 400 clamp(1rem, 2.2vw, 1.8rem)/1 var(--serif); }
.art-sheet svg { width: 100%; height: auto; margin-top: 5%; }
.art-flash { position: relative; width: 53%; aspect-ratio: 1.55; display: grid; align-content: space-between; padding: 5%; transform: rotate(-8deg); border-radius: 6px; background: #493027; color: #ffe0b0; border: 1px solid #ad7855; box-shadow: 5px 8px 0 #8a5339, 9px 16px 0 #503127, 12px 21px 14px #160d1436; }
.art-flash span { font-size: .7rem; font-weight: 700; letter-spacing: .08em; }

.library, .contact { padding-block: clamp(52px, 7vw, 86px); }
.library-description { color: var(--muted); margin: 20px 0 30px; }
.empty-library { border: 1px solid var(--line); background: var(--card); padding: clamp(23px, 5vw, 44px); border-radius: 7px; }
.empty-library h2 { font-size: 2.4rem; margin-block: 13px 9px; }
.empty-library p { color: var(--muted); margin-bottom: 18px; }
.resource-list, .cart-list { list-style: none; padding: 0; margin: 0; }
.resource-list { display: grid; gap: 12px; max-width: 820px; }
.resource-list li, .cart-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.resource-list li { padding: 21px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); }
.resource-list h2 { font-size: 1.55rem; margin-block: 3px 7px; }
.resource-source { color: var(--muted); font-size: .9rem; }
.contact > p { color: var(--muted); margin-block: 20px 25px; }
.contact-panel { width: min(620px, 100%); padding: clamp(20px, 4vw, 30px); background: var(--card); border: 1px solid var(--line); border-radius: 7px; }
.site-footer { background: #0c0b15; color: #f2e8f2; border-top: 1px solid #30283d; }
.home-page .site-footer { display: none; }
.footer-content { min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.footer-content p { color: #dfd1e0; font-size: .88rem; }
.footer-content a:not(.footer-brand) { font-size: .9rem; text-underline-offset: 4px; }
.footer-brand { color: var(--gold); font: 700 2rem/1 var(--display); text-decoration: none; }

dialog { padding: 0; width: min(620px, calc(100% - 26px)); max-height: calc(100% - 32px); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 18px 65px #120d24a6; }
dialog::backdrop { background: #191329b0; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-top { position: sticky; z-index: 1; top: 0; background: var(--card); display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 17px 22px; }
.dialog-top h2 { font-size: clamp(1.55rem, 4vw, 2.35rem); }
.close-button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--control-line); background: transparent; font-size: 1.65rem; line-height: 1; }
.close-button:hover { background: #392a48; }
#dialog-content { padding: 22px; }
.dialog-text { color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.product-summary { display: grid; grid-template-columns: 1.05fr 1fr; gap: 21px; align-items: start; }
.product-summary .artwork { border-radius: 6px; }
.included { display: block; margin-top: 14px; background: #2b213b; border-radius: 5px; padding: 10px 12px; }
.cart-list li { border-bottom: 1px solid var(--line); padding-block: 12px; }
.cart-list li:first-child { padding-top: 0; }
.cart-list button { background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--plum); font-size: .88rem; }
.cart-item-actions { display: grid; justify-items: end; flex: none; }
.cart-total { display: flex; justify-content: space-between; gap: 14px; padding-block: 15px; font-weight: 700; }
.demo-note { background: #352b26; color: #f1d6b2; padding: 12px; border-radius: 5px; }
.map { display: grid; justify-items: stretch; text-align: center; margin-block: 18px 16px; }
.map-root { justify-self: center; color: #fff; background: var(--accent-fill); padding: 8px 20px; border-radius: 5px; font-weight: 700; }
.map-branches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--line); }
.map-branch { display: grid; align-content: start; justify-items: center; gap: 5px; min-height: 78px; padding: 7px 5px; line-height: 1.25; border: 1px solid var(--control-line); background: #241d33; border-radius: 5px; font-size: .88rem; }
.map-branch span { color: var(--muted); font-size: .8rem; }
.map-branch[aria-pressed="true"] { background: #3d2c50; border-color: var(--plum); }
.map-explanation, .flash-prompt { padding: 15px; background: #2b223a; border-radius: 5px; min-height: 112px; }
.flash-prompt p + p { margin-top: 14px; }
.flash-prompt { margin-top: 10px; }
.worksheet { padding: 20px; border: 1px solid var(--line); border-radius: 5px; }
.worksheet h3 { margin: 12px 0 5px; }
.worksheet h3:first-child { margin-top: 0; }
.worksheet p { color: var(--muted); }

.admin { padding-block: 28px 72px; }
.admin > h1 { margin-bottom: 32px; }
.admin-gate, .admin-card { background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: clamp(21px, 3vw, 32px); }
.admin-gate { max-width: 580px; }
.admin-gate h2, .admin-card h2 { font-size: 1.7rem; letter-spacing: -.025em; margin-bottom: 12px; }
.admin-gate > p, .admin-card > p { color: var(--muted); }
.admin-gate .button { margin-top: 24px; }
.admin-help { font-size: .875rem; color: var(--muted); line-height: 1.5; }
#admin-setup-note { margin-top: 18px; }
.admin-account { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.admin-account p { overflow-wrap: anywhere; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.admin-form { display: grid; gap: 16px; margin-top: 24px; }
.admin-form label { display: grid; gap: 7px; font-size: .9375rem; font-weight: 600; min-width: 0; }
.admin-form input:not([type=checkbox]), .admin-form textarea, .admin-form select { width: 100%; min-width: 0; min-height: 46px; font: 400 1rem/1.4 var(--sans); background: #14111f; border: 1px solid var(--control-line); border-radius: 4px; padding: 11px 12px; color: var(--ink); }
.admin-form input::placeholder, .admin-form textarea::placeholder { color: #aaa0bb; opacity: 1; }
.admin-form input:focus-visible, .admin-form textarea:focus-visible, .admin-form select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.admin-form input[type=file] { padding: 7px; font-size: .875rem; }
.admin-form input::file-selector-button { min-height: 34px; border: 0; border-radius: 3px; background: #3b2a4c; color: var(--ink); padding-inline: 12px; margin-right: 10px; cursor: pointer; }
.admin-field-row { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; }
.admin-form fieldset { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 4px; }
.admin-form legend { padding-inline: 6px; font-size: .9375rem; }
.admin-form .material-option { display: flex; gap: 11px; align-items: center; padding-block: 8px; cursor: pointer; }
.material-option input { width: 20px; height: 20px; flex: none; accent-color: #b98de0; }
.form-status { color: #bbdfc7; font-size: .9375rem; overflow-wrap: anywhere; }
.form-status[data-state=error] { color: #ffc1ac; }
.new-code-result { display: grid; gap: 16px; margin-top: 24px; border: 1px solid #ab8b61; padding: 20px; background: #302631; }
.new-code-result p { font-size: .9375rem; color: #f1d6af; }
.new-code-result output { font: 700 1.1rem/1.5 var(--display); color: var(--gold); overflow-wrap: anywhere; user-select: all; }
.admin-codes { margin-top: 24px; }
#admin-code-list { margin-top: 22px; }
.admin-code-row { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding-block: 18px; border-top: 1px solid var(--line); }
.admin-code-row h3 { font-size: 1rem; margin-bottom: 5px; overflow-wrap: anywhere; }
.admin-code-row .button { flex: none; }
.private-library-empty { padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted); }
.local-preview-note {padding:12px 16px;margin-bottom:22px;border-left:3px solid var(--gold);background:#302532;color:#f7d9ae;font-size:.9375rem;}
.sample-library-heading { margin-block: 40px 18px; }
.sample-library-heading h2 { font-size: 1.5rem; margin-bottom: 8px; }
.sample-library-heading p { color: var(--muted); font-size: .9375rem; }

@media (max-width: 930px) {
  .wrap { width: calc(100% - 58px); }
  .section-head { align-items: start; flex-direction: column; gap: 14px; }
  .product-body { padding: 15px; }
  .product-footer { gap: 7px; flex-wrap: wrap; }
}

@media (min-width: 821px) and (max-aspect-ratio: 7 / 5) {
  .hero-image { inset: auto 0 0; height: 56.25vw; object-position: bottom; }
  .hero-shade { inset: auto 0 0; height: 56.25vw; background: linear-gradient(180deg, #151225, transparent 23%), linear-gradient(90deg, #100d2090, transparent 55%); }
}

@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-account { align-items: flex-start; flex-direction: column; }
  .wrap { width: calc(100% - 34px); }
  .hero { --art-height: clamp(280px, 85vw, 450px); min-height: 100vh; min-height: 100svh; display: block; padding-bottom: calc(var(--art-height) - 26px); }
  .hero-image { top: auto; height: var(--art-height); object-position: 82% bottom; }
  .hero-shade { top: auto; height: var(--art-height); background: linear-gradient(180deg, #151225, transparent 30%); }
  .hero-content { padding: clamp(158px, calc(158px + (100svh - 650px) / 3), 228px) 0 20px; }
  .hero h1 { font-size: clamp(4.3rem, 20vw, 7.4rem); }
  .hero-tagline { margin-block: 14px 20px; }
  .about-grid { grid-template-columns: 1fr; gap: 23px; }
  .about-intro > p:not(.eyebrow) { margin-top: 17px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .resource-list li { align-items: start; }
  .footer-content { padding-block: 20px; display: grid; grid-template-columns: 1fr auto; gap: 10px; }
  .footer-content p { grid-row: 2; grid-column: 1 / -1; }
}

@media (max-width: 440px) {
  .admin-field-row { grid-template-columns: 1fr; }
  .admin-code-row { align-items: flex-start; flex-direction: column; }
  .product-grid { grid-template-columns: 1fr; }
  .art-cover b, .art-flash b, .art-sheet b { font-size: 1.9rem; }
  .product-body { padding: 19px; }
  .product-summary { grid-template-columns: 1fr; }
  .resource-list li { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}

@media print {
  body:has(.worksheet) > :not(dialog), .close-button, .dialog-actions { display: none !important; }
  dialog { position: static; margin: 0; max-width: none; max-height: none; width: 100%; border: 0; box-shadow: none; overflow: visible; background: white; color: black; }
  dialog::backdrop { display: none; }
  .dialog-top { position: static; background: white; color: black; }
  .worksheet { border: 0; }
  .worksheet p { color: black; border-bottom: 1px solid #b6b6b6; padding-bottom: 34px; }
}

.hero-store:disabled { opacity: .58; cursor: not-allowed; box-shadow: none; }
