/* discordtag — site styles
   One stylesheet for every page. Checkout has its own file (checkout.css). */


/* ---------- Tokens ---------- */
:root {
  --paper: #F3F2F8;
  --surface: #FFFFFF;
  --sunk: #E9E7F2;
  --ink: #1B1A33;
  --muted: #5F5C7D;
  --line: #DCDAE8;
  --iris: #5B4BDB;
  --iris-hover: #4A3BC4;
  --iris-soft: #E6E2FF;
  --on-iris: #FFFFFF;
  --tag: #FFC94A;
  --tag-ink: #1B1A33;
  --danger: #C2304A;
  --shadow: 0 1px 0 rgba(27, 26, 51, .04), 0 8px 24px -12px rgba(27, 26, 51, .18);

  --display: "Bricolage Grotesque", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(1.9rem, 1.4rem + 1.8vw, 2.6rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.2vw, 4.75rem);

  --shell: 1180px;
  --gutter: clamp(18px, 4vw, 40px);
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 28px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #15142A;
  --surface: #1E1C38;
  --sunk: #252345;
  --ink: #EEEDF8;
  --muted: #A6A3C6;
  --line: #322F57;
  --iris: #8F84FF;
  --iris-hover: #A79EFF;
  --iris-soft: #2C2860;
  --on-iris: #15142A;
  --shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .2s, color .2s;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); letter-spacing: -.035em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: -.01em; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--iris); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--tag); color: var(--tag-ink); }

.shell { width: min(100% - 2 * var(--gutter), var(--shell)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-s);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px;
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color .15s, transform .15s, box-shadow .15s;
}
.button:active { transform: translateY(1px); }
.button-primary { background: var(--iris); color: var(--on-iris); }
.button-primary:hover { background: var(--iris-hover); }
.button-quiet { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.button-quiet:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.link { color: var(--iris); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.icon-button {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 999px; cursor: pointer; color: var(--ink);
}
.icon-button:hover { background: var(--sunk); }
.icon-button:disabled { opacity: .35; cursor: default; background: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 1.35rem/1 var(--display); letter-spacing: -.03em; text-decoration: none;
}
.brand img { width: 38px; height: 38px; }
.brand .wordmark span { color: var(--iris); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  padding: 10px 14px; border-radius: 999px; text-decoration: none; font-weight: 500; color: var(--muted);
}
.main-nav a:hover { color: var(--ink); background: var(--sunk); }
.main-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.header-tools { display: flex; align-items: center; gap: 4px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
.nav-toggle { display: none; }

.mobile-nav {
  position: fixed; inset: 72px 0 0; z-index: 49;
  background: var(--paper);
  padding: 16px var(--gutter) 32px;
  display: flex; flex-direction: column;
}
.mobile-nav a {
  font: 700 var(--step-2)/1 var(--display); letter-spacing: -.02em;
  padding: 18px 0; border-bottom: 1px solid var(--line); text-decoration: none;
}
.mobile-nav a[aria-current="page"] { color: var(--iris); }

@media (max-width: 820px) {
  .main-nav { display: none; }
  .header-tools { margin-left: auto; }
  .nav-toggle { display: grid; }
}

/* ---------- Hero (home) ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  align-items: center; gap: clamp(24px, 5vw, 64px);
  padding-block: clamp(36px, 7vw, 88px) clamp(28px, 5vw, 56px);
}
.hero h1 { max-width: 12ch; }
.hero-lede { margin-top: 20px; font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 44ch; }
.hero-art { position: relative; justify-self: center; width: min(100%, 380px); }
.hero-art img { width: 100%; height: auto; transform-origin: 50% 85%; }
@media (prefers-reduced-motion: no-preference) {
  .hero-art img { animation: mascot-in .9s cubic-bezier(.2, .9, .25, 1.25) both .1s; }
}
@keyframes mascot-in {
  from { opacity: 0; transform: translateY(28px) rotate(-6deg) scale(.94); }
  to   { opacity: 1; transform: none; }
}

/* The @ search: the main thing on the page */
.handle-search {
  margin-top: 32px; max-width: 560px;
  display: flex; align-items: center;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px var(--ink), var(--shadow);
  padding: 6px 6px 6px 22px;
}
.handle-search:focus-within { box-shadow: inset 0 0 0 2px var(--iris), 0 0 0 5px var(--iris-soft); }
.handle-search .at { font: 800 1.6rem/1 var(--display); color: var(--iris); margin-right: 4px; }
.handle-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: 650 1.35rem/1 var(--display); letter-spacing: -.01em; padding: 12px 4px;
}
.handle-search input::placeholder { color: var(--muted); opacity: .6; font-weight: 500; }
.handle-search .button { min-height: 52px; padding-inline: 26px; }
.suggestions { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: var(--step--1); }
.suggestions a {
  font: 650 .95rem/1 var(--display); text-decoration: none; color: var(--ink);
  padding: 8px 12px; border-radius: 999px; background: var(--sunk);
}
.suggestions a:hover { background: var(--iris-soft); }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { order: -1; width: 160px; justify-self: start; }
}
@media (max-width: 480px) {
  .handle-search { padding-left: 16px; }
  .handle-search .button { padding-inline: 18px; }
  .handle-search input { font-size: 1.15rem; }
}

/* ---------- Promise row ---------- */
.promises {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border-block: 1px solid var(--line);
  margin-bottom: clamp(48px, 7vw, 88px);
}
.promises div { padding: 22px 20px 22px 0; }
.promises div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.promises strong { display: block; font: 700 1.1rem/1.2 var(--display); }
.promises span { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 820px) {
  .promises { grid-template-columns: 1fr 1fr; }
  .promises div:nth-child(3) { padding-left: 0; border-left: 0; }
  .promises div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
.section { margin-bottom: clamp(56px, 9vw, 112px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-head p { color: var(--muted); margin-top: 8px; max-width: 52ch; }

/* ---------- Name tags (listing cards) ---------- */
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tag-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr);
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 4px 2px 8px; margin-inline: -2px;
}
.tag-row::-webkit-scrollbar { display: none; }
.tag-row > * { scroll-snap-align: start; }
@media (min-width: 1000px) { .tag-row { grid-auto-columns: calc((100% - 3 * 14px) / 4); } }

.nametag {
  position: relative;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px 20px 18px 20px;
  background: var(--surface);
  border-radius: var(--radius-m);
  box-shadow: inset 0 0 0 1px var(--line);
  min-height: 200px;
  transition: box-shadow .15s;
}
.nametag:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
/* punched hole: the tag motif */
.nametag::before {
  content: ""; position: absolute; top: 18px; right: 18px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line);
}
.nametag-kind { font-size: var(--step--1); color: var(--muted); padding-right: 26px; }
.nametag-handle {
  font: 800 2.4rem/1 var(--display); letter-spacing: -.035em;
  overflow-wrap: anywhere; margin-top: auto;
}
.nametag-handle .at { color: var(--iris); font-weight: 600; margin-right: 1px; }
.nametag-handle.is-long { font-size: 1.7rem; letter-spacing: -.02em; }
.nametag-handle.is-xlong { font-size: 1.35rem; letter-spacing: -.01em; }
.nametag-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price {
  font: 700 1.05rem/1 var(--display); letter-spacing: -.01em;
  background: var(--tag); color: var(--tag-ink);
  padding: 8px 12px 8px 14px; border-radius: 6px 999px 999px 6px;
  font-variant-numeric: tabular-nums;
}
.buy {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--paper); font-weight: 600;
}
.buy:hover { background: var(--iris); color: var(--on-iris); }
.buy[aria-busy="true"] { opacity: .6; cursor: progress; }

.skeleton { background: var(--sunk); border-radius: var(--radius-m); min-height: 200px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: pulse 1.4s ease-in-out infinite; }
}
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Shop by type ---------- */
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.type {
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: 22px; border-radius: var(--radius-m); text-decoration: none;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.type:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.type-sample { font: 800 2rem/1 var(--display); letter-spacing: -.03em; color: var(--iris); }
.type h3 { font-size: 1.15rem; }
.type p { color: var(--muted); font-size: var(--step--1); margin-top: 4px; }
.type-feature { grid-row: span 2; background: var(--ink); color: var(--paper); box-shadow: none; }
.type-feature .type-sample { font-size: clamp(3rem, 6vw, 5rem); color: var(--tag); }
.type-feature p { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.type-feature:hover { box-shadow: 0 0 0 3px var(--iris); }
@media (max-width: 820px) { .types { grid-template-columns: 1fr 1fr; } .type-feature { grid-column: span 2; grid-row: auto; } }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; }
.steps li { counter-increment: step; padding: 0 24px 0 0; position: relative; }
.steps li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.steps li::before {
  content: counter(step);
  display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 16px;
  border-radius: 50%; background: var(--iris-soft); color: var(--iris);
  font: 800 1rem/1 var(--display);
}
.steps h3 { font-size: 1.1rem; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: .95rem; }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps li, .steps li + li { padding: 0 0 0 56px; border: 0; }
  .steps li::before { position: absolute; left: 0; top: 0; }
}

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.faq-intro p { color: var(--muted); margin-top: 12px; }
.faq-intro .link { display: inline-block; margin-top: 16px; }
.qa { border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; font: 650 1.12rem/1.3 var(--display); letter-spacing: -.01em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: ""; flex: none; width: 12px; height: 12px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-3px); transition: transform .2s;
}
.qa details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.qa details p { padding: 0 0 22px; color: var(--muted); max-width: 62ch; }
.qa h2 { font-size: var(--step-2); margin: 40px 0 8px; }
.qa h2:first-child { margin-top: 0; }
@media (max-width: 820px) { .faq { grid-template-columns: 1fr; } }

/* ---------- Contact band ---------- */
.talk {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--iris); color: var(--on-iris);
  border-radius: var(--radius-l);
}
.talk img { width: 88px; height: 88px; }
.talk h2 { font-size: var(--step-2); }
.talk p { opacity: .85; margin-top: 6px; max-width: 46ch; }
.talk-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.talk .button { background: var(--on-iris); color: var(--iris); }
:root[data-theme="dark"] .talk .button { background: var(--paper); color: var(--ink); }
.talk .button:hover { filter: brightness(.95); }
@media (max-width: 820px) { .talk { grid-template-columns: 1fr; } .talk img { width: 64px; height: 64px; } }

/* ---------- Inner pages ---------- */
.page-head { padding-block: clamp(36px, 6vw, 72px) clamp(24px, 4vw, 40px); max-width: 760px; }
.page-head h1 { font-size: var(--step-4); }
.page-head p { margin-top: 16px; font-size: var(--step-1); color: var(--muted); max-width: 52ch; }
.prose { max-width: 68ch; }
.prose h2 { font-size: var(--step-2); margin: 48px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { color: var(--muted); margin: 0 0 14px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--ink); }
.note {
  padding: 18px 20px; border-radius: var(--radius-m);
  background: var(--sunk); color: var(--ink); font-size: .95rem;
}
.channels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 48px; }
.channel {
  display: flex; flex-direction: column; gap: 10px; padding: 26px;
  background: var(--surface); border-radius: var(--radius-m); box-shadow: inset 0 0 0 1px var(--line);
  text-decoration: none;
}
.channel:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.channel .brand-icon { width: 32px; height: 32px; color: var(--iris); }
.channel h2 { font-size: var(--step-2); }
.channel p { color: var(--muted); }
.channel .link { margin-top: auto; padding-top: 10px; }
@media (max-width: 680px) { .channels { grid-template-columns: 1fr; } }

/* ---------- Browse ---------- */
.browse { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; margin-bottom: 96px; }
.filters { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 22px; }
.filters-toggle { display: none; }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: var(--step--1); }
.search-field { position: relative; }
.search-field .at { position: absolute; left: 14px; bottom: 12px; font: 800 1.1rem/1 var(--display); color: var(--iris); }
.input, .select {
  width: 100%; min-height: 46px; padding: 0 14px;
  background: var(--surface); border: 0; border-radius: var(--radius-s);
  box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 500;
}
.search-field .input { padding-left: 34px; font: 650 1.05rem/1 var(--display); }
.input:focus, .select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--iris); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 12px; border: 0; border-radius: var(--radius-s); background: transparent;
  text-align: left; cursor: pointer; font-weight: 500; color: var(--muted);
}
.cat:hover { background: var(--sunk); color: var(--ink); }
.cat[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.cat small { font-variant-numeric: tabular-nums; opacity: .75; font-size: .8rem; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; margin-bottom: 14px; color: var(--muted); }
.more-row { display: flex; justify-content: center; margin-top: 28px; }
.empty { padding: 48px 24px; text-align: center; border-radius: var(--radius-m); background: var(--sunk); }
.empty p { color: var(--muted); margin-bottom: 16px; }

@media (max-width: 900px) {
  .browse { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters-toggle {
    display: flex; justify-content: space-between; align-items: center;
    min-height: 48px; padding: 0 16px; border: 0; border-radius: var(--radius-s);
    background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; cursor: pointer;
  }
  .filters-body { display: none; flex-direction: column; gap: 22px; }
  .filters.is-open .filters-body { display: flex; }
  .cat-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .cat { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; padding: 8px 14px; }
}
@media (min-width: 901px) { .filters-body { display: flex; flex-direction: column; gap: 22px; } }

/* ---------- 404 ---------- */
.lost { text-align: center; padding-block: 64px 112px; }
.lost img { width: 200px; margin: 0 auto 24px; }
.lost p { color: var(--muted); margin: 14px auto 28px; max-width: 40ch; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 48px 32px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 32px; }
.footer-grid p { color: var(--muted); margin-top: 12px; max-width: 34ch; font-size: .95rem; }
.footer-col h2 { font-size: 1rem; margin-bottom: 12px; letter-spacing: 0; }
.footer-col a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { margin-top: 40px; color: var(--muted); font-size: .85rem; }
@media (max-width: 680px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: span 2; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px;
  font-weight: 600; z-index: 200;
}
.toast:empty { display: none; }

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

/* Featured row controls */
.carousel { display: flex; gap: 6px; flex: none; }
.carousel .icon-button { box-shadow: inset 0 0 0 1.5px var(--line); }
.talk .button svg { width: 18px; height: 18px; }

@media (max-width: 680px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-head .carousel { align-self: flex-end; margin-top: -8px; }
}
:root[data-theme="dark"] .type-feature { background: var(--iris-soft); color: var(--ink); }
:root[data-theme="dark"] .type-feature p { color: var(--muted); }

/* ===================== v2 additions ===================== */

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

/* ---------- Loader (first page of a visit) ---------- */
.loader { display: none; }
.first-load .loader {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-content: center; justify-items: center; gap: 22px;
  background: var(--paper);
  transition: opacity .45s ease, visibility .45s;
}
.first-load .loader img { width: 72px; height: 72px; animation: loader-hop 1s cubic-bezier(.3, 0, .3, 1) infinite; }
.loader-bar { width: 120px; height: 4px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 40%; border-radius: inherit; background: var(--iris); animation: loader-slide 1s ease-in-out infinite; }
.first-load.loaded .loader { opacity: 0; visibility: hidden; }
.first-load body > :not(.loader) { opacity: 0; }
.first-load.loaded body > :not(.loader) { opacity: 1; transition: opacity .5s ease .1s; }
.first-load.loaded body > .toast { transition: none; }
@keyframes loader-hop { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-14px) rotate(-6deg); } 60% { transform: translateY(-14px) rotate(4deg); } }
@keyframes loader-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* ---------- Page switching ---------- */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
::view-transition-old(root) { animation: vt-out .2s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .34s cubic-bezier(0, 0, .2, 1) both; }
::view-transition-group(site-header) { animation-duration: 0s; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
/* Browsers without view transitions */
.soft-nav main, .soft-nav .site-footer { animation: vt-in .34s cubic-bezier(0, 0, .2, 1) both; }
.soft-nav.is-leaving main, .soft-nav.is-leaving .site-footer { opacity: 0; transform: translateY(-6px); transition: opacity .17s ease-in, transform .17s ease-in; }

/* ---------- Cart button ---------- */
.cart-toggle { position: relative; }
.cart-count {
  position: absolute; top: 4px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--tag); color: var(--tag-ink); font: 800 .72rem/1 var(--display);
  box-shadow: 0 0 0 2px var(--paper);
}
.cart-toggle.bump { animation: bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bump { 30% { transform: scale(1.22) rotate(-8deg); } 60% { transform: scale(.95); } }

/* ---------- Add-to-cart buttons on cards ---------- */
.buy { display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s, color .15s; }
.buy[aria-pressed="true"] { background: var(--iris-soft); color: var(--iris); }
.buy[aria-pressed="true"]::before {
  content: ""; width: 12px; height: 7px; margin-top: -3px;
  border-left: 2.2px solid currentColor; border-bottom: 2.2px solid currentColor; transform: rotate(-45deg);
}
.buy[aria-pressed="true"]:hover { background: var(--danger); color: #fff; }
.buy[aria-pressed="true"]:hover .buy-label { font-size: 0; }
.buy[aria-pressed="true"]:hover .buy-label::after { content: "Remove"; font-size: 1rem; }
.buy[aria-pressed="true"]:hover::before { display: none; }
.nametag:has(.buy[aria-pressed="true"]) { box-shadow: inset 0 0 0 2px var(--iris); }
.buy-small { min-height: 34px; padding: 0 12px; font-size: .9rem; }
.buy-small[aria-pressed="true"]:hover .buy-label::after { font-size: .9rem; }

/* ---------- Cart drawer ---------- */
.drawer {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink);
}
.drawer::backdrop { background: rgba(21, 20, 42, .45); opacity: 0; transition: opacity .22s; }
.drawer.is-open::backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(100%, 420px);
  display: flex; flex-direction: column;
  background: var(--paper); box-shadow: -20px 0 60px -30px rgba(21, 20, 42, .5);
  transform: translateX(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 12px 24px; }
.drawer-head h2 { font-size: var(--step-2); }
.cart-heading-count { color: var(--muted); font-weight: 600; }
.cart-items { list-style: none; margin: 0; padding: 0 16px; overflow-y: auto; flex: 1; }
.cart-item {
  display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "name price rm" "kind price rm";
  align-items: center; column-gap: 12px; padding: 14px 8px; border-bottom: 1px solid var(--line);
}
.cart-name { grid-area: name; font: 800 1.4rem/1.1 var(--display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.cart-name .at { color: var(--iris); font-weight: 600; }
.cart-kind { grid-area: kind; color: var(--muted); font-size: .85rem; }
.cart-price { grid-area: price; font: 700 1rem/1 var(--display); font-variant-numeric: tabular-nums; }
.cart-remove { grid-area: rm; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.cart-remove:hover { background: var(--sunk); color: var(--danger); }
.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.cart-empty p { color: var(--muted); max-width: 26ch; }
.cart-empty img { width: 140px; }
.cart-foot { padding: 18px 24px calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.cart-sum { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.cart-sum strong { font: 800 1.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.cart-foot .button { width: 100%; }
.cart-foot p { margin-top: 10px; text-align: center; font-size: .85rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .drawer-panel, .drawer::backdrop { transition: none; } }

/* ---------- Live search ---------- */
.hero-search-wrap { position: relative; max-width: 560px; z-index: 5; }
.live-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border-radius: 20px; box-shadow: inset 0 0 0 1.5px var(--line), 0 24px 50px -20px rgba(21, 20, 42, .35);
  max-height: 420px; overflow-y: auto;
  animation: drop-in .18s cubic-bezier(.2, .8, .2, 1);
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px); } }
.live-row {
  display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "name price btn" "kind price btn";
  align-items: center; column-gap: 12px; padding: 10px 12px; border-radius: 14px;
}
.live-row:hover, .live-row[aria-selected="true"] { background: var(--sunk); }
.live-name { grid-area: name; font: 800 1.25rem/1.1 var(--display); letter-spacing: -.02em; text-decoration: none; }
.live-name::after { content: ""; position: absolute; inset: 0; }
.live-row { position: relative; }
.live-name .at { color: var(--iris); font-weight: 600; }
.live-kind { grid-area: kind; font-size: .8rem; color: var(--muted); }
.live-row .price { grid-area: price; font-size: .95rem; padding: 6px 10px 6px 12px; }
.live-row .buy { grid-area: btn; position: relative; z-index: 1; }
.live-foot { padding: 12px; font-size: .9rem; color: var(--muted); }
.live-foot a { color: var(--iris); font-weight: 600; text-decoration: none; }
.live-foot a:hover { text-decoration: underline; }
@media (max-width: 480px) { .live-row .price { display: none; } }

/* ---------- FAQ motion ---------- */
.qa-body { overflow: hidden; }
.qa-body p { padding: 0 0 22px; color: var(--muted); max-width: 62ch; margin: 0; }
.qa summary { transition: color .15s; }
.qa summary:hover { color: var(--iris); }
.qa details.is-closing summary::after { transform: rotate(45deg) translateY(-3px); }

/* ---------- Card polish ---------- */
.nametag { transition: box-shadow .15s, transform .2s cubic-bezier(.2, .8, .2, 1); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .nametag:hover { transform: translateY(-3px); } }
.handle-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.cart-items:empty { display: none; }
