@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;

  --bg: #0c0e0e;
  --bg-deep: #070909;
  --surface: #141817;
  --surface-2: #191e1d;
  --raised: #1d2322;

  --line: rgba(233, 226, 208, .10);
  --line-soft: rgba(233, 226, 208, .06);
  --line-strong: rgba(233, 226, 208, .17);

  --text: #f0ede4;
  --muted: #9aa39b;
  --faint: #737d76;

  --gold: #d9bd83;
  --gold-bright: #f0d7a4;
  --gold-dim: rgba(217, 189, 131, .34);
  --gold-wash: rgba(217, 189, 131, .09);

  --danger: #f0a89a;

  --font: 'DM Sans', system-ui, -apple-system, Arial, sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 24px 60px -30px rgba(0, 0, 0, .9);
  --shadow-lift: 0 18px 44px -22px rgba(0, 0, 0, .85);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --gutter: clamp(20px, 4vw, 56px);
  --shell: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

:where(button, a, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--gold);
  color: #121513;
  font-size: 13px;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* ------------------------------------------------------------- ambience */
.ambience {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% -10%, #141918 0%, var(--bg) 46%, var(--bg-deep) 100%);
  contain: strict;
}

.ambience > span { position: absolute; display: block; }

.amb-grid {
  inset: 0;
  background-image:
    linear-gradient(rgba(233, 226, 208, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 226, 208, .035) 1px, transparent 1px);
  background-size: 76px 76px;
  -webkit-mask-image: radial-gradient(90% 70% at 50% 24%, #000 0%, transparent 78%);
  mask-image: radial-gradient(90% 70% at 50% 24%, #000 0%, transparent 78%);
  opacity: .8;
}

.amb-glow {
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.amb-glow-gold {
  width: min(58vw, 720px);
  aspect-ratio: 1.25;
  top: -18vh;
  left: -8vw;
  background: radial-gradient(circle, rgba(196, 160, 96, .20), transparent 68%);
  animation: drift-a 28s ease-in-out infinite alternate;
}
.amb-glow-cool {
  width: min(52vw, 640px);
  aspect-ratio: 1.1;
  bottom: -22vh;
  right: -10vw;
  background: radial-gradient(circle, rgba(74, 126, 120, .18), transparent 68%);
  animation: drift-b 34s ease-in-out infinite alternate;
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(5vw, 4vh, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.06); }
  to   { transform: translate3d(-5vw, -4vh, 0) scale(1); }
}

.amb-vignette {
  inset: 0;
  background: radial-gradient(130% 100% at 50% 40%, transparent 42%, rgba(0, 0, 0, .55) 100%);
}

.amb-grain {
  inset: -50%;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(to bottom, rgba(12, 14, 14, .92), rgba(12, 14, 14, .74));
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  max-width: var(--shell);
  margin: auto;
  padding: 0 var(--gutter);
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--gold-dim);
  background: linear-gradient(160deg, var(--gold-wash), transparent 70%);
  color: var(--gold);
  transition: border-color .25s var(--ease), background .25s var(--ease);
}
.brand-mark svg { width: 20px; height: 22px; }
.brand:hover .brand-mark { border-color: var(--gold); background: linear-gradient(160deg, rgba(217, 189, 131, .18), transparent 70%); }
.brand-text {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2.4px;
  line-height: 1.25;
  white-space: nowrap;
}
.brand-sub {
  display: block;
  color: var(--faint);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 2.2px;
}

.site-header nav { display: flex; align-items: center; gap: 30px; font-size: 14px; }
.site-header nav a,
.site-header nav .text-button { position: relative; color: var(--muted); padding: 6px 0; transition: color .2s var(--ease); }
.site-header nav a:hover, .site-header nav .text-button:hover { color: var(--text); }
.site-header nav a.active { color: var(--gold); }
.site-header nav a.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.text-button { color: var(--muted); font-size: 14px; transition: color .2s var(--ease); }
.text-button:hover { color: var(--gold); }

.wallet-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: rgba(233, 226, 208, .03);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.wallet-button:hover { border-color: var(--gold-dim); background: var(--gold-wash); transform: translateY(-1px); }
.wallet-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .04);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.wallet-button.connected .wallet-dot {
  background: #7fd4a8;
  box-shadow: 0 0 0 3px rgba(127, 212, 168, .16);
}

/* ----------------------------------------------------------------- main */
main {
  max-width: var(--shell);
  margin: auto;
  padding: 0 var(--gutter);
}

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: clamp(28px, 5vw, 52px) 0 clamp(24px, 3.4vw, 38px);
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--gold);
}
.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.04;
  letter-spacing: -.6px;
}
.intro h1 em {
  font-style: italic;
  background: linear-gradient(96deg, var(--gold-bright), var(--gold) 55%, #b9975f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro-note {
  margin: 0 0 6px;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
  text-align: right;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(340px, .92fr) minmax(400px, 1fr);
  gap: clamp(24px, 3.2vw, 48px);
  align-items: start;
  padding-bottom: 8px;
}

/* -------------------------------------------------------------- preview */
.portrait-panel {
  position: sticky;
  top: 104px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-card);
  padding: 16px 20px 0;
  overflow: hidden;
}

.panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}
.panel-top .eyebrow { margin: 0; font-size: 9.5px; color: var(--faint); letter-spacing: 1.9px; }
.edition-mark { font-size: 9.5px; letter-spacing: 1.9px; color: var(--faint); }

.art-mat {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--r-md);
  padding: clamp(18px, 3vw, 30px) clamp(22px, 4vw, 40px) 34px;
  background:
    radial-gradient(90% 70% at 50% 34%, rgba(217, 189, 131, .05), transparent 70%),
    linear-gradient(180deg, #101515, #0b0f0f);
  border: 1px solid var(--line-soft);
}
.art-mat::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(233, 226, 208, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 226, 208, .028) 1px, transparent 1px);
  background-size: 26px 26px;
}
.art-halo {
  position: absolute;
  z-index: -1;
  left: 50%; top: 44%;
  width: 72%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 189, 131, .16), transparent 66%);
  filter: blur(34px);
}

.art-frame { position: relative; }
.art-mat img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  image-rendering: pixelated;
  border-radius: 4px;
  transition: opacity .16s var(--ease), transform .3s var(--ease);
}
.art-mat img.swapping { opacity: .35; transform: scale(.985); }

.art-corner {
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--gold-dim);
  border-style: solid;
  z-index: 1;
}
.tl { top: 10px; left: 10px; border-width: 1px 0 0 1px; }
.tr { top: 10px; right: 10px; border-width: 1px 1px 0 0; }
.bl { bottom: 10px; left: 10px; border-width: 0 0 1px 1px; }
.br { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }

.mat-label {
  position: absolute;
  left: 0; right: 0; bottom: 12px;
  text-align: center;
  font-size: 8px;
  letter-spacing: 4.5px;
  color: var(--faint);
}

.art-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  font-size: 13px;
  color: var(--text);
}
#composition-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ccd0c8;
}
.tool-row { display: flex; gap: 7px; flex-shrink: 0; }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.icon-button svg {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-button:hover { color: var(--gold); border-color: var(--gold-dim); background: var(--gold-wash); }
.icon-button:active { transform: scale(.94); }
.icon-button.spin svg { animation: spin .5s var(--ease); }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(180deg); } }

.art-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 -20px;
  padding: 13px 20px;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .18);
  font-size: 8.5px;
  letter-spacing: 1.1px;
  color: var(--faint);
}

/* ----------------------------------------------------------- customizer */
.customizer {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.customizer-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.customizer-heading .eyebrow { font-size: 9.5px; color: var(--faint); letter-spacing: 1.9px; }
h2 { margin: 0; font: 400 clamp(26px, 3vw, 34px)/1.15 var(--serif); letter-spacing: -.3px; }

.count-pill {
  flex-shrink: 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.trait-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .28);
}
.trait-tabs button {
  position: relative;
  z-index: 1;
  padding: 10px 4px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color .22s var(--ease);
}
.trait-tabs button:hover { color: var(--text); }
.trait-tabs button[aria-selected="true"] { color: #f2e6c9; }
.tab-indicator {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px - 6px) / 4);
  border-radius: 7px;
  transition: transform .32s var(--ease), width .32s var(--ease);
  background: linear-gradient(180deg, rgba(217, 189, 131, .18), rgba(217, 189, 131, .07));
  border: 1px solid var(--gold-dim);
  transform: translateX(var(--tab-x, 0px));
}

.trait-scroller {
  position: relative;
  margin-top: 12px;
}
.trait-scroller::before,
.trait-scroller::after {
  content: '';
  position: absolute;
  left: 0; right: 12px;
  height: 28px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.trait-scroller::before { top: 0; background: linear-gradient(to bottom, var(--bg), transparent); }
.trait-scroller::after { bottom: 0; background: linear-gradient(to top, var(--bg), transparent); }
.trait-scroller[data-top="1"]::before { opacity: 1; }
.trait-scroller[data-bottom="1"]::after { opacity: 1; }

.trait-panel {
  height: clamp(300px, 42vh, 392px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 14px;
  margin-right: -6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 226, 208, .16) transparent;
}
.trait-panel::-webkit-scrollbar { width: 6px; }
.trait-panel::-webkit-scrollbar-track { background: transparent; }
.trait-panel::-webkit-scrollbar-thumb { background: rgba(233, 226, 208, .14); border-radius: 3px; }
.trait-panel::-webkit-scrollbar-thumb:hover { background: rgba(233, 226, 208, .26); }
.trait-panel:focus-visible { outline-offset: -2px; }

.trait-group {
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  animation: rise .34s var(--ease) both;
}
.trait-group:last-child { border-bottom: 0; }
.trait-group:nth-child(2) { animation-delay: .04s; }
.trait-group:nth-child(3) { animation-delay: .08s; }
.trait-group:nth-child(4) { animation-delay: .12s; }
.trait-group:nth-child(5) { animation-delay: .16s; }
.trait-group:nth-child(6) { animation-delay: .2s; }
.trait-group:nth-child(7) { animation-delay: .24s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.group-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.group-label h3 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: .1px; }
.group-label > span {
  font-size: 12px;
  color: var(--gold);
  opacity: .85;
  text-align: right;
}

.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line-strong), 0 2px 8px -2px rgba(0, 0, 0, .7);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.swatch:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 0 0 1px rgba(233, 226, 208, .35), 0 6px 14px -4px rgba(0, 0, 0, .8); }
.swatch.selected {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold), 0 4px 14px -4px rgba(217, 189, 131, .5);
}
.swatch.selected::after {
  content: '';
  position: absolute;
  left: 50%; top: 47%;
  width: 11px; height: 6px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  transform: translate(-50%, -50%) rotate(-45deg);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .9));
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}
.trait-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  padding: 10px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(233, 226, 208, .028);
  color: #bcc3bb;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.trait-option:hover { color: var(--text); border-color: var(--line-strong); background: rgba(233, 226, 208, .055); transform: translateY(-1px); }
.trait-option:active { transform: translateY(0) scale(.985); }
.trait-option.selected {
  color: #f4e8cb;
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(217, 189, 131, .17), rgba(217, 189, 131, .06));
  box-shadow: 0 6px 18px -10px rgba(217, 189, 131, .8);
}

/* ------------------------------------------------------------ mint dock */
.mint-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.mint-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #c3cac2;
}
.mint-line > div { display: flex; align-items: center; gap: 9px; }
.chain-glyph { color: var(--gold); font-size: 15px; }
.network-tag {
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgba(233, 226, 208, .04);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.3px;
  color: var(--muted);
}

.mint-terms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--line);
}
.mint-terms > div { padding: 11px 13px; background: rgba(233, 226, 208, .025); }
.mint-terms dt { font-size: 9px; letter-spacing: 1.5px; color: var(--faint); }
.mint-terms dd {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
  color: var(--gold-bright);
  font-variant-numeric: lining-nums tabular-nums;
}
.mint-terms dd small { font-family: var(--font); font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.mint-terms.live #term-left { color: var(--good, #7fd4a8); }

.mint-progress { margin: 0 0 14px; }
.mint-progress-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(233, 226, 208, .09);
  overflow: hidden;
}
.mint-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width .6s var(--ease);
}
.mint-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  font-size: 11px;
  letter-spacing: .6px;
  color: var(--faint);
  font-variant-numeric: lining-nums tabular-nums;
}
.mint-progress.sold .mint-progress-bar span { background: linear-gradient(90deg, #6fc39a, #7fd4a8); }
.mint-progress.sold .mint-progress-label { color: #7fd4a8; }

.mint-button {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #171a16;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .1px;
  box-shadow: 0 12px 30px -14px rgba(217, 189, 131, .75);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
}
.mint-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.mint-button:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -16px rgba(217, 189, 131, .85); }
.mint-button:hover::after { transform: translateX(120%); }
.mint-button:active { transform: translateY(0) scale(.994); }
.mint-button:disabled { filter: grayscale(.4); transform: none; }
.mint-button-arrow { font-size: 19px; line-height: 1; }
.batch-button {
  width: 100%;
  margin-top: 9px;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(233, 226, 208, .03);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.batch-button:hover:not(:disabled) { border-color: var(--gold-dim); background: var(--gold-wash); transform: translateY(-1px); }
.batch-button span { color: var(--muted); font-weight: 500; }

.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 6px;
  margin: 16px 0 4px;
  max-height: 220px;
  overflow-y: auto;
}
.batch-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
  border-radius: 3px;
  border: 1px solid var(--line-soft);
}

.mint-panel p {
  margin: 11px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--faint);
}

/* --------------------------------------------------------------- footer */
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(28px, 4vw, 44px);
  padding: 26px 0 34px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
}
footer > span {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: #aab1a5;
}
footer > div {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 10px;
  letter-spacing: .9px;
  color: var(--faint);
}
.footer-divider { color: rgba(233, 226, 208, .18); }

/* ---------------------------------------------------------------- modal */
dialog {
  width: min(540px, calc(100% - 28px));
  max-height: 86vh;
  padding: 26px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #181d1c, #121615);
  color: var(--text);
  box-shadow: 0 40px 120px -30px #000;
}
dialog[open] { animation: pop .26s var(--ease); }
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
dialog::backdrop {
  background: rgba(6, 9, 8, .74);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.modal-head .eyebrow { margin: 0; }
.close-button { font-size: 22px; line-height: 1; }
dialog h2 { font-size: clamp(27px, 4.4vw, 34px); margin-bottom: 4px; }
dialog p { font-size: 14px; line-height: 1.8; color: var(--muted); }
dialog a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
dialog .mint-button { margin-top: 20px; justify-content: center; }
dialog details { margin-top: 6px; }
dialog summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 8px 0; }
dialog summary:hover { color: var(--gold); }

.notice {
  padding: 14px 16px;
  border: 1px solid rgba(217, 189, 131, .28);
  border-radius: var(--r-sm);
  background: rgba(217, 189, 131, .08);
  color: #e3d5b1;
  font-size: 13.5px;
  line-height: 1.7;
}

.review-preview {
  display: block;
  width: 172px;
  height: 172px;
  margin: 18px auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  image-rendering: pixelated;
  box-shadow: var(--shadow-lift);
}
.review-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.review-row > span:first-child { color: var(--muted); }
.review-row > span:last-child { text-align: right; }

.trait-summary { max-height: 190px; overflow: auto; margin-top: 12px; scrollbar-width: thin; }
.step-list { padding-left: 20px; font-size: 14px; line-height: 1.8; color: var(--muted); }
.step-list li { margin: 10px 0; }
.step-list li::marker { color: var(--gold); }
.subtle { color: var(--muted); font-size: 13px; }
.error-note { color: var(--danger); }
.loading-note { padding: 30px 0; color: var(--muted); }
#tx-link { overflow-wrap: anywhere; }

.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.secondary-button {
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(233, 226, 208, .04);
  font-size: 14px;
}
.field { display: block; margin: 16px 0; font-size: 14px; }
.field input, .field select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .3);
  color: var(--text);
}

/* ---------------------------------------------------------------- toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 70;
  max-width: min(90vw, 420px);
  padding: 13px 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--gold-dim);
  background: rgba(22, 26, 24, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f0e6cf;
  font-size: 13.5px;
  text-align: center;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px) scale(.97);
  transition: opacity .24s var(--ease), transform .24s var(--ease);
}
#toast.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* --------------------------------------------------- one-screen shell */
/* On a desktop window tall enough to hold it, the studio becomes an app
   shell: nothing scrolls except the trait list. Below either threshold it
   falls back to the normal scrolling page. */
@media (min-width: 961px) and (min-height: 660px) {
  html, body { height: 100%; }
  body { overflow: hidden; display: flex; flex-direction: column; }

  .site-header { flex: 0 0 auto; }
  .header-inner { height: 68px; }

  main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .intro { flex: 0 0 auto; padding: clamp(14px, 2.2vh, 30px) 0 clamp(12px, 1.8vh, 24px); }
  .intro h1 { font-size: clamp(32px, 4.4vh, 52px); }
  .intro-note { font-size: 13px; line-height: 1.7; }

  .studio-layout { flex: 1 1 auto; min-height: 0; align-items: stretch; padding-bottom: 0; }

  /* preview column: the art takes whatever height is left */
  .portrait-panel {
    position: static;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0;
  }
  .panel-top, .art-tools, .art-caption { flex: 0 0 auto; }
  .art-mat { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
  /* the largest square that fits the leftover box, whichever axis binds */
  .art-frame { height: 100%; width: auto; aspect-ratio: 1; max-width: 100%; margin: auto; }
  .art-mat img { width: 100%; height: 100%; aspect-ratio: auto; }

  /* controls column: only the trait list scrolls */
  .customizer { height: 100%; min-height: 0; }
  .customizer-heading, .trait-tabs, .mint-panel { flex: 0 0 auto; }
  .customizer-heading { margin-bottom: clamp(10px, 1.6vh, 20px); }
  .trait-scroller { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .trait-panel { height: auto; flex: 1 1 auto; min-height: 0; }
  .mint-panel { margin-top: clamp(10px, 1.6vh, 18px); padding-top: clamp(10px, 1.6vh, 18px); }
  .mint-terms > div { padding: 9px 12px; }
  .mint-button { padding: 13px 20px; }

  footer {
    flex: 0 0 auto;
    margin-top: 0;
    padding: clamp(8px, 1.4vh, 16px) 0 clamp(10px, 1.6vh, 18px);
  }
  footer > span { font-size: 15px; }
}

/* Tall enough for the shell but short enough that the art would be squeezed:
   trim the decorative rows rather than the controls. */
@media (min-width: 961px) and (min-height: 660px) and (max-height: 820px) {
  .intro-note { display: none; }
  .art-caption { display: none; }
  .art-mat { padding: 14px 18px 24px; }
}

/* ----------------------------------------------------------- responsive */
@media (max-width: 1120px) {
  .studio-layout { grid-template-columns: minmax(300px, .9fr) minmax(340px, 1fr); }
  .intro-note { font-size: 13px; }
  .trait-option { font-size: 12px; }
  .option-grid { grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); }
}

@media (max-width: 900px) {
  .header-inner { height: 70px; }
  .site-header nav { display: none; }
  .intro { display: block; }
  .intro-note { margin-top: 16px; text-align: left; max-width: 46ch; }

  .studio-layout {
    grid-template-columns: 1fr;
    gap: 26px;
    max-width: 620px;
    margin: 0 auto;
  }
  .portrait-panel { position: static; }
  .trait-panel { height: auto; max-height: none; padding-right: 0; margin-right: 0; }
  .trait-scroller::before, .trait-scroller::after { display: none; }

  .trait-tabs { position: sticky; top: 70px; z-index: 30; background: rgba(10, 12, 12, .96); backdrop-filter: blur(10px); }
  .trait-tabs button { font-size: 13px; padding: 12px 2px; }

  .group-label h3 { font-size: 15px; }
  .group-label > span { font-size: 13px; }
  .swatch { width: 40px; height: 40px; }
  .trait-option { min-height: 48px; font-size: 13px; }
  .option-grid { grid-template-columns: repeat(auto-fit, minmax(98px, 1fr)); }

  .mint-panel {
    position: sticky;
    bottom: 0;
    z-index: 30;
    margin-top: 22px;
    padding: 14px 0 max(14px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 62%, rgba(12, 14, 14, .88));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  #toast { bottom: max(100px, calc(env(safe-area-inset-bottom) + 100px)); }

  footer { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 620px) {
  .header-inner { gap: 12px; }
  .customizer-heading .eyebrow { font-size: 9px; letter-spacing: 1.2px; }
  .art-tools { flex-wrap: wrap; row-gap: 10px; }
  #composition-name { flex: 1 1 100%; order: -1; }
  .tool-row { width: 100%; justify-content: space-between; }
  .brand { gap: 10px; min-width: 0; overflow: hidden; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text { font-size: 13.5px; letter-spacing: 1.5px; }
  .brand-sub { font-size: 7.5px; letter-spacing: 1.5px; }
  .wallet-button { padding: 9px 14px; font-size: 13px; gap: 8px; }
  .trait-tabs button { font-size: 12px; }
  .icon-button { width: 38px; height: 38px; }
  .art-caption { font-size: 7.5px; letter-spacing: .4px; }
  #composition-name { font-size: 12.5px; }
}

@media (max-width: 400px) {
  .brand-sub { display: none; }
  .art-caption span:nth-child(2) { display: none; }
  .option-grid { grid-template-columns: repeat(2, 1fr); }
}

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