/* ------------------------------------------------------------------
 * base.css — layout & components. Reads design tokens from skins.css.
 * ------------------------------------------------------------------ */

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

html { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-tracking);
  text-transform: var(--head-transform);
  margin: 0;
  line-height: 1.1;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-muted); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  padding: 11px 20px;
  border-radius: var(--pill-radius);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: var(--nav-tracking);
  text-transform: var(--nav-transform);
  transition: transform var(--transition), opacity var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-2px); opacity: 0.92; }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn.ghost:hover { border-color: var(--accent); }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 70px;
}
.logo {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  font-size: 22px;
  letter-spacing: var(--head-tracking);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.logo .mark {
  width: 26px; height: 26px;
  border-radius: var(--radius);
  background: var(--accent);
  display: inline-block;
  position: relative;
}
.logo .mark::after {
  content: "";
  position: absolute; inset: 6px;
  border: 2px solid var(--on-accent);
  border-radius: 50%;
}
.main-nav {
  display: flex;
  gap: 26px;
  margin-left: 8px;
  font-size: 13px;
  text-transform: var(--nav-transform);
  letter-spacing: var(--nav-tracking);
}
.main-nav a { color: var(--text-muted); transition: color var(--transition); }
.main-nav a:hover { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* skin switcher */
.skin-switch { position: relative; }
.skin-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 13px;
  border-radius: var(--pill-radius);
  font-size: 13px;
}
.skin-toggle .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--surface);
}
.skin-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 8px;
  width: 244px;
  max-height: min(72vh, 580px);
  overflow-y: auto;
  display: none;
  z-index: 50;
}
.skin-menu.open { display: block; }
.skin-menu .label {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); padding: 6px 10px 8px;
}
.skin-option {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text);
  padding: 9px 10px; border-radius: var(--radius);
  font-size: 14px;
}
.skin-option:hover { background: var(--surface-2); }
.skin-option .swatch {
  width: 34px; height: 22px; border-radius: 4px;
  border: 1px solid var(--border); flex: none;
  display: flex; overflow: hidden;
}
.skin-option .swatch i { flex: 1; }
.skin-option.active { background: var(--accent-soft); }
.skin-option .check { margin-left: auto; opacity: 0; }
.skin-option.active .check { opacity: 1; color: var(--accent); }

.cart-btn {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px; height: 42px;
  border-radius: var(--pill-radius);
  display: inline-flex; align-items: center; justify-content: center;
}
.cart-btn:hover { border-color: var(--accent); }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  transform: scale(0); transition: transform var(--transition);
}
.cart-count.show { transform: scale(1); }

.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); width: 42px; height: 42px;
  border-radius: var(--pill-radius);
  display: none; align-items: center; justify-content: center;
}

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  padding: 72px 0 56px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero .eyebrow {
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--accent);
  font-weight: 700; margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  letter-spacing: var(--hero-tracking);
  margin-bottom: 20px;
}
.hero p { font-size: 1.1rem; color: var(--text-muted); max-width: 46ch; margin: 0 0 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 44px; }
.hero-stats .n { font-family: var(--font-head); font-size: 1.8rem; font-weight: var(--head-weight); }
.hero-stats .l { font-size: 13px; color: var(--text-muted); }

.hero-collage { position: relative; height: 440px; }
.hero-collage .frame {
  position: absolute;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--frame-bg);
  padding: var(--frame-pad);
  box-shadow: var(--frame-shadow);
  transition: transform var(--transition);
}
.hero-collage .frame img {
  border-radius: calc(var(--radius) - 1px);
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-collage .f1 { width: 48%; height: 78%; left: 0; top: 8%; z-index: 2; }
.hero-collage .f2 { width: 42%; height: 56%; right: 4%; top: 0; z-index: 3; }
.hero-collage .f3 { width: 38%; height: 46%; right: 0; bottom: 0; z-index: 4; }
.hero-collage .frame:hover { transform: translateY(-6px) rotate(-1deg); }

/* ---------------- section heading ---------------- */
.section { padding: 56px 0; scroll-margin-top: 88px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 30px; flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head .sub { color: var(--text-muted); margin-top: 6px; }

/* ---------------- filter bar ---------------- */
.toolbar {
  display: flex; gap: 14px; align-items: center;
  flex-wrap: wrap; margin-bottom: 28px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--pill-radius);
  font-size: 13px; font-weight: 600;
  transition: all var(--transition);
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.toolbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--pill-radius); padding: 8px 14px;
}
.search input {
  background: transparent; border: 0; outline: none;
  color: var(--text); font-size: 14px; width: 150px;
}
.search input::placeholder { color: var(--text-muted); }
.select {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--pill-radius);
  padding: 9px 14px; font-size: 13px; font-weight: 600;
}

/* ---------------- artwork grid ---------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 30px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-art {
  position: relative;
  background: var(--surface-2);
  padding: clamp(20px, 6%, 34px);
  display: flex; align-items: center; justify-content: center;
  height: 300px;
  overflow: hidden;
}
.card-art .canvas {
  background: var(--frame-bg);
  padding: var(--frame-pad);
  border-radius: var(--radius);
  box-shadow: var(--frame-shadow);
  display: flex;
  max-width: 100%;
  max-height: 100%;
  cursor: pointer;
  transition: transform var(--transition);
}
.card:hover .card-art .canvas { transform: scale(1.03); }

.card-art .canvas img {
  border-radius: 1px;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
}
.badge {
  position: absolute; top: 14px; left: 14px;
  z-index: 4;
  background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 5px 10px;
  border-radius: var(--pill-radius);
}
.badge.sold { background: var(--text); }
.fav {
  position: absolute; top: 12px; right: 12px;
  z-index: 4;
  width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); backdrop-filter: blur(6px);
  transition: all var(--transition);
}
.fav:hover { color: var(--accent); border-color: var(--accent); }
.fav.on { color: var(--accent); }
.fav.on svg { fill: var(--accent); }

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.05rem; font-weight: var(--head-weight); font-family: var(--font-head); text-transform: var(--head-transform); letter-spacing: var(--head-tracking); }
.card-artist { color: var(--text-muted); font-size: 13px; margin: 3px 0 2px; }
.card-meta { color: var(--text-muted); font-size: 12px; }
.card-foot {
  margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.price { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.15rem; }
.add {
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  border-radius: var(--pill-radius); padding: 9px 16px; font-size: 13px; font-weight: 600;
  transition: all var(--transition);
}
.add:hover { opacity: 0.9; transform: translateY(-1px); }
.add.added { background: transparent; color: var(--accent); }

.empty { text-align: center; padding: 80px 20px; color: var(--text-muted); }

/* ---------------- artists strip ---------------- */
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.artist {
  font-family: inherit; color: inherit; width: 100%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 26px 22px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.artist:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.artist .ava {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 22px;
  color: var(--on-accent); background: var(--accent);
}
.artist h3 { font-size: 1rem; }
.artist .c { font-size: 12px; color: var(--text-muted); margin: 2px 0 8px; }
.artist p { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; }
.artist .artist-cta {
  margin-top: auto; font-size: 13px; font-weight: 600; color: var(--accent);
  letter-spacing: var(--nav-tracking); text-transform: var(--nav-transform);
}

/* clickable artist-name links */
.link { color: var(--text); cursor: pointer; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition), color var(--transition); }
.link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------------- artist detail page ---------------- */
.artist-banner { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.artist-banner .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.4; transform: scale(1.05);
}
.artist-banner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 4%, transparent 70%);
}
.artist-banner .inner { position: relative; z-index: 2; display: flex; gap: 30px; align-items: flex-end; padding: 60px 0 40px; }
.big-ava {
  width: 132px; height: 132px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 46px;
  color: var(--on-accent); background: var(--accent);
  box-shadow: var(--shadow); border: 4px solid var(--surface);
}
.artist-hero-text { padding-bottom: 6px; }
.back-link { display: inline-block; cursor: pointer; color: var(--text-muted); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.back-link:hover { color: var(--accent); }
.artist-hero-text .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--accent); font-weight: 700; }
.artist-hero-text h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: var(--hero-tracking); margin: 8px 0 6px; }
.artist-hero-text .origin { color: var(--text-muted); font-weight: 600; margin-bottom: 14px; }
.artist-hero-text p { color: var(--text-muted); max-width: 60ch; margin: 0; }
.artist-stats {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px;
}
.artist-stats > div {
  flex: 1; min-width: 130px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.artist-stats .n { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.5rem; }
.artist-stats .l { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }
.artist-view .grid { padding-bottom: 30px; }

/* ---------------- artwork detail page ---------------- */
.product-view {
  padding: 46px 0 34px;
}
.product-detail > .back-link {
  margin-bottom: 22px;
}
.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.product-art {
  min-height: 520px;
  padding: clamp(22px, 5vw, 52px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-art .canvas {
  background: var(--frame-bg);
  padding: var(--frame-pad);
  border-radius: var(--radius);
  box-shadow: var(--frame-shadow);
  display: flex;
  max-width: 100%;
  max-height: 100%;
}
.product-art .canvas img {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 720px);
  object-fit: contain;
}
.product-info {
  position: sticky;
  top: 96px;
  min-width: 0;
}
.product-info .cat {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 700;
}
.product-info h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: var(--hero-tracking);
  margin: 10px 0 8px;
}
.product-info .by {
  color: var(--text-muted);
  margin-bottom: 20px;
}
.product-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}
.product-price .p {
  font-family: var(--font-head);
  font-weight: var(--head-weight);
  font-size: 2rem;
}
.product-actions {
  display: flex;
  gap: 12px;
}

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 48px 0 60px;
  background: var(--surface);
  scroll-margin-top: 88px;
}
.footer-grid { display: flex; gap: 40px; flex-wrap: wrap; justify-content: space-between; }
.footer-grid p { color: var(--text-muted); max-width: 38ch; font-size: 14px; }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-cols h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin: 0 0 14px; }
.footer-cols a { display: block; color: var(--text); font-size: 14px; margin-bottom: 9px; }
.footer-cols a:hover { color: var(--accent); }
.foot-note { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------------- overlay ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.overlay.open { opacity: 1; pointer-events: auto; }

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { border-color: var(--accent); }
.spec { display: flex; flex-direction: column; gap: 0; margin: 20px 0; border-top: 1px solid var(--border); }
.spec .row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.spec .row span:first-child { color: var(--text-muted); }

/* ---------------- cart drawer ---------------- */
.drawer {
  position: fixed; z-index: 70; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(100%);
  transition: transform var(--transition);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 1.2rem; }
.drawer-body { flex: 1; overflow: auto; padding: 12px 24px; }
.cart-line { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-line .thumb { width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; flex: none; background: var(--surface-2); }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info h4 { font-size: 14px; font-family: var(--font-head); font-weight: var(--head-weight); }
.cart-line .info .a { font-size: 12px; color: var(--text-muted); }
.cart-line .right { text-align: right; }
.cart-line .right .x { background: transparent; border: 0; color: var(--text-muted); font-size: 12px; margin-top: 8px; }
.cart-line .right .x:hover { color: var(--accent); }
.drawer-foot { padding: 20px 24px 26px; border-top: 1px solid var(--border); }
.drawer-foot .totals { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 14px; color: var(--text-muted); }
.drawer-foot .grand { display: flex; justify-content: space-between; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 1.3rem; margin: 10px 0 16px; color: var(--text); }
.cart-empty { text-align: center; color: var(--text-muted); padding: 60px 20px; }

/* ---------------- toast ---------------- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  background: var(--text); color: var(--bg);
  padding: 12px 20px; border-radius: var(--pill-radius);
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); transition: all var(--transition);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* accent the highlighted hero word per skin; neon gets a gradient */
.hero h1 .grad { color: var(--accent); }
[data-skin="neon"] .hero h1 .grad {
  background: var(--neon-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
[data-skin="neon"] .logo .mark { background: var(--neon-grad); }

/* ---------------- responsive ---------------- */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-collage { height: 340px; }
  .product-grid { grid-template-columns: 1fr; }
  .product-art { min-height: 360px; }
  .product-info { position: static; }
  .main-nav { display: none; }
  .artist-banner .inner { flex-direction: column; align-items: flex-start; gap: 18px; padding: 40px 0 30px; }
  .big-ava { width: 96px; height: 96px; font-size: 34px; }
}
@media (max-width: 600px) {
  .header-actions .skin-label { display: none; }
  .icon-btn { display: inline-flex; }
  .hero { padding: 44px 0 36px; }
  .hero-stats { gap: 24px; }
  .toolbar .search input { width: 110px; }
  .product-view { padding-top: 28px; }
  .product-art { min-height: 290px; padding: 20px; }
  .product-info h1 { font-size: 2rem; }
  .product-actions { flex-direction: column; }
  .spec .row { align-items: flex-start; gap: 18px; }
  .spec .row span:last-child { text-align: right; }
}
