:root {
  --yellow: #0e1cb4;
  --yellow-dark: #0b1490;
  --brown: #8a4b21;
  --brown-dark: #3b2412;
  --cream: #f6f7ff;
  --bg-dark: #070a1f;
  --text-main: #0b1028;
  --text-light: #f6f7ff;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.18);
  --shadow-small: 0 6px 18px rgba(0, 0, 0, 0.18);
  --accent-neon: #b6ff2e;
  --accent-magenta: #ff2edc;
  --bg-base: #050617;
  --bg-ink: #0a0b22;
  --bg-ink-2: #090a1c;
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Baloo 2", "Nunito Sans", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 0%, rgba(60, 80, 255, 0.55) 0, rgba(14, 28, 180, 0.22) 35%, rgba(5, 6, 23, 1) 72%),
    radial-gradient(circle at 85% 20%, rgba(182, 255, 46, 0.14) 0, rgba(255, 46, 220, 0.08) 28%, rgba(5, 6, 23, 0) 60%),
    linear-gradient(180deg, #050617 0%, #06071a 55%, #07081f 100%);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.065;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.7) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1px 100%),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1px 100%);
  background-size: 220px 220px, 260px 260px, 240px 240px;
  animation: grainShift 9s linear infinite;
}

@keyframes grainShift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-10px, 6px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

img {
  max-width: 100%;
  display: block;
}

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

/* HEADLINE / DISPLAY FONT */

h1,
h2,
h3,
.logo-text,
.tagline,
.btn,
.nav a {
  font-family: "Chewy", "Anton", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.06em;
}

/* LAYOUT */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* HEADER / NAV */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background:
    linear-gradient(180deg, rgba(10, 11, 34, 0.82), rgba(8, 9, 28, 0.78));
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
  border-bottom: 3px solid #000;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    rgba(182, 255, 46, 0.65),
    rgba(60, 80, 255, 0.55),
    rgba(255, 46, 220, 0.45)
  );
  opacity: 0.6;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: var(--shadow-small);
  border: 4px solid #000;
}

.logo-text {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.95rem;
  color: var(--text-light);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.nav a {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: none;
  opacity: 0.92;
  color: var(--text-light);
}

.nav a:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.7rem;
  cursor: pointer;
  color: var(--text-light);
}

/* HERO / EDITOR SECTION */

.hero {
  padding: 4rem 0 3.2rem;
  position: relative;
  z-index: 1;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40px 0 -30px 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(
      circle at 30% 20%,
      rgba(182, 255, 46, 0.12) 0,
      rgba(14, 28, 180, 0.18) 28%,
      rgba(5, 6, 23, 0) 60%
    ),
    radial-gradient(
      circle at 80% 10%,
      rgba(255, 46, 220, 0.08) 0,
      rgba(14, 28, 180, 0.12) 30%,
      rgba(5, 6, 23, 0) 62%
    );
  opacity: 0.9;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 3rem;
  align-items: flex-start;
}

.tagline {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 0.5rem;
  color: rgba(246, 247, 255, 0.9);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 4.2vw, 3.2rem);
  line-height: 0.95;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-light);
  transform: skewX(-3deg);
  text-align: center;
}

.hero-subtitle {
  max-width: 540px;
  font-size: 1rem;
  margin: 0 auto 1.5rem;
  color: rgba(246, 247, 255, 0.92);
  text-align: center;
}

/* BUTTONS */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  border: 3px solid #000;
  cursor: pointer;
  box-shadow: var(--shadow-small);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  transition: transform 140ms ease, filter 180ms ease, background 180ms ease;
  will-change: transform;
  background: #000;
  color: var(--cream);
}

.btn.primary {
  background: #000;
  color: var(--cream);
}

.btn.primary:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 0 14px rgba(182, 255, 46, 0.14));
}

.btn.secondary {
  background: rgba(246, 247, 255, 0.9);
  color: var(--text-main);
}

.btn.secondary:hover {
  background: #fff;
  transform: translateY(-2px) scale(1.02);
}

.btn.ghost {
  background: transparent;
  border-style: dashed;
  color: var(--text-light);
}

.btn.ghost:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 0 12px rgba(255, 46, 220, 0.1));
}

/* SECTIONS & DIVIDERS */

.section {
  padding: 3.5rem 0;
  position: relative;
  z-index: 1;
}

.section .container {
  position: relative;
  z-index: 1;
}

.section-alt {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(14, 28, 180, 0.1)
  );
  position: relative;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-light);
  transform: skewX(-2deg);
}

.section-subtitle {
  text-align: center;
  max-width: 520px;
  margin: 0 auto 2rem;
  font-size: 0.95rem;
  color: rgba(246, 247, 255, 0.9);
}

.section-divider {
  height: 18px;
  width: 100%;
  background-image: repeating-linear-gradient(
    -45deg,
    #000 0 10px,
    rgba(182, 255, 46, 0.95) 10px 20px
  );
  opacity: 0.22;
  margin-bottom: 2rem;
}

.section-divider--inverse {
  height: 18px;
  width: 100%;
  background-image: repeating-linear-gradient(
    45deg,
    #000 0 10px,
    rgba(255, 46, 220, 0.9) 10px 20px
  );
  opacity: 0.18;
  margin-bottom: 2rem;
}

/* TWO COLUMN LAYOUT (GUIDE) */

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: flex-start;
}

.about-card {
  background: rgba(246, 247, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.4rem 1.5rem;
  box-shadow: var(--shadow-small);
  border: 3px solid #000;
}

/* FOOTER */

.site-footer {
  background: #000;
  color: var(--text-light);
  padding: 1.5rem 0 2rem;
  border-top: 3px solid #000;
}

.footer-content {
  text-align: center;
  font-size: 0.8rem;
}

.footer-disclaimer {
  max-width: 600px;
  margin: 0.5rem auto 0;
  opacity: 0.8;
}

/* EDITOR-SPECIFIC STYLING */

.editor-layout {
  align-items: flex-start;
  margin-bottom: 2rem;
}

.editor-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.editor-heading {
  margin-bottom: 2.5rem;
  text-align: center;
  width: 100%;
}

.editor-actions {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 520px;
}

.editor-actions .btn,
.editor-actions .upload-btn {
  flex: 1;
  min-width: 0;
}

.editor-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 520px;
  align-items: flex-end;
  justify-content: flex-end;
}

.editor-download {
  width: 100%;
  max-width: 520px;
  margin-top: 1rem;
}

.download-btn-full {
  width: 100%;
  display: flex;
  justify-content: center;
}

.upload-btn {
  position: relative;
  overflow: hidden;
}

.upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.canvas-wrap {
  margin-top: 0.75rem;
  border-radius: var(--radius-lg);
  border: 3px solid #000;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(182, 255, 46, 0.08), rgba(20, 22, 50, 0.95)),
    linear-gradient(180deg, #0a0c24 0%, #0d0f2a 100%);
  box-shadow: var(--shadow-soft);

  /* Wrapper follows canvas size horizontally, with small padding */
  width: 100%;
  max-width: 520px;
  padding: 0.75rem;

  /* Center the canvas inside */
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-wrap canvas {
  display: block;
  /* Canvas has its own border to show actual export area */
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

/* Canvas ratio & image fit controls */

.ratio-controls {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.ratio-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(246, 247, 255, 0.8);
}

.ratio-buttons {
  display: inline-flex;
  background: rgba(10, 11, 34, 0.7);
  border-radius: var(--radius-pill);
  padding: 2px;
  border: 1px solid rgba(246, 247, 255, 0.18);
}

.ratio-btn,
.fit-btn {
  border: none;
  background: transparent;
  color: rgba(246, 247, 255, 0.85);
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 120ms ease, color 120ms ease;
}

.ratio-btn.active,
.fit-btn.active {
  background: #f6f7ff;
  color: #000;
}

.editor-note {
  font-size: 0.8rem;
  margin-top: 0.75rem;
  color: rgba(246, 247, 255, 0.9);
  width: 100%;
  max-width: 520px;
  text-align: center;
}

.editor-sidebar {
  background: rgba(10, 11, 34, 0.42);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.4rem 1.6rem;
  border: 2px solid rgba(182, 255, 46, 0.18);
  backdrop-filter: blur(12px);
  box-shadow: none;
}

.editor-sidebar-desktop {
  display: block;
}

.editor-sidebar-mobile {
  display: none;
  width: 100%;
  max-width: 520px;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  padding: 1rem 1rem 1.2rem;
}

.editor-sidebar-mobile .sidebar-title {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.editor-sidebar-mobile .sidebar-subtitle {
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.sidebar-title {
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
  color: rgba(246, 247, 255, 0.95);
}

.sidebar-subtitle {
  font-size: 0.85rem;
  margin: 0 0 1rem;
  color: rgba(246, 247, 255, 0.9);
}

.mascot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
}

.mascot-thumb {
  background: rgba(246, 247, 255, 0.96);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.6rem 0.7rem;
  border: 3px solid #000;
  box-shadow: var(--shadow-small);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  transition: transform 140ms ease, box-shadow 180ms ease;
}

.mascot-thumb:hover {
  transform: translateY(-2px) rotate(-0.2deg);
  box-shadow: 0 0 14px rgba(60, 80, 255, 0.18);
}

.mascot-thumb-inner {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.mascot-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.sidebar-help {
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: rgba(246, 247, 255, 0.9);
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: minmax(0, 1fr);
  }

  .editor-sidebar-desktop {
    display: none;
  }

  .editor-sidebar-mobile {
    display: block;
  }

  .editor-sidebar-mobile .mascot-grid {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
  }

  .editor-sidebar-mobile .mascot-grid::-webkit-scrollbar {
    height: 4px;
  }

  .editor-sidebar-mobile .mascot-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
  }

  .editor-sidebar-mobile .mascot-grid::-webkit-scrollbar-thumb {
    background: rgba(182, 255, 46, 0.5);
    border-radius: 2px;
  }

  .editor-sidebar-mobile .mascot-thumb {
    flex: 0 0 auto;
    min-width: 70px;
    max-width: 70px;
    padding: 0.4rem 0.4rem 0.5rem;
  }

  .editor-sidebar-mobile .mascot-thumb-inner {
    width: 100%;
    aspect-ratio: 1 / 1;
  }

  .editor-sidebar-mobile .mascot-label {
    font-size: 0.6rem;
    margin-top: 0.2rem;
  }

  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.97);
    color: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.8rem 1.5rem 1.1rem;
    gap: 0.7rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.18s ease;
  }

  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    color: #fff;
  }

  .hero {
    padding-top: 3rem;
  }

  .editor-controls {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .canvas-wrap {
    border-width: 2px;
  }
}

