/* =========================================================
   Rafaela Lontro · portfolio styles
   Mobile first. Breakpoints: 600px · 768px · 1000px · 1280px
   ---------------------------------------------------------
   1. Tokens          7. About           13. Contact
   2. Base            8. Timeline        14. Footer
   3. Doodles         9. Skills          15. Lightbox
   4. Components     10. Languages       16. Animations
   5. Header         11. Photography     17. Reduced motion
   6. Hero           12. Projects
   ========================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
  --purple: #7B4FA0;
  --purple-dark: #6A4190;
  --deep: #3D2257;
  --lavender: #B79CE0;
  --lilac: #E9DDF7;
  --cream: #FFFBF5;
  --paper: #FFFEFB;
  --pink: #F7C6D9;
  --yellow: #FFE9A8;
  --mint: #C8F0DC;
  --error: #9B1B52;

  --font-head: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Patrick Hand", "Segoe Print", cursive;

  /* irregular radii = "sketched" shapes */
  --radius-sketch: 18px 28px 20px 30px / 28px 18px 30px 20px;
  --radius-small: 12px 16px 10px 18px / 16px 10px 18px 12px;
  --radius-pill: 40px 32px 38px 30px / 30px 38px 32px 40px;

  --shadow-sketch: 4px 5px 0 var(--lavender);
  --shadow-soft: 0 10px 24px rgba(61, 34, 87, .08);

  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --ease-soft: cubic-bezier(.22, .8, .36, 1);

  --header-h: 68px;
  color-scheme: light;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--deep);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .5em;
  color: var(--deep);
}

p { margin: 0 0 1em; }

a { color: var(--purple); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--deep); }

:focus-visible {
  outline: 3px dashed var(--purple);
  outline-offset: 3px;
  border-radius: 6px;
}

main:focus { outline: none; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute;
  left: 12px; top: -80px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--deep);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 12px; color: #fff; }

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

.section { position: relative; padding: 56px 0 64px; }
.section--tight { padding-top: 16px; }
.section--lilac { background: var(--lilac); }

@media (min-width: 768px) {
  .container { padding: 0 24px; }
  .section { padding: 72px 0 88px; }
  .section--tight { padding-top: 24px; }
}

/* Section headings with a scribbled underline */
.section-head { margin-bottom: 32px; }
.section-title {
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 0;
}
.title-scribble {
  display: block;
  width: 150px; height: 16px;
  margin: 2px 0 14px;
  fill: none;
  stroke: var(--lavender);
  stroke-width: 5;
  stroke-linecap: round;
  overflow: visible;
}
.section-intro { max-width: 40em; font-size: 1.1rem; }

.hand-heading {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 2rem;
  color: var(--purple);
  transform: rotate(-2deg);
}
.hand-heading--small { font-size: 1.7rem; margin-top: 8px; }

/* ---------- 3. DOODLES ---------- */
.doodle {
  position: absolute;
  z-index: 0;
  width: var(--s, 48px);
  height: var(--s, 48px);
  color: var(--purple);
  overflow: visible;
  pointer-events: none;
  filter: url(#crayon);
}
.hide-sm { display: none; }
@media (min-width: 768px) { .hide-sm { display: block; } }

/* Every <svg><use> icon inherits line colour and fill from CSS */
svg use { overflow: visible; }

/* Wavy dividers between sections */
.divider {
  display: block;
  background: var(--from);
  line-height: 0;
  margin-top: -1px;
}
.divider svg { display: block; width: 100%; height: 34px; overflow: visible; }
.divider-fill { fill: var(--to); }
.divider-line {
  fill: none;
  stroke: var(--lavender);
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
@media (min-width: 768px) { .divider svg { height: 52px; } }

/* ---------- 4. COMPONENTS ---------- */

/* Buttons: pill shape with hand-drawn outline */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: .6em 1.35em;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--deep);
  text-decoration: none;
  background: var(--paper);
  border: 2.5px solid var(--deep);
  border-radius: var(--radius-pill);
  box-shadow: 3px 4px 0 var(--deep);
  cursor: pointer;
  transition: transform .35s var(--ease-bounce), box-shadow .2s, background-color .2s;
}
.btn:hover { transform: scale(1.06) rotate(-1deg); color: var(--deep); }
.btn:active { transform: scale(.97); box-shadow: 1px 2px 0 var(--deep); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn--primary { background: var(--purple); color: #fff; }
.btn--primary:hover { background: var(--purple-dark); color: #fff; }
.btn--soft { background: var(--yellow); }
.btn-icon { width: 22px; height: 22px; flex: none; overflow: visible; }

.is-wiggling { animation: wiggle .5s ease; }

/* Cards: sketched border, soft shadow, washi tape */
.card {
  position: relative;
  background: var(--paper);
  border: 2.5px solid var(--deep);
  border-radius: var(--radius-sketch);
  padding: 26px 20px 22px;
  box-shadow: var(--shadow-sketch), var(--shadow-soft);
  transition: transform .4s var(--ease-bounce), box-shadow .3s;
}
.card:hover {
  transform: translateY(-6px) rotate(1deg);
  box-shadow: 6px 8px 0 var(--lavender), 0 16px 30px rgba(61, 34, 87, .12);
}
@media (min-width: 768px) { .card { padding: 30px 26px 26px; } }

.tape::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 92px;
  height: 26px;
  background: repeating-linear-gradient(90deg, rgba(247, 198, 217, .92) 0 10px, rgba(247, 198, 217, .7) 10px 14px);
  transform: translateX(-50%) rotate(-4deg);
  clip-path: polygon(0 8%, 4% 0, 8% 10%, 12% 0, 88% 0, 92% 10%, 96% 0, 100% 8%, 100% 92%, 96% 100%, 92% 90%, 88% 100%, 12% 100%, 8% 90%, 4% 100%, 0 92%);
  box-shadow: 0 2px 4px rgba(61, 34, 87, .08);
  pointer-events: none;
}
.tape--yellow::before { background: repeating-linear-gradient(90deg, rgba(255, 233, 168, .95) 0 10px, rgba(255, 233, 168, .75) 10px 14px); transform: translateX(-50%) rotate(3deg); left: 30%; }
.tape--mint::before { background: repeating-linear-gradient(90deg, rgba(200, 240, 220, .95) 0 10px, rgba(200, 240, 220, .75) 10px 14px); transform: translateX(-50%) rotate(-2deg); left: 72%; }

/* Sticker badges and tags */
.sticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 10px;
  border: 2.5px solid var(--deep);
  border-radius: var(--radius-pill);
  box-shadow: 2px 3px 0 var(--deep);
  font-size: 1.2rem;
}
.sticker svg { width: 28px; height: 28px; color: var(--deep); overflow: visible; }
.sticker--pink { background: var(--pink); }
.sticker--mint { background: var(--mint); }
.sticker--yellow { background: var(--yellow); }

.tag-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 8px; }
.tag {
  display: inline-block;
  padding: 4px 13px;
  font-weight: 700;
  font-size: .93rem;
  line-height: 1.4;
  background: var(--lilac);
  border: 2px solid var(--deep);
  border-radius: var(--radius-small);
  transform: rotate(var(--tr, 0deg));
}
.tag:nth-child(3n+1) { --tr: -1.5deg; }
.tag:nth-child(3n+2) { --tr: 1deg; }
.tag--pink { background: var(--pink); }
.tag--yellow { background: var(--yellow); }
.tag--mint { background: var(--mint); }

.hand-note {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--purple);
}

/* ---------- 5. HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 251, 245, .94);
  border-bottom: 2px dashed var(--lavender);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: rgba(255, 251, 245, .85); backdrop-filter: blur(8px); }
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--deep);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--purple); }
.brand-star { width: 32px; height: 32px; color: var(--purple); overflow: visible; transition: transform .5s var(--ease-bounce); }
.brand:hover .brand-star { transform: rotate(72deg) scale(1.1); }
.brand-last { display: none; }
@media (min-width: 440px) { .brand-last { display: inline; } }

/* Language bubbles */
.lang-switch { display: flex; gap: 5px; }
.lang-btn {
  min-width: 38px;
  height: 36px;
  padding: 0 7px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .9rem;
  color: var(--deep);
  background: var(--paper);
  border: 2px solid var(--deep);
  border-radius: 55% 45% 50% 40% / 45% 55% 45% 55%;
  cursor: pointer;
  transition: transform .35s var(--ease-bounce), background-color .2s, color .2s;
}
.lang-btn:nth-child(2) { border-radius: 45% 55% 40% 50% / 55% 45% 55% 45%; }
.lang-btn:nth-child(3) { border-radius: 50% 40% 55% 45% / 40% 50% 45% 55%; }
.lang-btn:hover { transform: scale(1.1) rotate(-4deg); background: var(--lilac); }
.lang-btn[aria-pressed="true"] { background: var(--purple); color: #fff; box-shadow: 2px 3px 0 var(--deep); }

/* Hamburger */
.nav-toggle {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  background: var(--lilac);
  border: 2.5px solid var(--deep);
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.nav-toggle-lines span {
  display: block;
  width: 20px;
  height: 3px;
  margin: 4px 0;
  background: var(--deep);
  border-radius: 3px;
  transition: transform .3s var(--ease-soft), opacity .2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-lines span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu panel */
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  display: block;
  padding: 10px 14px;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--deep);
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: background-color .2s;
}
.site-nav a:hover, .site-nav a.is-active { background: var(--lilac); }

.js .site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  padding: 12px 16px 20px;
  background: var(--cream);
  border-bottom: 2.5px solid var(--deep);
  box-shadow: 0 12px 24px rgba(61, 34, 87, .12);
}
.js .site-nav.is-open { display: block; animation: drop-in .3s var(--ease-soft); }
.js .site-nav ul { flex-direction: column; }

@media (min-width: 1000px) {
  .nav-toggle { display: none; }
  .js .site-nav, .site-nav {
    display: block;
    position: static;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    margin-right: 12px;
  }
  .js .site-nav ul { flex-direction: row; }
  .site-nav a { padding: 7px 12px; font-size: 1rem; }
}
@media (min-width: 1280px) { .site-nav a { padding: 7px 15px; } }

/* ---------- 6. HERO ---------- */
.hero { position: relative; padding: 32px 0 48px; overflow: hidden; }

.hero-grid { display: grid; gap: 28px; align-items: center; }
.hero-portrait { order: -1; }
@media (min-width: 900px) {
  .hero { padding: 64px 0 72px; }
  .hero-grid { grid-template-columns: 1.3fr 1fr; gap: 48px; }
  .hero-portrait { order: 0; }
}

.hero-hello {
  margin: 0;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.9rem;
  color: var(--purple);
  transform: rotate(-2deg);
  transform-origin: left;
}

.hero-name-wrap { position: relative; display: inline-block; margin-bottom: 14px; }
.hero-name {
  margin: 0;
  font-size: clamp(2.7rem, 11vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .01em;
}
.hero-name .word { display: inline-block; white-space: nowrap; }
.hero-name .word-2 { color: var(--purple); }
.hero-name .letter { display: inline-block; }
.hero-name-wrap .twinkle {
  position: absolute;
  width: var(--s);
  height: var(--s);
  color: var(--purple);
  overflow: visible;
  pointer-events: none;
}

.hero-tags { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags li {
  padding: 3px 12px;
  font-weight: 700;
  font-size: .95rem;
  background: var(--lilac);
  border: 2px solid var(--deep);
  border-radius: var(--radius-small);
}
.hero-tags li:nth-child(2) { background: var(--pink); transform: rotate(1deg); }
.hero-tags li:nth-child(3) { background: var(--mint); transform: rotate(-1deg); }

.hero-intro { max-width: 34em; font-size: 1.125rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
@media (max-width: 480px) { .hero-actions .btn { flex: 1 1 100%; } }

/* Portrait (cartoon or real photo) inside a hand-drawn circle */
.hero-portrait {
  position: relative;
  width: min(72vw, 380px);
  aspect-ratio: 1;
  margin: 8px auto 0;
}
/* Two-sided card: front = cartoon, back = photo. JS toggles .is-flipped every 5s */
.hero-portrait { perspective: 1100px; }
.portrait-inner {
  position: absolute;
  inset: 5%;
  transform-style: preserve-3d;
  transition: transform 1.1s var(--ease-bounce);
}
.portrait-inner.is-flipped { transform: rotateY(180deg); }
.portrait-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--lilac);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.portrait-face--back { transform: rotateY(180deg); }
.portrait-cartoon, .portrait-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-photo { object-position: 50% 22%; } /* keeps the face centred in the circle */

/* The hand-drawn frame gives a little twirl on every swap */
.portrait-frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transition: rotate 1.1s var(--ease-bounce); }
.hero-portrait.is-flipped .portrait-frame { rotate: 180deg; }

/* Pause / play the swap (auto-changing content must be pausable) */
.portrait-pause {
  position: absolute;
  left: 4%;
  bottom: 6%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--deep);
  background: var(--paper);
  border: 2px solid var(--deep);
  border-radius: 50% 45% 55% 48%;
  box-shadow: 2px 3px 0 var(--deep);
  cursor: pointer;
  transition: transform .3s var(--ease-bounce);
}
.portrait-pause:hover { transform: scale(1.1); }
.portrait-pause svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.portrait-pause .icon-play { display: none; fill: currentColor; stroke-width: 2; }
.portrait-pause[aria-pressed="true"] .icon-pause { display: none; }
.portrait-pause[aria-pressed="true"] .icon-play { display: block; }
html:not(.js) .portrait-pause { display: none; }
.doodle--portrait { z-index: 2; }
.portrait-note {
  position: absolute;
  right: -2%;
  bottom: 6%;
  z-index: 2;
  margin: 0;
  padding: 2px 14px 4px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--deep);
  background: var(--yellow);
  border: 2px solid var(--deep);
  border-radius: var(--radius-pill);
  transform: rotate(-8deg);
}
.cartoon-eyes { transform-origin: 150px 146px; animation: blink 5s infinite; }

/* Highlight cards */
.highlights { margin-top: 56px; }
.highlights .hand-heading { text-align: center; margin-bottom: 28px; }
.highlight-grid { display: grid; gap: 34px; }
@media (min-width: 768px) { .highlight-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.highlight-card { text-align: center; }
.highlight-card h3 { font-size: 1.35rem; }
.highlight-card p { margin: 0; }
.card-icon { display: block; width: 76px; height: 76px; margin: 4px auto 12px; color: var(--purple); overflow: visible; filter: url(#crayon); }

/* ---------- 7. ABOUT ---------- */
.about-grid { display: grid; gap: 36px; }
@media (min-width: 900px) { .about-grid { grid-template-columns: 1.5fr 1fr; gap: 56px; align-items: start; } }
.about-text p { font-size: 1.1rem; }

.about-aside { display: grid; gap: 28px; }
@media (min-width: 900px) { .about-aside { padding-top: 70px; } }
.about-aside .hand-note { display: flex; align-items: flex-end; gap: 6px; margin: 0; transform: rotate(-3deg); }
.note-arrow { width: 64px; height: 64px; flex: none; color: var(--purple); overflow: visible; transform: scaleX(-1); }

.facts-card h3 { font-size: 1.35rem; }
.fact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  font-weight: 700;
  background: var(--cream);
  border: 2px dashed var(--lavender);
  border-radius: var(--radius-small);
}
.fact:nth-child(2) { transform: rotate(-.8deg); }
.fact:nth-child(3) { transform: rotate(.6deg); }
.fact-icon { width: 34px; height: 34px; flex: none; color: var(--purple); overflow: visible; }

/* ---------- 8. TIMELINE ---------- */
.timeline { position: relative; max-width: 860px; margin: 0 auto; padding-left: 44px; }
.timeline-track {
  position: absolute;
  left: 15px; top: 20px; bottom: 0;
  border-left: 3px dashed var(--lavender);
}
.timeline-progress {
  position: absolute;
  left: 13px; top: 20px; bottom: 0;
  width: 7px;
  border-radius: 6px;
  background: repeating-linear-gradient(170deg, var(--purple) 0 6px, #8D62B3 6px 9px);
  transform-origin: top;
  transform: scaleY(1);
}
.js .timeline-progress { transform: scaleY(0); }

.timeline-group + .timeline-group { margin-top: 44px; }
.timeline-group-title { position: relative; z-index: 2; margin: 0 0 22px -44px; }
.timeline-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.timeline-item { position: relative; }

.timeline-dot {
  position: absolute;
  left: -40px; top: 26px;
  z-index: 2;
  width: 26px; height: 26px;
  background: var(--yellow);
  border: 3px solid var(--deep);
  border-radius: 50% 45% 55% 48%;
}
.timeline-group:nth-of-type(2) .timeline-dot { background: var(--mint); }
.timeline-group:nth-of-type(3) .timeline-dot { background: var(--pink); }
.js .timeline-dot { transform: scale(0); }
.js .timeline-item.is-visible .timeline-dot { transform: scale(1); transition: transform .55s var(--ease-bounce) .2s; }

.timeline-card { display: flex; flex-direction: column; }
.timeline-title { font-size: 1.3rem; margin-bottom: .2em; }
.timeline-date {
  order: -1;
  margin: 0 0 4px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.1;
  color: var(--purple);
}
.timeline-org { margin: 0; font-weight: 700; color: var(--purple); }
.timeline-points { margin: 12px 0 0; padding-left: 1.2em; }
.timeline-points li { margin-bottom: .35em; padding-left: .2em; }
.timeline-points li::marker { color: var(--lavender); content: "✿  "; }

@media (min-width: 768px) {
  .timeline { padding-left: 64px; }
  .timeline-track { left: 24px; }
  .timeline-progress { left: 22px; }
  .timeline-group-title { margin-left: -64px; }
  .timeline-dot { left: -52px; }
}

/* ---------- 9. SKILLS ---------- */
.skills-grid { display: grid; gap: 34px; }
@media (min-width: 768px) { .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; } }
@media (min-width: 1000px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } }
.skill-group h3 { font-size: 1.35rem; }

/* ---------- 10. LANGUAGES ---------- */
.languages-card { margin-top: 36px; }
.languages-card > h3 { font-size: 1.5rem; }
.languages-grid { display: grid; gap: 26px; }
@media (min-width: 768px) {
  .languages-grid { grid-template-columns: 1fr 1fr; gap: 28px 36px; }
  .languages-grid .language:first-child { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .languages-grid { grid-template-columns: .6fr 1fr 1fr; }
  .languages-grid .language:first-child { grid-column: auto; }
}
.language h4 { font-size: 1.2rem; margin-bottom: 10px; }

.native-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px 6px 8px;
  font-weight: 700;
  background: var(--yellow);
  border: 2px solid var(--deep);
  border-radius: var(--radius-pill);
  transform: rotate(-2deg);
}
.native-badge svg { width: 26px; height: 26px; color: var(--purple); overflow: visible; }

.level-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.level-list li {
  display: grid;
  grid-template-columns: minmax(7.5em, 1fr) 1.2fr 2.2em;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
}
.level-name { font-weight: 600; }
.level-value { font-family: var(--font-head); font-weight: 700; color: var(--purple); text-align: right; }
.level-bar {
  position: relative;
  height: 14px;
  background: var(--cream);
  border: 2px solid var(--deep);
  border-radius: 10px 6px 9px 7px;
  overflow: hidden;
}
.level-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--level) / 6 * 100%);
  background: repeating-linear-gradient(-60deg, var(--purple) 0 4px, var(--lavender) 4px 6px);
  border-radius: 0 8px 6px 0;
  transition: width 1.1s var(--ease-soft) .2s;
}
.js .languages-card:not(.is-visible) .level-fill { width: 0; }
.cefr-note { margin: 22px 0 0; font-size: .92rem; font-style: italic; }

/* ---------- 11. PHOTOGRAPHY ---------- */
.gallery-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.tab-btn {
  min-height: 44px;
  padding: 6px 18px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--deep);
  background: var(--paper);
  border: 2.5px solid var(--deep);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: transform .35s var(--ease-bounce), background-color .2s;
}
.tab-btn:hover { transform: scale(1.05) rotate(-1deg); }
.tab-btn[aria-pressed="true"] { background: var(--purple); color: #fff; box-shadow: 3px 4px 0 var(--deep); }

.gallery-caption {
  max-width: 44em;
  margin: 0 0 4px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--purple);
}
.gallery-hint { font-size: .95rem; margin: 0; }

.polaroid-grid {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px 16px;
}
@media (min-width: 768px) { .polaroid-grid { grid-template-columns: repeat(3, 1fr); gap: 38px 28px; } }
@media (min-width: 1100px) { .polaroid-grid { grid-template-columns: repeat(4, 1fr); } }

.polaroid {
  position: relative;
  display: block;
  width: 100%;
  padding: 9px 9px 0;
  font: inherit;
  color: inherit;
  text-align: center;
  background: #fff;
  border: 0;
  box-shadow: 0 8px 18px rgba(61, 34, 87, .15), 0 1px 2px rgba(61, 34, 87, .12);
  transform: rotate(var(--r, 0deg));
  transition: transform .4s var(--ease-bounce), box-shadow .3s;
  cursor: zoom-in;
}
.polaroid::before { /* pin */
  content: "";
  position: absolute;
  top: -8px; left: 50%;
  z-index: 1;
  width: 16px; height: 16px;
  margin-left: -8px;
  background: radial-gradient(circle at 35% 35%, #fff 0 2px, var(--pink) 3px);
  border: 2px solid var(--deep);
  border-radius: 50%;
}
.polaroid:hover, .polaroid:focus-visible {
  z-index: 2;
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 16px 30px rgba(61, 34, 87, .22);
}
.polaroid-photo { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--lilac); }
.polaroid-photo img { width: 100%; height: 100%; object-fit: cover; }
.polaroid-label {
  display: block;
  padding: 6px 0 9px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.1;
  color: var(--deep);
}
.polaroid-grid.is-switching li { animation: pop-in .5s var(--ease-bounce) both; animation-delay: calc(var(--i) * 45ms); }

/* ---------- 12. PROJECTS ---------- */
.project-grid { display: grid; gap: 40px; }
@media (min-width: 768px) { .project-grid { grid-template-columns: repeat(2, 1fr); gap: 34px; } }
@media (min-width: 1000px) { .project-grid { grid-template-columns: repeat(3, 1fr); } }
.project-card { display: flex; flex-direction: column; }
.project-card h3 { font-size: 1.3rem; }
.project-card .tag-list { margin-top: auto; padding-top: 6px; }
.project-photo {
  margin: 0 0 18px;
  padding: 7px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(61, 34, 87, .14);
  transform: rotate(-1.5deg);
}
.project-card:nth-child(2) .project-photo { transform: rotate(1.5deg); }
.project-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.hand-note--center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 40px 0 0;
  text-align: center;
  transform: rotate(-2deg);
}
.note-flower { width: 44px; height: 44px; color: var(--purple); overflow: visible; }

/* ---------- 13. CONTACT ---------- */
.contact-grid { display: grid; gap: 44px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; } }

.contact-info { position: relative; }
.contact-info > p { font-size: 1.1rem; }
.contact-email a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.05rem, 4.5vw, 1.3rem);
  word-break: break-all;
}
.contact-email svg { width: 32px; height: 32px; flex: none; color: var(--purple); overflow: visible; }

.social-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; gap: 14px; }
.social-link {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: var(--paper);
  border: 2.5px solid var(--deep);
  border-radius: var(--radius-sketch);
  box-shadow: 3px 4px 0 var(--deep);
  transition: transform .35s var(--ease-bounce);
}
.social-link:hover { transform: scale(1.1) rotate(-4deg); }
.social-link svg { width: 36px; height: 36px; color: var(--purple); overflow: visible; }

.contact-plane {
  display: block;
  width: 84px;
  height: 84px;
  margin: 28px 0 0 auto;
  color: var(--purple);
  overflow: visible;
  filter: url(#crayon);
  animation: float 6s ease-in-out infinite alternate;
}
.contact-plane.is-flying { animation: fly-away 2.4s cubic-bezier(.5, 0, .75, .3) forwards; }

.contact-form h3 { font-size: 1.45rem; margin-bottom: 4px; }
.form-required { font-size: .92rem; margin-bottom: 18px; }
.field { margin-bottom: 8px; }
.field label { display: block; margin-bottom: 4px; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.field input, .field textarea {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  font-size: 1rem;
  color: var(--deep);
  background: var(--cream);
  border: 2px solid var(--deep);
  border-radius: var(--radius-small);
  transition: background-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { background: #fff; box-shadow: 3px 4px 0 var(--lavender); }
.field [aria-invalid="true"] { border-color: var(--error); background: #FFF4F8; }
.field-error { min-height: 1.4em; margin: 4px 0 0; font-size: .92rem; font-weight: 700; color: var(--error); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .btn { margin-top: 8px; }
.form-status { min-height: 1.5em; margin: 14px 0 0; font-weight: 700; }
.form-status[data-type="success"] { color: #2E6B4F; }
.form-status[data-type="error"] { color: var(--error); }

/* ---------- 14. FOOTER ---------- */
.site-footer { position: relative; padding: 32px 0 40px; }

/* Partners & support logos, pinned like paper notes */
.supporters {
  margin-bottom: 36px;
  padding-bottom: 36px;
  text-align: center;
  border-bottom: 2px dashed var(--lavender);
}
.supporters-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 30px;
  font-size: 1.9rem;
}
.supporters-heart { width: 30px; height: 30px; color: var(--purple); overflow: visible; }
.supporters-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 36px 40px;
}
.supporter-card {
  display: grid;
  place-items: center;
  padding: 20px;
  background: #fff;
}
.supporter-card img { display: block; width: 100%; height: auto; }
/* EU logo: never rotated or distorted (EU visual identity rules) */
.supporter-card--eu { width: min(100%, 400px); padding: 22px 24px; }
.supporter-card--eu:hover { transform: translateY(-6px); }
/* Foundation logo: playful tilt like the polaroids */
.supporter-card--yllf { width: 168px; padding: 12px; transform: rotate(-2.5deg); }
.supporter-card--yllf img { border-radius: 4px; }
.supporter-card--yllf:hover { transform: translateY(-6px) rotate(1deg); }
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}
.footer-copy { margin: 0; font-weight: 600; }
@media (min-width: 900px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}
.back-to-top:hover .rocket { transform: translateY(-4px) rotate(-8deg); }
.rocket { transition: transform .35s var(--ease-bounce); color: var(--deep); }

/* ---------- 15. LIGHTBOX ---------- */
.lightbox {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--deep);
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(61, 34, 87, .86); }
.lightbox-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 12px 90px;
}
.lightbox-figure {
  margin: 0;
  padding: 12px 12px 6px;
  max-width: min(94vw, 960px);
  background: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  transform: rotate(-1deg);
}
.lightbox[open] .lightbox-figure { animation: pop-in .4s var(--ease-bounce); }
.lightbox-img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 230px);
  max-height: calc(100dvh - 230px);
  margin: 0 auto;
  object-fit: contain;
  background: var(--lilac);
}
.lightbox-figure figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 2px 4px;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.2;
}
.lightbox-counter { flex: none; color: var(--purple); }
.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  color: var(--deep);
  background: var(--cream);
  border: 2.5px solid var(--deep);
  border-radius: 50% 45% 55% 48%;
  box-shadow: 3px 4px 0 var(--deep);
  cursor: pointer;
  transition: transform .3s var(--ease-bounce);
}
.lightbox-btn:hover { transform: scale(1.1); }
.lightbox-btn svg { width: 24px; height: 24px; }
.lightbox-btn:focus-visible { outline-color: var(--yellow); }
.lightbox-close { top: 12px; right: 12px; }
.lightbox-prev { bottom: 18px; left: calc(50% - 70px); }
.lightbox-next { bottom: 18px; right: calc(50% - 70px); }
.lightbox-next svg { transform: scaleX(-1); }
@media (min-width: 768px) {
  .lightbox-inner { padding: 60px 96px; }
  .lightbox-img { max-height: calc(100vh - 170px); max-height: calc(100dvh - 170px); }
  .lightbox-prev, .lightbox-next { bottom: auto; top: calc(50% - 26px); }
  .lightbox-prev { left: 24px; }
  .lightbox-next { right: 24px; }
  .lightbox-close { top: 20px; right: 24px; }
}
body.lightbox-open { overflow: hidden; }

/* Cursor sparkle trail */
.sparkle {
  position: fixed;
  z-index: 200;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--c);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  pointer-events: none;
  animation: sparkle-fade .8s ease-out forwards;
}

/* ---------- 16. ANIMATIONS ---------- */

/* Language switch: soft text fade, no layout jump */
[data-i18n], .gallery-caption, .polaroid-grid img { transition: opacity .18s ease; }
.is-lang-fading [data-i18n], .is-lang-fading .gallery-caption { opacity: 0; }

/* Scroll reveal (uses the separate "translate" property so hover transforms still work) */
.js .reveal {
  opacity: 0;
  translate: 0 28px;
  transition: opacity .7s var(--ease-soft) var(--delay, 0s), translate .7s var(--ease-soft) var(--delay, 0s),
              transform .4s var(--ease-bounce), box-shadow .3s;
}
.js .reveal.is-visible { opacity: 1; translate: 0 0; }

/* Draw-on lines (paths use pathLength="1") */
.js .draw {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  fill-opacity: 0;
  transition: stroke-dashoffset 1.8s var(--ease-soft), fill-opacity .7s ease 1s;
}
.js .draw.is-visible { stroke-dashoffset: 0; fill-opacity: 1; }
.js .divider-line.draw { transition-duration: 2.4s; }

/* Hero name: letter-by-letter bounce */
.js .hero-name .letter { animation: letter-bounce .8s var(--ease-bounce) both; animation-delay: calc(var(--i) * 55ms + 150ms); }

.float { animation: float var(--dur, 6s) ease-in-out var(--delay, 0s) infinite alternate; }
.twinkle { animation: twinkle 2.8s ease-in-out var(--delay, 0s) infinite; }

@keyframes float {
  from { transform: translateY(0) rotate(-4deg); }
  to   { transform: translateY(-12px) rotate(4deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: .35; transform: scale(.7) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.1) rotate(20deg); }
}
@keyframes letter-bounce {
  0%   { opacity: 0; transform: translateY(-40px) scale(.6) rotate(-10deg); }
  60%  { opacity: 1; transform: translateY(6px) scale(1.08) rotate(3deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes wiggle {
  0%, 100% { rotate: 0deg; }
  20% { rotate: -6deg; }
  40% { rotate: 5deg; }
  60% { rotate: -3deg; }
  80% { rotate: 2deg; }
}
@keyframes pop-in {
  0%   { opacity: 0; scale: .85; }
  100% { opacity: 1; scale: 1; }
}
@keyframes drop-in {
  from { opacity: 0; translate: 0 -10px; }
  to   { opacity: 1; translate: 0 0; }
}
@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.1); }
}
@keyframes fly-away {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  20%  { transform: translate(-20px, 10px) rotate(-8deg); opacity: 1; }
  100% { transform: translate(60vw, -70vh) rotate(18deg) scale(.4); opacity: 0; }
}
@keyframes sparkle-fade {
  0%   { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), 18px) scale(.2) rotate(90deg); }
}

/* ---------- 17. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .js .reveal { opacity: 1; translate: none; }
  .js .draw { stroke-dasharray: none; stroke-dashoffset: 0; fill-opacity: 1; }
  .js .timeline-dot { transform: none; }
  .js .languages-card:not(.is-visible) .level-fill { width: calc(var(--level) / 6 * 100%); }
  .float, .twinkle, .cartoon-eyes, .contact-plane { animation: none !important; }
  .card:hover, .btn:hover, .polaroid:hover, .lang-btn:hover, .tab-btn:hover, .social-link:hover { transform: none; }
  .polaroid:hover, .polaroid:focus-visible { transform: rotate(var(--r, 0deg)); }
  /* Portrait: swap pictures without spinning */
  .portrait-inner, .portrait-inner.is-flipped { transform: none; }
  .portrait-face--back { transform: none; opacity: 0; }
  .portrait-inner.is-flipped .portrait-face--back { opacity: 1; }
  .hero-portrait.is-flipped .portrait-frame { rotate: none; }
}
