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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Locked while the mobile nav drawer is open */
body.is-nav-open {
  overflow: hidden;
}

/* ── Responsive layout tokens ──────────────────────────
   Breakpoint literals mirror --bp-md / --bp-sm in tokens.css.
──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --gutter:      var(--space-md);
    --nav-height:  60px;
    --space-3xl:   120px;
    --space-2xl:   80px;
  }
}

@media (max-width: 480px) {
  :root {
    --space-3xl:   88px;
    --space-2xl:   56px;
    --space-xl:    40px;
  }
}

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

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

ul {
  list-style: none;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--border-radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.btn--primary {
  background: var(--color-accent);
  color: white;
}
.btn--primary:hover {
  background: var(--color-accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(160,48,212,0.35);
}

.btn--outline {
  background: transparent;
  color: var(--color-text-primary);
  border: 1.5px solid currentColor;
}
.btn--outline:hover {
  background: var(--color-text-primary);
  color: var(--color-bg);
  transform: translateY(-2px);
}

.btn--ghost {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1.5px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

/* ── Cursor blob ──────────────────────────────────────
   Only for devices with a real pointer. On touch there is
   no cursor to replace, and hiding the system cursor there
   would strip the caret from any focusable control.
──────────────────────────────────────────────────────── */
.cursor-blob {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  body,
  .btn,
  .nav__toggle {
    cursor: none;
  }

  .cursor-blob {
    display: block;
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-accent);
    mix-blend-mode: multiply;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width var(--duration-base) var(--ease-out),
                height var(--duration-base) var(--ease-out),
                background var(--duration-base) var(--ease-out),
                opacity var(--duration-base);
    will-change: transform;
  }
  .cursor-blob.is-hovering {
    width: 48px;
    height: 48px;
    background: var(--color-monika);
    opacity: 0.6;
  }
}

@media (hover: none), (pointer: coarse) {
  .btn,
  .nav__toggle {
    cursor: pointer;
  }
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--duration-xslow) var(--ease-out),
              transform var(--duration-xslow) var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Monika SVG wrapper & animations ─────────────────────
   Size Monika by setting --monika-size on any ancestor. The
   wrapper is the sizing, masking and animation unit: the body
   and the face layer are laid out as percentages of it, so
   scaling the wrapper keeps the face registered to the body.
   Never set a width on .monika-expression — that decouples
   the face from the body it sits on.
──────────────────────────────────────────────────────── */
.monika-wrapper {
  position: relative;
  width: var(--monika-size, 100%);
  max-width: 100%;
  height: auto;
  aspect-ratio: 652.55 / 967.33; /* Matches Monika-body.svg */
  animation: monika-bob 5s ease-in-out infinite;
}

@keyframes monika-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

/* Glow. Monika-body.svg wraps a PNG whose alpha channel is opaque across
   the whole canvas, so filter: drop-shadow() renders as a hard rectangle
   rather than tracing her silhouette. This paints the glow behind her
   instead. Sections opt in by setting --monika-glow. */
.monika-wrapper::before {
  content: '';
  position: absolute;
  inset: 4% -16% 10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--monika-glow, transparent), transparent);
  z-index: 0;
  pointer-events: none;
}

.monika-body {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

.monika-expression {
  position: absolute;
  /* The face is 600px wide on a 652px body, roughly 92% width */
  width: 92%;
  height: auto;
  aspect-ratio: 1 / 1;
  /* Centered horizontally: (100 - 92) / 2 = 4% */
  left: 4%;
  /* Rough guess for vertical placement on the head — tweak as needed! */
  top: 6%; 
  z-index: 2;
  transition: opacity 0.2s ease;
}

/* Sideeye Animation */
@keyframes pupils-look {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-15px); }
  75% { transform: translateX(15px); }
}
.monika-sideeye-anim ellipse {
  animation: pupils-look 3s ease-in-out infinite;
  transform-box: fill-box;
}
/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-accent); border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
