/* Avatar Maker — risograph / sticker-press styling. No web fonts, no CDN. */

:root {
  --ink: #17140f;
  --ink-2: #4a4238;
  --paper: #f5efe3;
  --paper-2: #ebe2d2;
  --card: #fffdf8;
  --flame: #ef4b28;
  --ocean: #1f5fd0;
  --amber: #f0b429;
  --moss: #2f855a;
  --line: 2px solid var(--ink);
  --line-h: 3px solid var(--ink);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 999px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--ocean); text-underline-offset: 3px; }
a:hover { color: var(--flame); }

:focus-visible {
  outline: 3px solid var(--ocean);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 14px;
}

h1 { font-size: clamp(34px, 6vw, 60px); }
h2 { font-size: clamp(25px, 3.6vw, 34px); }
h3 { font-size: 20px; }

p { margin: 0 0 16px; }

.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--ink-2);
  max-width: 62ch;
}

/* ------------------------------------------------------------------ chrome */

.topbar {
  border-bottom: var(--line-h);
  background: var(--paper);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: var(--line);
  border-radius: 10px;
  background: var(--flame);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  color: var(--card);
  font-size: 17px;
}

.topbar nav {
  display: flex;
  gap: 18px;
  font-weight: 600;
  font-size: 15px;
}

.hero { padding: 44px 0 26px; }
.hero .tagline {
  display: inline-block;
  background: var(--amber);
  border: var(--line);
  border-radius: var(--r-pill);
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------ studio */

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 26px;
  align-items: start;
  padding-bottom: 12px;
}

.stage-col { position: sticky; top: 18px; }

.stage {
  border: var(--line-h);
  border-radius: var(--r-lg);
  background:
    radial-gradient(var(--paper-2) 1.6px, transparent 1.7px) 0 0 / 14px 14px,
    var(--card);
  box-shadow: var(--shadow);
  padding: 20px;
}

.stage svg {
  display: block;
  width: 100%;
  height: auto;
  border: var(--line);
  border-radius: var(--r-md);
}

.stage-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.seedbar {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.seedbar input {
  flex: 1 1 190px;
  min-width: 0;
  font: inherit;
  font-size: 16px;
  padding: 10px 14px;
  border: var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
}

.status {
  margin-top: 12px;
  min-height: 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--moss);
}

button, .btn {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  padding: 10px 16px;
  min-height: 42px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

button:active, .btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-primary { background: var(--flame); color: var(--card); border: var(--line-h); }
.btn-ink { background: var(--ink); color: var(--card); }

select {
  font: inherit;
  font-weight: 700;
  padding: 10px 12px;
  min-height: 42px;
  border: var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
}

.rail {
  border: var(--line-h);
  border-radius: var(--r-lg);
  background: var(--paper-2);
  box-shadow: var(--shadow);
  padding: 18px;
  max-height: min(78vh, 900px);
  overflow-y: auto;
}

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rail-head h2 { margin: 0; font-size: 22px; }
.rail-head span { font-size: 13px; color: var(--ink-2); font-weight: 600; }

.group { border: 0; margin: 0 0 16px; padding: 0; }

.group legend {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 0 0 7px;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  padding: 7px 12px;
  min-height: 38px;
  font-size: 14px;
  border-radius: var(--r-pill);
  box-shadow: none;
}

.chip.is-on {
  background: var(--flame);
  color: var(--card);
  box-shadow: var(--shadow-sm);
}

.swatch {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 50%;
  box-shadow: none;
}

.swatch.is-on {
  box-shadow: var(--shadow-sm);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.noscript {
  border: var(--line);
  border-left: 8px solid var(--flame);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 14px 16px;
  margin-bottom: 18px;
}

/* ------------------------------------------------------------------ prose */

.section { padding: 46px 0; border-top: var(--line); }
.section > p, .section > ul, .section > ol { max-width: 68ch; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.card {
  border: var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }

.step-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: var(--line);
  border-radius: 50%;
  background: var(--amber);
  font-weight: 800;
  margin-bottom: 10px;
}

.faq { max-width: 74ch; }

.faq details {
  border: var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 4px 16px;
  margin-bottom: 12px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: " +"; color: var(--flame); font-weight: 800; }
.faq details[open] summary::after { content: " \2212"; }
.faq details p { margin: 0 0 14px; }

.prose { padding: 40px 0 10px; max-width: 74ch; }
.prose h2 { margin-top: 34px; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.meta { font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* ----------------------------------------------------------------- footer */

.site-footer {
  border-top: var(--line-h);
  margin-top: 40px;
  padding: 26px 0 40px;
  font-size: 15px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  justify-content: space-between;
  align-items: center;
}

.footer-nav { display: flex; gap: 18px; font-weight: 600; }

/* ------------------------------------------------------------- 404 / misc */

.center-block { padding: 70px 0; text-align: center; }
.center-block .btn { display: inline-block; text-decoration: none; }

@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .stage-col { position: static; }
  .rail { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
