/* Importing Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

body {
  font-family: 'Caveat';
  background-color: var(--bg-black);
  color: white;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ! Reset */
body, html{ font-family: 'Inter', Arial, Helvetica, sans-serif; font-size: clamp(15px, 2.5vw, 16px); box-sizing: border-box; margin: 0; padding: 0; overflow-x: hidden; }
*,*:before,*:after{ box-sizing: border-box; }
h1,h2,h3,h4,h5,h6, p, ol, ul{margin: 0 0 1rem 0;padding: 0;}
ol,ul{list-style-type: none;}
img{ max-width: 100%; height: auto; }
h1{ font-size: clamp(1.75rem, 5vw, 4rem); }
h2{ font-size: clamp(1.5rem, 4vw, 3rem); }
h3{ font-size: clamp(1.25rem, 3vw, 2rem); }
h4{ font-size: clamp(0.95rem, 1.5vw, 1rem); }
h5{ font-size: 0.8rem; }
h6{ font-size: 0.6rem; }
a{ text-decoration: none; }

.spacer{height: 100px;}

/* HEADER */

:root {
  --bg-black: #000000;
  --menu-bg: var(--bg-black);
  --menu-color: white;
}

.header {
  background-color: var(--menu-bg);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  padding: clamp(8px, 1.5%, 16px) clamp(12px, 2%, 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: visible;
}

.header__content {
  max-width: min(1200px, 95%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo {
  display: flex;
  align-items: center;
  color: var(--menu-color);
  font-size: 1.125rem;
}

.header__quick{
  display: flex; 
  align-items: center;
  color:var(--menu-color)
}

.header__menu{
  padding: 0;
  margin: 0;
}

.header__menu li{
  display: inline-block;
}

.header__menu li a{
  color: var(--menu-color);
  opacity: 0.8;
  display: block;
  padding: clamp(10px, 1.2vw, 16px);
  font-size: clamp(13px, 1.8vw, 15px);
}

/* Bold current page in header */
body.page-index .header__menu a[data-page="index"],
body.page-perleopache .header__menu a[data-page="perleopache"],
body.page-frasedioggi .header__menu a[data-page="frasedioggi"],
body.page-frasedidomani .header__menu a[data-page="frasedidomani"],
body.page-sonoio .header__menu a[data-page="sonoio"],
body.page-alfred .header__menu a[data-page="alfred"],
body.page-experiments .header__menu a[data-page="experiments"] {
  font-weight: bold;
  opacity: 1;
}
body.page-pivaz .header__logo {
  opacity: 1;
}

.header__quick {
  display: flex; 
  align-items: center;
  color:var(--menu-color)
}

@media (max-width: 768px) {
  .header {
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
    overflow: visible;
  }

  .header__content {
    max-width: none;
    width: 100%;
    overflow: visible;
  }

  .header__menu{
    position: absolute;
    top: 56px;
    left: 8px;
    right: 8px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    background-color: var(--menu-bg);
    height: 0;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(.215, .61, .355, 1);
    border-radius: 0 0 8px 8px;
  }

  .header__menu li{
    display: block;
    width: 100%;
    border-bottom: 1px solid #444;
    box-sizing: border-box;
  }

  .menu-open .header__menu{
    height: calc(100vh - 56px);
    padding: 20px max(16px, env(safe-area-inset-left, 0px)) 20px max(16px, env(safe-area-inset-right, 0px));
    max-height: calc(100dvh - 56px);
  }

  .header__menu li a{
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 18px 0;
    font-size: 17px;
  }

  .icon-hamburger{
    --hamburger-size: min(48px, 12vw);
    height: var(--hamburger-size);
    width: var(--hamburger-size);
    min-width: 44px;
    min-height: 44px;
    margin-left: 8px;
    margin-right: 0;
    padding: 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    overflow: visible;
    flex-shrink: 0;
  }

  .icon-hamburger span{
    height: 2px;
    width: min(18px, 5vw + 12px);
    min-width: 14px;
    background: var(--menu-color);
    position: relative;
    display: block;
    margin: 0 auto;
    transition: transform 0.25s cubic-bezier(.215, .61, .355, 1);
    transform-origin: center center;
    flex-shrink: 0;
  }

  .menu-open .icon-hamburger span:nth-child(1){
    transform: translateY(4px) rotate(45deg);
  }
  .menu-open .icon-hamburger span:nth-child(2){
    transform: translateY(-4px) rotate(-45deg);
  }

  .header__quick{
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 44px;
    overflow: visible;
  }
}

/* COVER */

.cover {
  text-align: center;
  padding: 0;
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-position: center center;
  background-size: cover;
  background-color: var(--bg-black);
  box-sizing: border-box;
}

.cover__content {
  width: min(90%, 1200px);
  max-width: 90%;
  padding: clamp(16px, 3vw, 32px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.cover__content h1 {
  font-size: clamp(2rem, 8vw, 5rem);
  line-height: 1.15;
}

.cover__subtitle {
  font-size: clamp(1rem, 4vw, 2rem);
  line-height: 1.3;
  margin-top: 0.5em;
}

.experiments__wrap {
  width: 100%;
  flex: 1;
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  min-height: 0;
}
.experiments__square {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 200px;
  overflow: hidden;
}
.experiments__square canvas {
  display: block;
  width: 100%;
  height: 100%;
}
body.page-experiments .cover {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  height: 100vh;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  body.page-experiments .cover {
    padding-bottom: 70px;
    height: auto;
    min-height: calc(100vh - 70px);
  }
}
body.page-experiments .cover__content.experiments__wrap {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 0;
}

.rainbow-text {
  font-family: 'Caveat', cursive;
  line-height: 1.15;
  font-size: clamp(3rem, 18vw, 8rem);
  position: relative;
  animation: rainbowAnimation 5s linear infinite;
  padding-right: 0.1em;
  display: inline-block;
  width: auto;
  overflow: visible;
}

h1.rainbow-text {
  font-size: clamp(3rem, 18vw, 8rem);
}

.cover__content p {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.25rem, 4vw, 2rem);
  color: white;
  line-height: 1.4;
}

.alfred-section {
  width: 100%;
  background: var(--bg-black);
  color: white;
  padding: 0 0 clamp(40px, 8vw, 80px);
}

.alfred-section__content {
  width: min(92%, 1100px);
  margin: 0 auto;
}

body.page-alfred .alfred-section {
  min-height: 100vh;
  padding-top: clamp(72px, 12vw, 120px);
  display: flex;
  align-items: center;
}

.alfred-scene {
  --alfred-scale: 1;
  --alfred-ground: calc(42px * var(--alfred-scale));
  position: relative;
  width: 100%;
  max-width: min(980px, 100%);
  margin: 0 auto;
  height: clamp(240px, 38vw, 380px);
  overflow: hidden;
}

.alfred-grass-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--alfred-ground);
  height: 4px;
  background: #39b54a;
}

/* WALL CLOCK */
.alfred-clock {
  position: absolute;
  left: 10%;
  bottom: calc(var(--alfred-ground) + 150px * var(--alfred-scale));
  width: 60px;
  height: 60px;
  transform: scale(var(--alfred-scale));
  transform-origin: bottom center;
  user-select: none;
  pointer-events: none;
}

.alfred-clock__face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1a1a1a;
  border: 3px solid #888;
  box-shadow: 0 0 6px rgba(0,0,0,0.5), inset 0 0 8px rgba(0,0,0,0.4);
  box-sizing: border-box;
}

/* Tick marks */
.alfred-clock__tick {
  position: absolute;
  display: block;
  background: #ccc;
  top: 4px;
  left: 50%;
  width: 1.5px;
  height: 5px;
  margin-left: -0.75px;
  transform-origin: center calc(27px - 4px);
}

/* Make hour ticks (12, 3, 6, 9) slightly thicker/taller */
.alfred-clock__tick--12 { transform: rotate(0deg); }
.alfred-clock__tick--1 { transform: rotate(30deg); }
.alfred-clock__tick--2 { transform: rotate(60deg); }
.alfred-clock__tick--3 { transform: rotate(90deg); }
.alfred-clock__tick--4 { transform: rotate(120deg); }
.alfred-clock__tick--5 { transform: rotate(150deg); }
.alfred-clock__tick--6 { transform: rotate(180deg); }
.alfred-clock__tick--7 { transform: rotate(210deg); }
.alfred-clock__tick--8 { transform: rotate(240deg); }
.alfred-clock__tick--9 { transform: rotate(270deg); }
.alfred-clock__tick--10 { transform: rotate(300deg); }
.alfred-clock__tick--11 { transform: rotate(330deg); }

/* Cardinal ticks: bolder */
.alfred-clock__tick--12,
.alfred-clock__tick--3,
.alfred-clock__tick--6,
.alfred-clock__tick--9 {
  width: 2px;
  height: 7px;
  margin-left: -1px;
  background: #fff;
}

/* Hands */
.alfred-clock__hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 1px;
}

.alfred-clock__hand--hour {
  width: 2.5px;
  height: 14px;
  margin-left: -1.25px;
  background: #fff;
  z-index: 3;
}

.alfred-clock__hand--minute {
  width: 1.8px;
  height: 19px;
  margin-left: -0.9px;
  background: #ddd;
  z-index: 4;
}

.alfred-clock__hand--second {
  width: 0.8px;
  height: 21px;
  margin-left: -0.4px;
  background: #ff4b4b;
  z-index: 5;
}

.alfred-clock__center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  margin-left: -2px;
  border-radius: 50%;
  background: #ff4b4b;
  z-index: 6;
}

/* CHAIR */
.alfred-chair {
  position: absolute;
  left: 50%;
  /* Posiziona la base del contenitore sulla linea dell'erba, poi sposta giù per le gambe */
  bottom: calc(var(--alfred-ground) + 5px);
  width: 170px;
  height: 170px;
  transform: translateX(-50%) scale(var(--alfred-scale));
  transform-origin: bottom center;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  user-select: none;
  pointer-events: none;
}

.alfred-chair__img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: bottom center;
  display: block;
}

/* BATHROOM DOOR */
.alfred-bathroom {
  position: absolute;
  right: 8%;
  bottom: calc(var(--alfred-ground) + 4px);
  width: 80px;
  height: 140px;
  transform: scale(var(--alfred-scale));
  transform-origin: bottom center;
  user-select: none;
  pointer-events: none;
}

.alfred-bathroom__door {
  position: relative;
  width: 100%;
  height: 100%;
  background: #5c3a1e;
  border-radius: 3px 3px 0 0;
  border: 2px solid #3a2210;
  border-bottom: none;
  box-shadow: inset -4px 0 8px rgba(0,0,0,0.3), inset 2px 0 4px rgba(255,255,255,0.05);
}

.alfred-bathroom__handle {
  position: absolute;
  right: 10px;
  top: 52%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4a843;
  box-shadow: 0 0 3px rgba(212,168,67,0.5), inset 0 -1px 1px rgba(0,0,0,0.3);
}

.alfred-bathroom__label {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', Arial, sans-serif;
  font-size: 9px;
  font-weight: 700;
  color: #d4a843;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
}

.alfred-bathroom__sign {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 16px;
  background: #2a7d2a;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
  transition: background 0.6s ease;
}

.alfred-bathroom__sign.is-occupied {
  background: #c0392b;
}

.alfred-bathroom__sign-text {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 6px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1;
}

/* STICKMAN */
.alfred-stickman.is-in-bathroom {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.alfred-stickman {
  --alfred-body-color: #ffffff;
  --alfred-cap-top: #ff4b4b;
  --alfred-cap-bottom: #b51212;
  --alfred-cap-brim-top: #ff4b4b;
  --alfred-cap-brim-bottom: #8f1010;
  position: absolute;
  left: 0;
  bottom: calc(var(--alfred-ground) + 4px);
  width: 34px;
  height: 100px;
  transform: translateX(-50%) scaleX(var(--alfred-facing, 1)) translateY(var(--alfred-bob, 0px)) scale(var(--alfred-scale, 1));
  transform-origin: bottom center;
}

.alfred-stickman span {
  position: absolute;
  display: block;
  background: var(--alfred-body-color);
}

.alfred-stickman--uttervalda {
  --uttervalda-tail-local-dir: 1;
  --hair-color: #d4a843;
  --hair-color-dark: #b8912e;
  left: calc(50% + 66px);
}

/* ── Hair flowing down: hangs from back of head ── */
/* In local coords: face=left (eye at left:3px), back=right */
.alfred-stickman--uttervalda::before {
  content: '';
  position: absolute;
  /* Head center is at ~17px. Hair should start centered on back half of head */
  top: 3px;
  left: 17px;
  width: 7px;
  height: 28px;
  transform: translateX(calc(var(--uttervalda-tail-local-dir) * 2px)) rotate(calc(var(--uttervalda-tail-local-dir) * -8deg));
  transform-origin: top center;
  background: var(--hair-color);
  border-radius: 3px 3px 5px 5px;
  z-index: 4;
  pointer-events: none;
}

/* Sitting + looking around: hair always falls toward back (right in local space) */
.alfred-stickman--uttervalda.is-sitting.is-looking-around::before {
  transform: translateX(2px) rotate(-8deg);
}

/* Facing front sitting: wide straight hair flowing down behind the back */
.alfred-stickman--uttervalda.is-sitting.is-facing-front::before {
  top: 2px;
  left: 7px;
  width: 20px;
  height: 30px;
  transform: translateX(0) rotate(0deg);
  border-radius: 4px 4px 6px 6px;
  z-index: 0;
}

/* Hide the cap elements */
.alfred-stickman--uttervalda .alfred-stickman__cap-base,
.alfred-stickman--uttervalda .alfred-stickman__cap-brim,
.alfred-stickman--uttervalda .alfred-stickman__cap-button {
  display: none;
}

/* ── Head pseudo-element setup ── */
.alfred-stickman--uttervalda .alfred-stickman__head::before,
.alfred-stickman--uttervalda .alfred-stickman__head::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.alfred-stickman--uttervalda .alfred-stickman__head {
  z-index: 3;
}

/* ── Hair on head (profile): covers top and back only ── */
/* In local coords: left (0%) = face side, right (100%) = back/nuca */
.alfred-stickman--uttervalda .alfred-stickman__head::before {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--hair-color);
  clip-path: polygon(
    /* Start at face side, high up (forehead) */
    5% 22%,
    8% 15%,
    15% 8%,
    25% 3%,
    38% 0%,
    52% 0%,
    68% 2%,
    80% 6%,
    90% 14%,
    95% 24%,
    /* Back of head descends far down — covers all white behind flowing hair */
    100% 75%,
    95% 75%,
    /* Diagonal cut back up toward face */
    88% 50%,
    75% 38%,
    60% 30%,
    45% 26%,
    30% 24%,
    12% 24%
  );
  z-index: 1;
}

/* ── Hair on head (front facing / sitting): symmetric top only ── */
.alfred-stickman--uttervalda.is-sitting.is-facing-front .alfred-stickman__head::before {
  clip-path: polygon(
    /* Left side down to ear level */
    0% 32%,
    0% 22%,
    5% 13%,
    15% 6%,
    28% 2%,
    50% 0%,
    72% 2%,
    85% 6%,
    95% 13%,
    100% 22%,
    /* Right side down to ear level */
    100% 32%,
    /* Symmetric fringe across forehead */
    90% 28%,
    75% 24%,
    60% 22%,
    50% 21%,
    40% 22%,
    25% 24%,
    10% 28%
  );
}

/* ── No separate after needed ── */
.alfred-stickman--uttervalda .alfred-stickman__head::after {
  display: none;
}

.alfred-stickman--uttervalda .alfred-stickman__body {
  z-index: 2;
}

.alfred-stickman--uttervalda .alfred-stickman__body::before {
  display: none;
}

.alfred-stickman--uttervalda .alfred-stickman__body::after {
  content: '';
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  width: 16px;
  height: 23px;
  transform: translateX(-50%);
  background: var(--alfred-body-color);
  clip-path: polygon(35% 0%, 65% 0%, 100% 100%, 0% 100%);
}

/* Align legs under body center for uttervalda */
.alfred-stickman--uttervalda .alfred-stickman__leg--left {
  left: 15px;
}

.alfred-stickman--uttervalda .alfred-stickman__leg--right {
  left: 17px;
}

/* Head: no border, solid white, overflow hidden clips mouth at edge */
.alfred-stickman__head {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: var(--alfred-body-color) !important;
  left: 7px;
  top: -1px;
  z-index: 2;
  overflow: hidden;
}

/* Eye: profile (single dot near outer edge) */
.alfred-stickman__eye {
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: #000 !important;
  top: 6px;
  left: 3px;
  z-index: 3;
  transition: left 0.15s ease, top 0.15s ease;
}

/* Second eye via pseudo-element, hidden in profile */
.alfred-stickman__eye::before {
  content: '';
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: #000;
  top: 0;
  left: 9px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Mouth: half-smile at the very edge, clipped by overflow:hidden.
   Rotated ~12° to be perpendicular to the circle border at exit point. */
.alfred-stickman__mouth {
  position: absolute;
  width: 7px;
  height: 2.5px;
  border-bottom: 1.5px solid #000;
  border-radius: 0 0 50% 0;
  border-left: none;
  background: transparent !important;
  top: 12px;
  left: -2px;
  z-index: 3;
  transform: rotate(-12deg);
  transform-origin: right center;
  transition: width 0.15s ease, left 0.15s ease, border-radius 0.15s ease, top 0.15s ease, transform 0.15s ease;
}

/* Frontal face (sitting relaxed): both eyes, centered full smile */
.alfred-stickman.is-facing-front .alfred-stickman__eye {
  left: 6px;
  top: 6px;
}

.alfred-stickman.is-facing-front .alfred-stickman__eye::before {
  opacity: 1;
  left: 6px;
}

.alfred-stickman.is-facing-front .alfred-stickman__mouth {
  width: 8px;
  height: 4px;
  left: 6px;
  top: 11px;
  border-bottom: 1.5px solid #000;
  border-left: none;
  border-right: none;
  border-radius: 0 0 50% 50%;
  transform: rotate(0deg);
  transform-origin: center center;
}

.alfred-stickman__cap-base,
.alfred-stickman__cap-brim,
.alfred-stickman__cap-button {
  position: absolute;
  display: block;
}

.alfred-stickman__cap-base {
  width: 20px;
  height: 11px;
  top: -5px;
  left: 8px;
  border-radius: 11px 11px 6px 6px;
  background: linear-gradient(180deg, var(--alfred-cap-top) 0%, var(--alfred-cap-bottom) 100%) !important;
  transform: rotate(8deg);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.18);
  z-index: 3;
}

.alfred-stickman__cap-brim {
  width: 21px;
  height: 6px;
  top: 2px;
  left: 16px;
  border-radius: 4px 9px 9px 4px;
  background: linear-gradient(180deg, var(--alfred-cap-brim-top) 0%, var(--alfred-cap-brim-bottom) 100%) !important;
  transform: rotate(18deg);
  z-index: 2;
}

.alfred-stickman__cap-button {
  width: 4px;
  height: 4px;
  top: -7px;
  left: 18px;
  border-radius: 50%;
  background: var(--alfred-cap-top) !important;
}

.alfred-stickman__body {
  width: 3px;
  height: 32px;
  left: 16px;
  top: 19px;
}

.alfred-stickman__arm,
.alfred-stickman__leg {
  width: 3px;
  transform-origin: top center;
}

.alfred-stickman__arm {
  height: 14px;
  top: 25px;
}

.alfred-stickman__forearm {
  position: absolute;
  top: 100%;
  left: 0;
  width: 3px;
  height: 12px;
  background: var(--alfred-body-color);
  transform-origin: top center;
  transform: rotate(0deg);
}

.alfred-stickman__arm--left {
  left: 14px;
  animation: none;
}

.alfred-stickman__arm--right {
  left: 18px;
  animation: none;
}

.alfred-stickman__leg {
  height: 48px;
  top: 51px;
}

.alfred-stickman__leg--left {
  left: 14px;
  animation: none;
}

.alfred-stickman__leg--right {
  left: 18px;
  animation: none;
}

/* Calf: visibility controlled by JS for smooth knee transitions */
.alfred-stickman__calf {
  position: absolute;
  top: 100%;
  left: 0;
  width: 3px;
  height: 0px;
  background: var(--alfred-body-color);
  transform-origin: top center;
  transform: rotate(0deg);
  opacity: 0;
}

.alfred-stickman.is-sitting {
  --alfred-bob: 0px;
  height: 74px;
  bottom: calc(var(--alfred-ground) + 5%);
}

.alfred-stickman.is-sitting .alfred-stickman__body {
  height: 22px;
  top: 19px;
  left: 16px;
  transform: rotate(0deg);
  transform-origin: top center;
}

.alfred-stickman.is-sitting .alfred-stickman__cap-base {
  top: -7px;
  left: 7px;
  transform: rotate(0deg);
  border-radius: 11px 11px 7px 7px;
}

.alfred-stickman.is-sitting .alfred-stickman__cap-brim {
  opacity: 0;
}

.alfred-stickman.is-sitting.is-looking-around .alfred-stickman__cap-brim {
  opacity: 1;
  top: 2px;
  left: 16px;
  transform: rotate(18deg);
}

.alfred-stickman.is-sitting.is-looking-around .alfred-stickman__cap-base {
  top: -5px;
  left: 8px;
  border-radius: 11px 11px 6px 6px;
  transform: rotate(8deg);
}

.alfred-stickman.is-sitting.is-looking-around .alfred-stickman__cap-button {
  top: -7px;
  left: 18px;
  transform: rotate(8deg);
}

.alfred-stickman.is-sitting .alfred-stickman__cap-button {
  top: -8px;
  left: 15px;
  z-index: 1;
  opacity: 1;
}

.alfred-stickman.is-sitting .alfred-stickman__arm,
.alfred-stickman.is-sitting .alfred-stickman__leg {
  animation: none;
}

.alfred-stickman.is-sitting .alfred-stickman__leg {
  height: 14px;
}

.alfred-stickman.is-sitting .alfred-stickman__arm--left {
  top: 22px;
  left: 13px;
  height: 18px;
  transform: rotate(-100deg);
  z-index: 1;
}

.alfred-stickman.is-sitting .alfred-stickman__forearm--left {
  height: 16px;
  transform: rotate(-125deg);
}

.alfred-stickman.is-sitting .alfred-stickman__arm--right {
  top: 22px;
  left: 19px;
  height: 18px;
  transform: rotate(100deg);
  z-index: 1;
}

.alfred-stickman.is-sitting .alfred-stickman__forearm--right {
  height: 16px;
  transform: rotate(125deg);
}

.alfred-stickman.is-sitting .alfred-stickman__leg--left {
  top: 40px;
  left: 14px;
  height: 14px;
  transform: rotate(30deg);
}

.alfred-stickman.is-sitting .alfred-stickman__leg--right {
  top: 40px;
  left: 18px;
  height: 14px;
  transform: rotate(-30deg);
}

.alfred-stickman.is-sitting .alfred-stickman__calf {
  opacity: 1;
  height: 28px;
}

.alfred-stickman.is-sitting .alfred-stickman__calf--left {
  transform: rotate(-30deg);
}

.alfred-stickman.is-sitting .alfred-stickman__calf--right {
  transform: rotate(30deg);
}

/* Standing idle: subtle breathing / weight-shift */
.alfred-stickman.is-standing-idle .alfred-stickman__body {
  animation: alfredIdleBody 3.5s ease-in-out infinite;
}

/* Thinking arm (right) in front of head when standing */
.alfred-stickman.is-standing-idle .alfred-stickman__arm--right {
  z-index: 3;
}

.alfred-stickman.is-standing-idle .alfred-stickman__forearm--right::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 11px;
  left: -1.8px;
  top: calc(100% - 2.4px);
  border-radius: 1.8px;
  background: linear-gradient(180deg, #4b4f56 0%, #1f2227 100%);
  box-shadow: 0 0 0 0.8px rgba(255, 255, 255, 0.2), 0 0.8px 1.6px rgba(0, 0, 0, 0.45);
  transform: rotate(0deg);
  transform-origin: center center;
  z-index: 4;
}

.alfred-stickman.is-standing-idle .alfred-stickman__forearm--right::before {
  content: '';
  position: absolute;
  width: 2.2px;
  height: 2.2px;
  left: 0.4px;
  top: calc(100% + 1.2px);
  border-radius: 50%;
  background: #8ad8ff;
  opacity: 0.75;
  box-shadow: 0 0 1.2px rgba(138, 216, 255, 0.8);
  z-index: 5;
}

@keyframes alfredIdleBody {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(0.8deg); }
}

/* Old keyframes removed – all limb posing is handled by JS */

@keyframes rainbowAnimation {
  0% { color: hsl(0, 100%, 50%); }
  14% { color: hsl(60, 100%, 50%); }
  34% { color: hsl(120, 100%, 50%); }
  50% { color: hsl(180, 100%, 50%); }
  67% { color: hsl(240, 100%, 50%); }
  84% { color: hsl(300, 100%, 50%); }
  100% { color: hsl(360, 100%, 50%); }
}

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .cover__content {
    width: 95%;
    padding: 20px 16px;
  }

  .cover__content h1 {
    font-size: clamp(2.25rem, 10vw, 5rem);
    line-height: 1.2;
  }

  .cover__subtitle {
    font-size: clamp(1.15rem, 5vw, 2rem);
  }

  h1.rainbow-text,
  .rainbow-text {
    font-size: clamp(3.5rem, 22vw, 8rem);
  }

  .cover__content p {
    font-size: clamp(1.4rem, 5vw, 2rem);
    line-height: 1.5;
  }

  .cover__nav-arrow {
    font-size: clamp(1.75rem, 6vw, 2rem);
  }
}

@media (max-width: 380px) {
  html {
    font-size: 17px;
  }

  .cover__content h1 {
    font-size: clamp(2.5rem, 12vw, 5rem);
  }

  h1.rainbow-text,
  .rainbow-text {
    font-size: clamp(4rem, 24vw, 8rem);
  }

  .cover__content p {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .cover__subtitle {
    font-size: clamp(1.25rem, 6vw, 2rem);
  }

  .experiments__square {
    width: min(400px, 92vmin);
    min-width: 260px;
  }
}

/* IFRAME */

.threads-embed {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%; 
  height: 100%; 
  padding: 2%;
  box-sizing: border-box;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  margin: auto;
}

.threads-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 700px) {
  .threads-embed {
    width: min(95%, 400px);
    height: 70vh;
    max-height: 500px;
  }
}

.cover__content--with-padding {
  padding-left: clamp(12px, 5vw, 50px);
  padding-right: clamp(12px, 5vw, 50px);
}

.cover__nav-arrow {
  font-size: clamp(1.5rem, 5vw, 2rem);
}
.cover__nav-arrow--left { left: 0; }
.cover__nav-arrow--right { right: 0; }

.perleopache-gallery {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 50px;
}

.perleopache-gallery__arrow {
  font-size: 2rem;
  cursor: pointer;
  position: absolute;
  user-select: none;
}

.perleopache-gallery__arrow--left {
  left: 10px;
}

.perleopache-gallery__arrow--right {
  right: 10px;
}

.perleopache-gallery__image {
  max-width: 300px;
  cursor: pointer;
}

/* LIKE BLOCK */
.like-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0 0;
  margin: 0 auto;
  max-width: min(1200px, 95%);
}
.like-block__count {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  font-variant-numeric: tabular-nums;
  color: var(--menu-color, white);
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.like-block__heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  line-height: 0;
}
.like-block__heart:hover {
  color: #ff7b86;
  border-color: rgba(255, 123, 134, 0.5);
  background: rgba(255, 123, 134, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 123, 134, 0.2);
  transform: scale(1.06);
}
.like-block__heart:active {
  transform: scale(0.98);
}
.like-block__heart:disabled {
  cursor: default;
  opacity: 0.95;
}
.like-block__heart-wrap {
  display: block;
  width: 1.25rem;
  height: 1.15rem;
}
.like-block__heart-icon {
  width: 100%;
  height: 100%;
  display: block;
}
.like-block__heart-fill {
  transition: fill-opacity 0.25s ease;
}
.like-block__heart:hover .like-block__heart-fill,
.like-block__heart--liked .like-block__heart-fill {
  fill-opacity: 1;
}
.like-block__heart--liked,
.like-block__heart--liked:hover {
  color: #ff7b86;
  border-color: rgba(255, 123, 134, 0.45);
  background: rgba(255, 123, 134, 0.15);
}

/* FOOTER */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(10px, 1.5%, 16px) clamp(12px, 5%, 32px);
  background-color: var(--bg-black);
  position: fixed;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
}

.footer .left, .footer .right {
  display: flex;
  align-items: center;
}

.footer .left {
  margin-right: auto;
}

.footer .left a {
  color: white;
  font-size: 24px;
  margin-right: 10px;
  text-decoration: none;
}

.footer .left a:hover {
  color: white;
}

.footer .right {
  margin-left: auto;
  text-align: right;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 1;
  min-width: 0;
}

.footer .right span {
  color: white;
  font-weight: bold;
  line-height: 1.25;
}

@media (max-width: 768px) {
  .footer .left a {
    font-size: 22px;
    margin-right: 10px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .footer .right span {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .footer {
    padding: 10px 12px;
  }

  .footer .left a {
    font-size: 22px;
    margin-right: 10px;
  }

  .footer .right span {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .footer .right span {
    font-size: 12px;
  }
}