/* Anusuya Arts — storefront design system.
   Spec: design-system/anusuya-arts/MASTER.md. Tokens + shared components only;
   page-specific rules live in static/css/pages/<page>.css.
   Scoped under body.aa; resets use :where() so legacy Bootstrap pages keep working. */

:root {
  --wall: #FAFAF7;
  --card: #FFFFFF;
  --ink: #16141A;
  --ink-2: #4A4652;
  --line: #E7E3EA;
  --accent: #D61F69;
  --accent-hover: #B8175A;
  --accent-ink: #FFFFFF;
  --accent-soft: #FDE7F0;
  --success: #15803D;
  --danger: #DC2626;
  --warning: #B45309;

  /* series jewel colours */
  --soul: #E11D48;
  --space: #4338CA;
  --life: #059669;
  --wings: #EA580C;
  --divine: #CA8A04;

  --font-display: "Cormorant", Georgia, serif;
  --font-body: "Montserrat", system-ui, -apple-system, sans-serif;

  --s1: 8px; --s2: 12px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px; --s8: 96px;
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1280px;
  --radius: 8px;
  --header-h: 64px;

  --shadow-frame: 0 18px 30px -18px rgba(22, 20, 26, .45), 0 2px 4px rgba(22, 20, 26, .12);
  --shadow-frame-hover: 0 28px 40px -20px rgba(22, 20, 26, .5), 0 4px 8px rgba(22, 20, 26, .14);
  --shadow-pop: 0 16px 40px rgba(22, 20, 26, .18);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --t-fast: 160ms;
  --t-med: 240ms;
}

/* ---------- base ---------- */
body.aa {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
:where(.aa) *, :where(.aa) *::before, :where(.aa) *::after { box-sizing: border-box; }
:where(.aa) h1, :where(.aa) h2, :where(.aa) h3, :where(.aa) h4, :where(.aa) p,
:where(.aa) figure, :where(.aa) ul, :where(.aa) ol, :where(.aa) dl, :where(.aa) dd { margin: 0; }
:where(.aa) h1, :where(.aa) h2, :where(.aa) h3, :where(.aa) h4 {
  font-family: var(--font-display); font-weight: 600; color: var(--ink);
  line-height: 1.1; letter-spacing: -0.01em; text-transform: none; text-wrap: balance;
}
:where(.aa) h1 { font-size: clamp(40px, 5vw, 76px); line-height: 1.05; }
:where(.aa) h2 { font-size: clamp(30px, 3.4vw, 48px); }
:where(.aa) h3 { font-size: 24px; }
:where(.aa) p { text-wrap: pretty; }
/* the legacy theme tracks p, a, label, headings at 1px */
:where(.aa) p, :where(.aa) a, :where(.aa) label, :where(.aa) li, :where(.aa) span { letter-spacing: normal; }
:where(.aa) a { color: inherit; text-decoration: none; }
:where(.aa) a:hover, :where(.aa) a:focus { color: inherit; text-decoration: none; }
:where(.aa) img { display: block; max-width: 100%; height: auto; }
:where(.aa) ul[class], :where(.aa) ol[class] { padding: 0; list-style: none; }
:where(.aa) button { font: inherit; color: inherit; cursor: pointer; }
.aa :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.aa ::selection { background: var(--accent); color: var(--accent-ink); }
.aa .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.aa .nums { font-variant-numeric: tabular-nums; }
.aa-icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.aa-container { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.aa-section { padding-block: clamp(48px, 8vw, 96px); }
.aa-muted { color: var(--ink-2); }
.aa-small { font-size: 14px; }
.aa-lead { font-size: clamp(17px, 1.4vw, 20px); line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.aa-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.aa-link { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; transition: text-decoration-color var(--t-fast) ease, color var(--t-fast) ease; }
.aa-link:hover, .aa-link:focus-visible { color: var(--accent); text-decoration-color: currentColor; }

/* ---------- buttons ---------- */
.aa-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border: 1px solid transparent; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink) !important;
  font: 600 14px/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; cursor: pointer; text-decoration: none !important;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease, transform 120ms var(--ease);
}
.aa-btn:hover { background: var(--accent-hover); }
.aa-btn:active { transform: scale(.98); }
.aa-btn[disabled], .aa-btn.is-disabled { opacity: .5; pointer-events: none; }
.aa-btn--dark { background: var(--ink); }
.aa-btn--dark:hover { background: #2E2A33; }
.aa-btn--ghost { background: transparent; color: var(--ink) !important; border-color: var(--ink); }
.aa-btn--ghost:hover { background: var(--ink); color: var(--card) !important; }
.aa-btn--block { display: flex; width: 100%; }
.aa-btn .aa-icon { width: 18px; height: 18px; }

/* ---------- chips ---------- */
.aa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aa-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.aa-chip:hover { border-color: var(--ink); }
.aa-chip[aria-current="true"], .aa-chip[aria-pressed="true"], .aa-chip.is-active { background: var(--accent-soft); border-color: var(--accent-hover); color: var(--accent-hover); }
.aa-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--series, var(--accent)); flex: none; }

/* ---------- the frame ---------- */
.aa-frame {
  display: block; position: relative; aspect-ratio: 3 / 4;
  background: var(--card); border: 10px solid var(--ink);
  box-shadow: var(--shadow-frame);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.aa-frame::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(22, 20, 26, .08), inset 0 2px 6px rgba(22, 20, 26, .10); pointer-events: none; }
.aa-frame-mat { position: absolute; inset: 8%; display: grid; place-items: center; }
.aa-frame-mat img { width: 100%; height: 100%; object-fit: contain; }
@media (hover: hover) and (pointer: fine) {
  a.aa-frame:hover { transform: translateY(-4px); box-shadow: var(--shadow-frame-hover); }
}
.aa-frame--lg { border-width: 14px; }
.aa-frame--sm { border-width: 5px; box-shadow: 0 6px 12px -8px rgba(22, 20, 26, .45); }
.aa-frame--sm .aa-frame-mat { inset: 6%; }
@media (max-width: 559px) { .aa-frame { border-width: 6px; } .aa-frame--lg { border-width: 10px; } }

/* ---------- product card ---------- */
.aa-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
@media (min-width: 560px) { .aa-gallery { gap: 40px 24px; } }
@media (min-width: 900px) { .aa-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 40px; } }
@media (min-width: 1200px) { .aa-gallery--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.aa-card-art { display: flex; flex-direction: column; }
.aa-card-art .aa-frame { margin-bottom: 20px; }
.aa-card-title { font-family: var(--font-display); font-size: clamp(19px, 1.7vw, 23px); font-weight: 600; line-height: 1.2; color: var(--ink); }
.aa-card-title a:hover { color: var(--accent); }
.aa-card-series { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.aa-card-price { margin-top: 8px; font-size: 15px; }
.aa-card-price .aa-muted { font-weight: 400; font-size: 13px; }
.aa-card-art form { margin: auto 0 0; padding-top: 14px; } /* buttons share a baseline across the row */
.aa-card-art .aa-btn { min-height: 44px; padding: 0 16px; font-size: 13px; }
@media (max-width: 559px) { .aa-card-art .aa-btn { width: 100%; padding: 0 8px; } }

/* ---------- section heads ---------- */
.aa-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.aa-head p { margin-top: 8px; }
.aa-head .aa-link { font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ---------- panels & forms ---------- */
.aa-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 3vw, 32px); }
.aa-field { display: grid; gap: 6px; margin-bottom: 18px; }
.aa-field label, .aa-label { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0; }
.aa-field input:not([type=checkbox]):not([type=radio]), .aa-field select, .aa-field textarea, .aa-input {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: 16px/1.4 var(--font-body); box-shadow: none;
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.aa-field textarea { min-height: 120px; resize: vertical; }
.aa-field input:focus, .aa-field select:focus, .aa-field textarea:focus, .aa-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.aa-help { font-size: 13px; color: var(--ink-2); }
.aa-error, .aa-field .errorlist { font-size: 13px; color: var(--danger); list-style: none; padding: 0; margin: 0; }
.aa-field.has-error input, .aa-field.has-error select { border-color: var(--danger); }

/* ---------- crumbs ---------- */
.aa-crumbs { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 20px; font-size: 13px; color: var(--ink-2); }
.aa-crumbs a:hover { color: var(--accent); }
.aa-crumbs span[aria-hidden] { opacity: .5; }

/* ---------- commerce split + sticky bar ---------- */
.aa-split { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) {
  .aa-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; }
  .aa-split > aside { position: sticky; top: calc(var(--header-h) + 24px); }
}
.aa-sticky-bar { display: none; }
@media (max-width: 899px) {
  .aa-sticky-bar {
    display: flex; align-items: center; gap: 16px; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(22, 20, 26, .08);
  }
  .aa-sticky-bar .aa-btn { flex: 1; }
  body.has-sticky-bar { padding-bottom: 88px; }
}

/* ---------- header ---------- */
.aa-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .97); border-bottom: 1px solid var(--line); }
.aa-header-in { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.aa-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.aa-brand img { width: 40px; height: 40px; object-fit: contain; }
.aa-brand span { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: .01em; color: var(--ink); line-height: 1; }
.aa-nav { display: flex; gap: 4px; margin-inline: auto; }
.aa-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 500; letter-spacing: .02em; color: var(--ink); border-radius: var(--radius); transition: color var(--t-fast) ease; }
.aa-nav a:hover, .aa-nav a[aria-current="page"] { color: var(--accent); }
.aa-tools { display: flex; align-items: center; gap: 4px; }
.aa-iconbtn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
.aa-iconbtn:hover { background: var(--accent-soft); color: var(--accent); }
.aa-badge { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.aa-badge[data-empty="true"] { display: none; }
.aa-admin { position: relative; }
.aa-admin summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; }
.aa-admin summary::-webkit-details-marker { display: none; }
.aa-admin ul { position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.aa-admin li a { display: block; padding: 10px 12px; border-radius: 6px; font-size: 14px; }
.aa-admin li a:hover { background: var(--accent-soft); color: var(--accent); }
.aa-menu-btn { display: none; }
.aa-sheet { position: fixed; inset: var(--header-h) 0 0 0; z-index: 60; background: var(--card); padding: 24px var(--gutter); display: none; flex-direction: column; gap: 4px; overflow-y: auto; }
.aa-sheet.is-open { display: flex; }
.aa-sheet a { display: flex; align-items: center; min-height: 52px; font-family: var(--font-display); font-size: 28px; font-weight: 600; border-bottom: 1px solid var(--line); }
.aa-sheet a.aa-sheet-small { font-family: var(--font-body); font-size: 16px; font-weight: 500; }
@media (max-width: 899px) {
  .aa-nav, .aa-tools .aa-hide-sm { display: none; }
  .aa-menu-btn { display: inline-grid; }
  .aa-tools { margin-left: auto; }
  .aa-brand span { font-size: 22px; }
}

/* ---------- trust strip ---------- */
.aa-trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-block: 28px; border-block: 1px solid var(--line); }
.aa-trust li { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.aa-trust .aa-icon { width: 28px; height: 28px; color: var(--accent); }
.aa-trust strong { display: block; font-weight: 600; }
@media (max-width: 719px) { .aa-trust { grid-template-columns: 1fr; } }

/* ---------- toasts ---------- */
.aa-toasts { position: fixed; z-index: 80; top: calc(var(--header-h) + 12px); right: 16px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.aa-toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-pop); font-size: 14px; font-weight: 500; transition: opacity var(--t-med) ease, transform var(--t-med) var(--ease); }
.aa-toast--success { border-left-color: var(--success); }
.aa-toast--error, .aa-toast--danger { border-left-color: var(--danger); }
.aa-toast--warning { border-left-color: var(--warning); }
.aa-toast--info { border-left-color: var(--accent); }
.aa-toast button { margin-left: auto; border: 0; background: none; padding: 0 0 0 8px; font-size: 18px; line-height: 1; color: var(--ink-2); }
.aa-toast.is-hiding { opacity: 0; transform: translateY(-8px); }

/* ---------- footer ---------- */
.aa-footer { margin-top: clamp(64px, 10vw, 120px); background: var(--ink); color: #EDEAF0; }
.aa-footer a { color: #EDEAF0; }
.aa-footer a:hover { color: #FF8DBA; }
.aa-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; padding-block: 64px 40px; }
.aa-footer-brand p { margin-top: 14px; max-width: 34ch; color: #C9C4CF; font-size: 14px; }
.aa-footer .aa-footer-word { margin: 0; font-family: var(--font-display); font-size: 34px; font-weight: 600; color: #FFFFFF; line-height: 1; }
.aa-footer h2 { font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #FFFFFF; margin-bottom: 14px; }
.aa-footer li + li { margin-top: 10px; }
.aa-footer li { font-size: 14px; }
.aa-footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-block: 20px 28px; border-top: 1px solid #2F2B35; font-size: 13px; color: #A9A3B0; }
@media (max-width: 899px) { .aa-footer-grid { grid-template-columns: 1fr 1fr; } .aa-footer-brand { grid-column: 1 / -1; } }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .aa [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 400ms var(--ease), transform 400ms var(--ease); transition-delay: calc(var(--i, 0) * 60ms); }
  .js .aa [data-reveal].is-in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .aa *, .aa *::before, .aa *::after { transition-duration: 1ms !important; animation: none !important; }
}

/* ---------- search dialog ---------- */
.aa-search { width: min(640px, calc(100vw - 32px)); max-height: min(80vh, 720px); margin: 10vh auto auto; padding: 0; border: 0; border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-pop); font-family: var(--font-body); }
.aa-search::backdrop { background: rgba(22, 20, 26, .45); }
.aa-search-bar { display: flex; gap: 8px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); margin: 0; }
.aa-search-bar .aa-input { flex: 1; }
.aa-search-results { display: grid; gap: 4px; padding: 8px; overflow-y: auto; max-height: calc(min(80vh, 720px) - 82px); }
.aa-search-item { display: grid; grid-template-columns: 56px 1fr; gap: 16px; align-items: center; padding: 10px; border-radius: var(--radius); }
.aa-search-item:hover, .aa-search-item:focus-visible { background: var(--accent-soft); }
.aa-search-item strong { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 1.2; }
.aa-search-item .aa-muted { font-size: 13px; }
.aa-search-empty { padding: 20px 12px; color: var(--ink-2); }
.aa-brand img { width: 40px; height: 40px; }
.aa-footer-mark { width: 56px; height: 56px; margin-bottom: 14px; }
