/* Gothic Mewse: black velvet, violet glow, lavender lettering, silver filigree. */
:root {
  --bg: #0b0a0e;
  --bg-raised: #141019;
  --card: #18121f;
  --line: #2f2539;
  --text: #ece4f5;
  --muted: #a898b8;
  --lavender: #cbb3ee;
  --violet: #9b5fd6;
  --plum: #4e2366;
  --deep: #2a1238;
  --silver: #c8c3cf;
  --danger: #f0a3b4;
  --radius: 14px;
  --display: "Grenze Gotisch", "UnifrakturMaguntia", Georgia, serif;
  --body: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --max: 1120px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 1.2rem;
  line-height: 1.6;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -8%, rgba(120, 55, 175, 0.38), transparent 70%),
    radial-gradient(ellipse 40% 30% at 0% 35%, rgba(255, 255, 255, 0.035), transparent 70%),
    radial-gradient(ellipse 40% 30% at 100% 60%, rgba(255, 255, 255, 0.03), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a { color: var(--lavender); text-decoration-color: rgba(203, 179, 238, 0.4); text-underline-offset: 3px; }
a:hover { color: #fff; text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--lavender); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em;
  color: #f4eefb;
  text-shadow: 0 0 22px rgba(155, 95, 214, 0.45);
}
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
h3 { font-size: 1.6rem; }

p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.eyebrow {
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.6em;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 10, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 40px; height: 40px; border-radius: 8px; box-shadow: 0 0 18px rgba(155, 95, 214, 0.45); }
.brand span { font-family: var(--display); font-size: 1.6rem; line-height: 1; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; color: var(--text); padding: 8px 10px; border-radius: 8px; font-size: 1.1rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--lavender); background: rgba(155, 95, 214, 0.12); }
.nav .cart-link { display: inline-flex; align-items: center; gap: 6px; }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--violet); color: #fff; font-family: var(--body); font-weight: 700; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-count[hidden] { display: none; }
@media (max-width: 560px) {
  .brand span { display: none; }
  .nav a { padding: 8px 8px; font-size: 1.05rem; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--body); font-size: 1.15rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 12px 24px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #8a4fc7, #5d2a8a);
  border-color: rgba(203, 179, 238, 0.35);
  box-shadow: 0 0 24px rgba(155, 95, 214, 0.35);
}
.btn-primary:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 0 34px rgba(155, 95, 214, 0.55); }
.btn-ghost { color: var(--lavender); background: transparent; border-color: rgba(203, 179, 238, 0.4); }
.btn-ghost:hover { color: #fff; background: rgba(155, 95, 214, 0.15); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-block { width: 100%; }

/* Ornament */
.ornament { display: flex; justify-content: center; color: var(--silver); opacity: 0.75; margin: 8px auto 28px; }
.ornament svg { width: 220px; height: 24px; }

/* Hero */
.hero { text-align: center; padding: 48px 0 24px; }
.hero-logo {
  width: min(260px, 64vw); margin: 0 auto 26px; border-radius: 18px;
  box-shadow: 0 0 60px rgba(155, 95, 214, 0.55), 0 0 0 1px rgba(203, 179, 238, 0.15);
}
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.2rem); max-width: 18ch; margin: 0 auto 0.4em; }
.hero .lede { color: var(--muted); max-width: 36rem; margin: 0 auto 1.4em; font-size: 1.3rem; }
.hero-note { color: var(--muted); font-size: 1.05rem; margin: 14px 0 0; }
.moons { list-style: none; margin: 0 auto 30px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px; color: var(--lavender); font-style: italic; }
.moons li::before { content: "☾"; margin-right: 8px; color: var(--violet); font-style: normal; }

/* Sections */
.section { padding: 40px 0; }
.section-head { text-align: center; margin-bottom: 8px; }

/* Product grid */
.grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: linear-gradient(180deg, rgba(42, 18, 56, 0.55), rgba(24, 18, 31, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: rgba(155, 95, 214, 0.55); box-shadow: 0 0 36px rgba(155, 95, 214, 0.22); transform: translateY(-2px); }
.card-img { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--deep); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-sub { color: var(--muted); margin: 0; }
.card-tag { font-style: italic; color: var(--lavender); margin: 4px 0 10px; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.price { font-weight: 700; font-size: 1.35rem; color: #f4eefb; }
.sold-out { color: var(--danger); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.9rem; }

/* Grimoire feature card */
.feature { max-width: 920px; margin: 0 auto; }
@media (min-width: 760px) {
  .feature { flex-direction: row; }
  .feature .card-img { flex: 0 0 42%; aspect-ratio: auto; }
  .feature .card-body { padding: 28px 32px; }
}
.feature .card-body p:not(.eyebrow):not(.card-sub) { color: var(--text); }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

[data-order] { margin: 0 0 24px; padding: 20px; border: 1px solid rgba(203, 179, 238, 0.35); border-radius: var(--radius); background: rgba(42, 18, 56, 0.45); }
[data-order][hidden] { display: none; }
[data-order] .btn { margin: 4px; }

/* About teaser and quotes */
.panel {
  background: rgba(20, 16, 25, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
}
@media (min-width: 720px) { .panel { padding: 40px 48px; } }
.teaser { max-width: 46rem; margin: 0 auto; text-align: center; }

.quotes { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .quotes { grid-template-columns: repeat(3, 1fr); } }
.quote { margin: 0; padding: 22px; border-left: 2px solid var(--violet); background: rgba(42, 18, 56, 0.35); border-radius: 0 var(--radius) var(--radius) 0; }
.quote p { font-style: italic; font-size: 1.25rem; margin-bottom: 0.6em; }
.quote cite { color: var(--muted); font-style: normal; }
.stars { color: var(--lavender); letter-spacing: 0.15em; }
.rating-line { text-align: center; color: var(--muted); margin-top: 18px; }

/* Product page */
.crumbs { padding-top: 22px; font-size: 1rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.product { display: grid; gap: 28px; grid-template-columns: 1fr; padding: 18px 0 10px; }
@media (min-width: 880px) { .product { grid-template-columns: 1.05fr 1fr; gap: 48px; } }

.gallery-main { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--deep); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.thumbs button { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--deep); cursor: pointer; aspect-ratio: 1 / 1; opacity: 0.7; }
.thumbs button[aria-current="true"] { border-color: var(--lavender); opacity: 1; }
.thumbs button:hover { opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.buy h1 { margin-bottom: 0.1em; }
.buy .subtitle { color: var(--muted); font-size: 1.3rem; margin-bottom: 0.6em; }
.buy .price { font-size: 1.7rem; }
.buy .size { color: var(--muted); margin-left: 8px; }
.buy .tagline { font-style: italic; color: var(--lavender); font-size: 1.3rem; margin: 18px 0; }
.buy-row { display: flex; gap: 12px; align-items: stretch; margin: 20px 0 8px; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg-raised); }
.qty button { width: 44px; height: 48px; border: 0; background: transparent; color: var(--text); font-size: 1.4rem; cursor: pointer; }
.qty button:hover { background: rgba(155, 95, 214, 0.15); }
.qty input { width: 44px; text-align: center; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-row .btn { flex: 1; min-width: 180px; }
.ship-note { color: var(--muted); font-size: 1rem; }

.notes { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 10px 0 6px; }
@media (min-width: 720px) { .notes { grid-template-columns: repeat(3, 1fr); } }
.note { background: rgba(42, 18, 56, 0.4); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; }
.note h3 { font-size: 1.4rem; margin-bottom: 0.2em; }
.note p { margin: 0; color: var(--text); }
.profile { text-align: center; color: var(--lavender); font-style: italic; margin-top: 10px; }

.info { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .info { grid-template-columns: 1fr 1fr; } }
.moon-list { list-style: none; padding: 0; margin: 0; }
.moon-list li { padding-left: 1.6em; position: relative; margin-bottom: 0.4em; }
.moon-list li::before { content: "☾"; position: absolute; left: 0; color: var(--violet); }
.fine { color: var(--muted); font-size: 1.05rem; }

/* Prose pages */
.prose { max-width: 44rem; margin: 0 auto; }
.prose h2 { margin-top: 1.4em; }
.member { display: flex; gap: 18px; align-items: center; margin-top: 28px; }
.member img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

/* Cart */
.cart-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 14px; }
.cart-item { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(20, 16, 25, 0.75); }
.cart-item img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.cart-item h3 { font-size: 1.4rem; margin: 0; }
.cart-item h3 a { color: inherit; text-decoration: none; }
.cart-item .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.cart-item .qty button { width: 38px; height: 40px; }
.cart-item .qty input { width: 36px; }
.remove { background: none; border: 0; color: var(--muted); font: inherit; font-size: 1rem; text-decoration: underline; cursor: pointer; padding: 4px; }
.remove:hover { color: var(--danger); }
.totals { border-top: 1px solid var(--line); padding-top: 16px; }
.totals .line { display: flex; justify-content: space-between; margin-bottom: 6px; }
.totals .total { font-size: 1.4rem; font-weight: 700; }
.error { color: var(--danger); margin-top: 12px; }
.empty { text-align: center; padding: 30px 0; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0;
  background: #1f1628; border: 1px solid rgba(203, 179, 238, 0.35); color: var(--text);
  padding: 12px 18px; border-radius: 999px; box-shadow: 0 0 30px rgba(155, 95, 214, 0.35);
  transition: opacity 0.2s ease, transform 0.2s ease; z-index: 50; width: max-content; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast a { margin-left: 10px; font-weight: 700; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 30px 0 40px; color: var(--muted); font-size: 1.05rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--lavender); }

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