/* ---------- Fonts ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/fraunces-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
::selection { background: var(--accent); color: var(--accent-ink); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Theme tokens ---------- */
:root {
  --bg: #f7f7fa;
  --surface: #ffffff;
  --surface-alt: #eef0f6;
  --ink: #192639;
  --ink-soft: #55617a;
  --border: #dde1ea;
  --accent: #4059c4;
  --accent-2: #7c5cef;
  --accent-ink: #ffffff;
  --accent-soft: #e8edfb;
  --accent-gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --warn-bg: #fff4e5;
  --warn-border: #f0b959;
  --warn-ink: #6b4a06;
  --max-width: 1120px;
  --shadow-color: 25, 38, 57;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --surface: #161d2c;
    --surface-alt: #1e2637;
    --ink: #eef1f7;
    --ink-soft: #aab3c5;
    --border: #2c3548;
    --accent: #8ba0ee;
    --accent-2: #b09dfa;
    --accent-ink: #0f1420;
    --accent-soft: #22304f;
    --warn-bg: #3a2c10;
    --warn-border: #a97a1c;
    --warn-ink: #ffd98c;
    --shadow-color: 0, 0, 0;
  }
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(var(--shadow-color), 0.03);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand .mark {
  width: 1.9rem;
  height: 1.9rem;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 2px 5px rgba(var(--shadow-color), 0.18));
}
.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.main-nav a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 0.2rem;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent-gradient);
  transition: right 0.18s ease;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--accent);
}
.main-nav a:hover::after, .main-nav a[aria-current="page"]::after {
  right: 0;
}
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .main-nav ul { gap: 0.6rem 0.9rem; font-size: 0.88rem; }
}

main { min-height: 60vh; }

.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 4rem;
  padding: 2.5rem 0 2rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0.85;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
}
.footer-grid h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.45rem; }
.footer-grid a { color: var(--ink-soft); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }
.footer-base {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 1.25rem 0 0;
}
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.35rem; color: var(--border); }

/* ---------- Hero ---------- */
.hero-band {
  position: relative;
  overflow: hidden;
  contain: paint;
  background-image:
    radial-gradient(38rem 26rem at -6rem -8rem, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    radial-gradient(34rem 24rem at 110% 115%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 70%);
  background-repeat: no-repeat;
}
.hero {
  padding: 3rem 0 2.5rem;
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin: 0 0 0.75rem; }
.hero p { font-size: 1.15rem; color: var(--ink-soft); max-width: 42rem; margin: 0 auto; }
.hero-image {
  max-width: 100%;
  height: auto;
  border-radius: 1.1rem;
  box-shadow: 0 30px 70px -30px rgba(var(--shadow-color), 0.35), 0 1px 0 rgba(var(--shadow-color), 0.04);
}
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1.75rem; flex-wrap: wrap; }

.page-intro { padding: 2.5rem 0 1rem; }
.page-intro h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin: 0.5rem 0 0.75rem; }
.page-intro .lede { color: var(--ink-soft); font-size: 1.08rem; max-width: 46rem; }
.artist-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  margin-bottom: 1rem;
  box-shadow: 0 10px 22px -10px rgba(64, 89, 196, 0.55);
}
.artist-avatar-sm {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cat, var(--accent));
  background: color-mix(in srgb, var(--cat, var(--accent)) 12%, var(--surface));
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.35rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  background: var(--accent-gradient);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px rgba(64, 89, 196, 0.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(64, 89, 196, 0.6); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 22px -14px rgba(var(--shadow-color), 0.4); }

/* ---------- Grids & cards ---------- */
.section { padding: 2.5rem 0; }
.section-alt {
  background-color: var(--surface-alt);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.section-head h2 { font-size: 1.5rem; margin: 0; position: relative; padding-left: 0.9rem; }
.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  border-radius: 4px;
  background: var(--accent-gradient);
}
.section-head .see-all { font-size: 0.9rem; font-weight: 700; text-decoration: none; }
.section-head .see-all:hover { text-decoration: underline; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: color-mix(in srgb, var(--cat, var(--accent)) 55%, var(--border));
  transform: translateY(-4px);
  box-shadow: 0 16px 28px -14px color-mix(in srgb, var(--cat, var(--accent)) 45%, rgba(25, 38, 57, 0.55));
}
.card h3 { margin: 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }
.card-thumb {
  width: calc(100% + 2.5rem);
  max-width: none;
  margin: -1.25rem -1.25rem 0.25rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  background: var(--surface-alt);
  transition: transform 0.35s ease;
}
.card:hover .card-thumb { transform: scale(1.05); }
.card .tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cat, var(--accent));
  background: color-mix(in srgb, var(--cat, var(--accent)) 14%, var(--surface));
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* Category cards (homepage "Explore by category") */
.card-category { gap: 0.65rem; }
.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  color: var(--cat, var(--accent));
  background: color-mix(in srgb, var(--cat, var(--accent)) 15%, var(--surface));
  margin-bottom: 0.15rem;
  transition: transform 0.2s ease, background 0.2s ease;
}
.category-icon svg { width: 1.4rem; height: 1.4rem; }
.card-category:hover .category-icon {
  background: var(--cat, var(--accent));
  color: var(--accent-ink);
  transform: scale(1.06) rotate(-4deg);
}

.category-hero {
  position: relative;
  overflow: hidden;
  background: color-mix(in srgb, var(--cat, var(--accent)) 8%, var(--surface-alt));
  border: 1px solid color-mix(in srgb, var(--cat, var(--accent)) 20%, var(--border));
  border-radius: 16px;
  padding: 2rem;
  margin: 1.5rem 0 2.5rem;
}
.category-hero::after {
  content: "";
  position: absolute;
  top: -3rem;
  right: -3rem;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--cat, var(--accent)) 25%, transparent);
  filter: blur(8px);
  z-index: 0;
}
.category-hero > * { position: relative; z-index: 1; }
.category-hero .category-icon-lg {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 12px;
  margin-bottom: 0.85rem;
}
.category-hero .category-icon-lg svg { width: 1.9rem; height: 1.9rem; }
.category-hero h1 { margin: 0.4rem 0 0.75rem; }
.category-hero p { color: var(--ink-soft); max-width: 48rem; margin: 0; font-size: 1.05rem; }

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0 2rem;
}
.category-pill {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--surface);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.category-pill:hover, .category-pill[aria-current="page"] {
  border-color: var(--cat, var(--accent));
  color: var(--cat, var(--accent));
  background: color-mix(in srgb, var(--cat, var(--accent)) 10%, var(--surface));
}

/* ---------- Article content ---------- */
.article {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}
.article h2 { margin-top: 2.2rem; font-size: 1.4rem; }
.article h3 { margin-top: 1.6rem; font-size: 1.15rem; }
.article p { margin: 1rem 0; }
.article ul, .article ol { padding-left: 1.4rem; }
.article blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}
.article .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0.75rem 0 1.5rem;
}

.illusion-page .article { max-width: 46rem; }

/* ---------- Illusion demo stage ---------- */
.demo-stage {
  position: relative;
  background: linear-gradient(180deg, var(--surface-alt), var(--surface));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.25rem;
  margin: 1.75rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 20px 40px -28px rgba(var(--shadow-color), 0.4);
}
.demo-stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--accent-gradient);
  opacity: 0.7;
}
.demo-stage figcaption,
.demo-caption {
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-align: center;
  max-width: 34rem;
}
.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}
.demo-controls label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.demo-photo {
  width: 100%;
  max-width: 26rem;
  max-height: 26rem;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface);
}
.demo-placeholder {
  width: 100%;
  max-width: 26rem;
  aspect-ratio: 4 / 3;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 1.5rem;
  background: var(--surface);
}

/* ---------- Notices ---------- */
.notice {
  position: relative;
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 10px;
  padding: 1rem 1.25rem 1rem 3rem;
  font-size: 0.92rem;
  margin: 1.75rem 0;
}
.notice::before {
  content: "⚠";
  position: absolute;
  left: 1.1rem;
  top: 1rem;
  font-size: 1.1rem;
  line-height: 1;
}
.notice strong { display: block; margin-bottom: 0.25rem; }

/* ---------- Related & meta panels ---------- */
.related-panel {
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding-top: 2rem;
}
.related-panel h2 { font-size: 1.25rem; }
.meta-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  box-shadow: 0 12px 28px -22px rgba(var(--shadow-color), 0.5);
}
.meta-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; }
.meta-panel dt { color: var(--ink-soft); font-weight: 600; }
.meta-panel dd { margin: 0; }

/* ---------- Cookie consent ---------- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.12);
  padding: 1rem 1.25rem;
  display: none;
}
.cookie-banner.is-visible { display: block; }
.cookie-banner .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}
.cookie-banner p { margin: 0; font-size: 0.88rem; color: var(--ink-soft); max-width: 42rem; }
.cookie-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cookie-actions button {
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
}
.cookie-actions button.accept { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
