:root {
  --ink: #3a2e4d;
  --paper: #fffaf2;
  --pink: #ffb8d1;
  --peach: #ffd3b6;
  --yellow: #fff1a8;
  --mint: #c1f0d9;
  --green: #c8f7a6;
  --sky: #b8e2ff;
  --blue: #c3d4ff;
  --lilac: #e2c8ff;
  --shadow: 4px 4px 0 var(--ink);
  --wobble: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 1.25rem;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(58,46,77,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58,46,77,.05) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow-x: hidden;
  line-height: 1.5;
}
h1, h2, h3, .logo { font-family: "Caveat", cursive; font-weight: 700; margin: 0; }
a { color: inherit; }
.tiny { font-size: .95rem; opacity: .75; }

#doodle-layer {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
}
body.doodling #doodle-layer { pointer-events: auto; cursor: crosshair; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1.2rem;
  background: rgba(255,250,242,.92);
  border-bottom: 3px dashed var(--ink);
  flex-wrap: wrap;
}
.logo { font-size: 2.2rem; text-decoration: none; }
.logo span { color: #ff6fa5; }
.nav-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.nav-links a { text-decoration: none; position: relative; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 3px; width: 0;
  background: #ff6fa5; border-radius: 3px; transition: width .25s;
}
.nav-links a:hover::after { width: 100%; }

/* ---------- BUTTONS ---------- */
.btn, .pen-btn {
  font: inherit; color: var(--ink); cursor: pointer;
  border: 3px solid var(--ink); border-radius: var(--wobble);
  padding: .5rem 1.2rem; box-shadow: var(--shadow);
  text-decoration: none; display: inline-block;
  transition: transform .12s, box-shadow .12s;
  background: #fff;
}
.btn:hover, .pen-btn:hover { transform: translate(-2px,-2px) rotate(-1deg); box-shadow: 6px 6px 0 var(--ink); }
.btn:active, .pen-btn:active { transform: translate(3px,3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-pink { background: var(--pink); }
.btn-yellow { background: var(--yellow); }
.btn-lilac { background: var(--lilac); }
.pen-btn { padding: .3rem .9rem; background: var(--mint); }
.pen-btn[aria-pressed="true"] { background: #ff6fa5; color: #fff; }

/* ---------- HERO ---------- */
.hero {
  min-height: 85vh; max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center;
  padding: 3rem 1.5rem;
}
.hero h1 { font-size: clamp(3.2rem, 9vw, 6rem); line-height: 1; margin: .3rem 0 1rem; }
.lead { font-size: 1.5rem; }
.scribble { position: relative; white-space: nowrap; color: #ff5c9a; }
.scribble::after {
  content: ""; position: absolute; left: -4%; right: -4%; bottom: -.1em; height: .35em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M2 14 Q 30 2 60 12 T 120 10 T 198 8' fill='none' stroke='%23ffd84d' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center/100% 100%;
  z-index: -1;
}
.typer { background: var(--yellow); padding: 0 .3rem; border-radius: 6px; }
.caret { animation: blink 1s steps(1) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.wiggle { display: inline-block; animation: wiggle 2.5s ease-in-out infinite; }
@keyframes wiggle { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

.hero-art { position: relative; text-align: center; }
#avatar { width: min(340px, 80vw); cursor: pointer; filter: drop-shadow(6px 6px 0 var(--ink)); transition: transform .2s; }
#avatar:hover { transform: rotate(-4deg) scale(1.03); }
#avatar.boop { animation: boop .5s; }
@keyframes boop { 30% { transform: scale(.9, 1.1); } 60% { transform: scale(1.1, .9); } }
.wave-hand { transform-origin: 175px 150px; animation: wave 1.6s ease-in-out infinite; }
@keyframes wave { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }
.eyes { transform-origin: center; animation: blinkEyes 4s infinite; transform-box: fill-box; }
@keyframes blinkEyes { 0%,94%,100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.hint { font-family: "Caveat"; font-size: 1.4rem; margin-top: .3rem; transform: rotate(-4deg); }
.sticker { position: absolute; font-size: 2.2rem; animation: float 4s ease-in-out infinite; user-select: none; }
.s1 { top: 0; left: 8%; color: #ffc93c; }
.s2 { top: 20%; right: 4%; color: #ff6fa5; animation-delay: -1s; }
.s3 { bottom: 15%; left: 0; color: #8b7cf6; animation-delay: -2s; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-14px) rotate(15deg); } }

/* ---------- SECTIONS ---------- */
.section { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem; }
.section-title { font-size: clamp(2.6rem, 6vw, 3.8rem); text-align: center; }
.section-sub { text-align: center; margin-top: .2rem; opacity: .8; }
.hl { padding: 0 .5rem; border-radius: var(--wobble); display: inline-block; transform: rotate(-1.5deg); }
.hl-blue { background: var(--sky); }
.hl-pink { background: var(--pink); }
.hl-yellow { background: var(--yellow); }
.hl-green { background: var(--green); }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .6s, transform .6s; }
.reveal.shown { opacity: 1; transform: none; }

/* ---------- STICKY NOTES ---------- */
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.8rem; margin-top: 2rem; }
.note { perspective: 900px; height: 220px; cursor: pointer; outline: none; }
.note:nth-child(odd) { transform: rotate(-2deg); }
.note:nth-child(even) { transform: rotate(2deg); }
.note-inner { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.4,1.6,.5,1); transform-style: preserve-3d; }
.note.flipped .note-inner { transform: rotateY(180deg); }
.note-front, .note-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  border: 3px solid var(--ink); border-radius: 4px 4px 30px 4px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.2rem; text-align: center;
}
.note-front::before {
  content: ""; position: absolute; top: -14px; width: 70px; height: 24px;
  background: rgba(255,255,255,.65); border: 2px dashed rgba(58,46,77,.4); transform: rotate(-4deg);
}
.note-back { transform: rotateY(180deg); font-size: 1.15rem; }
.note h3 { font-size: 2rem; }
.big { font-size: 3rem; }
.note.yellow .note-front, .note.yellow .note-back { background: var(--yellow); }
.note.pink .note-front, .note.pink .note-back { background: var(--pink); }
.note.blue .note-front, .note.blue .note-back { background: var(--sky); }
.note.green .note-front, .note.green .note-back { background: var(--green); }
.note:hover .note-inner { animation: jiggle .4s; }
@keyframes jiggle { 25% { rotate: 2deg; } 75% { rotate: -2deg; } }
.note.flipped:hover .note-inner { animation: none; }

.fact-box {
  margin: 3rem auto 0; max-width: 620px; text-align: center;
  background: #fff; border: 3px dashed var(--ink); border-radius: var(--wobble); padding: 1.5rem;
}
#fact-text { font-size: 1.4rem; min-height: 2.2em; transition: opacity .2s; }

/* ---------- CARDS ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.6rem; margin-top: 2rem; }
.card {
  border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: var(--shadow);
  padding: 1.4rem; cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translate(-3px,-3px) rotate(-1deg); box-shadow: 8px 8px 0 var(--ink); }
.card h3 { font-size: 2rem; }
.card-icon { font-size: 2.6rem; display: inline-block; transition: transform .4s; }
.card:hover .card-icon { transform: rotate(360deg) scale(1.15); }
.card .more { max-height: 0; overflow: hidden; transition: max-height .4s, margin .4s; border-top: 0 dashed var(--ink); }
.card.open .more { max-height: 200px; margin-top: .8rem; padding-top: .6rem; border-top-width: 2px; }
.c-peach { background: var(--peach); }
.c-mint { background: var(--mint); }
.c-sky { background: var(--sky); }
.c-lilac { background: var(--lilac); }

.skills-title { text-align: center; font-size: 2.2rem; margin-top: 3rem; }
.skills-title small { font-family: "Patrick Hand"; font-size: 1rem; font-weight: 400; }
.skills { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }
.skills li {
  border: 2.5px solid var(--ink); border-radius: 999px; padding: .3rem 1rem; background: #fff;
  transition: transform .2s, background .2s; cursor: default;
}

/* ---------- WHY ---------- */
.why-wrap { display: flex; gap: 2rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }
.paper {
  max-width: 560px; background: #fff; padding: 2rem 2rem 1.5rem 3.5rem; position: relative;
  border: 3px solid var(--ink); box-shadow: var(--shadow); transform: rotate(-1deg);
  background-image: linear-gradient(transparent 39px, var(--sky) 40px);
  background-size: 100% 40px; line-height: 40px;
}
.paper::before { content: ""; position: absolute; left: 2.2rem; top: 0; bottom: 0; width: 2px; background: #ff8fb5; }
.checklist { padding-left: 1rem; margin: 0; }
.checklist label { cursor: pointer; }
.checklist input { width: 1.2rem; height: 1.2rem; accent-color: #ff6fa5; cursor: pointer; vertical-align: middle; }
.checklist input:checked + span { text-decoration: line-through wavy #ff6fa5; opacity: .7; }
.check-msg { font-family: "Caveat"; font-size: 1.6rem; text-align: right; margin: 0; }
.arrow-doodle { text-align: center; max-width: 220px; font-family: "Caveat"; font-size: 1.6rem; }
.arrow-doodle svg { width: 160px; transform: scaleX(-1) rotate(10deg); }
.draw { stroke-dasharray: 300; stroke-dashoffset: 300; }
.shown .draw, .draw.shown { animation: draw 1.4s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- CONTACT ---------- */
.contacts { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center; margin-top: 2rem; }
.contact {
  text-decoration: none; font-size: 1.4rem; padding: .7rem 1.4rem;
  border: 3px solid var(--ink); border-radius: var(--wobble); box-shadow: var(--shadow);
  transition: transform .15s;
}
.contact:hover { transform: translateY(-5px) rotate(2deg); }
.c-pink { background: var(--pink); } .c-blue { background: var(--blue); }
.c-yellow { background: var(--yellow); } .c-green { background: var(--green); }

.guestbook { margin-top: 3.5rem; text-align: center; }
.guestbook h3 { font-size: 2.2rem; }
.guestbook small { font-family: "Patrick Hand"; font-size: 1rem; font-weight: 400; }
#gb-form { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
#gb-input {
  font: inherit; padding: .5rem 1rem; border: 3px solid var(--ink); border-radius: var(--wobble);
  width: min(380px, 100%); background: #fff; color: var(--ink);
}
#gb-input:focus { outline: 3px dashed #ff6fa5; outline-offset: 3px; }
.gb-wall { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 1.5rem; }
.gb-note {
  width: 160px; min-height: 120px; padding: .9rem; border: 2.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.1rem; word-wrap: break-word; position: relative; animation: pop .35s cubic-bezier(.4,1.8,.5,1);
}
.gb-note button { position: absolute; top: 2px; right: 6px; border: 0; background: none; font: inherit; cursor: pointer; color: var(--ink); }
@keyframes pop { from { transform: scale(0) rotate(-20deg); } }

.footer { text-align: center; padding: 2rem 1rem 3rem; border-top: 3px dashed var(--ink); margin-top: 2rem; }

/* confetti */
.confetti { position: fixed; top: -20px; z-index: 60; pointer-events: none; font-size: 1.4rem; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* toast */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(150%);
  background: var(--yellow); border: 3px solid var(--ink); box-shadow: var(--shadow);
  padding: .6rem 1.2rem; border-radius: var(--wobble); z-index: 70; transition: transform .35s;
  font-size: 1.2rem; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- MOBILE ---------- */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; text-align: center; min-height: auto; padding-top: 2rem; }
  .hero-buttons { justify-content: center; }
  .hero-art { order: -1; }
  .nav { justify-content: center; padding: .5rem 1rem; }
  .nav-links { gap: .9rem; justify-content: center; }
  .section { padding: 3rem 1rem; }
  .paper { padding-left: 3rem; padding-right: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .draw { stroke-dashoffset: 0; }
}
