/* Project Phil storefront */

:root {
  --bg: #080a0f;
  --bg-1: #0d1017;
  --bg-2: #12161f;
  --bg-3: #1a1f2a;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.2);

  --text: #eef1f6;
  --text-2: #a6aebb;
  --text-3: #79828f;

  --accent: #3b8bff;
  --accent-hi: #6aa9ff;
  --accent-ink: #03101f;
  --accent-soft: rgba(59, 139, 255, 0.12);
  --accent-line: rgba(59, 139, 255, 0.38);

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 48px -16px rgba(0, 0, 0, 0.6), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 60px 120px -30px rgba(0, 0, 0, 0.75), 0 12px 32px -8px rgba(0, 0, 0, 0.6);

  --display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* How wide the content gets before it stops growing and centres, and the smallest gap left at each side. */
  --wrap: 1600px;
  --gutter: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; scrollbar-color: #2a303b var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Keeps the footer at the bottom of the window on short pages: main takes up whatever height is left over. */
  display: flex; flex-direction: column; min-height: 100vh;
}
body > main { flex: 1 0 auto; }
svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--mono); }

/* ---------- Buttons ---------- */
.btn {
  --h: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px; border-radius: 8px;
  font-size: 14.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-lg { --h: 50px; padding: 0 24px; font-size: 15.5px; border-radius: 10px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 24px -8px rgba(59, 139, 255, 0.6); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { background: rgba(255, 255, 255, 0.05); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-3); }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; font-size: 15px; white-space: nowrap; }
.link-arrow svg { width: 15px; height: 15px; color: var(--text-2); transition: transform .25s var(--ease); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; flex: none; }
.brand-mark { width: 34px; height: 34px; object-fit: contain; }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.nav .spacer { flex: 1; }
.nav > a, .nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; border: 0; background: transparent; cursor: pointer;
  font-size: 14.5px; font-weight: 500; color: var(--text-2);
  transition: color .2s, background-color .2s;
}
.nav > a:hover, .nav-btn:hover, .nav-btn[aria-expanded="true"] { color: var(--text); background: var(--bg-2); }
.nav > a[aria-current="page"] { color: var(--accent-hi); }
.nav-btn svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.nav-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.menu-wrap { position: relative; }
.menu-pop {
  position: absolute; top: calc(100% + 10px); left: 0; width: 290px; padding: 6px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.menu-pop a { display: block; padding: 10px 12px; border-radius: 8px; }
.menu-pop a:hover { background: var(--bg-3); }
.menu-pop b { display: block; font-size: 14.5px; font-weight: 600; }
.menu-pop span { display: block; font-size: 13px; color: var(--text-3); line-height: 1.4; }
.menu-sep { height: 1px; background: var(--line); margin: 6px; }

.nav-search {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 12px; min-width: 230px;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 8px; color: var(--text-3); cursor: pointer;
  font-size: 14px; transition: border-color .2s;
}
.nav-search:hover { border-color: var(--line-3); }
.nav-search svg { width: 16px; height: 16px; flex: none; }
.nav-search .label { flex: 1; text-align: left; }
.kbd { font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--text-3); white-space: nowrap; }

.nav > a.cart-link { position: relative; padding: 10px 12px; }
.cart-link svg { width: 19px; height: 19px; }
.cart-badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav > a.nav-cta { margin-left: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 10px 20px; }
.nav > a.nav-cta:hover { background: var(--accent-hi); color: var(--accent-ink); }
.nav-btn.nav-user { gap: 8px; margin-left: 8px; padding: 6px 12px 6px 8px; font-weight: 600; color: var(--text); white-space: nowrap; }
.menu-user { left: auto; right: 0; width: 200px; }
.menu-user a { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; }
.menu-user a svg { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.nav-user img { width: 28px; height: 28px; border-radius: 50%; }

.menu-btn { display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; place-items: center; cursor: pointer; }
.menu-btn svg { width: 20px; height: 20px; }
.mobile-menu { border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: 18px; }
.mobile-menu a:not(.btn) { display: block; padding: 11px 4px; color: var(--text-2); font-weight: 500; border-bottom: 1px solid var(--line); }
.mobile-menu a[aria-current="page"] { color: var(--text); }
.mobile-menu .btn { margin-top: 16px; }

/* ---------- Hero ---------- */
/* The picture behind it is the "bg" setting, set as an inline background-image by index.ejs. */
.hero { position: relative; padding: clamp(56px, 8vw, 104px) 0 clamp(56px, 7vw, 96px); overflow: hidden; background-size: cover; background-position: center; background-repeat: no-repeat; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(42px, 6.2vw, 84px); letter-spacing: -0.04em; line-height: 1; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { margin-top: 24px; max-width: 520px; font-size: clamp(17px, 1.5vw, 19px); color: var(--text-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 0; margin-top: 52px; }
.hero-stats div { padding: 0 28px; border-left: 1px solid var(--line-2); }
.hero-stats div:first-child { padding-left: 0; border-left: 0; }
.hero-stats b { display: block; font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 13.5px; color: var(--text-3); }

/* Capped so the cards stay the size they were when the page was narrower, and pushed to the right edge. */
.stack { position: relative; aspect-ratio: 1 / 0.82; width: 100%; max-width: 640px; justify-self: end; }
.stack a {
  position: absolute; width: 62%; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line-2); background: var(--bg-1); box-shadow: var(--shadow-lg);
  transition: transform .5s var(--ease), border-color .3s;
}
.stack a:hover { border-color: var(--accent-line); z-index: 5; }
.stack .label {
  position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 99px;
  background: rgba(8, 10, 15, 0.75); backdrop-filter: blur(8px); border: 1px solid var(--line-2);
  font-size: 12.5px; font-weight: 600;
}
.stack .s1 { top: 0; left: 0; transform: rotate(-3deg); z-index: 2; }
.stack .s2 { top: 6%; right: 0; transform: rotate(4deg); z-index: 1; }
.stack .s3 { bottom: 0; left: 8%; transform: rotate(2deg); z-index: 3; }
.stack .s4 { bottom: 5%; right: 3%; width: 46%; transform: rotate(-5deg); z-index: 4; }
.stack .s2 .label { left: auto; right: 12px; }
.stack .s1:hover { transform: rotate(-1deg) translateY(-6px); }
.stack .s2:hover { transform: rotate(2deg) translateY(-6px); }
.stack .s3:hover { transform: rotate(0deg) translateY(-6px); }
.stack .s4:hover { transform: rotate(-2deg) translateY(-6px); }

/* ---------- Generated product art ---------- */
.art {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center;
  background:
    radial-gradient(80% 90% at 80% 0%, hsl(var(--h) 90% 55% / .45), transparent 70%),
    linear-gradient(135deg, hsl(var(--h) 70% 15%), hsl(calc(var(--h) + 18) 60% 7%));
}
.art::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent);
  mask-image: linear-gradient(180deg, #000, transparent);
}
.art-win {
  position: relative; width: 74%; border-radius: 8px; overflow: hidden;
  background: rgba(8, 10, 15, 0.78); border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7);
}
.art-bar { display: flex; align-items: center; gap: 5px; padding: 7px 9px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.art-bar i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.art-bar span { margin-left: 6px; font-family: var(--mono); font-size: 9.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-body { display: grid; grid-template-columns: 22% 1fr; gap: 8px; padding: 9px; }
.art-side { display: grid; gap: 5px; align-content: start; }
.art-side i, .art-rows i { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); }
.art-side i:first-child { background: hsl(var(--h) 90% 62%); }
.art-rows { display: grid; gap: 6px; }
.art-rows i { height: 9px; }
.art-rows i:nth-child(1) { width: 55%; background: rgba(255, 255, 255, 0.24); }
.art-rows i:nth-child(2) { width: 92%; }
.art-rows i:nth-child(3) { width: 78%; }
.art-rows i:nth-child(4) { width: 40%; background: hsl(var(--h) 90% 62% / .7); }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 7vw, 96px) 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-1); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap; margin-bottom: 36px; }
.head h2 { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -0.03em; }
.head p { margin-top: 12px; max-width: 560px; color: var(--text-2); font-size: 17px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 99px;
  background: transparent; border: 1px solid var(--line-2); color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer;
  transition: color .2s, background-color .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: var(--line-3); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.chip .n { font-family: var(--mono); font-size: 12px; opacity: .7; }

/* ---------- Product cards ---------- */
.store-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.pcard {
  position: relative; grid-column: span 4; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .3s var(--ease), transform .3s var(--ease), background-color .3s;
}
.pcard.lg { grid-column: span 6; }
.pcard:hover { border-color: var(--accent-line); background: var(--bg-2); transform: translateY(-3px); }
.pcard-link { position: absolute; inset: 0; z-index: 1; }
.pcard-media { position: relative; border-bottom: 1px solid var(--line); }
.badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; }
.tag {
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: rgba(8, 10, 15, 0.75); backdrop-filter: blur(8px); border: 1px solid var(--line-2); color: var(--text-2);
}
.tag-accent { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.tag-product { background: #1a3a52; border-color: #1e5080; color: #7ec8f0; }
.tag-user    { background: #2a1a52; border-color: #4a2a90; color: #b08af0; }
.tag-order   { background: #3a1a1a; border-color: #802020; color: #f08a8a; }
.tag-release { background: #1a3a1a; border-color: #206020; color: #8af08a; }
.tag-category { background: #3a2e10; border-color: #7a5e20; color: #f0c870; }
.pcard-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.pcard-cat { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.pcard h3 { margin-top: 8px; font-size: 20px; }
.pcard.lg h3 { font-size: 24px; }
.pcard p { margin-top: 8px; color: var(--text-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 20px; }
.price { font-family: var(--display); font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price.free { color: var(--accent-hi); }
.pcard-foot form { position: relative; z-index: 2; }
.cart-item form { flex: none; }
.cart-add {
  position: relative; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); color: var(--text);
  transition: background-color .2s, border-color .2s, color .2s;
}
.cart-add:hover { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.cart-add[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.cart-add svg { width: 17px; height: 17px; }
.empty { padding: 48px 0; text-align: center; color: var(--text-3); }

/* ---------- Inner pages ---------- */
.eyebrow { font-family: var(--mono); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-hi); }
.page-head { position: relative; padding: clamp(48px, 6vw, 80px) 0 clamp(40px, 5vw, 64px); overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 120% at 85% 0%, rgba(59, 139, 255, 0.18), transparent 70%);
}
.page-head .wrap { position: relative; }
.page-head h1 { margin-top: 10px; font-size: clamp(38px, 5vw, 64px); letter-spacing: -0.04em; }
.page-head p { margin-top: 16px; max-width: 600px; color: var(--text-2); font-size: 18px; }
.page-head .btn { margin-top: 26px; }
.section > .wrap > .chips { margin-bottom: 28px; }

/* ---------- Products page ---------- */
.page-head .crumbs { margin-bottom: 18px; }
.shop { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.shop-side { position: sticky; top: 96px; display: grid; gap: 20px; }
.side-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.side-card h4 { padding: 18px 20px; border-bottom: 1px solid var(--line); font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.side-list { display: grid; gap: 2px; padding: 8px; }
.side-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 15px; text-align: left; cursor: pointer; transition: color .2s, background-color .2s; }
.side-list button:hover { color: var(--text); background: var(--bg-2); }
.side-list button[aria-pressed="true"] { color: var(--accent-hi); background: var(--accent-soft); }
.side-list button svg { width: 16px; height: 16px; flex: none; }
.side-list .n { margin-left: auto; min-width: 28px; padding: 2px 6px; border-radius: 4px; background: var(--bg-3); font-family: var(--mono); font-size: 12px; text-align: center; }
.side-list button[aria-pressed="true"] .n { background: var(--accent); color: var(--accent-ink); }
.shop-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 15px; }
.shop-bar b { color: var(--text); }
.shop-bar select { height: 44px; padding: 0 14px; border-radius: 8px; background: var(--bg-1); border: 1px solid var(--line-2); font: inherit; font-size: 14.5px; color: var(--text); cursor: pointer; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.scard { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .3s var(--ease), transform .3s var(--ease); }
.scard:hover { border-color: var(--accent-line); transform: translateY(-3px); }
.scard-media { position: relative; display: block; border-bottom: 1px solid var(--line); }
.scard-media .tag { position: absolute; top: 12px; right: 12px; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.scard-body { flex: 1; display: flex; flex-direction: column; padding: 20px; }
.scard h3 { font-size: 19px; }
.scard p { margin-top: 8px; color: var(--text-2); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.scard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 16px; }
.scard-tags span { padding: 3px 8px; border-radius: 4px; background: var(--bg-3); color: var(--text-2); font-size: 12px; }
.scard-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.scard-foot .price { font-size: 22px; }

.stat-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0; }
.stat-row div { padding: 0 clamp(24px, 4vw, 52px); border-left: 1px solid var(--line-2); text-align: center; }
.stat-row div:first-child { border-left: 0; }
.stat-row b { display: block; font-family: var(--display); font-size: clamp(38px, 5vw, 58px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; color: var(--text); }
.stat-row span { font-size: 14px; color: var(--text-3); }
.info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.info { padding: 24px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.section-alt .info { background: var(--bg); }
.info > svg { height: 22px; color: var(--accent-hi); }
.info > i { font-size: 22px; color: var(--accent-hi); }
.info .step { font-family: var(--mono); font-size: 13px; color: var(--accent-hi); }
.info h3 { margin-top: 16px; font-size: 19px; }
.info p { margin-top: 8px; color: var(--text-2); font-size: 15px; }

.product { padding: 28px 0 clamp(56px, 7vw, 96px); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; font-size: 14px; color: var(--text-3); }
.crumbs a:hover { color: var(--text); }
.crumbs svg { height: 9px; }
.crumbs span { color: var(--text-2); }
.product-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.product-media { border: 1px solid var(--line-2); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow); }
.product-info h1 { margin-top: 10px; font-size: clamp(34px, 4vw, 52px); letter-spacing: -0.035em; }
.product-info > p { margin-top: 16px; color: var(--text-2); font-size: 17.5px; }
.product-buy { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; margin-top: 28px; }
.product-buy .price { font-size: 32px; }
.cart-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); box-shadow: none; }
.included { display: grid; gap: 12px; margin: 32px 0 0; padding: 24px 0 0; list-style: none; border-top: 1px solid var(--line); color: var(--text-2); font-size: 15.5px; }
.included li { display: flex; align-items: center; gap: 12px; }
.included svg { width: 18px; height: 16px; flex: none; color: var(--accent-hi); }

/* ---------- Cart ---------- */
.cart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.cart-items { display: grid; gap: 12px; }
.cart-item { display: flex; align-items: center; gap: 18px; padding: 14px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.cart-thumb { flex: none; width: 128px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-2); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h3 { margin-top: 6px; font-size: 19px; transition: color .2s; }
.cart-item-info a:hover h3 { color: var(--accent-hi); }
.cart-remove {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 9px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-2); color: var(--text-2);
  transition: background-color .2s, border-color .2s, color .2s;
}
.cart-remove:hover { border-color: var(--line-3); color: var(--text); }
.cart-remove svg { width: 15px; height: 15px; }
.cart-clear { justify-self: start; display: inline-flex; align-items: center; gap: 7px; margin-top: 4px; padding: 6px 4px; background: transparent; border: 0; cursor: pointer; color: var(--text-3); font-size: 14px; transition: color .2s; }
.cart-clear:hover { color: var(--text); }
.cart-clear svg { width: 13px; height: 13px; }
.cart-summary { position: sticky; top: 96px; padding: 24px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.cart-summary h2 { font-size: 20px; margin-bottom: 14px; }
.cart-summary .sum-head { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.cart-summary .sum-row span:first-child { text-transform: capitalize; }
.sum-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; color: var(--text-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.sum-row.total { margin: 6px 0 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text); font-family: var(--display); font-size: 20px; font-weight: 700; }
.sum-note { margin-top: 12px; color: var(--text-3); font-size: 13.5px; text-align: center; }
.cart-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 32px 0; }
.cart-empty > svg { height: 34px; color: var(--text-3); }
.cart-empty h2 { margin-top: 20px; font-size: 26px; }
.cart-empty p { margin: 8px 0 26px; color: var(--text-2); }

/* ---------- Sign in ---------- */
.login-card { width: 100%; max-width: 420px; padding: 36px 32px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.login-card .brand-mark { display: block; margin: 0 auto; width: 44px; height: 44px; }
.login-card h1 { margin-top: 18px; font-size: 30px; letter-spacing: -0.03em; color: var(--text); }
.login-card p { margin: 10px 0 26px; font-size: 16px; color: var(--text-2); }
.login-page { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: clamp(40px, 8vh, 96px); padding-bottom: clamp(40px, 8vh, 96px); }
.form { display: grid; gap: 14px; text-align: left; }
.form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form input {
  height: 46px; padding: 0 14px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line-2);
  font: inherit; font-size: 15.5px; color: var(--text); transition: border-color .2s;
}
.form input:hover { border-color: var(--line-3); }
.form input:focus { outline: 0; border-color: var(--accent); }
.form .btn { margin-top: 6px; }
.form-error { margin-bottom: 16px; padding: 10px 14px; border-radius: 9px; background: rgba(255, 90, 90, 0.1); border: 1px solid rgba(255, 90, 90, 0.35); color: #ff9c9c; font-size: 14.5px; text-align: left; }
.form-or { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--text-3); font-size: 13px; }
.form-or::before, .form-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.form-alt { display: block; margin-top: 20px; color: var(--text-3); font-size: 14.5px; }
.form-alt a { color: var(--accent-hi); font-weight: 600; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; gap: 24px; }
.admin-card { padding: 24px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.admin-card h2 { font-size: 20px; margin-bottom: 18px; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-card-head h2 { margin: 0; }
.staff { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; padding-top: 40px; padding-bottom: clamp(56px, 7vw, 96px); }
.staff-side { position: sticky; top: 96px; display: grid; gap: 12px; padding: 18px 12px 12px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.staff-side .eyebrow { padding: 0 12px; }
.staff-side nav { display: grid; gap: 4px; }
.staff-side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text-2); font-size: 15px; font-weight: 500; transition: color .2s, background-color .2s; }
.staff-side a:hover { color: var(--text); background: var(--bg-2); }
.staff-side a[aria-current="page"] { color: var(--accent-hi); background: var(--accent-soft); }
.staff-side a svg { width: 15px; height: 15px; flex: none; }
.staff-side .staff-back { padding-top: 14px; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: var(--text-3); font-size: 14px; }
.admin-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; }
.admin-perm { display: block; }
.admin-perm select { height: 42px; }
.admin-perm select:disabled { opacity: .55; cursor: not-allowed; }
.admin-card > .chips { margin-bottom: 16px; }
.chip[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.chip svg { width: 12px; height: 12px; }
.status { flex: none; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 12px; font-weight: 600; text-transform: capitalize; }
.status-paid { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.status-revoked { background: rgba(255, 90, 90, 0.1); border-color: rgba(255, 90, 90, 0.35); color: #ff9c9c; }
.staff-main h1 { margin-bottom: 24px; font-size: clamp(28px, 3vw, 38px); letter-spacing: -0.03em; }
.admin-hint { margin: -8px 0 14px; color: var(--text-3); font-size: 14.5px; }
.form-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form .span { grid-column: 1 / -1; }
.form select, .form textarea {
  padding: 0 14px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line-2);
  font: inherit; font-size: 15.5px; color: var(--text); transition: border-color .2s;
}
.form select { height: 46px; width: 100%; }
.form textarea { padding: 12px 14px; resize: vertical; }
.form select:focus, .form textarea:focus { outline: 0; border-color: var(--accent); }
.form input:disabled { opacity: .55; cursor: not-allowed; }
.form label.check { display: flex; align-items: center; gap: 10px; align-self: end; height: 46px; font-size: 15px; color: var(--text); }
.form label.check input { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; }
.form-inline { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: 16px; }
.form-inline .btn { margin: 0; height: 46px; }
.admin-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.admin-row > div { flex: 1; min-width: 0; }
.admin-row b { display: block; font-weight: 600; }
.admin-row small { display: block; color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Account ---------- */
.account { padding-top: 36px; padding-bottom: clamp(56px, 7vw, 96px); }


/* Announcement banner */
.site-banner { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 20px; font-size: 13.5px; font-weight: 500; position: relative; }
.site-banner span { text-align: center; }
.site-banner-close { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; opacity: .6; font-size: 14px; padding: 4px 6px; }
.site-banner-close:hover { opacity: 1; }
.site-banner-info { background: color-mix(in srgb, var(--accent) 15%, var(--bg-1)); color: var(--text); border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.site-banner-info .site-banner-close { color: var(--text); }
.site-banner-success { background: color-mix(in srgb, #22c55e 15%, var(--bg-1)); color: #86efac; border-bottom: 1px solid color-mix(in srgb, #22c55e 30%, transparent); }
.site-banner-success .site-banner-close { color: #86efac; }
.site-banner-warning { background: color-mix(in srgb, #f59e0b 15%, var(--bg-1)); color: #fcd34d; border-bottom: 1px solid color-mix(in srgb, #f59e0b 30%, transparent); }
.site-banner-warning .site-banner-close { color: #fcd34d; }

/* Changelog */
.changelog { display: flex; flex-direction: column; gap: 0; padding-left: 16px; border-left: 2px solid var(--line); margin-top: 8px; }
.cl-entry { display: flex; gap: 20px; position: relative; padding-bottom: 28px; }
.cl-entry:last-child { padding-bottom: 0; }
.cl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); border: 2px solid var(--bg-0); flex-shrink: 0; margin-top: 6px; margin-left: -22px; }
.cl-dot-latest { background: var(--accent); }
.cl-card { flex: 1; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 20px; }
.cl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.cl-version { font-size: 14px; font-weight: 700; color: var(--text); font-family: var(--mono, monospace); }
.cl-title { font-size: 14px; color: var(--text-2); }
.cl-date { font-size: 12px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.cl-notes { font-size: 13px; color: var(--text-2); line-height: 1.65; margin: 0; white-space: pre-wrap; font-family: inherit; }

/* Review page */
.reviews-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.reviews-page-head h1 { font-size: clamp(22px,4vw,32px); font-weight: 800; letter-spacing: -.03em; }
.reviews-page-head p { color: var(--text-3); margin-top: 4px; font-size: 14px; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-list-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 20px; align-items: center; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 20px; }
.review-list-art { width: 64px; height: 64px; border-radius: var(--r); overflow: hidden; flex-shrink: 0; }
.review-list-art .art { width: 100%; height: 100%; border-radius: var(--r); }
.review-list-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.review-list-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-list-existing { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.review-list-comment { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-list-none { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.review-list-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 64px 24px; text-align: center; }
.empty-state-icon { font-size: 40px; color: var(--text-3); }
.empty-state h2 { font-size: 20px; font-weight: 700; }
.empty-state p { color: var(--text-3); font-size: 14px; }
@media (max-width: 620px) {
  .review-list-item { grid-template-columns: 48px 1fr; }
  .review-list-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; }
}

/* Reviews */
.reviews-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.review-avg { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 14px; color: var(--text-2); }
.stars { color: #f59e0b; font-size: 15px; display: flex; gap: 2px; }
.stars-sm { font-size: 13px; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.review-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.review-mine { border-color: var(--accent); }
.review-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.review-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.review-avatar { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.review-avatar-placeholder { display: grid; place-items: center; background: var(--bg-2); color: var(--text-3); font-size: 14px; }
.review-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.review-date { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.review-comment { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-top: 4px; }
.star-picker { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; margin-top: 8px; }
.star-picker input { display: none; }
.star-picker label { font-size: 28px; color: var(--text-3); cursor: pointer; transition: color .1s; }
.star-picker label:hover,
.star-picker label:hover ~ label,
.star-picker input:checked + label,
.star-picker input:checked + label ~ label { color: #f59e0b; }

/* Invoice */
.inv-card { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 36px 40px 32px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-1) 60%); }
.inv-number { font-size: clamp(32px, 5vw, 48px); font-weight: 800; letter-spacing: -0.04em; color: var(--text); line-height: 1; }
.inv-store { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.inv-dates { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 13px; color: var(--text-3); }
.inv-parties { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-bottom: 1px solid var(--line); }
.inv-party { padding: 24px 40px; border-right: 1px solid var(--line); }
.inv-party:last-child { border-right: none; }
.inv-party-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-hi); margin-bottom: 8px; }
.inv-party-name { font-size: 16px; font-weight: 600; color: var(--text); }
.inv-party-email { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.inv-body { display: grid; grid-template-columns: minmax(0,1fr) 280px; }
.inv-items { padding: 0 40px; border-right: 1px solid var(--line); }
.inv-row { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line-2); font-size: 14.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.inv-row span:last-child { flex-shrink: 0; }
.inv-row-head { padding: 18px 0 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); border-bottom: 1px solid var(--line); }
.inv-totals { padding: 24px 32px; background: var(--bg-2); align-self: start; }
.inv-totals .sum-row { padding: 6px 0; }
.inv-foot { padding: 16px 40px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--text-3); }
@media print {
  .no-print, header, footer { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .inv-card { border: 1px solid #ddd !important; }
  .inv-top, .inv-totals { background: #f4f4f4 !important; }
  main { padding-top: 8px !important; }
}

.account-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.account-content { min-width: 0; }
.account-profile { position: sticky; top: 100px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.account-profile-top { position: relative; padding: 28px 20px 20px; text-align: center; }
.account-profile-gear { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-3); transition: color .2s, background-color .2s; }
.account-profile-gear:hover { color: var(--text); background: var(--bg-2); }
.account-profile-avatar { width: 96px; height: 96px; border-radius: var(--r-lg); margin: 0 auto 14px; overflow: hidden; border: 2px solid var(--line-2); }
.account-profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-profile-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.account-profile-meta { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.account-profile-info { border-top: 1px solid var(--line); }
.profile-row { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; min-width: 0; }
.profile-row span { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.profile-row button { flex: none; display: grid; place-items: center; width: 28px; height: 28px; background: none; border: none; cursor: pointer; color: var(--text-3); border-radius: 6px; transition: color .2s, background-color .2s; }
.profile-row button:hover { color: var(--text); background: var(--bg-2); }
.account-profile-foot { padding: 14px 16px; }
.account-profile-foot .btn { width: 100%; justify-content: center; }
.account-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-bottom: 16px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.account-tabs a { padding: 12px 16px; text-align: center; font-weight: 600; font-size: 15px; color: var(--text-2); transition: color .2s, background-color .2s; }
.account-tabs a:hover { color: var(--text); background: var(--bg-3); }
/* Tabs without script: the panel named in the address (#orders, #settings) shows, and Downloads shows when none is. */
.account-panel { display: none; padding: 24px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); scroll-margin-top: 150px; }
.account-panel:target, .account-panel.default { display: block; }
.account-panel:target ~ .account-panel.default { display: none; }
.account:has(#orders:target) .account-tabs a[href="#orders"],
.account:has(#settings:target) .account-tabs a[href="#settings"],
.account:not(:has(#orders:target, #settings:target)) .account-tabs a[href="#downloads"] { color: var(--text); background: var(--bg-3); }
.account-panel h2 { font-size: 24px; }
.account-sub { margin: 4px 0 24px; color: var(--text-2); font-size: 14.5px; }
.account-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.account-thumb { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r); overflow: hidden; background: var(--bg-3); border: 1px solid var(--line-2); color: var(--text-3); }
.account-thumb .art { width: 100%; height: 100%; aspect-ratio: auto; }
.account-thumb .art-win { width: 82%; }
.account-thumb .art-bar span { display: none; }
.account-thumb > svg { width: 24px; height: 24px; }
.account-info { flex: 1; min-width: 0; }
.account-info h3 { font-size: 20px; }
.account-info span { color: var(--text-2); font-size: 14px; }
.account-row .btn { flex: none; }
.account-panel .empty a { color: var(--accent-hi); font-weight: 600; }
.account-settings { display: grid; gap: 4px; max-width: 460px; padding-top: 8px; border-top: 1px solid var(--line-2); }
.account-settings .sum-row span:last-child { color: var(--text); }
.account-settings .form { margin: 16px 0 8px; }
.account-settings .btn { justify-self: start; margin-top: 8px; }
.cart-discount { display: flex; gap: 0; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.cart-discount input { flex: 1; min-width: 0; background: transparent; border: none; border-radius: 0; padding: 10px 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.cart-discount input:focus { outline: none; box-shadow: none; }
.cart-discount .btn { border-radius: 0; border: none; border-left: 1px solid var(--line); flex-shrink: 0; background: var(--accent); color: var(--accent-ink); margin: 0; align-self: stretch; }
.cart-discount-remove { margin-top: 8px; width: 100%; justify-content: center; }
.cart-summary .btn-ghost { margin-top: 12px; }
.cart-summary .sum-row span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }

/* ---------- Error page ---------- */
.error-page { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: clamp(80px, 14vh, 160px); padding-bottom: clamp(80px, 14vh, 160px); }
.error-page h1 { margin-top: 10px; font-size: clamp(72px, 12vw, 140px); letter-spacing: -0.05em; color: var(--accent); }
.error-page p { margin: 8px 0 30px; color: var(--text-2); font-size: 18px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-1); }
.footer-top { display: flex; gap: 40px; padding-top: 48px; padding-bottom: 40px; }
.footer-brand-col { flex: 1.8; min-width: 0; }
.footer-col { flex: 1; min-width: 0; }
.footer-brand-col { display: flex; flex-direction: column; gap: 12px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--text); text-decoration: none; }
.footer-brand img { opacity: .85; }
.footer-tagline { font-size: 13.5px; color: var(--text-3); line-height: 1.5; max-width: 260px; }
.footer-col { display: flex; flex-direction: column; gap: 2px; }
.footer-col-head { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 10px; }
.footer-col-link { font-size: 14px; color: var(--text-2); padding: 4px 0; transition: color .15s; }
.footer-col-link:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); flex-wrap: wrap; }

/* ---------- Staff tables ---------- */
.staff-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.staff-head h1, .staff-head h2 { margin: 0; }
.staff-head h2 { font-size: 22px; }
.staff-head p { margin-top: 4px; color: var(--text-2); font-size: 14.5px; }
.admin-grid > .staff-head { margin: 12px 0 -4px; }
.table-card { overflow-x: auto; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; text-align: left; }
.table th { padding: 12px 16px; background: var(--bg-2); color: var(--text-2); font-weight: 600; white-space: nowrap; }
.table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table .right { text-align: right; }
.table .none { padding: 24px 16px; text-align: center; color: var(--text-3); }
.table td a:hover { color: var(--accent-hi); }
.table .actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.table .form { display: inline-block; }
.table select { height: 36px; padding: 0 10px; font-size: 14px; }
.table select:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: color .2s, background-color .2s; }
.icon-btn:hover { color: var(--text); background: var(--bg-3); }
.icon-btn.danger { color: #ff9c9c; }
.icon-btn.danger:hover { color: #ffc4c4; background: rgba(255, 90, 90, 0.12); }
.icon-btn svg { width: 15px; height: 15px; }
/* A product a user owns, with an x to take it away. */
.owned { display: inline-flex; align-items: center; gap: 6px; margin: 2px 4px 2px 0; padding: 2px 4px 2px 8px; border-radius: 4px; background: var(--bg-3); font-size: 12.5px; }
.owned button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 4px; background: transparent; color: var(--text-3); cursor: pointer; }
.owned button:hover { color: #ff9c9c; }
.owned svg { width: 10px; height: 10px; }

/* ---------- Modal ---------- */
/* Opened and closed with ToggleMenu('<id>') from main.js, which switches the hidden class. */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-card.modal-wide { max-width: 640px; }
.modal-card { width: 100%; max-width: 420px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h2 { font-size: 20px; }
.modal-head p { margin-top: 4px; color: var(--text-2); font-size: 14.5px; }
.modal-close { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; transition: color .2s, background-color .2s; }
.modal-close:hover { color: var(--text); background: var(--bg-3); }
.modal-close svg { width: 16px; height: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.modal-group-label { font-family: var(--mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 6px; }
.modal-actions .btn { margin: 0; }

/* ---------- Toast ---------- */
/* SendToast in main.js shows it, sets the colour classes and slides it in with .toast-visible. */
.toast {
  display: none; position: fixed; right: 20px; bottom: 20px; z-index: 100; max-width: min(380px, calc(100vw - 40px));
  padding: 12px 16px; border: 1px solid transparent; border-radius: var(--r); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.toast-visible { transform: translateY(0); }
.toast > p { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.toast.text-black { color: #000; }
.toast.bg-green-300 { background: #86efac; border-color: #86efac; }
.toast.bg-red-300 { background: #fca5a5; border-color: #fca5a5; }
.toast.bg-yellow-300 { background: #fde047; border-color: #fde047; }
.toast.bg-purple-300 { background: #d8b4fe; border-color: #d8b4fe; }
.toast.bg-blue-300 { background: #93c5fd; border-color: #93c5fd; }

/* ---------- Search dialog ---------- */
.search {
  width: min(600px, calc(100vw - 32px)); margin-top: 14vh; padding: 0; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.search::backdrop { background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(4px); }
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.search-field svg { width: 18px; height: 18px; flex: none; }
.search-field input { flex: 1; min-width: 0; height: 56px; background: transparent; border: 0; outline: 0; font: inherit; font-size: 16px; color: var(--text); }
.search-results { max-height: 360px; overflow-y: auto; padding: 6px; }
.search-results a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 8px; }
.search-results a:hover, .search-results a:focus-visible { background: var(--bg-3); outline: 0; }
.search-results b { display: block; font-weight: 600; font-size: 15px; }
.search-results small { display: block; font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.search-results .price { font-size: 15px; }
.search-results .none { padding: 24px 12px; text-align: center; color: var(--text-3); font-size: 15px; }

/* ---------- Reveal ---------- */
/* Plays once on load, in CSS only: nothing in main.js has to switch it on. */
.reveal { animation: reveal .7s var(--ease) backwards; }
@keyframes reveal { from { opacity: 0; transform: translateY(16px); } }

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

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-search { min-width: 0; }
  .nav-search .label, .nav-search .kbd { display: none; }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .inv-parties { grid-template-columns: 1fr 1fr; }
  .inv-party { padding: 20px 28px; }
  .inv-body { grid-template-columns: 1fr; }
  .inv-items { padding: 0 28px; border-right: none; border-bottom: 1px solid var(--line); }
  .inv-totals { padding: 20px 28px; }
  .inv-top { padding: 28px; }
  .inv-foot { padding: 14px 28px; }
.account-layout { grid-template-columns: 1fr; gap: 20px; }
  .account-profile { position: static; }
  .shop { grid-template-columns: 1fr; gap: 24px; }
  .shop-side { position: static; }
  .nav { display: none; }
  .menu-btn { display: grid; }
  .hero-grid, .product-grid, .cart-grid { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .staff { grid-template-columns: 1fr; gap: 20px; }
  .staff-side { position: static; padding: 10px 10px 8px; }
  .staff-side .eyebrow { display: none; }
  .staff-side nav { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .staff-side .staff-back { padding-top: 10px; font-size: 13px; }
  .admin-row { flex-wrap: wrap; }
  .stack { display: none; }
  .pcard, .pcard.lg { grid-column: span 6; }
  .footer-top { flex-wrap: wrap; gap: 28px; }
  .footer-brand-col { flex: 1 1 100%; }
  .footer-col { flex: 1 1 calc(50% - 14px); }
}
@media (max-width: 620px) {
  .staff { gap: 12px; }
  .staff-side { padding: 6px; }
  .staff-side nav { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .staff-side nav::-webkit-scrollbar { display: none; }
  .staff-side nav a { flex-shrink: 0; font-size: 13.5px; padding: 8px 11px; }
  .staff-side .staff-back { display: none; }
  .table .hide-sm { display: none; }
  .col-email { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .col-perm { width: 100px; }
  .col-perm select { width: 100%; font-size: 13px; padding: 0 6px; }
  .modal { align-items: center; padding: 10px; }
  .modal-card, .modal-card.modal-wide { max-width: 100%; max-height: calc(100vh - 20px); border-radius: 14px; padding: 20px 16px; }
  .modal-actions { flex-direction: column-reverse; gap: 8px; margin-top: 12px; }
  .modal-actions .btn { width: 100%; justify-content: center; }
  .admin-card { padding: 16px; }
  .form-actions .btn { flex: 1; justify-content: center; }
  .shop-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 22px 0; }
  .hero-stats div { padding: 0 20px; }
  .hero-stats div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .hero-cta .btn { flex: 1; }
  .pcard, .pcard.lg { grid-column: 1 / -1; }
  .info-grid { grid-template-columns: 1fr; }
  .form-wide, .form-inline { grid-template-columns: 1fr; }
  .cart-item { gap: 12px; }
  .stat-row { gap: 24px 0; }
  .stat-row div { flex: 1 1 50%; border-left: none; border-top: 1px solid var(--line-2); padding: 20px 16px 0; }
  .stat-row div:first-child { border-top: 0; padding-top: 0; }
  .stat-row div:nth-child(2) { border-top: 0; padding-top: 0; }
  .account-row { flex-wrap: wrap; }
  .account-row .btn { flex: 1; }
  .account-panel { padding: 16px; }
  .account-tabs a { padding: 10px 8px; font-size: 13.5px; }
  .account-settings .btn { justify-self: stretch; }
  .login-card { padding: 28px 20px; border-radius: 12px; }
  .login-card h1 { font-size: 24px; }
  .cart-thumb { width: 76px; }
}
