@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/BarlowCondensed-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Event text fonts: subset to Latin, used only on the badge canvas. */
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Open Sans";
  src: url("fonts/OpenSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("fonts/Poppins-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("fonts/Poppins-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Kaushan Script";
  src: url("fonts/KaushanScript-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --purple: #984DF9;
  --purple-strong: #6E2BD9;
  --ink: #323335;
  --muted: #5F6368;
  --page: #F3F4F6;
  --surface: #FFFFFF;
  --line: #D4D6DC;
  --error: #B3261E;
  --radius: 14px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  color-scheme: light;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.site-header,
.layout,
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header {
  padding-top: 24px;
}

.eyebrow {
  margin: 0;
  color: var(--purple-strong);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 8px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

h1 span {
  display: block;
  margin-top: 4px;
  color: var(--purple-strong);
  font-size: 0.55em;
  font-weight: 400;
  text-transform: none;
}

.lede {
  margin: 0;
  color: var(--muted);
}

.layout {
  display: grid;
  gap: 24px;
  padding-top: 20px;
  padding-bottom: 32px;
}

@media (min-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
  }

  .preview {
    position: sticky;
    top: 16px;
  }
}

.canvas-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 24px rgb(0 0 0 / 0.08);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

canvas.has-photo {
  cursor: grab;
  touch-action: none;
}

canvas.dragging {
  cursor: grabbing;
}

canvas:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: -3px;
}

.add-photo {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
}

fieldset {
  min-width: 0;
  margin: 0 0 16px;
  padding: 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
}

legend {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
}

legend + * {
  clear: both;
}

.field + .field {
  margin-top: 16px;
}

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

label {
  font-weight: 600;
}

.count {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

input[type="text"] {
  box-sizing: border-box;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  font-size: 16px;
}

input[type="text"]:focus-visible {
  border-color: var(--purple-strong);
  outline: 3px solid rgb(152 77 249 / 0.35);
  outline-offset: 0;
}

input[aria-invalid="true"] {
  border-color: var(--error);
}

.help,
.privacy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.error {
  margin: 6px 0 0;
  color: var(--error);
  font-size: 0.9rem;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--error);
  border-radius: 8px;
  background: #FDECEA;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--purple-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--purple-strong);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: var(--purple-strong);
  color: #fff;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn:focus-visible,
.file-btn:focus-within {
  outline: 3px solid rgb(152 77 249 / 0.45);
  outline-offset: 2px;
}

.btn:disabled {
  border-color: var(--line);
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.file-btn {
  position: relative;
}

.file-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.photo-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.photo-tools input[type="range"] {
  flex: 1;
  accent-color: var(--purple-strong);
}

.link-btn {
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--purple-strong);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actions .btn {
  flex: 1 1 160px;
}

.site-footer {
  padding-bottom: 32px;
  color: var(--muted);
  font-size: 0.85rem;
}
