:root {
  --bg-deep: #140e0c;
  --bg-mid: #1f1511;
  --lime: #c5e07a;
  --lime-dim: #9bb85a;
  --shell: #8a4524;
  --shell-light: #c4783a;
  --cream: #f3e6d0;
  --ink: #1a100c;
  --gold: #e8a838;
  --muted: rgba(243, 230, 208, 0.72);
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--cream);
  background: var(--bg-deep);
  overflow-x: hidden;
  min-height: 100dvh;
}

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

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 70% 35%, rgba(197, 224, 122, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 20% 70%, rgba(196, 120, 58, 0.18), transparent 50%),
    linear-gradient(165deg, #241814 0%, #140e0c 45%, #0e0a08 100%);
}

#crumbs {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: glowDrift 12s ease-in-out infinite alternate;
}

.glow-a {
  width: min(48vw, 420px);
  height: min(48vw, 420px);
  top: 8%;
  right: 8%;
  background: rgba(197, 224, 122, 0.22);
}

.glow-b {
  width: min(40vw, 340px);
  height: min(40vw, 340px);
  bottom: 12%;
  left: 6%;
  background: rgba(232, 168, 56, 0.16);
  animation-delay: -4s;
}

.tile-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28vh;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(243, 230, 208, 0.03) 0 48px,
      rgba(243, 230, 208, 0.07) 48px 96px
    ),
    linear-gradient(to top, rgba(10, 6, 4, 0.85), transparent);
  mask-image: linear-gradient(to top, black 20%, transparent 100%);
}

@keyframes glowDrift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-3%, 4%) scale(1.08);
  }
}

.topnav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--lime);
}

.nav-links {
  display: flex;
  gap: clamp(0.85rem, 2.5vw, 1.6rem);
  font-weight: 700;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--cream);
}

.hero {
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - 4.5rem);
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  padding: 0 clamp(1rem, 4vw, 2.5rem) 1.5rem;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  padding-bottom: 1rem;
  animation: riseIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime-dim);
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 14vw, 7.2rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--cream);
  text-shadow: 0 0 40px rgba(197, 224, 122, 0.18);
}

.tagline {
  margin: 1rem 0 1.5rem;
  max-width: 28rem;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  line-height: 1.45;
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cta:hover {
  transform: translateY(-2px);
}

.cta-home,
.cta.is-current {
  background: var(--lime);
  color: var(--ink);
}

.cta-odoo {
  background: transparent;
  border-color: rgba(243, 230, 208, 0.35);
  color: var(--cream);
}

.cta-odoo:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.cta-glad {
  background: var(--shell);
  color: var(--cream);
}

.cta-glad:hover {
  background: var(--shell-light);
  color: var(--ink);
}

.mascot-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.roach {
  width: min(92vw, 720px);
  height: auto;
  transform-origin: 50% 70%;
  will-change: transform;
  pointer-events: auto;
  cursor: pointer;
  outline: none;
}

.roach:focus-visible {
  filter: drop-shadow(0 0 12px rgba(197, 224, 122, 0.55));
}

.dress-hint {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--lime-dim);
}

.roach-body {
  transform-origin: 320px 300px;
}

.leg {
  transform-origin: 320px 260px;
}

.ground-shadow {
  transform-origin: 320px 470px;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subpages */
.page {
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem;
  max-width: 40rem;
}

.page h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.8rem);
  line-height: 1;
}

.page p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.5;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: center;
    padding-bottom: 2.5rem;
  }

  .hero-copy {
    padding-bottom: 0;
  }

  .mascot-stage {
    position: relative;
    inset: auto;
    min-height: min(70vh, 620px);
    pointer-events: none;
  }

  .roach {
    width: min(100%, 640px);
  }
}

@media (max-width: 899px) {
  .hero-copy {
    padding-top: 42vh;
  }

  .mascot-stage {
    align-items: flex-start;
    padding-top: 1rem;
  }

  .roach {
    width: min(88vw, 420px);
    margin-top: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glow,
  .hero-copy {
    animation: none;
  }
}

/* Projects catch arena */
.page-projects {
  overflow: hidden;
}

.projects-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 4.5rem);
  padding: 0 clamp(1rem, 4vw, 2.5rem) 1.25rem;
}

.projects-intro {
  position: relative;
  z-index: 2;
  max-width: 36rem;
  margin-bottom: 0.75rem;
  animation: riseIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.projects-intro h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  line-height: 0.95;
}

.projects-hint {
  margin: 0;
}

.catch-arena {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: min(62vh, 560px);
  border-radius: 24px;
  border: 1px solid rgba(243, 230, 208, 0.12);
  background:
    radial-gradient(ellipse 60% 50% at 50% 80%, rgba(197, 224, 122, 0.08), transparent 60%),
    rgba(10, 6, 4, 0.35);
  overflow: hidden;
  touch-action: manipulation;
}

.crawler {
  position: absolute;
  left: 0;
  top: 0;
  width: 150px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  background-color: transparent;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  transform-origin: 50% 55%;
  will-change: transform;
  overflow: visible;
}

.crawler::-moz-focus-inner {
  border: 0;
  padding: 0;
}

.crawler:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 6px;
}

.crawler-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  background: transparent;
  pointer-events: none;
}

.crawler .shell-text {
  pointer-events: none;
  user-select: none;
}

.crawler.is-spooked .crawler-svg {
  filter: brightness(1.12);
}

.crawler.is-caught {
  pointer-events: none;
}

.crawler.is-caught .crawler-svg {
  animation: catchPop 0.48s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}

@keyframes catchPop {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  45% {
    transform: scale(1.28);
    opacity: 1;
  }
  100% {
    transform: scale(0.15);
    opacity: 0;
  }
}

.projects-fallback {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.projects-fallback a {
  color: var(--lime);
  font-weight: 700;
}

@media (max-width: 600px) {
  .crawler {
    width: 128px;
  }
}

/* Contact — mail kitchen */
.page-contact {
  overflow: hidden;
}

.contact-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 4.5rem);
  padding: 0 clamp(1rem, 4vw, 2.5rem) 1.25rem;
}

.contact-intro {
  position: relative;
  z-index: 2;
  max-width: 38rem;
  margin-bottom: 0.75rem;
  animation: riseIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.contact-intro h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  line-height: 0.95;
}

.mail-arena {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: min(58vh, 520px);
  border-radius: 24px;
  border: 1px solid rgba(243, 230, 208, 0.12);
  background:
    radial-gradient(ellipse 55% 45% at 70% 30%, rgba(197, 224, 122, 0.1), transparent 55%),
    rgba(10, 6, 4, 0.35);
  overflow: hidden;
  cursor: crosshair;
  touch-action: manipulation;
}

.crumb-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mail-crumb {
  position: absolute;
  width: 10px;
  height: 7px;
  margin: -4px 0 0 -5px;
  border-radius: 40% 60% 55% 45%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(232, 168, 56, 0.35);
  transform: rotate(18deg);
  animation: crumbPop 0.35s ease-out;
}

@keyframes crumbPop {
  from {
    transform: scale(0.2) rotate(18deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(18deg);
    opacity: 1;
  }
}

.courier.is-hungry .courier-svg {
  filter: saturate(1.25) brightness(1.06);
}

.letter-panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(8, 5, 4, 0.72);
  backdrop-filter: blur(6px);
}

.letter-panel[hidden] {
  display: none;
}

.letter-card {
  width: min(440px, 100%);
  padding: 1.6rem 1.4rem 1.35rem;
  border-radius: 18px;
  background:
    linear-gradient(165deg, #f3e6d0 0%, #e8d4b0 100%);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.letter-stamp {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a4524;
}

.letter-card h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  line-height: 1.1;
}

.letter-body {
  margin: 0 0 1.1rem;
  font-size: 1.02rem;
  line-height: 1.45;
  color: #3a2818;
  min-height: 4.5rem;
}

.letter-email-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 1rem;
}

.letter-email {
  flex: 1 1 auto;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(26, 16, 12, 0.08);
  color: #1a100c;
  font-weight: 700;
  font-size: 0.92rem;
  word-break: break-all;
}

.letter-card .cta-home {
  background: #1a100c;
  color: #c5e07a;
}

.letter-card .cta-odoo {
  border-color: rgba(26, 16, 12, 0.35);
  color: #1a100c;
}

.letter-card .cta-glad {
  background: #8a4524;
  color: #f3e6d0;
}

.copy-toast {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #5a7a30;
}

