/* ============================================================
   Simple Pixel Art — Shared Design System
   ============================================================ */

:root {
  --accent: #ff5a3c;
  --accent-2: #00d4a8;
  --accent-soft: #ffe6df;

  --bg: #fafaf7;
  --bg-2: #f2f2ed;
  --surface: #ffffff;
  --surface-2: #f6f6f3;
  --line: #e6e6e0;
  --line-strong: #d2d2cb;

  --ink: #0a0a0a;
  --ink-2: #2a2a2a;
  --muted: #6b6b66;
  --muted-2: #98988f;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 0 rgba(10,10,10,.04), 0 1px 2px rgba(10,10,10,.04);
  --shadow: 0 4px 14px -6px rgba(10,10,10,.08), 0 1px 0 rgba(10,10,10,.04);
  --shadow-lg: 0 24px 60px -24px rgba(10,10,10,.22);

  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; padding: 0; color: inherit; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.container--wide { max-width: 1480px; }

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { background: #1a1a1a; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface); border-color: var(--ink); }
.btn--danger { background: transparent; color: #b13e53; border: 1px solid #ffd6dc; }
.btn--danger:hover { background: #fff0f2; border-color: #b13e53; }
.btn--lg { padding: 14px 24px; font-size: 15px; }
.btn--sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn--block { width: 100%; justify-content: center; }

/* ---- Button loading state ---- */
.btn.is-loading {
  position: relative;
  pointer-events: none;
  /* color: transparent hides BOTH child elements AND bare text nodes. */
  color: transparent !important;
  text-shadow: none;
}
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-width: 2px;
  border-style: solid;
  border-color: var(--ink);
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.7s linear infinite;
}
/* Variant overrides come AFTER so border-color wins over the base value.
   Primary (black) needs a white spinner; ghost/danger are fine with ink. */
.btn--primary.is-loading::after { border-color: #fff; border-top-color: transparent; }
.btn--danger.is-loading::after  { border-color: #b13e53; border-top-color: transparent; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---- Modal busy state ---- */
.modal-busy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 12px;
}
.modal-busy__text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.studio-page .modal-busy__text { color: var(--s-muted); }

/* ============== Navigation ============== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(250,250,247,.78);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 32px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 28px; height: 28px;
  gap: 1px;
  background: var(--ink);
  padding: 3px;
  border-radius: 6px;
  flex-shrink: 0;
}
.brand__mark--sm { width: 22px; height: 22px; padding: 2px; }
.px { background: #fff; }
.px--1, .px--9 { background: var(--accent); }
.px--3, .px--7 { background: var(--accent-2); }
.px--5 { background: var(--ink); border: 1px solid #fff; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 3px;
}
.nav__links {
  display: flex;
  gap: 4px;
  font-size: 14px;
}
.nav__links a {
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.nav__links a:hover { color: var(--ink); background: var(--surface); }
body[data-page="home"]    .nav__links a[data-page="home"],
body[data-page="studio"]  .nav__links a[data-page="studio"],
body[data-page="pixelate"].nav__links a[data-page="pixelate"],
body[data-page="ascii"]   .nav__links a[data-page="ascii"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.nav__cta { display: flex; align-items: center; gap: 8px; }

/* ============== AUTH (sign-in button + user pill) ============== */
.auth-signin {
  gap: 8px !important;
  padding: 7px 12px !important;
}
.auth-signin__g {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
}
.auth-pill {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}
.auth-pill__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.auth-pill__btn:hover { background: var(--surface-2); border-color: var(--ink); }

/* Skeleton (shown while the SDK validates a cached session) */
.auth-pill--skeleton .auth-pill__btn {
  cursor: default;
  pointer-events: none;
  border-color: var(--line);
}
.auth-pill__avatar--skeleton {
  background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%) !important;
  background-size: 200% 100% !important;
  animation: pill-shimmer 1.4s ease-in-out infinite;
}
.auth-pill__name--skeleton {
  display: inline-block;
  width: 72px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: pill-shimmer 1.4s ease-in-out infinite;
}
@keyframes pill-shimmer {
  0%, 100% { background-position: 0% 0; }
  50%      { background-position: 100% 0; }
}
.auth-pill__avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  flex-shrink: 0;
}
.auth-pill__avatar--initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  background: var(--accent-soft);
}
.auth-pill__name {
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-pill__badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: #fff;
  padding: 2px 5px;
  border-radius: 3px;
}
.auth-pill--admin .auth-pill__btn { border-color: var(--ink); }

.auth-pill__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 18px 40px -10px rgba(10,10,10,0.18);
  padding: 6px;
  z-index: 60;
}
.auth-pill__email {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  padding: 6px 10px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-pill__menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.auth-pill__menu button:hover { background: var(--surface-2); color: var(--ink); }
.auth-pill__link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
}
.auth-pill__link:hover { background: var(--surface-2); color: var(--ink); }

/* Dark variant for studio top bar */
.studio-page .auth-pill__btn {
  background: var(--s-bg-2);
  border-color: var(--s-line-3);
  color: var(--s-ink);
  height: 28px;
  font-size: 12px;
}
.studio-page .auth-pill__btn:hover { background: var(--s-bg-3); border-color: var(--s-ink-2); }
.studio-page .auth-pill__avatar { width: 20px; height: 20px; }
.studio-page .auth-pill__avatar--initials { color: var(--s-ink); background: var(--s-bg-3); }
.studio-page .auth-pill__menu {
  background: #252525;
  border-color: var(--s-line-3);
  box-shadow: 0 18px 40px -10px rgba(0,0,0,0.5);
}
.studio-page .auth-pill__email { color: var(--s-muted); border-bottom-color: var(--s-line); }
.studio-page .auth-pill__menu button { color: var(--s-ink-2); }
.studio-page .auth-pill__menu button:hover { background: var(--s-bg-2); color: var(--s-ink); }
/* Links (My dashboard, Admin dashboard) — same dark treatment as the buttons. */
.studio-page .auth-pill__link        { color: var(--s-ink-2); }
.studio-page .auth-pill__link:hover  { background: var(--s-bg-2); color: var(--s-ink); }
.studio-page .auth-pill__link svg,
.studio-page .auth-pill__menu button svg { color: var(--s-muted); }
.studio-page .auth-pill__link:hover svg,
.studio-page .auth-pill__menu button:hover svg { color: var(--s-ink); }
.studio-page .auth-signin { background: var(--s-bg-2) !important; border-color: var(--s-line-3) !important; color: var(--s-ink) !important; height: 28px; }
.studio-page .auth-signin:hover { background: var(--s-bg-3) !important; border-color: var(--s-ink-2) !important; }
.studio-page .auth-pill__avatar--skeleton,
.studio-page .auth-pill__name--skeleton {
  background: linear-gradient(90deg, var(--s-bg-2) 0%, var(--s-bg-3) 50%, var(--s-bg-2) 100%) !important;
  background-size: 200% 100% !important;
}

/* ============== LANGUAGE TOGGLE ============== */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid var(--line);
  background: transparent;
  transition: border-color .15s ease, background .15s ease;
}
.lang-toggle:hover { border-color: var(--line-strong); background: var(--surface); }
.lang-toggle [data-lang] {
  padding: 0 4px;
  border-radius: 4px;
  transition: color .15s ease;
}
.lang-toggle [data-lang].is-active { color: var(--ink); font-weight: 600; }
.lang-toggle__sep { color: var(--muted-2); }
@media (max-width: 720px) {
  .lang-toggle { font-size: 10px; padding: 5px 8px; }
}
/* Dark variant for studio top bar */
.studio-page .lang-toggle {
  color: var(--s-muted);
  border-color: var(--s-line-3);
  height: 28px;
  font-size: 10px;
  padding: 0 10px;
}
.studio-page .lang-toggle:hover {
  background: var(--s-bg-2);
  border-color: var(--s-ink-2);
}
.studio-page .lang-toggle [data-lang].is-active { color: var(--s-ink); }

@media (max-width: 860px) { .nav__links { display: none; } }
@media (max-width: 560px) { .nav__cta .btn--ghost { display: none; } }

/* ============== Eyebrow + Section Heads ============== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow--muted { background: transparent; }
.eyebrow__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(0,212,168,.18);
}
.section { padding: 110px 0; }
.section--alt { background: var(--bg-2); }
.section__head { max-width: 700px; margin-bottom: 56px; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section__head h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  margin: 18px 0 14px;
}
.section__head p { color: var(--muted); font-size: 17px; max-width: 540px; }
.section__head--center p { margin-left: auto; margin-right: auto; }

/* ============== HERO ============== */
.hero {
  padding: 80px 0 110px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(10,10,10,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,10,10,.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at top, rgba(0,0,0,.6), transparent 70%);
  pointer-events: none;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
  position: relative;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 24px 0 22px;
  font-weight: 600;
}
.accent { color: var(--accent); position: relative; display: inline-block; }
.accent::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 12px;
  background: var(--accent-soft);
  z-index: -1;
  border-radius: 2px;
}
.hero__lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 0 32px;
}
.hero__lead strong { color: var(--ink); font-weight: 600; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero interactive frame (window-style) */
.hero__art { position: relative; }
.hero__frame {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero__frame-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.hero__dots { display: flex; gap: 6px; }
.hero__dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.hero__dots span:nth-child(1) { background: #ff5a5a; }
.hero__dots span:nth-child(2) { background: #ffc857; }
.hero__dots span:nth-child(3) { background: #00d4a8; }
.hero__filename {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  text-align: center;
}
.hero__try {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot--green { background: var(--accent-2); box-shadow: 0 0 0 4px rgba(0,212,168,.18); }

.hero__canvas-wrap {
  position: relative;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Credit pill for the currently displayed featured hero design */
.hero__credit {
  position: absolute;
  left: 28px;
  bottom: 28px;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.78);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  pointer-events: auto;
  overflow: hidden;
  max-width: calc(100% - 56px);
}
.hero__credit[hidden] { display: none; }
.hero__credit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  color: inherit;
  text-decoration: none;
  transition: background .15s ease;
}
.hero__credit-link:hover { background: rgba(255,255,255,0.12); }
.hero__credit-link svg { opacity: 0.85; flex-shrink: 0; }
.hero__credit-link--profile { padding-left: 10px; }
.hero__credit-link--ig {
  padding: 5px 9px;
  border-left: 1px solid rgba(255,255,255,0.15);
}
.hero__credit-link--ig:hover {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}
.hero__credit-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: -0.01em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
.hero__credit-author {
  color: #ffcc99;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.hero__credit-author::before { content: "·"; margin: 0 6px 0 2px; color: rgba(255,255,255,0.4); }
#heroCanvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background:
    repeating-conic-gradient(#f7f7f3 0% 25%, #ececdf 0% 50%) 50% / 14px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(10,10,10,.04);
  cursor: crosshair;
  touch-action: none;
  width: 100%;
  max-width: 384px;
  height: auto;
  aspect-ratio: 1;
  display: block;
}
.hero__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  gap: 12px;
}
.hero__palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.hero__palette button {
  width: 22px; height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(10,10,10,.08);
  cursor: pointer;
  position: relative;
  transition: transform .15s ease;
}
.hero__palette button:hover { transform: scale(1.1); }
.hero__palette button.is-active::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid var(--ink);
  border-radius: 7px;
}
.hero__actions { display: flex; gap: 6px; }
.chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color .15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip--icon { width: 28px; padding: 0; justify-content: center; }
.chip--share {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  padding: 0 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.chip--share:hover { background: #1a1a1a; border-color: #1a1a1a; }
.chip--icon.is-spinning svg { animation: heroSpin .4s cubic-bezier(.7,.0,.3,1); }
@keyframes heroSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.hero__chip {
  position: absolute;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  letter-spacing: 0.02em;
}
.hero__chip--b { bottom: -16px; right: 24px; }
.hero__chip-key {
  background: var(--ink);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
}

@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; gap: 56px; }
}

/* ============== TOOLS GRID (Cards) ============== */
.tools-grid {
  padding: 100px 0;
  background: var(--bg-2);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card-tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.card-tool:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}
.card-tool__visual {
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card-tool__visual--studio {
  background: linear-gradient(135deg, #fafaf7, #f0f0e8);
}
.card-tool__visual--pixelate {
  background: linear-gradient(135deg, #fff4f0, #ffe6df);
}
.card-tool__visual--ascii {
  background: #0a0a0a;
  color: #00d4a8;
  font-family: var(--font-mono);
}
.mini-grid {
  width: 70%;
  aspect-ratio: 1;
  display: grid;
  gap: 1px;
  background: rgba(10,10,10,.1);
  padding: 1px;
  border-radius: 4px;
}
.mini-grid span { background: var(--surface); }
.mini-ascii {
  font-size: 14px;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.5px;
  color: #00d4a8;
}
.card-tool__body { padding: 24px 24px 28px; }
.card-tool__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.card-tool__body h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.card-tool__body p { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.card-tool__cta {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap .2s ease;
}
.card-tool:hover .card-tool__cta { gap: 8px; }

@media (max-width: 880px) { .cards { grid-template-columns: 1fr; } }

/* ============== TOOL PAGE (Pixelate / ASCII) ============== */
.tool-page { padding: 60px 0 110px; }
.tool-page__head { max-width: 700px; margin: 0 auto 36px; text-align: center; }
.tool-page__head h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  margin: 18px 0 14px;
}
.tool-page__head p { color: var(--muted); font-size: 17px; }

/* ============== CONVERTER ============== */
.converter {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Original-side compare card doubles as drop target */
.compare--source { cursor: pointer; }
.compare--source.has-image { cursor: default; }
.compare--source:not(.has-image) .compare__frame {
  border: 2px dashed var(--line-strong);
  background-image: none;
  background-color: var(--surface);
  transition: border-color .2s ease, background-color .2s ease;
}
.compare--source.is-dragover .compare__frame {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}
.compare--source.has-image .compare__empty { display: none; }

.compare__change {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-transform: none;
  flex: 0 0 auto;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.compare__change svg { flex-shrink: 0; }
.compare__change:hover {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.compare--source.has-image .compare__change { display: inline-flex; }

/* Drop UI shown inside the empty frame */
.compare__empty--drop {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 24px 18px;
  color: var(--muted);
  line-height: 1.35;
  max-width: 100%;
}
.drop__icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.drop__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: 100%;
}
.drop__sub { font-size: 13px; color: var(--muted); line-height: 1.4; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.drop__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 4px;
  line-height: 1.4;
}

.converter__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1.1fr) minmax(120px, 0.7fr);
  grid-template-areas:
    "slider1 slider2 toggle"
    "preset  preset   actions";
  gap: 16px 22px;
  align-items: end;
}
.converter__panel > :nth-child(1) { grid-area: slider1; }
.converter__panel > :nth-child(2) { grid-area: slider2; }
.converter__panel > :nth-child(3) { grid-area: toggle; }
.converter__panel > :nth-child(4) { grid-area: preset; }
.converter__panel > :nth-child(5) { grid-area: actions; align-self: end; justify-self: end; }
.converter__panel .control { min-width: 0; }
.converter__panel .presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
}
.converter__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .converter__panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "slider1"
      "slider2"
      "toggle"
      "preset"
      "actions";
  }
  .converter__panel > :nth-child(5) { justify-self: stretch; }
  .converter__actions { justify-content: stretch; }
  .converter__actions .btn { flex: 1; justify-content: center; }
}
.control { display: flex; flex-direction: column; gap: 8px; }
.control label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
}
.control__value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 999px;
}
.control__hint { font-size: 12px; color: var(--muted); margin: 0; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--ink);
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--ink);
}

.switch { position: relative; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; inset: 0;
  background: var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease;
}
.switch__slider::before {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform .2s ease;
}
.switch input:checked + .switch__slider { background: var(--ink); }
.switch input:checked + .switch__slider::before { transform: translateX(16px); }

.presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
}
.control.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.control.is-disabled input[type="range"] { cursor: not-allowed; }
.preset, .ramp {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--ink-2);
  transition: all .15s ease;
}
.preset:hover, .ramp:hover { border-color: var(--ink); }
.preset.is-active, .ramp.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.ramp { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; }

.converter__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.converter__compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.compare {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.compare__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  overflow: visible;
  line-height: 1;
}
.compare__label > span {
  white-space: nowrap;
  overflow: visible;
  flex: 0 0 auto;
}
.compare__frame {
  flex: 1;
  min-height: 560px;
  background:
    repeating-conic-gradient(#f5f5f0 0% 25%, #ebebe5 0% 50%) 50% / 20px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.compare__frame canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* Loader / placeholder text inside a frame should never poke out */
.compare__frame .compare__empty,
.compare__frame .loader__text {
  max-width: 100%;
  padding: 0 12px;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}
.compare__frame { contain: layout paint; }

/* ---- Zoom overlay (Pixelate / ASCII previews) ---- */
.zoom-overlay {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  font-family: var(--font-mono);
  box-shadow: 0 2px 10px -2px rgba(0,0,0,0.12);
  z-index: 4;
  user-select: none;
}
.zoom-overlay button {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.zoom-overlay button:hover { background: var(--surface-2); color: var(--ink); }
.zoom-overlay button:disabled { opacity: 0.35; cursor: not-allowed; }
.zoom-overlay button:disabled:hover { background: transparent; color: var(--ink-2); }
.zoom-overlay__val {
  font-size: 11px;
  min-width: 44px;
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.02em;
}
/* Dark variant for ASCII result */
.compare__frame--ascii .zoom-overlay {
  background: rgba(30,30,30,0.92);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 2px 10px -2px rgba(0,0,0,0.4);
}
.compare__frame--ascii .zoom-overlay button { color: rgba(255,255,255,0.7); }
.compare__frame--ascii .zoom-overlay button:hover { background: rgba(255,255,255,0.08); color: #fff; }
.compare__frame--ascii .zoom-overlay__val { color: rgba(255,255,255,0.5); }

/* The canvas inside a zoom-able frame: GPU-friendly scaling */
.compare__frame canvas { transform-origin: center center; transition: transform .18s ease; }
#resultCanvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.compare__empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.compare__frame canvas[data-has] + .compare__empty { display: none; }

@media (max-width: 880px) {
  .converter__compare { grid-template-columns: 1fr 1fr; }
  .compare__frame { min-height: 360px; }
}
@media (max-width: 560px) {
  .converter__compare { grid-template-columns: 1fr; }
  .compare__frame { min-height: 320px; }
}

/* ============== Pixel Spinner / Loader ============== */
.pixel-spinner {
  width: 36px;
  height: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}
.pixel-spinner span {
  background: var(--ink);
  border-radius: 1px;
  opacity: 0.15;
  animation: pixel-pulse 1.2s infinite ease-in-out;
}
.pixel-spinner span:nth-child(1) { animation-delay: 0.0s; }
.pixel-spinner span:nth-child(2) { animation-delay: 0.1s; }
.pixel-spinner span:nth-child(3) { animation-delay: 0.2s; }
.pixel-spinner span:nth-child(6) { animation-delay: 0.3s; }
.pixel-spinner span:nth-child(9) { animation-delay: 0.4s; }
.pixel-spinner span:nth-child(8) { animation-delay: 0.5s; }
.pixel-spinner span:nth-child(7) { animation-delay: 0.6s; }
.pixel-spinner span:nth-child(4) { animation-delay: 0.7s; }
.pixel-spinner span:nth-child(5) { animation-delay: 0.4s; background: var(--accent); }
@keyframes pixel-pulse {
  0%, 100% { opacity: 0.15; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
.loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 5;
  /* No opacity fade — appears instantly with full blur */
}
.loader[hidden] { display: none; }
.loader__text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* ASCII compare specifics */
.compare__frame--ascii {
  background: var(--ink);
  padding: 16px;
  align-items: flex-start;
  justify-content: flex-start;
}
.compare__frame--ascii .compare__empty { color: rgba(255,255,255,.5); margin: auto; }
.compare__frame--ascii .loader { background: rgba(10,10,10,.86); }
.compare__frame--ascii .loader__text { color: rgba(255,255,255,.7); }
.compare__frame--ascii .pixel-spinner span { background: #fff; opacity: 0.15; }
.compare__frame--ascii .pixel-spinner span:nth-child(5) { background: var(--accent-2); }
.ascii__output {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: var(--font-mono);
  color: #f5f5f0;
  line-height: 1;
  white-space: pre;
  overflow: auto;
  font-size: 6px;
  background: transparent;
}
.ascii__output:empty { display: none; }
.ascii__compare .compare__frame { aspect-ratio: 1; }

/* ============== FEATURES ============== */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.feature__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  margin-bottom: 18px;
}
.feature__icon svg { width: 22px; height: 22px; }
.feature h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.feature p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ============== GALLERY ============== */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.gallery__item {
  aspect-ratio: 1;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}
.gallery__item:hover { transform: translateY(-2px); }
.gallery__item canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
@media (max-width: 860px) { .gallery { grid-template-columns: 1fr 1fr; } }

/* ============== CREATIONS OF THE MONTH ============== */
.section__head--between {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  max-width: none;
  flex-wrap: wrap;
}
.section__head--between > div { max-width: 540px; }
.creations__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.creation {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.creation:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}
.creation__rank {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}
.creation__art {
  aspect-ratio: 1;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px;
}
.creation__art canvas {
  width: 80%;
  height: 80%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.creation__body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.creation__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.creation__author-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
}
.creation__author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  padding: 2px 0;
  transition: color .15s ease;
}
.creation__author:hover { color: var(--accent); }
.creation__author svg { flex-shrink: 0; }
.creation__author.author-link--ig {
  width: 24px; height: 24px;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0;
}
.creation__author.author-link--ig:hover {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  border-color: transparent;
}
.creation__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.creation__likes { display: inline-flex; align-items: center; gap: 4px; }
.creation__dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.creation__dl:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (max-width: 880px) { .creations__grid { grid-template-columns: 1fr; } }

/* ============== MODAL (light theme — used on landing) ============== */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}
.modal-root[hidden] { display: none; }
.modal-root.is-open { pointer-events: auto; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px -16px rgba(10,10,10,0.25);
  /* No fade — shadow blur stays at final value */
}
.modal-root--large  .modal { max-width: 600px; }
.modal-root--xlarge .modal { max-width: 960px; }
.modal-root--small  .modal { max-width: 380px; }
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.modal__close {
  width: 28px; height: 28px;
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.modal__close:hover { background: var(--surface-2); color: var(--ink); }
.modal__body {
  padding: 20px;
  overflow: auto;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}
.modal__body p { margin: 0 0 10px; }
.modal__body p:last-child { margin-bottom: 0; }
.modal__actions {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--surface-2);
}

/* Form */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field:last-child { margin-bottom: 0; }
.form-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.form-input,
.form-textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.05);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-input-prefixed {
  position: relative;
  display: flex;
  align-items: stretch;
}
.form-input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  pointer-events: none;
}
.form-input--prefixed { padding-left: 24px; }
.form-file__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(0,212,168,0.12);
  border: 1px solid var(--accent-2);
  border-radius: 4px;
  padding: 4px 8px;
}
.form-prefill-note {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(255,90,60,0.2);
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13px;
}
.form-prefill-note strong {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(255,255,255,0.6);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Auth0-derived contact field (read-only chip) */
.form-readonly {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
}
.form-readonly svg { color: var(--muted); flex-shrink: 0; }
.form-readonly > span:nth-of-type(1) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.form-readonly__hint {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* Hero submission size lock notice */
.form-size-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-2);
  background: rgba(0, 212, 168, 0.08);
  border: 1px solid rgba(0, 212, 168, 0.28);
  border-radius: 10px;
}
.form-size-notice svg { flex-shrink: 0; margin-top: 2px; color: #00a786; }

/* Crisp pixel-art preview for downsampled / .pxa images. Stays inside the
   56×56 container (no overflow crop) and uses object-fit:contain so a non-
   square or tiny source is fully visible. */
.form-file__preview img[style*="pixelated"] {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--surface);
}

/* "No design yet? Open Studio with the right size" block */
.form-studio-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px 16px;
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.form-studio-cta--picker {
  grid-template-columns: 1fr;
}
.form-studio-cta__copy { min-width: 0; }
.form-studio-cta__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.form-studio-cta__hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.form-studio-cta__sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.form-studio-cta__size {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.form-studio-cta__size:hover { border-color: var(--ink); color: var(--ink); }
.form-studio-cta__size.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.form-studio-cta__btn {
  justify-self: start;
  padding: 8px 14px;
  font-size: 12px;
}
.form-studio-cta--picker .form-studio-cta__btn { justify-self: start; }
@media (max-width: 480px) {
  .form-studio-cta { grid-template-columns: 1fr; }
  .form-studio-cta__btn { justify-self: stretch; text-align: center; }
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }
.form-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border: 2px dashed var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  text-align: center;
}
.form-file:hover { border-color: var(--ink); background: var(--surface-2); }
.form-file input { display: none; }
.form-file__hint { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.form-file.has-file { border-color: var(--accent-2); background: rgba(0,212,168,0.05); }
.form-file__preview {
  width: 56px; height: 56px;
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.form-file__preview img { width: 100%; height: 100%; object-fit: cover; }
.form-error {
  color: #b13e53;
  font-size: 12px;
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ============== CTA ============== */
.cta {
  background: var(--ink);
  color: #fff;
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .6;
  pointer-events: none;
}
.cta__inner { position: relative; text-align: center; }
.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 14px;
}
.cta p { color: rgba(255,255,255,.7); font-size: 17px; margin: 0 0 32px; }
.cta__buttons { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.cta .btn--primary { background: #fff; color: var(--ink); }
.cta .btn--primary:hover { background: #f0f0f0; }
.cta .btn--ghost { color: #fff; border-color: rgba(255,255,255,.25); }
.cta .btn--ghost:hover { background: rgba(255,255,255,.08); border-color: #fff; }

/* ============== PAGE TRANSITION ============== */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--ink);
  pointer-events: none;
  transform: translateY(0%);
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}
.page-transition__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity .25s ease, transform .25s ease;
}
.page-transition__mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 48px; height: 48px;
  gap: 2px;
  background: var(--ink);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
}
.page-transition__mark .px { background: #fff; }
.page-transition__mark .px--1, .page-transition__mark .px--9 { background: var(--accent); }
.page-transition__mark .px--3, .page-transition__mark .px--7 { background: var(--accent-2); }
.page-transition__mark .px--5 { background: var(--ink); border: 1px solid #fff; }

/* States */
.page-transition.is-revealing {
  transform: translateY(-100%);
  transition: transform .55s cubic-bezier(.85,0,.15,1);
}
.page-transition.is-covering {
  transform: translateY(0%);
  animation: page-cover .38s cubic-bezier(.7,0,.3,1) forwards;
}
.page-transition.is-covering .page-transition__inner {
  opacity: 1;
  transform: scale(1);
  animation: mark-pop .38s ease forwards;
}
.page-transition.is-idle {
  transform: translateY(-100%);
  pointer-events: none;
}
@keyframes page-cover {
  from { transform: translateY(100%); }
  to   { transform: translateY(0%); }
}
@keyframes mark-pop {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* Entry animation for page contents — opacity only, no transform.
   A persistent transform on <body> would make it a containing block for
   position:fixed elements (e.g. the modal-root), which produces a visible
   jump when focusable elements call .focus() inside the modal. */
@media (prefers-reduced-motion: no-preference) {
  body { animation: page-enter .45s ease both; }
}
@keyframes page-enter {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============== ABOUT ============== */
.about {
  padding: 90px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.about__inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}
.about__left h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin: 16px 0 16px;
}
.about__credits {
  font-size: 17px;
  color: var(--ink-2);
  margin: 0 0 10px;
}
.about__credits a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-thickness .15s ease, color .15s ease;
}
.about__credits a:hover { text-decoration-thickness: 2px; color: var(--ink); }
.about__note { color: var(--muted); font-size: 14px; margin: 0; }
.about__right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.bmac-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: #ffdd00;
  color: #0d0c22;
  border-radius: 14px;
  border: 1px solid #e2c500;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 6px 0 #b89f00;
}
.bmac-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #b89f00; }
.bmac-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b89f00; }
.bmac-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bmac-btn__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-sans);
  line-height: 1.1;
}
.bmac-btn__text strong { font-size: 15px; font-weight: 600; }
.bmac-btn__text em {
  font-style: normal;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: rgba(13,12,34,.6);
  margin-top: 3px;
}
.about__links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.about__links a { transition: color .15s ease; }
.about__links a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .about__inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ============== ADMIN ============== */
.admin { padding: 60px 0 100px; }
.admin__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.admin__head h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 14px 0 8px;
  color: var(--ink);
}
.admin__subtitle { color: var(--muted); margin: 0; }
.admin__counts {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.admin__counts strong { color: var(--ink); font-weight: 600; }

.admin__gate, .admin__denied, .admin__empty {
  text-align: center;
  padding: 80px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.admin__gate .pixel-spinner { margin: 0 auto 18px; }
.admin__denied h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--ink);
  margin: 0 0 8px;
}
.admin__denied code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-2);
}
.admin__denied .btn { margin-top: 18px; }
.admin__empty-icon { font-size: 36px; margin-bottom: 10px; }

.admin__tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
}
.admin__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.admin__tab:hover { color: var(--ink-2); }
.admin__tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.admin__tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0 6px;
  background: var(--surface-2);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.admin__tab.is-active .admin__tab-count {
  background: var(--ink);
  color: #fff;
}

.admin__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ============== EXPLORE / PROFILE ============== */
.explore {
  padding: 64px 0 96px;
  min-height: 60vh;
}
.explore__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.explore__head h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
  margin: 8px 0 6px;
}
.explore__subtitle { color: var(--muted); margin: 0; }
.explore__sort {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.explore__sort-btn {
  padding: 7px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.explore__sort-btn:hover { color: var(--ink); }
.explore__sort-btn.is-active { background: var(--ink); color: #fff; }

.explore__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.explore-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, border-color .15s ease;
}
.explore-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.explore-card__art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background:
    repeating-conic-gradient(#f5f5f0 0% 25%, #ebebe5 0% 50%) 50% / 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  border: 0;
  padding: 0;
}
.explore-card__art img,
.explore-card__art canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.explore-card__size {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  background: rgba(10,10,10,0.7);
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
}
.explore-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.explore-card__author-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.explore-card__author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.explore-card__author:hover { color: var(--ink); }
.explore-card__author-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Generic author link styling — used on explore + creations cards. */
.author-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--ink-2);
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.author-link:hover { color: var(--ink); }
.author-link--ig {
  width: 26px; height: 26px;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.author-link--ig:hover {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  border-color: transparent;
}
.explore-card__author img,
.explore-card__author .explore-card__avatar-stub {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
}
.explore-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.explore-card__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.explore-card__reactions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.rxn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.rxn:hover { color: var(--ink); border-color: var(--line-strong); }
.rxn--like.is-active    { background: rgba(255,90,60,0.12);  color: #ff5a3c; border-color: rgba(255,90,60,0.35); }
.rxn--dislike.is-active { background: rgba(91,124,250,0.12); color: #5b7cfa; border-color: rgba(91,124,250,0.35); }

.explore__loader {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 48px 0;
  color: var(--muted);
}
.explore__empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted);
}
.explore__empty .btn { margin-top: 18px; }
.explore__more { text-align: center; margin-top: 32px; }

/* Project visibility badge + Publish toggle on /my cards */
.adcard__visibility {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(10,10,10,0.78);
  color: #fff;
}
.adcard__visibility--public  { background: rgba(0,168,134,0.92); }
.adcard__visibility--private { background: rgba(10,10,10,0.78); }

.adcard__publish {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.adcard__publish input { position: absolute; opacity: 0; pointer-events: none; }
.adcard__publish-track {
  position: relative;
  width: 34px; height: 18px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background .18s ease, border-color .18s ease;
  flex-shrink: 0;
}
.adcard__publish-thumb {
  position: absolute;
  top: 1px; left: 1px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform .18s ease, background .18s ease;
}
.adcard__publish input:checked ~ .adcard__publish-track {
  background: var(--accent-2, #00d4a8);
  border-color: var(--accent-2, #00d4a8);
}
.adcard__publish input:checked ~ .adcard__publish-track .adcard__publish-thumb {
  transform: translateX(16px);
}
.adcard__publish input:disabled ~ .adcard__publish-track { opacity: 0.5; }

/* ============== PROFILE EDITOR (/my Profile tab) ============== */
.profile-editor {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto;
}
.profile-editor__head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.profile-editor__avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.profile-editor__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-editor__avatar span {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--muted);
}
.profile-editor__copy h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.01em;
}
.profile-editor__copy p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}
.profile-editor__copy code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}
.profile-editor .form-input,
.profile-editor .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}
.profile-editor .form-input:focus,
.profile-editor .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 60, 0.15);
}
.profile-editor .form-textarea { min-height: 80px; resize: vertical; }
.profile-editor .form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.profile-editor .form-hint {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-align: right;
}
.profile-editor .form-input-prefixed {
  position: relative;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.profile-editor .form-input-prefixed:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 60, 0.15);
}
/* RESET the global absolute prefix (that overlays the input) so we can use
   a real flex-row prefix here without the text overlapping with what the
   user types. */
.profile-editor .form-input-prefix {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.profile-editor .form-input--prefixed {
  border: 0;
  border-radius: 0;
  padding-left: 12px;  /* override global padding-left: 24px */
  flex: 1;
  min-width: 0;
}
.profile-editor .form-input--prefixed:focus { box-shadow: none; border: 0; }

.profile-editor .form-hint--left { text-align: left; margin: 4px 0 8px; }
.profile-editor__privacy {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.profile-editor__privacy legend {
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-editor__check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
}
.profile-editor__check input {
  width: 16px; height: 16px;
  accent-color: var(--accent);
}
.profile-editor__avatar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.profile-editor__avatar-actions .btn { cursor: pointer; }

.profile-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.profile-editor__feedback {
  margin: 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.profile-editor__feedback--ok  { background: rgba(0,168,134,0.1); color: #00866a; border: 1px solid rgba(0,168,134,0.3); }
.profile-editor__feedback--err { background: rgba(177,62,83,0.1); color: #b13e53; border: 1px solid rgba(177,62,83,0.3); }

/* Public profile links row (Instagram, email chips on /u/<handle>) */
.profile__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 10px;
}
.profile__links:empty { display: none; }
.profile__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.profile__link:hover { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.profile__link svg { flex-shrink: 0; }
.profile__link--ig:hover {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  border-color: transparent;
}

/* ============== PROFILE PAGE ============== */
.profile { padding: 64px 0 96px; min-height: 60vh; }
.profile__head {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.profile__avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
}
.profile__avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
/* Pixel-art SVG avatars (e.g. the seed brand account) — render crisp. */
.profile__avatar img[src^="data:image/svg+xml"] {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #0a0a0a;
}
.profile__avatar span {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  color: var(--muted);
}
.profile__info h1 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.02em;
}
.profile__handle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.profile__bio { margin: 4px 0 10px; color: var(--ink-2); max-width: 520px; }
.profile__stats {
  display: flex; gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.profile__stats strong { color: var(--ink); }
.profile__gate, .profile__notfound {
  text-align: center; padding: 64px 24px;
  color: var(--muted);
}
/* Date filter row above the cards */
.admin__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.admin__filters[hidden] { display: none; }
.admin__filter-presets { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.admin__filter-chip {
  padding: 5px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.admin__filter-chip:hover    { color: var(--ink); border-color: var(--line-strong); }
.admin__filter-chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.admin__filter-range {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.admin__filter-range label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  letter-spacing: 0.04em;
}
.admin__filter-range input[type="date"] {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  background: var(--surface);
}
.admin__filter-clear {
  padding: 5px 10px;
  background: transparent;
  border: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.admin__filter-clear:hover { color: var(--ink); }

.admin__hint {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(91, 124, 250, 0.08);
  border: 1px solid rgba(91, 124, 250, 0.28);
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}
.admin__hint svg { color: #5b7cfa; flex-shrink: 0; margin-top: 3px; }
.admin__hint strong { color: var(--ink); }

/* "Two surfaces" legend at top of every tab */
.admin__surfaces {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 4px;
}
@media (max-width: 720px) {
  .admin__surfaces { grid-template-columns: 1fr; }
}
.admin__surface {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.admin__surface--hero      { background: linear-gradient(180deg, rgba(255,90,60,0.06), transparent); border-color: rgba(255,90,60,0.3); }
.admin__surface--creations { background: linear-gradient(180deg, rgba(0,212,168,0.06), transparent); border-color: rgba(0,212,168,0.3); }
.admin__surface-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-family: var(--font-display);
  color: var(--ink);
}
.admin__surface-head svg     { flex-shrink: 0; }
.admin__surface--hero      .admin__surface-head svg     { color: #ff5a3c; }
.admin__surface--creations .admin__surface-head svg     { color: #00a786; }
.admin__surface-head strong { font-weight: 600; letter-spacing: -0.01em; }
.admin__surface-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin__surface-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
}
.admin__surface p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.admin__surface code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink-2);
}

/* Surface pill on each submission card */
.adcard__surface {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
}
.adcard__surface--hero      { background: rgba(255,90,60,0.92); }
.adcard__surface--creations { background: rgba(0,168,134,0.92); }

/* Grouped header on the Featured tab */
.admin__group-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 4px 6px;
  border-bottom: 1px solid var(--line);
  margin-top: 6px;
}
.admin__group-head strong {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.admin__group-head span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.admin__group-head .admin__group-count {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
}
.admin__group-head--hero      strong { border-bottom: 2px solid #ff5a3c; padding-bottom: 2px; }
.admin__group-head--creations strong { border-bottom: 2px solid #00a786; padding-bottom: 2px; }

.admin__empty--inline {
  grid-column: 1 / -1;
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* Slot pill in the global counts row */
.admin__slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
}
.admin__slot--hero      strong { color: #ff5a3c; }
.admin__slot--creations strong { color: #00a786; }
.adcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .2s ease;
}
.adcard:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.adcard__art {
  aspect-ratio: 1;
  background:
    repeating-conic-gradient(#f5f5f0 0% 25%, #ebebe5 0% 50%) 50% / 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.adcard__art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.adcard__art[data-zoom] { cursor: zoom-in; }
.adcard__zoom-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.adcard__art:hover .adcard__zoom-hint { opacity: 1; transform: translateY(0); }

/* Lightbox-style preview inside the shared Modal */
.submission-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: stretch;
}
.submission-preview__frame {
  position: relative;
  background:
    repeating-conic-gradient(#f5f5f0 0% 25%, #ebebe5 0% 50%) 50% / 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 420px;
  aspect-ratio: 1;
}
.submission-preview__frame img {
  position: absolute;
  inset: 18px;
  width: calc(100% - 36px);
  height: calc(100% - 36px);
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.submission-preview__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}
.submission-preview__row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.submission-preview__row span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.submission-preview__row strong {
  font-weight: 500;
  color: var(--ink);
  word-break: break-word;
}
.submission-preview__desc {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
@media (max-width: 720px) {
  .submission-preview { grid-template-columns: 1fr; }
  .submission-preview__frame { min-height: 240px; }
}
.adcard__status {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
}
.adcard__status--pending  { background: #ffc857; color: #000; }
.adcard__status--approved { background: var(--accent-2); color: #000; }
.adcard__status--featured { background: var(--accent); color: #fff; }
.adcard__status--rejected { background: #b13e53; color: #fff; }
.adcard__body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.adcard__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}
.adcard__title--editable {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
}
.adcard__title--editable .adcard__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adcard__rename {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.adcard:hover .adcard__rename { opacity: 1; }
.adcard__rename:hover { background: var(--surface-2); color: var(--ink); }
.adcard__rename:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.adcard__name-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  letter-spacing: -0.02em;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.adcard__name-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 90, 60, 0.18);
}
.adcard__title--editable.is-saving .adcard__name-input { opacity: 0.6; }
.adcard__author {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.adcard__author a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.adcard__desc {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.adcard__meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.adcard__actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.adcard__actions .btn { flex: 1 1 auto; padding: 8px 12px; font-size: 12px; justify-content: center; text-align: center; }
.adcard__submitter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
}
.adcard__submitter--anon {
  border-style: dashed;
  border-color: rgba(177, 62, 83, 0.35);
  background: rgba(177, 62, 83, 0.05);
}
.adcard__submitter--linked {
  border-color: rgba(0, 168, 134, 0.3);
  background: rgba(0, 168, 134, 0.06);
}
.adcard__sub-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  background: var(--ink);
  color: #fff;
}
.adcard__sub-avatar--stub  { background: var(--ink); color: #fff; }
.adcard__sub-avatar--anon  {
  background: rgba(177, 62, 83, 0.18);
  color: #b13e53;
}
.adcard__sub-text {
  display: flex; flex-direction: column;
  min-width: 0; flex: 1;
}
.adcard__sub-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.adcard__sub-name {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adcard__sub-name a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.adcard__sub-email {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adcard__rejected-reason {
  margin-top: 10px;
  font-size: 12px;
  padding: 8px 10px;
  background: #fff0f3;
  border: 1px solid #ffd6dc;
  border-radius: 6px;
  color: #b13e53;
}

/* ============== FOOTER ============== */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 15px;
  letter-spacing: -0.02em;
}
.footer__links { display: flex; gap: 24px; }
.footer__links a:hover { color: var(--ink); }

/* Compact "About" block surfaced in every page footer. */
.footer__about {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  text-align: right;
}
.footer__about-credits {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.footer__about-credits a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}
.footer__about-credits a:hover { text-decoration-color: var(--accent); }
.footer__bmac {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ffdd00;
  color: #1a1a1a;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 3px 0 #b89f00;
  transition: transform .15s ease, box-shadow .15s ease;
}
.footer__bmac:hover { transform: translateY(-1px); box-shadow: 0 4px 0 #b89f00; color: #1a1a1a; }
.footer__bmac:active { transform: translateY(1px); box-shadow: 0 1px 0 #b89f00; }
.footer__bmac svg { width: 12px; height: 12px; }
@media (max-width: 640px) {
  .footer__about { align-items: flex-start; text-align: left; }
}
