/* ==========================================================================
   OpenAlbion Armory — base design system
   Kawaii-retro: periwinkle paper, chunky ink outlines, hard offset shadows,
   sticker cards, scalloped edges. Hand-written CSS. No external fonts/images.
   ========================================================================== */

:root {
  --paper: #e9e5ff;
  --paper-deep: #d9d2ff;
  --paper-soft: #f4f1ff;
  --ink: #241c3a;
  --ink-soft: #5b4d78;
  --cream: #fff8ec;
  --white: #fffdf8;
  --red: #e5485a;
  --red-deep: #b9283c;
  --red-pale: #ffe0e3;
  --mint: #b8efd4;
  --mint-soft: #e3fbf0;
  --butter: #ffe6a2;
  --butter-soft: #fff6d8;
  --sky: #b9e6ff;
  --sky-soft: #e4f6ff;
  --lilac: #d9c8ff;
  --lilac-soft: #f0eaff;
  --coral: #ff9c87;
  --coral-soft: #ffe4de;

  --border: 3px solid var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;

  --font-display: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN",
    "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --header-h: 78px;
  --ease-pop: cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 22px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgb(36 28 58 / 0.11) 1px, transparent 1.3px);
  background-size: 22px 22px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

::selection {
  background: var(--red-deep);
  color: var(--cream);
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  overflow: visible;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 850;
  line-height: 1.06;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

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

.container {
  width: min(1160px, calc(100% - 44px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 400;
  padding: 0.7rem 1rem;
  background: var(--butter);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* --------------------------------------------------------------- headings */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.36rem 0.7rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kicker-pill--red {
  background: var(--red-pale);
}

.kicker-pill--mint {
  background: var(--mint-soft);
}

.kicker-pill--butter {
  background: var(--butter);
}

.kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 3px rgb(229 72 90 / 0.18);
}

.section-head {
  display: grid;
  gap: 0.8rem;
  max-width: 780px;
}

.section-title {
  font-size: clamp(2.1rem, 4.4vw, 3.4rem);
}

.section-lede {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 62ch;
}

.mark {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  z-index: 0;
}

.mark::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: -0.06em;
  right: -0.08em;
  bottom: 0.02em;
  height: 0.52em;
  background: var(--butter);
  border-radius: 4px;
  transform: rotate(-1.1deg);
}

.text-soft {
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.78rem 1.2rem;
  background: var(--white);
  color: var(--ink);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn--primary {
  background: var(--red-deep);
  color: var(--cream);
}

.btn--primary:hover {
  background: #a62035;
}

.btn--butter {
  background: var(--butter);
}

.btn--mint {
  background: var(--mint);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding-inline: 0.45rem;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.btn--ghost:hover {
  transform: none;
  box-shadow: none;
  background: rgb(36 28 58 / 0.06);
}

.btn--small {
  padding: 0.5rem 0.8rem;
  font-size: 0.8rem;
  border-width: 2px;
  box-shadow: 2px 2px 0 var(--ink);
}

.btn--small:hover {
  box-shadow: 3px 3px 0 var(--ink);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 2px 2px 0 var(--ink);
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.is-loading .icon {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--white);
  color: var(--ink);
  border: var(--border);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.icon-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.icon-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--ink);
}

.icon-btn .icon {
  width: 20px;
  height: 20px;
}

/* ---------------------------------------------------------------- stickers */

.sticker {
  position: relative;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tape {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 92px;
  height: 26px;
  background: rgb(255 248 236 / 0.9);
  border: 2px dashed var(--ink);
  transform: translateX(-50%) rotate(-4deg);
  border-radius: 3px;
  box-shadow: 1px 1px 0 rgb(36 28 58 / 0.15);
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill--red {
  background: var(--red-pale);
}

.pill--mint {
  background: var(--mint-soft);
}

.pill--butter {
  background: var(--butter);
}

.pill--lilac {
  background: var(--lilac-soft);
}

.pill--sky {
  background: var(--sky-soft);
}

.pill--ink {
  background: var(--ink);
  color: var(--cream);
}

/* -------------------------------------------------------------- item icons */

.item-visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 2px 2px 0 var(--ink);
}

.item-visual__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-visual__fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: var(--card-soft, var(--paper-soft));
}

.item-visual__glyph {
  width: 76%;
  height: 76%;
}

.sparkle {
  position: absolute;
  pointer-events: none;
  color: var(--ink);
}

.sparkle svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ----------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: var(--border);
  transition: box-shadow 0.18s ease;
}

.site-header.is-stuck {
  box-shadow: 0 5px 0 var(--ink);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.24rem;
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
}

.brand-tag {
  align-self: flex-start;
  margin-top: 2px;
  padding: 0.24rem 0.36rem;
  background: var(--red-deep);
  color: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 1px 1px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
  transform: rotate(-4deg);
}

.type-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.type-nav a {
  padding: 0.46rem 0.82rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}

.type-nav a:hover {
  background: var(--paper-soft);
  border-color: var(--ink);
}

.type-nav a.is-active {
  background: var(--butter);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.35rem;
}

.nav-toggle {
  display: none;
}

.mobile-menu {
  display: none;
  border-top: var(--border);
  background: var(--cream);
}

.mobile-menu:not([hidden]) {
  display: block;
}

.mobile-menu .container {
  display: grid;
  gap: 0.4rem;
  padding-top: 0.9rem;
  padding-bottom: 1.2rem;
}

.mobile-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none;
}

.mobile-menu__link.is-active {
  background: var(--butter);
}

.mobile-menu__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.mobile-menu__meta a {
  padding: 0.4rem 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-soft);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

/* ----------------------------------------------------------------- footer */

.site-footer {
  position: relative;
  background: var(--paper-deep);
  padding-bottom: 1.6rem;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 1fr;
  gap: 2.4rem;
  padding-top: 2.4rem;
}

.footer-brand {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  max-width: 38ch;
}

.footer-brand .brand-mark {
  width: 52px;
  height: 52px;
}

.footer-brand__name {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.footer-brand p {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-title {
  margin-bottom: 0.85rem;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-links {
  display: grid;
  gap: 0.5rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.footer-links .icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.45rem 1.2rem;
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 2px dashed rgb(36 28 58 / 0.35);
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.footer-bottom p {
  max-width: 65ch;
}

/* --------------------------------------------------------------- scallops */

.scallop {
  height: var(--scallop-h, 24px);
  background: var(--scallop-color, var(--cream));
  filter: drop-shadow(0 -3px 0 var(--ink));
  -webkit-mask-image: radial-gradient(
    circle at 50% 100%,
    #000 calc(var(--scallop-r, 23px)),
    transparent calc(var(--scallop-r, 23px) + 0.7px)
  );
  -webkit-mask-size: var(--scallop-w, 48px) 100%;
  -webkit-mask-repeat: repeat-x;
  mask-image: radial-gradient(
    circle at 50% 100%,
    #000 calc(var(--scallop-r, 23px)),
    transparent calc(var(--scallop-r, 23px) + 0.7px)
  );
  mask-size: var(--scallop-w, 48px) 100%;
  mask-repeat: repeat-x;
  margin-bottom: -1px;
}

.scallop--cream {
  --scallop-color: var(--cream);
}

.scallop--white {
  --scallop-color: var(--white);
}

.scallop--paper {
  --scallop-color: var(--paper);
}

.scallop--paper-deep {
  --scallop-color: var(--paper-deep);
}

.scallop--mint {
  --scallop-color: var(--mint-soft);
}

.scallop--butter {
  --scallop-color: var(--butter-soft);
}

.scallop--lilac {
  --scallop-color: var(--lilac-soft);
}

/* ---------------------------------------------------------------- marquee */

.marquee {
  position: relative;
  overflow: hidden;
  background: var(--red-deep);
  color: var(--cream);
  border: var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transform: rotate(-0.55deg);
}

.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 34s linear infinite;
}

.marquee:hover .marquee__track,
.marquee:focus-within .marquee__track {
  animation-play-state: paused;
}

.marquee__group {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  padding: 0.72rem 0.65rem;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.marquee__group svg {
  width: 14px;
  height: 14px;
  color: var(--butter);
  flex: none;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ---------------------------------------------------------------- skeletons */

.skeleton {
  background: linear-gradient(100deg, var(--paper-soft) 28%, #fff 48%, var(--paper-soft) 68%);
  background-size: 220% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

/* ------------------------------------------------------------------ states */

.state-panel {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  padding: 2.6rem 1.4rem;
  text-align: center;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.state-panel__art {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  background: var(--paper-soft);
  border: var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.state-panel__art .glyph {
  width: 70px;
  height: 70px;
}

.state-panel h3 {
  font-size: 1.3rem;
}

.state-panel p {
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.state-panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 300;
  max-width: min(92vw, 460px);
  padding: 0.7rem 1.05rem;
  background: var(--ink);
  color: var(--cream);
  border: 3px solid var(--cream);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 0.83rem;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-tone="error"] {
  background: var(--red-deep);
}

.toast[data-tone="success"] {
  background: #1f6047;
}

/* ---------------------------------------------------------------- utilities */

.stack {
  display: grid;
  gap: 1rem;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.nowrap {
  white-space: nowrap;
}

.muted {
  color: var(--ink-soft);
}

.divider-dots {
  height: 3px;
  border: 0;
  background-image: radial-gradient(circle, var(--ink) 1.4px, transparent 1.5px);
  background-size: 12px 3px;
  opacity: 0.35;
  margin: 1.2rem 0;
}

/* ------------------------------------------------------------------- media */

@media (max-width: 1100px) {
  .brand-tag {
    display: none;
  }

  .type-nav a {
    padding-inline: 0.7rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 899px) {
  :root {
    --header-h: 68px;
  }

  .container {
    width: min(1160px, calc(100% - 36px));
  }

  .type-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-grid;
  }

  .header-actions {
    margin-left: auto;
  }

  .brand-name {
    font-size: 1.12rem;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem;
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }
}

@media (max-width: 639px) {
  .container {
    width: calc(100% - 32px);
  }

  .scallop {
    --scallop-h: 18px;
    --scallop-w: 36px;
    --scallop-r: 17px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    margin-top: 1.6rem;
  }

  .btn {
    padding: 0.72rem 1rem;
    font-size: 0.88rem;
  }

  .brand-name {
    font-size: 1.04rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .marquee__track {
    animation: none;
  }
}
