/* Kaayko store access modal — shared by the landing page and /about.
   Markup is injected by js/storeAccess.js; this file styles it. */

:root {
  --sa-fg: #ede8df;
  --sa-muted: rgba(237, 232, 223, 0.58);
  --sa-gold: #b5935a;
  --sa-gold-bright: #d9bd7b;
  --sa-ease: cubic-bezier(0.76, 0, 0.24, 1);
}

/* Every rule here is scoped to #store-modal on purpose.
   This file used to style a bare `.modal`, which is ALSO the class on the
   store's image-zoom overlay in storestyle.css. Loading both on store.html
   put a fixed, full-screen, always-visible layer over the catalogue: this
   file has no `.modal.active` rule, so nothing ever hid it. Keep the id. */

/* ── Store modal — one card for both Access and Request ───────────── */
#store-modal {
  position: fixed;
  inset: 0;
  /* Above every page chrome that hosts it — the landing panels and the
     /about top bar both sit well below this. */
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 5vw, 2rem);
}

#store-modal[hidden] {
  display: none;
}

#store-modal .modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 4, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 300ms ease;
}

#store-modal .modal-card {
  position: relative;
  width: min(420px, 100%);
  padding: clamp(2rem, 5vw, 2.75rem) clamp(1.5rem, 5vw, 2.5rem) clamp(1.75rem, 4vw, 2.25rem);
  border: 1px solid rgba(181, 147, 90, 0.28);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(181, 147, 90, 0.09), transparent 62%),
    #0c0c0c;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  text-align: center;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 320ms ease, transform 380ms var(--sa-ease);
}

#store-modal.modal--open .modal-scrim {
  opacity: 1;
}

#store-modal.modal--open .modal-card {
  opacity: 1;
  transform: none;
}

#store-modal .modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  background: none;
  color: rgba(181, 147, 90, 0.75); /* 4.2:1 on the card — an icon-only control needs 3:1 */
  cursor: pointer;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.6rem;
  line-height: 1;
  transition: color 200ms ease, transform 240ms var(--sa-ease);
}

#store-modal .modal-close:hover ,
#store-modal .modal-close:focus-visible {
  color: var(--sa-gold-bright);
  transform: rotate(90deg);
}

/* Focus must stay VISIBLE (2.4.7): a gold ring on every control in the card. */
#store-modal .modal-close:focus-visible,
#store-modal .modal-action:focus-visible,
#store-modal .modal-fallback a:focus-visible,
#store-modal .store-arrow:focus-visible {
  outline: 2px solid var(--sa-gold-bright);
  outline-offset: 3px;
}

#store-modal .modal-eyebrow {
  color: rgba(181, 147, 90, 0.9); /* 5.7:1 — 11px uppercase text needs 4.5:1 */
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.68rem;
  font-style: italic;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

#store-modal .modal-title {
  margin-top: 0.55rem;
  color: var(--sa-fg);
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2.1rem, 7vw, 2.9rem);
  font-weight: 400;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

#store-modal .modal-title::after {
  content: "";
  display: block;
  width: 3.25rem;
  height: 1px;
  margin: 0.85rem auto 0;
  background: linear-gradient(90deg, transparent, var(--sa-gold), transparent);
}

#store-modal .modal-sub {
  margin-top: 0.85rem;
  color: var(--sa-muted);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(0.82rem, 2.6vw, 0.94rem);
  font-style: italic;
  letter-spacing: 0.09em;
  line-height: 1.5;
}

#store-modal .modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(1.4rem, 4vw, 1.9rem);
}

#store-modal .modal-body[hidden] {
  display: none;
}

#store-modal .modal-copy {
  max-width: 30ch;
  color: rgba(237, 232, 223, 0.66);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
  line-height: 1.6;
}

#store-modal .modal-action {
  margin-top: 1.35rem;
  padding: 0.72em 1.9em;
  border: 1px solid rgba(181, 147, 90, 0.45);
  color: var(--sa-fg);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(0.72rem, 2.2vw, 0.82rem);
  letter-spacing: 0.2em;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 240ms ease, color 240ms ease, background 240ms ease;
}

#store-modal .modal-action:hover ,
#store-modal .modal-action:focus-visible {
  border-color: var(--sa-gold-bright);
  background: rgba(181, 147, 90, 0.1);
  color: var(--sa-gold-bright);
}

#store-modal .modal-fallback {
  margin-top: 1.1rem;
  color: rgba(237, 232, 223, 0.6); /* 6.2:1 (was 3.3:1 at 12px) */
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.76rem;
  font-style: italic;
  letter-spacing: 0.06em;
}

#store-modal .modal-fallback a {
  color: rgba(181, 147, 90, 0.8);
  text-decoration: none;
  border-bottom: 1px solid rgba(181, 147, 90, 0.3);
}

#store-modal .modal-fallback a:hover {
  color: var(--sa-gold-bright);
}

#modal-body-code {
  width: min(260px, 100%);
}

.store-field-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid rgba(181, 147, 90, 0.7); /* 3.8:1 — the input boundary needs 3:1 (1.4.11) */
  padding-bottom: 2px;
  transition: border-color 280ms ease;
}

.store-field-wrap:focus-within { border-bottom-color: var(--sa-gold); }
.store-field-wrap.error        { border-bottom-color: rgba(255, 80, 80, 0.8); }
.store-field-wrap.ok           { border-bottom-color: rgba(130, 190, 80, 0.75); }

/* Real <label> for the code field (3.3.2); visually hidden, read by AT. */
.store-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.store-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  color: rgba(237, 232, 223, 0.88);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(0.92rem, 1.7vw, 1.05rem);
  letter-spacing: 0.14em;
  padding: 0.6em 0;
  text-align: center;
  caret-color: var(--sa-gold);
}

.store-input::placeholder {
  color: rgba(237, 232, 223, 0.6); /* 6.2:1 (was 1.6:1) */
  letter-spacing: 0.07em;
}

.store-input:focus-visible {
  outline: 2px solid var(--sa-gold-bright);
  outline-offset: 4px;
  border-radius: 2px;
}

.store-input:disabled { opacity: 0.35; }

.store-arrow {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(181, 147, 90, 0.72); /* 3.9:1 — icon-only control needs 3:1 */
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35em;
  line-height: 1;
  padding: 0.3em 0 0.3em 0.5em;
  flex-shrink: 0;
  transition: color 200ms ease, transform 200ms ease;
}

.store-arrow:hover,
.store-arrow:focus-visible {
  color: var(--sa-gold-bright);
  transform: translateX(4px);
}

.store-arrow:disabled {
  cursor: default;
  color: rgba(181, 147, 90, 0.1);
  transform: none;
}

.store-hint {
  margin-top: 0.65em;
  min-height: 1.2em;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(0.72rem, 1.2vw, 0.8rem);
  font-style: italic;
  letter-spacing: 0.04em;
  color: rgba(255, 80, 80, 0.92); /* 5.3:1 (was 3.5:1) — error text must stay legible */
  text-align: center;
  opacity: 0;
  transition: opacity 260ms ease, color 260ms ease;
}

.store-hint.visible { opacity: 1; }
.store-hint.ok      { color: rgba(140, 195, 80, 0.8); }
