:root {
  /* Hand-drawn & Sketchy: warm cotton sketchbook paper */
  --bg: oklch(0.942 0.018 84);
  --surface: oklch(0.905 0.02 82);
  --surface-raised: oklch(0.974 0.011 86);
  --surface-muted: oklch(0.875 0.022 82);
  --ink: oklch(0.2 0.018 55);
  --ink-secondary: oklch(0.38 0.015 55);
  --ink-muted: oklch(0.5 0.012 55);
  --on-ink: oklch(0.985 0.008 90);
  --border: oklch(0.2 0.018 55 / 0.25);
  --border-strong: oklch(0.2 0.018 55);

  --accent: oklch(0.49 0.16 258); /* cobalt fountain-pen ink */
  --accent-hover: oklch(0.42 0.16 258);
  --accent-soft: oklch(0.49 0.16 258 / 0.12);
  --on-accent: oklch(0.99 0.004 90);

  --error-bg: oklch(0.94 0.04 25);
  --error-ink: oklch(0.45 0.16 25);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --radius-sketch: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --radius-sketch-sm: 120px 10px 140px 12px / 12px 130px 10px 120px;
  --shadow-sketch: 3px 3px 0 var(--ink);
  --shadow-sketch-hover: 5px 5px 0 var(--ink);
  --shadow-sheet: -4px 0 0 var(--ink);
}

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

html {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  background-color: var(--bg);
  background-image:
    radial-gradient(120% 80% at 15% 10%, oklch(0.97 0.012 88 / 0.55), transparent 60%),
    radial-gradient(100% 90% at 85% 90%, oklch(0.89 0.026 78 / 0.45), transparent 65%);
  color: var(--ink);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overscroll-behavior: none;
}

/* Tactile cotton sketchbook paper fiber grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.075;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

:where(a, button, input, select, textarea, [tabindex="0"]):focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.boot-loader {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.boot-mark {
  font-family: "Architects Daughter", cursive, sans-serif;
  font-size: 2rem;
}

.boot-sub {
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.blazor-error-bar {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--on-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sketch-sm);
  font-size: 0.85rem;
  gap: 12px;
  z-index: 100;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: calc(100vh + 185px);
  min-height: calc(100dvh + 185px);
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}

/* Scroll-reactive sketchbook doodle layer */
.sketchbook-doodles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.doodle-stroke {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.doodle-dashed {
  stroke-dasharray: 6 6;
}

.doodle-giant {
  opacity: 0.42;
}

.doodle-shift {
  transform-box: fill-box;
  transform-origin: center;
}

.doodle-sticker {
  opacity: 0.68;
  filter: drop-shadow(1.5px 2.5px 0 oklch(0.2 0.018 55 / 0.22));
}

.sticker-diecut {
  paint-order: stroke;
}

.stamp-text {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  fill: currentColor;
}

.stamp-text-sm {
  font-family: "IBM Plex Mono", monospace;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  fill: currentColor;
}

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  filter: drop-shadow(0 3px 4px oklch(0.2 0.018 55 / 0.12));
}

.bar-top-sheet {
  position: relative;
  z-index: 2;
  background-color: oklch(0.925 0.02 83);
}

.bar.is-compact .bar-top-sheet {
  box-shadow:
    inset 0 -2px 0 oklch(0.2 0.018 55 / 0.42),
    inset 0 -7px 8px -5px oklch(0.2 0.018 55 / 0.25);
}

/* Fixed, non-scaling crumpled paper texture shared across all 3 sheets */
.bar-paper-clip,
.bar-tags-paper,
.bar-landing-paper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bar-paper-clip::before,
.bar-tags-paper::before,
.bar-landing-paper::before,
.bar-rip-edge::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 520px;
  background-image:
    linear-gradient(125deg, oklch(0.98 0.01 86 / 0.5) 0%, transparent 30%, oklch(0.82 0.028 78 / 0.36) 52%, transparent 76%, oklch(0.97 0.012 86 / 0.42) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.032' numOctaves='4' seed='7'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23f6efe2' surfaceScale='3.2'%3E%3CfeDistantLight azimuth='55' elevation='48'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='0.48'/%3E%3C/svg%3E");
  background-size: 100% 520px, 320px 320px;
  background-repeat: no-repeat, repeat;
}

.bar-tags-paper::before,
.bar-landing-paper::before {
  top: -102px;
}

.bar-rip-edge::before {
  top: -280px;
}

.bar-in,
.filters {
  position: relative;
  z-index: 1;
}

/* Ripped edge is physically attached to the bottom of .bar-landing-flap and folds in 3D with it */
.bar-rip-edge {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
  overflow: hidden;
  pointer-events: none;
  background-color: oklch(0.925 0.02 83);
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 28%,
    96.8% 50%, 94.5% 21%, 91.6% 36%, 89.4% 78%, 86.5% 43%, 83.6% 57%, 80.8% 14%, 77.9% 36%,
    75.9% 71%, 72.6% 28%, 69.7% 43%, 66.8% 21%, 64.6% 64%, 61.4% 36%, 58.5% 86%, 55.2% 50%, 52.6% 28%,
    49.5% 57%, 46.8% 21%, 43.4% 43%, 40.7% 78%, 37.6% 30%, 34.9% 50%, 32% 14%, 29.2% 64%, 26.2% 36%,
    23.4% 78%, 20% 28%, 17.2% 50%, 14.2% 21%, 11.5% 71%, 8.2% 36%, 5.4% 57%, 2.4% 21%, 0% 43%
  );
}

/* Full-width 3D Origami paper-fold landing flap (Fold 2) */
.bar-landing {
  position: relative;
  z-index: 1;
  perspective: 1200px;
  max-height: calc((1 - var(--fold-hero, 0)) * 220px);
}

.bar.is-hero-folded .bar-landing,
.bar.is-compact .bar-landing {
  overflow: hidden;
  max-height: 0;
  pointer-events: none;
}

.bar.is-hero-folded .bar-rip-edge {
  display: none;
}

.bar-landing-flap {
  position: relative;
  width: 100%;
  background-color: oklch(0.925 0.02 83);
  transform-origin: top center;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--fold-hero, 0) * -88deg));
  backface-visibility: hidden;
  will-change: transform;
}

.bar-landing-flap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    oklch(0.2 0.018 55 / 0.28) 0%,
    oklch(0.2 0.018 55 / 0.08) 55%,
    transparent 100%
  );
  opacity: var(--fold-hero, 0);
}

.bar-landing-inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 16px max(24px, env(safe-area-inset-right)) 18px max(24px, env(safe-area-inset-left));
}

.bar-landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.bar-landing .hero {
  margin-bottom: 0;
}

.landing-notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: oklch(0.974 0.011 86 / 0.72);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sketch-sm);
}

.landing-note {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.note-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.landing-scroll-cue {
  margin-top: 14px;
  font-size: 0.74rem;
  color: var(--ink-muted);
}

@media (max-width: 820px) {
  .bar-landing-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.bar-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
  height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-family: "Architects Daughter", cursive, sans-serif;
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.navrow {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}

.navrow::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  flex: none;
  font-family: "Architects Daughter", cursive, sans-serif;
  font-size: 0.88rem;
  line-height: 1;
  color: var(--ink-secondary);
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sketch-sm);
  padding: 7px 11px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 150ms var(--ease-out), border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.nav-pill:not(:disabled):active {
  transform: scale(0.96);
}

.nav-pill.on {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.nav-pill .n {
  opacity: 0.7;
  margin-left: 5px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

@media (hover: hover) and (pointer: fine) {
  .nav-pill:not(.on):hover {
    color: var(--ink);
    border-color: var(--ink);
  }
}

.search {
  position: relative;
  flex: none;
}

.search input {
  width: 215px;
  background: var(--surface-raised);
  border: 2px solid var(--ink);
  color: var(--ink);
  font-size: 0.84rem;
  padding: 7px 28px 7px 12px;
  border-radius: var(--radius-sketch-sm);
}

.search input::-webkit-search-cancel-button,
.search input::-webkit-search-decoration,
.tag-search-input::-webkit-search-cancel-button,
.tag-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.filters {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 12px max(24px, env(safe-area-inset-left));
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filters .lbl {
  flex: none;
  font-family: "Architects Daughter", cursive, sans-serif;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-right: 4px;
}

.filter-sep {
  flex: none;
  width: 2px;
  height: 16px;
  border-left: 2px dashed var(--border);
  margin: 0 4px;
}

.filter-select {
  flex: none;
  appearance: none;
  background: var(--surface-raised);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sketch-sm);
  padding: 4px 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--ink);
  cursor: pointer;
}

.nsfw-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--ink-secondary);
  cursor: pointer;
  user-select: none;
}

.chip {
  flex: none;
  white-space: nowrap;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sketch-sm);
  padding: 4px 10px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.chip:not(:disabled):active {
  transform: scale(0.96);
}

.chip.on {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 2px 2px 0 var(--accent);
}

.chip .n {
  opacity: 0.6;
  margin-left: 4px;
}

/* Fold 1: Full-width crumpled paper flap for Tag Search (folds in 3D as one sheet) */
.tag-browser-wrap {
  position: relative;
  z-index: 2;
  perspective: 1200px;
  overflow: hidden;
  width: 100%;
  max-height: calc((1 - var(--fold-tags, 0)) * 420px);
}

.bar.is-compact .tag-browser-wrap {
  pointer-events: none;
}

.tag-browser-flap {
  position: relative;
  width: 100%;
  background-color: oklch(0.925 0.02 83);
  padding: 2px 0 14px;
  transform-origin: top center;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--fold-tags, 0) * -86deg));
  backface-visibility: hidden;
  will-change: transform;
}

.tag-browser-flap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: linear-gradient(
    to bottom,
    oklch(0.2 0.018 55 / 0.28) 0%,
    oklch(0.2 0.018 55 / 0.08) 55%,
    transparent 100%
  );
  opacity: var(--fold-tags, 0);
}

.tag-browser-clip {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}

@media (prefers-reduced-motion: reduce) {
  .bar-landing-flap,
  .tag-browser-flap {
    transform: none;
  }
  .bar.is-compact .bar-landing,
  .bar.is-compact .tag-browser-wrap {
    max-height: 0;
    padding-bottom: 0;
  }
}

.tag-browser {
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: var(--radius-sketch);
  background-color: var(--surface-raised);
  background-image:
    linear-gradient(130deg, oklch(0.99 0.008 86 / 0.45) 0%, transparent 45%, oklch(0.86 0.025 80 / 0.28) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='tb'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.035' numOctaves='3' seed='11'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23faf5eb' surfaceScale='2.5'%3E%3CfeDistantLight azimuth='55' elevation='50'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23tb)' opacity='0.35'/%3E%3C/svg%3E");
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sketch);
}

.tag-browser::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    oklch(0.2 0.018 55 / 0.32) 0%,
    oklch(0.2 0.018 55 / 0.1) 55%,
    transparent 100%
  );
  opacity: var(--fold-tags, 0);
}

.tag-browser-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-search-input {
  flex: 1;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sketch-sm);
  padding: 7px 12px;
  font-size: 0.84rem;
  color: var(--ink);
  background: var(--bg);
}

.tag-group-label {
  font-family: "Architects Daughter", cursive, sans-serif;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  margin: 10px 0 6px;
}

.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-empty {
  margin: 6px 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sketch-sm);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 14px;
  min-height: 36px;
  border: 2px solid var(--ink);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.btn:not(:disabled):active {
  transform: translate(2px, 2px) scale(0.96);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-lg {
  padding: 12px 18px;
}

.btn-primary {
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: 2px 2px 0 var(--accent);
}

.btn-accent {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-ghost {
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-subtle {
  border-color: transparent;
  background: transparent;
  color: var(--ink-secondary);
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--bar-open-h, 240px) max(24px, env(safe-area-inset-right)) 64px max(24px, env(safe-area-inset-left));
  flex: 1;
}

.hero {
  max-width: 68ch;
  margin-bottom: 24px;
}

.hero-title {
  font-family: "Architects Daughter", cursive, sans-serif;
  font-size: 2.3rem;
  line-height: 1.18;
  font-weight: 400;
  margin: 0 0 8px;
}

.hero-highlight {
  position: relative;
  display: inline-block;
  color: var(--accent);
}

.hero-squiggle {
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -6px;
  width: calc(100% + 4px);
  height: 12px;
  color: var(--accent);
  pointer-events: none;
}

.hero-squiggle path {
  stroke-dasharray: 260;
  stroke-dashoffset: 0;
}

.hero-subtitle {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.results-bar {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.84rem;
  color: var(--ink-secondary);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(304px, 1fr));
  gap: 22px;
}

.gallery-pagination {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.artist-card {
  position: relative;
  display: flex;
  flex-direction: column;
  filter: drop-shadow(3px 4px 0 oklch(0.2 0.018 55 / 0.88));
  transition: transform 180ms var(--ease-out), filter 180ms var(--ease-out);
}

.card-paper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background-color: var(--surface-raised);
  background-image:
    linear-gradient(132deg, oklch(0.99 0.006 85 / 0.45) 0%, transparent 40%, oklch(0.86 0.02 80 / 0.22) 68%, transparent 100%);
}

/* 6 distinct torn, chipped, and different-paper-stock silhouettes */
.artist-card:nth-child(6n+1) {
  transform: rotate(-0.6deg);
  filter: drop-shadow(3px 4px 0 oklch(0.2 0.018 55 / 0.88));
}
.artist-card:nth-child(6n+1) .card-paper {
  clip-path: polygon(0% 1%, 28% 0%, 31% 1.8%, 35% 0.2%, 72% 0.6%, 94% 0%, 100% 3.5%, 99.2% 38%, 97.5% 41%, 99.5% 45%, 100% 98%, 68% 99.4%, 64% 97.8%, 60% 99.5%, 2% 99%, 0.4% 62%, 2% 59%, 0% 55%);
}

/* 2: Faint blue-ruled notebook paper with chipped corners */
.artist-card:nth-child(6n+2) {
  transform: rotate(0.5deg);
  filter: drop-shadow(4px 3px 0 oklch(0.49 0.16 258 / 0.85));
}
.artist-card:nth-child(6n+2) .card-paper {
  background-color: oklch(0.978 0.008 90);
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 23px,
      oklch(0.62 0.12 245 / 0.16) 24px
    );
  clip-path: polygon(2% 0%, 82% 0.5%, 85% 2.5%, 89% 0.4%, 99% 1%, 100% 96%, 96% 100%, 44% 99.2%, 41% 97.2%, 37% 99.5%, 1% 99%, 0% 22%, 1.8% 19%, 0.2% 15%);
}

/* 3: Drafting graph paper with ragged top & bottom nicks */
.artist-card:nth-child(6n+3) {
  transform: rotate(-0.35deg);
  filter: drop-shadow(3px 3px 0 oklch(0.2 0.018 55 / 0.88));
}
.artist-card:nth-child(6n+3) .card-paper {
  background-color: oklch(0.968 0.01 115);
  background-image:
    linear-gradient(oklch(0.5 0.08 155 / 0.11) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.5 0.08 155 / 0.11) 1px, transparent 1px);
  background-size: 20px 20px;
  clip-path: polygon(0% 2%, 18% 0.4%, 21% 2.2%, 25% 0%, 60% 0.8%, 63% 2.4%, 67% 0.3%, 98% 1%, 100% 72%, 98% 75%, 100% 79%, 99% 99%, 75% 98.8%, 71% 100%, 4% 99%, 0% 95%, 1.5% 44%, 0% 40%);
}

/* 4: Warm kraft/manila scrap with dog-ear bite */
.artist-card:nth-child(6n+4) {
  transform: rotate(0.65deg);
  filter: drop-shadow(4px 4px 0 oklch(0.6 0.19 28 / 0.82));
}
.artist-card:nth-child(6n+4) .card-paper {
  background-color: oklch(0.925 0.036 80);
  background-image:
    linear-gradient(118deg, oklch(0.96 0.02 84 / 0.45) 0%, transparent 45%, oklch(0.85 0.04 76 / 0.32) 72%, transparent 100%);
  clip-path: polygon(1% 0.5%, 52% 0%, 55% 2%, 59% 0.2%, 94% 0%, 100% 5%, 99.4% 88%, 95% 100%, 24% 99.2%, 20% 97.4%, 17% 99.5%, 0.5% 99%, 0% 28%, 2% 24%, 0.2% 20%);
}

/* 5: Blush/peach origami scrap with torn edge */
.artist-card:nth-child(6n+5) {
  transform: rotate(-0.45deg);
  filter: drop-shadow(3px 4px 0 oklch(0.2 0.018 55 / 0.88));
}
.artist-card:nth-child(6n+5) .card-paper {
  background-color: oklch(0.958 0.022 40);
  background-image:
    linear-gradient(45deg, oklch(0.99 0.01 40 / 0.4) 0%, transparent 50%, oklch(0.89 0.03 38 / 0.25) 100%);
  clip-path: polygon(0% 1.5%, 38% 0%, 41% 2.2%, 45% 0.4%, 99% 0.8%, 100% 30%, 98% 33%, 100% 37%, 99.2% 98.5%, 58% 99.5%, 54% 97.6%, 50% 99.6%, 2% 99%, 0% 72%, 2% 68%, 0.2% 64%);
}

/* 6: Crumpled cream vellum with diagonal fold */
.artist-card:nth-child(6n) {
  transform: rotate(0.28deg);
  filter: drop-shadow(4px 3px 0 oklch(0.56 0.14 162 / 0.85));
}
.artist-card:nth-child(6n) .card-paper {
  background-color: oklch(0.966 0.014 84);
  background-image:
    linear-gradient(155deg, transparent 0%, oklch(0.88 0.024 80 / 0.28) 48%, oklch(0.99 0.008 86 / 0.5) 52%, transparent 100%);
  clip-path: polygon(1.5% 0%, 72% 0.6%, 76% 2.3%, 79% 0.3%, 98.5% 1%, 100% 56%, 98.2% 59%, 100% 63%, 99% 99%, 34% 99.4%, 30% 97.5%, 26% 99.5%, 0.5% 98.5%, 0% 14%, 1.8% 11%, 0% 8%);
}

/* Subtle washi-tape strip on alternating cards */
.artist-card:nth-child(3n+1)::before,
.artist-card:nth-child(4n+2)::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 58px;
  height: 15px;
  transform: translateX(-50%) rotate(-3deg);
  background: oklch(0.75 0.12 162 / 0.62);
  border: 1px solid oklch(0.2 0.018 55 / 0.25);
  pointer-events: none;
  z-index: 3;
}

.artist-card:nth-child(4n+2)::before {
  left: 26%;
  width: 52px;
  transform: translateX(-50%) rotate(5deg);
  background: oklch(0.84 0.14 88 / 0.7);
}

@media (hover: hover) and (pointer: fine) {
  .artist-card:hover {
    transform: translate(-2px, -3px) rotate(0deg);
    filter: drop-shadow(5px 6px 0 oklch(0.2 0.018 55 / 0.92));
  }
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-muted);
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.artist-card:nth-child(3n+1) .card-media {
  border-radius: 12px 6px 10px 6px;
}

.artist-card:nth-child(3n+2) .card-media {
  border-radius: 6px 12px 6px 12px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 260ms var(--ease-out);
}

.card-img-fade {
  animation: imgFade 160ms var(--ease-out) both;
}

@media (hover: hover) and (pointer: fine) {
  .artist-card:hover .card-media img {
    transform: scale(1.03);
  }
}

.media-badge-row {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.price-badge {
  padding: 3px 9px;
  border-radius: var(--radius-sketch-sm);
  background: var(--surface-raised);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 600;
  box-shadow: 2px 2px 0 var(--ink);
}

.nsfw-badge {
  padding: 3px 8px;
  border-radius: var(--radius-sketch-sm);
  background: #b91c1c;
  border: 1.5px solid var(--ink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 2px 2px 0 var(--ink);
}

.thumb-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ink);
}

.thumb-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: oklch(0.98 0.01 90 / 0.45);
  cursor: pointer;
}

.thumb-dot::after {
  content: "";
  position: absolute;
  inset: -12px -8px;
}

.thumb-dot.active {
  background: var(--on-ink);
  transform: scale(1.25);
}

.card-body {
  padding: 12px 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.artist-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}

.avatar-lg {
  width: 44px;
  height: 44px;
}

.artist-identity {
  min-width: 0;
  flex: 1;
}

.artist-name {
  font-size: 0.96rem;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-handle {
  font-size: 0.74rem;
  color: var(--ink-muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artist-bio {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-pill {
  padding: 2px 8px;
  border-radius: var(--radius-sketch-sm);
  border: 1px dashed var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: 0.72rem;
}

.tag-pill-nsfw {
  border-color: #b91c1c;
  background: rgba(185, 28, 28, 0.1);
  color: #b91c1c;
  font-weight: 700;
}

.reason-pill {
  padding: 2px 8px;
  border-radius: var(--radius-sketch-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cta-link {
  flex: 1;
}

.skeleton-card {
  background: var(--surface-raised);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sketch);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-media {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: var(--surface-muted);
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--surface-muted);
}

.skeleton-line-lg { width: 65%; }
.skeleton-line-md { width: 85%; }
.skeleton-line-sm { width: 40%; }

.backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0.2 0.018 55 / 0.45);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
  outline: none;
  animation: fadeIn 180ms var(--ease-out) both;
}

.modal-backdrop {
  z-index: 60;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.sheet {
  width: min(520px, 100vw);
  height: 100%;
  background: var(--surface-raised);
  border-left: 2px solid var(--ink);
  box-shadow: var(--shadow-sheet);
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideInRight 280ms var(--ease-drawer) both;
}

.sheet-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sheet-title {
  font-family: "Architects Daughter", cursive, sans-serif;
  margin: 0;
  font-size: 1.4rem;
}

.sheet-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sheet-stage {
  display: block;
  border-radius: 8px;
  border: 2px solid var(--ink);
  overflow: hidden;
}

.sheet-stage img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.sheet-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.sheet-thumb {
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.sheet-thumb.active {
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--accent);
}

.sheet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sheet-bio {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-secondary);
  white-space: pre-line;
  max-width: 65ch;
}

.sheet-actions {
  margin-top: auto;
  padding-top: 16px;
  border-top: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-action-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.copy-btn {
  flex: none;
  min-width: 96px;
}

.copy-icon-wrap {
  position: relative;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-icon {
  position: absolute;
  inset: 0;
  transition:
    opacity 300ms cubic-bezier(0.2, 0, 0, 1),
    transform 300ms cubic-bezier(0.2, 0, 0, 1),
    filter 300ms cubic-bezier(0.2, 0, 0, 1);
}

.copy-icon.is-visible {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.copy-icon.is-hidden {
  opacity: 0;
  transform: scale(0.25);
  filter: blur(4px);
}

.modal-card {
  width: min(460px, 100%);
  background: var(--surface-raised);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sketch);
  box-shadow: var(--shadow-sketch-hover);
  padding: 24px;
  animation: modalEnter 200ms var(--ease-out) both;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-title {
  font-family: "Architects Daughter", cursive, sans-serif;
  margin: 0;
  font-size: 1.4rem;
}

.modal-copy,
.modal-list {
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

.modal-success {
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  font-size: 0.86rem;
}

.modal-error {
  margin: 10px 0;
  padding: 10px 12px;
  background: var(--error-bg);
  color: var(--error-ink);
  font-size: 0.84rem;
}

.modal-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 14px 0 6px;
}

.brief-input {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sketch-sm);
  padding: 10px 12px;
  font-size: 0.95rem;
  background: var(--bg);
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--surface-raised);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sketch);
}

.empty-doodle {
  color: var(--accent);
  margin-bottom: 12px;
}

.empty-title {
  margin: 0 0 8px;
  font-family: "Architects Daughter", cursive, sans-serif;
  font-size: 1.4rem;
}

.empty-copy {
  margin: 0 0 16px;
  color: var(--ink-secondary);
}

.footer {
  position: relative;
  overflow: visible;
  perspective: 1200px;
  font-family: "Architects Daughter", cursive, sans-serif;
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

.footer-rip-edge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 14px;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
  background-color: oklch(0.925 0.02 83);
  clip-path: polygon(
    0% 100%, 100% 100%, 100% 65%,
    96.5% 45%, 94% 75%, 91% 58%, 88.5% 22%, 85.5% 55%, 82.5% 40%, 79.5% 80%, 76.5% 60%,
    74% 28%, 71% 68%, 68% 52%, 65% 78%, 62% 35%, 59% 62%, 56% 15%, 53% 48%, 50% 68%,
    47% 42%, 44% 76%, 41% 55%, 38% 20%, 35% 66%, 32% 48%, 29% 82%, 26% 32%, 23% 60%,
    20% 22%, 17% 68%, 14% 48%, 11% 75%, 8% 30%, 5% 62%, 2.5% 76%, 0% 54%
  );
}

.footer-sheet,
.footer-sheet-under {
  position: relative;
  overflow: hidden;
  background-color: oklch(0.925 0.02 83);
  padding: 28px max(24px, env(safe-area-inset-right)) 3.5rem max(24px, env(safe-area-inset-left));
  transform-origin: top center;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--fold-footer, 1) * 76deg));
  backface-visibility: hidden;
  will-change: transform;
}

.footer-sheet {
  z-index: 1;
}

.footer-sheet-under {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

.footer.is-ripping .footer-sheet-under {
  opacity: 1;
}

.footer.is-ripping .footer-sheet {
  z-index: 30;
}

.footer-sheet::before,
.footer-sheet-under::before,
.footer-rip-edge::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(125deg, oklch(0.98 0.01 86 / 0.5) 0%, transparent 30%, oklch(0.82 0.028 78 / 0.36) 52%, transparent 76%, oklch(0.97 0.012 86 / 0.42) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.032' numOctaves='4' seed='7'/%3E%3CfeDiffuseLighting in='noise' lighting-color='%23f6efe2' surfaceScale='3.2'%3E%3CfeDistantLight azimuth='55' elevation='48'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='0.48'/%3E%3C/svg%3E");
  background-size: 100% 100%, 320px 320px;
  background-repeat: no-repeat, repeat;
}

.footer-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(
    to bottom,
    oklch(0.2 0.018 55 / 0.26) 0%,
    oklch(0.2 0.018 55 / 0.08) 55%,
    transparent 100%
  );
  opacity: var(--fold-footer, 1);
}

.footer-inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  overflow-wrap: anywhere;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.footer-link-dash {
  display: inline-block;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 350ms var(--ease-out), margin-right 350ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .footer-link:hover .footer-link-dash {
    width: 10px;
    margin-right: 5px;
  }
}

.footer-giant {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 24px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  user-select: none;
}

.footer-write-svg {
  width: min(1160px, 100%);
  height: auto;
  margin-bottom: -1.5%;
  color: oklch(0.2 0.018 55 / 0.34);
  overflow: visible;
}

.write-stroke {
  stroke-width: 4.2;
}

.footer-write-paths .write-stroke,
.footer-typo-paths .write-stroke {
  fill: currentColor;
  fill-opacity: 0;
}

.footer-flourish-paths .write-stroke {
  fill: none;
  stroke-width: 3.6;
}

.footer-write-svg.is-crayon .footer-write-paths,
.footer-write-svg.is-crayon .footer-typo-paths {
  filter: url(#crayon-grain);
}

.footer-write-svg.is-crayon .write-stroke {
  stroke-width: 6.5;
}

.footer-write-svg.is-brush .footer-write-paths,
.footer-write-svg.is-brush .footer-typo-paths {
  filter: url(#brush-soft);
}

.footer-write-svg.is-brush .write-stroke {
  stroke-width: 7.5;
}

.footer-write-svg.is-pencil .footer-write-paths,
.footer-write-svg.is-pencil .footer-typo-paths {
  filter: url(#pencil-grain);
}

.footer-write-svg.is-pencil .write-stroke {
  stroke-width: 2.3;
}

.footer-pen-nib,
.footer-eraser {
  color: var(--accent);
}

.footer-tool-img {
  filter: drop-shadow(2px 4px 4px rgba(35, 25, 18, 0.28));
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes modalEnter { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes modalExit { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.96); } }

@keyframes imgFade { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes drawSquiggle { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }
@keyframes drawDoodle { from { stroke-dashoffset: 220; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes sketchShift {
  0%   { transform: translate(0px, 0px) rotate(0deg); }
  25%  { transform: translate(0.8px, -0.6px) rotate(0.45deg); }
  50%  { transform: translate(-0.7px, 0.7px) rotate(-0.4deg); }
  75%  { transform: translate(0.5px, 0.4px) rotate(0.25deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-squiggle path {
    animation: drawSquiggle 520ms var(--ease-out) 120ms both;
  }

  .doodle-group.is-shifting .doodle-shift {
    animation: sketchShift 580ms steps(1, end) infinite;
  }

  .doodle-stroke:not(.doodle-dashed) {
    stroke-dasharray: 220;
    animation: drawDoodle 650ms var(--ease-out) both;
  }

  .doodle-dashed {
    animation: fadeIn 450ms var(--ease-out) both;
  }

  .skeleton-media,
  .skeleton-line {
    animation: pulseSoft 1.4s ease-in-out infinite;
  }

  @keyframes pulseSoft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .chip, .nav-pill, .artist-card, .card-media img, .copy-icon { transition-duration: 0.01ms !important; }
  .hero-squiggle path { animation: none; stroke-dashoffset: 0; }
}

@media (pointer: coarse) {
  .brief-input, .tag-search-input, .search input, .filter-select { font-size: 16px; }
  .btn, .nav-pill, .chip, .filter-select { min-height: 44px; }
}

@media (max-width: 640px) {
  .bar-in { padding: 8px 16px; height: auto; flex-wrap: wrap; gap: 10px; }
  .search { order: 3; width: 100%; }
  .search input { width: 100%; }
  .filters, .tag-browser-clip, .bar-landing-inner { padding-left: 16px; padding-right: 16px; }
  .container { padding: var(--bar-open-h, 290px) 16px 48px; }
}
