/* Super Maestro — playful, colorful, deliberately not corporate. */

:root {
  --bg: #fff6e5;
  --ink: #2b2140;
  --pink: #ff6b9d;
  --orange: #ffb347;
  --teal: #2ec4b6;
  --purple: #7b61ff;
  --yellow: #ffd166;
  --card-border: #2b2140;
  --shadow-offset: 6px;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  /* Big soft color blobs (the "aurora") + a tiny tiled doodle pattern
     (stars/waves/sparkles) so the empty page never reads as flat/empty. */
  background-image:
    radial-gradient(ellipse 700px 500px at 8% 5%, rgba(255, 107, 157, 0.35) 0, transparent 70%),
    radial-gradient(ellipse 800px 600px at 95% 15%, rgba(46, 196, 182, 0.3) 0, transparent 70%),
    radial-gradient(ellipse 900px 700px at 50% 100%, rgba(123, 97, 255, 0.22) 0, transparent 70%),
    radial-gradient(ellipse 600px 500px at 15% 85%, rgba(255, 209, 102, 0.35) 0, transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%237b61ff' stroke-width='2' stroke-linecap='round' opacity='0.16'%3E%3Cpath d='M20 30 l6 -14 l6 14 l14 6 l-14 6 l-6 14 l-6 -14 l-14 -6 z'/%3E%3Cpath d='M120 90 l4 -10 l4 10 l10 4 l-10 4 l-4 10 l-4 -10 l-10 -4 z'/%3E%3Cpath d='M40 120 q10 -14 20 0 q10 14 20 0' /%3E%3Ccircle cx='140' cy='30' r='4'/%3E%3Ccircle cx='90' cy='140' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  color: var(--ink);
  font-family: 'Baloo 2', system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Floating sparkle layer, purely decorative, sits behind all content. */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--yellow);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  opacity: 0;
  animation: twinkle 3.4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  filter: drop-shadow(0 0 4px rgba(255, 209, 102, 0.8));
}

.spark:nth-child(3n) {
  background: var(--pink);
  filter: drop-shadow(0 0 4px rgba(255, 107, 157, 0.8));
}

.spark:nth-child(3n + 1) {
  background: var(--teal);
  filter: drop-shadow(0 0 4px rgba(46, 196, 182, 0.8));
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.15) rotate(25deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spark {
    animation: none;
    opacity: 0.5;
  }
}

/* Everything else sits above the decorative background layer. */
.site-header,
.layout,
.contact-section,
.site-footer {
  position: relative;
  z-index: 1;
}

h1, h2, h3 {
  font-family: 'Fredoka', system-ui, sans-serif;
}

a {
  color: var(--purple);
}

img {
  max-width: 100%;
}

/* ---------- header / hero banner ----------
   No image generator on hand for a new logo (see docs/RECOMMENDATIONS.md),
   so the banner is hand-coded: a comic-card "sign" shape (matches the rest
   of the site's design language) with a Fredoka wordmark, a floating-emoji
   doodle border, and the EN/IT language switch tucked in the corner. */

.site-header {
  display: flex;
  justify-content: center;
  padding: 2.5rem 1rem 1rem;
}

.hero-banner {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: 0 1.5rem;
  padding: 2.25rem 2rem 1.75rem;
  text-align: center;
  background: linear-gradient(135deg, var(--pink), var(--orange) 45%, var(--yellow) 75%, var(--teal));
  border: 4px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--card-border);
  transform: rotate(-1deg);
  overflow: visible;
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.2rem);
  color: white;
  letter-spacing: 0.5px;
  text-shadow: 3px 3px 0 var(--card-border);
}

.hero-title small {
  font-size: 0.55em;
  color: var(--ink);
  background: white;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  border: 2px solid var(--card-border);
  text-shadow: none;
  vertical-align: middle;
  margin-left: 0.2rem;
  display: inline-block;
}

.hero-tagline {
  display: inline-block;
  margin: 0.7rem 0 0;
  font-weight: 700;
  color: var(--ink);
  background: white;
  padding: 0.35rem 1.1rem;
  border-radius: 999px;
  border: 2px solid var(--card-border);
  box-shadow: 2px 2px 0 var(--card-border);
}

.hero-doodle {
  position: absolute;
  font-size: 1.8rem;
  transform: rotate(var(--r, 0deg));
  animation: bob 3.2s ease-in-out infinite;
  animation-delay: var(--b, 0s);
  filter: drop-shadow(2px 2px 0 rgba(43, 33, 64, 0.25));
  pointer-events: none;
}

@keyframes bob {
  0%, 100% { transform: rotate(var(--r, 0deg)) translateY(0); }
  50% { transform: rotate(var(--r, 0deg)) translateY(-8px); }
}

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

.chibi-sorcerer-banner {
  bottom: -38px;
  left: -28px;
  width: 100px;
  transform: rotate(-9deg);
  z-index: 4;
}

.chibi-politician-banner {
  bottom: -38px;
  right: -28px;
  width: 100px;
  transform: rotate(9deg);
  z-index: 4;
}

.lang-switch {
  position: absolute;
  top: -16px;
  right: 18px;
  display: flex;
  gap: 0.35rem;
  background: white;
  border: 2px solid var(--card-border);
  border-radius: 999px;
  padding: 0.25rem;
  box-shadow: 2px 2px 0 var(--card-border);
}

.lang-btn {
  border: none;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.3rem 0.4rem;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.lang-btn:hover {
  opacity: 0.8;
}

.lang-btn.active {
  opacity: 1;
  background: var(--yellow);
  transform: scale(1.1);
}

/* ---------- projects section title ---------- */

.projects-title {
  margin: 0 0 1rem;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.projects-title::after {
  content: '';
  height: 2px;
  flex: 1;
  min-width: 2rem;
  background: linear-gradient(90deg, var(--pink), transparent);
  border-radius: 999px;
}

/* ---------- layout ---------- */

.layout {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.col {
  position: relative;
  background: white;
  border: 3px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--card-border);
  padding: 3.5rem 1.75rem 1.75rem;
}

.projects-col {
  /* Extra top clearance so the "Unprofessional projects" label never sits
     under the peeking pirate chibi (its footprint reaches ~94px down). */
  padding-top: 6rem;
}

/* ---------- chibis ---------- */

.chibi {
  position: absolute;
  z-index: 3;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.2));
}

.chibi-pirate {
  top: -50px;
  left: -35px;
  width: 90px;
  transform: rotate(-8deg);
}

.chibi-archeologist {
  top: -45px;
  left: -35px;
  width: 85px;
  transform: rotate(-6deg);
}

.chibi-diver {
  bottom: -40px;
  right: -30px;
  width: 130px;
  transform: rotate(6deg);
}

/* ---------- projects ---------- */

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.project-card {
  display: block;
  border: 3px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  background: var(--yellow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 4px 4px 0 var(--card-border);
}

.project-card:hover {
  transform: rotate(-1deg) scale(1.02);
  box-shadow: 6px 6px 0 var(--card-border);
}

.project-card.coming-soon {
  background: #f0f0f0;
  filter: grayscale(0.3);
  cursor: default;
}

.project-card.coming-soon:hover {
  transform: none;
  box-shadow: 4px 4px 0 var(--card-border);
}

.project-banner {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
}

.project-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-banner.contain {
  background: #000;
}

.project-banner.contain img {
  object-fit: contain;
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--pink);
  color: white;
  font-weight: 700;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25);
  transform: rotate(4deg);
}

/* ---------- intro ---------- */

.intro-col {
  background: var(--purple);
  color: white;
  padding-top: 6.5rem;
  padding-bottom: 4rem;
}

.intro-col h2 {
  margin-top: 0.5rem;
}

.intro-col a {
  color: var(--yellow);
}

/* ---------- contact ----------
   A native <details>/<summary> shell keeps this section small by default
   (a fun "Send a Raven 🪶" tab) and expandable into the full form — no JS
   toggle needed, and it stays keyboard/screen-reader friendly for free.
   See docs/SITE_INVENTORY.md. */

.contact-section {
  position: relative;
  max-width: 1200px;
  margin: 3rem auto;
  padding: 2rem 1.5rem;
}

.contact-details {
  position: relative;
  background: var(--orange);
  border: 3px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--card-border);
  overflow: hidden;
}

.contact-summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  list-style: none;
  cursor: pointer;
  padding: 1.1rem 1.75rem;
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  user-select: none;
  transition: transform 0.15s ease, background 0.15s ease;
}

.contact-summary::-webkit-details-marker {
  display: none;
}

.contact-summary::marker {
  content: '';
}

.contact-summary:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateX(2px);
}

.contact-summary:focus-visible {
  outline: 3px dashed var(--card-border);
  outline-offset: -4px;
}

.contact-summary-label {
  flex: 1;
}

.contact-summary-icon {
  font-size: 1rem;
  transition: transform 0.25s ease;
}

.contact-details[open] .contact-summary-icon {
  transform: rotate(180deg);
}

.chibi-monk-peek {
  width: 52px;
  flex-shrink: 0;
  transform: rotate(-6deg);
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.contact-inner {
  position: relative;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  border-top: 3px dashed var(--card-border);
  margin: 0 1.75rem;
  padding: 1.5rem 0.25rem 2rem;
}

.contact-copy {
  flex: 1;
  min-width: 200px;
}

.contact-form {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-form label {
  font-weight: 700;
}

.contact-form input,
.contact-form textarea {
  border: 2px solid var(--card-border);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.contact-form button {
  align-self: flex-start;
  background: var(--pink);
  color: white;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  border: 2px solid var(--card-border);
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  box-shadow: 3px 3px 0 var(--card-border);
  cursor: pointer;
}

.contact-form button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--card-border);
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-status {
  min-height: 1.4em;
  font-weight: 700;
}

.contact-status.success {
  color: #1a7a4c;
}

.contact-status.error {
  color: #c23b3b;
}

/* ---------- 404 page ----------
   Standalone page (404.html) — same comic-card visual language as the rest
   of the site, just a single centered card instead of the two-column
   layout. See docs/SITE_INVENTORY.md. */

.notfound-main {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 2rem;
}

.notfound-card {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 1.5rem;
  padding: 3.5rem 2rem 2.5rem;
  text-align: center;
  background: white;
  border: 4px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--card-border);
  transform: rotate(-1deg);
}

.notfound-chibi {
  position: absolute;
  top: -64px;
  left: 50%;
  width: 130px;
  transform: translateX(-50%) rotate(-6deg);
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.2));
}

.notfound-title {
  margin: 1.25rem 0 1rem;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  color: var(--purple);
}

.notfound-body {
  margin: 0 0 1.75rem;
  text-align: left;
}

.notfound-body p {
  margin: 0;
}

.notfound-home {
  display: inline-block;
  background: var(--pink);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-family: 'Fredoka', sans-serif;
  border: 2px solid var(--card-border);
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  box-shadow: 3px 3px 0 var(--card-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.notfound-home:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--card-border);
}

@media (max-width: 480px) {
  .notfound-card {
    padding: 3rem 1.25rem 2rem;
  }

  .notfound-chibi {
    width: 100px;
    top: -52px;
  }
}

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

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  font-size: 0.9rem;
  color: #6b6480;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .chibi-pirate,
  .chibi-archeologist {
    top: -34px;
    left: -20px;
    width: 80px;
  }

  .chibi-diver {
    bottom: -30px;
    right: -20px;
    width: 100px;
  }

  .contact-inner {
    flex-direction: column;
  }

  .contact-summary {
    padding: 0.9rem 1.1rem;
    font-size: 1.05rem;
  }

  .chibi-monk-peek {
    width: 40px;
  }

  .hero-banner {
    padding: 2rem 1.25rem 1.5rem;
  }

  .hero-doodle {
    font-size: 1.3rem;
  }

  .chibi-sorcerer-banner,
  .chibi-politician-banner {
    width: 70px;
    bottom: -22px;
  }

  .chibi-sorcerer-banner {
    left: -14px;
  }

  .chibi-politician-banner {
    right: -14px;
  }

  .lang-switch {
    top: -14px;
    right: 12px;
  }
}
