:root {
  --wood-dark: #5a3a1b;
  --wood-mid: #7a4f27;
  --wood-light: #9c6b38;
  --ink: #2a1a0c;
  --cream: #fff8ec;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  height: 100vh;
  height: 100dvh;
  color: #fff;
  background: url('background-siruli.webp') center / cover no-repeat fixed;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* readability overlay on top of the background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,40,20,.45) 0%, rgba(10,30,15,.25) 40%, rgba(8,25,12,.55) 100%);
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ---------- HEADER ---------- */
header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px clamp(12px, 3vw, 48px);
  background: rgba(10, 46, 24, .55);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(255, 215, 120, .35);
  animation: slideDown .8s ease both;
}

header img.logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
  animation: popIn .9s cubic-bezier(.17,.67,.3,1.4) both;
}

header .org {
  line-height: 1.35;
  text-shadow: 0 2px 6px rgba(0,0,0,.7);
}
header .org .l1 { font-weight: 700; font-size: clamp(.7rem, 1.6vw, 1rem); letter-spacing: .5px; }
header .org .l2 { font-weight: 500; font-size: clamp(.66rem, 1.3vw, .82rem); opacity: .92; }

/* ---------- MAIN ---------- */
main {
  position: relative;          /* anchor for absolute character */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(12px, 2.5vh, 28px) clamp(16px, 4vw, 48px);
  gap: clamp(14px, 3vh, 28px);
}

.brand { flex: 0 0 auto; animation: fadeUp .9s ease .15s both; }

.brand h1 {
  font-family: 'Baloo 2', cursive;
  font-size: clamp(2.6rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
  color: #fff;
  text-shadow:
    0 2px 0 #1b5e20,
    0 4px 0 #14401a,
    0 8px 22px rgba(0,0,0,.55);
  animation: floaty 4s ease-in-out infinite;
}

.brand .tagline {
  margin-top: 10px;
  font-size: clamp(.8rem, 2.2vw, 1.4rem);
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.75);
  padding: 6px 18px;
  display: inline-block;
  background: rgba(27, 94, 32, .45);
  border: 1px solid rgba(255, 215, 120, .4);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* ---------- TAGLINE "UP-DOWN" JUMP ANIMATION (text only) ----------
   Each word jumps in a staggered ripple. Scoped to the tagline and kept on
   inline-block spans with a bottom transform-origin so the layout box of the
   tagline never changes. */
.brand .tagline .word {
  display: inline-block;
  transform-origin: center bottom;
  animation: tagline-jump 3.6s ease-in-out infinite;
  will-change: transform;
}

@keyframes tagline-jump {
  0%, 55%, 100% {
    transform: scaleY(1);
  }
  60% {
    transform: scaleY(0.9);
  }
  65% {
    transform: scaleY(0.9) translateY(-70%) rotateX(180deg);
    color: #ffe3a0;
  }
  75% {
    transform: translateY(0) scaleY(1) rotateX(0deg);
  }
  80% {
    transform: scaleY(0.9);
  }
  90% {
    transform: scaleY(1);
  }
}

/* ---------- CHARACTER + BUTTONS FLEX ---------- */
.stage {
  position: relative;
  display: flex;
  flex-direction: row;         /* desktop */
  align-items: center;
  justify-content: center;     /* plank sits centered on the page */
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

/* Character pinned to left-center so the plank stays centered */
.character {
  position: absolute;
  left: clamp(0px, 3vw, 70px);
  bottom: -55px;
}
.character img {
  display: block;
  width: clamp(260px, 36vw, 460px);
  max-height: 82vh;
  height: auto;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,.5));
}

/* ---------- WOODEN PLANK PANEL ---------- */
.plank {
  flex: 0 0 auto;
  position: relative;
  padding: clamp(18px, 3vh, 30px) clamp(20px, 2vw, 30px);
  border-radius: 16px;
  background:
    repeating-linear-gradient(
      180deg,
      var(--wood-mid) 0px,
      var(--wood-mid) 26px,
      var(--wood-light) 27px,
      var(--wood-mid) 28px,
      var(--wood-mid) 54px,
      var(--wood-dark) 55px,
      var(--wood-mid) 56px
    );
  box-shadow:
    inset 0 0 0 4px rgba(255,255,255,.06),
    inset 0 2px 8px rgba(255,255,255,.12),
    inset 0 -4px 10px rgba(0,0,0,.4),
    0 14px 30px rgba(0,0,0,.5);
  border: 6px solid var(--wood-dark);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.2vh, 20px);
  animation: fadeUp 1s ease .4s both;
}
/* bolt/nail corners of the plank */
.plank::before,
.plank::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  background: radial-gradient(circle at 35% 30%, #d7b27a, #6b4a24 70%);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.6);
  top: 10px;
}
.plank::before { left: 10px; }
.plank::after  { right: 10px; }

.plank .plank-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--cream);
  text-shadow: 0 1px 0 #3a2410, 0 2px 4px rgba(0,0,0,.5);
  letter-spacing: 1px;
  margin-bottom: -4px;
}

/* ---------- GAME UI BUTTONS ----------
   Fix for the clipping bug: the angled frame is drawn by a ::before
   pseudo-element placed BEHIND the content, so the content (label + chip)
   is never cut by the button's clip-path. */
.game-btn {
  --c1: #2ec27e;
  --c2: #1fa968;
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 240px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,.28));
  transition: transform .15s ease, filter .15s ease;
  isolation: isolate;
}
/* colored body with the angled bottom-right corner */
.game-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  border-radius: 8px;
  border-top: 2px solid rgba(255,255,255,.4);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 0 100%);
}
.game-btn .label {
  flex: 1;
  padding: 15px 16px;
  color: #fff;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
  white-space: nowrap;
}
.game-btn .chip {
  position: relative;
  width: 50px;
  flex: 0 0 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c2);
  margin: 6px 6px 6px 0;
  border-radius: 6px;
  background: #fff;
}
.game-btn .chip svg {
  width: 22px;
  height: 22px;
  transition: transform .15s ease;
}
.game-btn:hover .chip svg { transform: translateX(3px); }
.game-btn:hover { transform: translateY(-3px) scale(1.02); filter: drop-shadow(0 9px 0 rgba(0,0,0,.3)); }
.game-btn:active { transform: translateY(3px); filter: drop-shadow(0 2px 0 rgba(0,0,0,.3)); }

.game-btn.alt { --c1: #ffb224; --c2: #f08c00; }
.game-btn.alt .chip { color: #f08c00; }

/* ---------- CONTACT ---------- */
.contact {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  background: rgba(8, 36, 18, .72);
  backdrop-filter: blur(6px);
  border-top: 2px solid rgba(255, 215, 120, .3);
  box-shadow: 0px -20px 100px black;
  padding: clamp(12px, 2vh, 20px) clamp(16px, 4vw, 48px);
  text-align: center;
  font-size: .85rem;
  line-height: 1.5;
}
.contact .contact-heading {
  font-family: 'Baloo 2', cursive;
  letter-spacing: 1px;
  margin-bottom: 4px;
  color: #ffe3a0;
  font-size: .95rem;
}
.contact .sub { font-weight: 600; opacity: .95; font-size: .82rem; }
.contact .addr { opacity: .85; margin-top: 4px; font-size: .8rem; }
.contact a { color: #ffe3a0; text-decoration: none; }
.contact a:hover { text-decoration: underline; }

/* accordion toggle — hidden on desktop/tablet, used on mobile */
.contact-toggle {
  display: none;
  width: 100%;
  background: none;
  border: none;
  color: #ffe3a0;
  font-family: 'Baloo 2', cursive;
  font-size: .95rem;
  letter-spacing: 1px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.contact-toggle .arrow {
  transition: transform .3s ease;
  font-size: .8rem;
}
.contact-body {
  overflow: hidden;
  transition: max-height .4s ease, opacity .3s ease, margin .3s ease;
}

footer {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 10px;
  font-size: .78rem;
  background: rgba(5, 24, 12, .85);
  color: rgba(255,255,255,.8);
  letter-spacing: .5px;
}

/* ---------- ANIMATIONS ---------- */
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(26px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- RESPONSIVE ---------- */
/* tablet: still one viewport, no scroll. Bigger character. */
@media (max-width: 1024px) {
  .character { left: clamp(-20px, 1vw, 20px); }
  .character img { width: clamp(240px, 34vw, 380px); max-height: 70vh; }
  .game-btn { min-width: 215px; }
}

/* narrow tablet / large phone */
@media (max-width: 820px) {
  .character img { width: clamp(200px, 30vw, 300px); max-height: 58vh; }
}

/* ---------- MOBILE: no scroll, absolute character, accordion contact ---------- */
@media (max-width: 680px) {
  main {
    justify-content: flex-start;
    padding-top: clamp(16px, 3vh, 28px);
  }

  .stage {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }

  /* character absolute, anchored bottom-left; bottom may be clipped off-screen */
  .character {
    position: absolute;
    left: 10%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 5;
    pointer-events: none;
  }
  .character img {
    width: clamp(260px, 78vw, 360px);
    max-height: none;
  }

  /* plank floats above the character */
  .plank {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 260px;
    margin-top: clamp(8px, 2vh, 20px);
    left: 50px;
  }
  .game-btn { width: 100%; min-width: 0; }

  header { gap: 0; }

  /* contact becomes an accordion, collapsed by default */
  .contact { padding-top: 10px; padding-bottom: 10px; }
  .contact .contact-heading { display: none; }   /* toggle replaces the static heading */
  .contact-toggle { display: flex; }
  .contact-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
  }
  .contact.open .contact-body {
    max-height: 260px;
    opacity: 1;
    margin-top: 10px;
  }
  .contact.open .contact-toggle .arrow { transform: rotate(180deg); }
}

/* very short screens: keep character from overflowing the title */
@media (max-height: 560px) and (min-width: 681px) {
  .character img { max-height: 64vh; }
  .brand h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
}
