:root {
  color-scheme: dark;
  font-family: Georgia, "Times New Roman", serif;
  color: #fff8dc;
  background: #102a23;
  --wood-light: #a9672f;
  --wood-mid: #75401f;
  --wood-dark: #3f2115;
  --cream: #fff0bd;
  --ink: #321c14;
}

* { box-sizing: border-box; }

html {
  min-width: 280px;
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #102a23;
}

.forest,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.forest {
  z-index: 0;
  background: url("assets/forest-hero-v1.png") center center / cover no-repeat;
  transform: scale(1.015);
}

.vignette {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(6, 24, 20, 0.36) 0%, rgba(7, 28, 23, 0.08) 34%, rgba(7, 20, 16, 0.46) 100%),
    radial-gradient(ellipse at center, rgba(9, 33, 25, 0.03) 0%, rgba(3, 16, 13, 0.68) 100%);
}

.hero {
  position: relative;
  z-index: 3;
  width: min(100% - 28px, 940px);
  min-height: calc(100svh - 54px);
  padding: clamp(28px, 5vh, 64px) 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.language-picker {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 0;
  z-index: 5;
}

.language-picker select {
  min-height: 42px;
  padding: 8px 34px 8px 13px;
  border: 2px solid rgba(255, 231, 153, 0.72);
  border-radius: 12px;
  color: #fff4c9;
  background: rgba(26, 59, 43, 0.9);
  box-shadow: 0 5px 16px rgba(4, 15, 11, 0.38);
  font: 750 0.86rem ui-sans-serif, system-ui, sans-serif;
}

.studio {
  margin: 0 0 10px;
  padding: 7px 16px 6px;
  color: #fff3c7;
  background: rgba(34, 56, 38, 0.68);
  border: 1px solid rgba(255, 232, 165, 0.38);
  border-radius: 999px;
  box-shadow: 0 5px 20px rgba(4, 15, 11, 0.35);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(0.58rem, 1.6vw, 0.76rem);
  font-weight: 800;
  letter-spacing: 0.17em;
}

.wordmark {
  display: block;
  width: min(92vw, 780px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 9px 2px rgba(42, 22, 10, 0.34)) drop-shadow(0 20px 28px rgba(4, 14, 10, 0.38));
}

.tagline {
  margin: -2px 0 clamp(20px, 3vh, 34px);
  padding: 7px 18px 9px;
  color: #fff6d2;
  background: rgba(20, 48, 36, 0.66);
  border-radius: 999px;
  text-shadow: 0 2px 4px rgba(25, 12, 5, 0.9);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.035em;
}

.wood-menu {
  width: min(100%, 560px);
  display: grid;
  gap: 13px;
  perspective: 900px;
}

.wood-plank {
  position: relative;
  min-height: 62px;
  padding: 15px 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  border: 3px solid #3a1d11;
  border-radius: 7px 13px 8px 12px;
  clip-path: polygon(2% 7%, 98% 0, 100% 88%, 95% 100%, 3% 94%, 0 17%);
  color: var(--cream);
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(255, 214, 138, 0.11) 9% 10%, transparent 11% 78%, rgba(57, 27, 14, 0.22) 79% 82%, transparent 83%),
    repeating-linear-gradient(176deg, rgba(255,255,255,0.035) 0 2px, rgba(30,12,7,0.045) 3px 6px),
    linear-gradient(180deg, var(--wood-light), var(--wood-mid) 56%, var(--wood-dark));
  box-shadow: 0 8px 0 #2c160e, 0 15px 22px rgba(6, 17, 12, 0.46), inset 0 2px rgba(255, 225, 168, 0.25);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(1rem, 3vw, 1.18rem);
  font-weight: 850;
  letter-spacing: 0.025em;
  text-decoration: none;
  text-shadow: 0 2px 1px #3b1c10;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.wood-plank::before,
.wood-plank::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5d699, #6e4828 55%, #27150e 68%);
  box-shadow: 0 1px 2px rgba(0,0,0,0.8);
  transform: translateY(-50%);
}

.wood-plank::before { left: 19px; }
.wood-plank::after { right: 19px; }

.plank-play { transform: rotate(-0.8deg); }
.plank-about { transform: rotate(-0.35deg) scale(0.91); }

.wood-plank:hover,
.wood-plank:focus-visible {
  z-index: 1;
  filter: brightness(1.13) saturate(1.08);
  transform: rotate(0deg) translateY(-3px) scale(1.015);
  box-shadow: 0 10px 0 #2c160e, 0 19px 28px rgba(6, 17, 12, 0.5), inset 0 2px rgba(255, 225, 168, 0.28);
  outline: 3px solid rgba(255, 231, 153, 0.76);
  outline-offset: 4px;
}

.wood-plank:active {
  transform: translateY(4px) scale(0.99);
  box-shadow: 0 4px 0 #2c160e, 0 9px 14px rgba(6, 17, 12, 0.45), inset 0 2px rgba(255, 225, 168, 0.22);
}

.plank-icon {
  width: 1.4em;
  color: #ffe176;
  font-size: 1.16em;
  line-height: 1;
}

.parchment {
  width: min(100%, 680px);
  margin-top: clamp(30px, 6vh, 58px);
  padding: 28px clamp(21px, 5vw, 48px) 26px;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 247, 205, 0.9), rgba(225, 198, 132, 0.92)),
    repeating-linear-gradient(0deg, rgba(87, 48, 20, 0.06) 0 1px, transparent 1px 5px);
  border: 3px solid #704321;
  border-radius: 42px 14px 38px 18px / 18px 34px 16px 38px;
  box-shadow: 0 12px 0 rgba(63, 32, 15, 0.62), 0 22px 38px rgba(5, 18, 12, 0.5), inset 0 0 26px rgba(119, 66, 25, 0.15);
}

.parchment h2 {
  margin: 8px 0 10px;
  color: #4a2b18;
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.parchment p {
  margin: 8px 0;
  font-size: clamp(0.92rem, 2.4vw, 1.04rem);
  line-height: 1.55;
}

.version {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid rgba(74, 43, 24, 0.3);
  border-radius: 999px;
  color: #693c20;
  background: rgba(255, 250, 222, 0.5);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
}

.device-note {
  color: #6a452a;
  font-size: 0.88rem !important;
}

footer {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 11px 18px max(11px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 16px;
  color: rgba(255, 246, 214, 0.82);
  background: rgba(7, 25, 19, 0.72);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.75rem;
  backdrop-filter: blur(6px);
}

footer a { color: #ffe7a1; }

.firefly {
  position: fixed;
  z-index: 2;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff3a0;
  box-shadow: 0 0 7px 3px rgba(240, 255, 126, 0.66);
  animation: drift 4.5s ease-in-out infinite alternate;
}

.firefly-one { left: 12%; top: 31%; }
.firefly-two { right: 15%; top: 24%; animation-delay: -1.8s; }
.firefly-three { right: 8%; bottom: 22%; animation-delay: -3s; }

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

@keyframes drift {
  from { transform: translate3d(-4px, -7px, 0); opacity: 0.45; }
  to { transform: translate3d(8px, 8px, 0); opacity: 1; }
}

@media (max-width: 520px) {
  .forest { background-position: 46% center; }

  .hero {
    width: min(100% - 20px, 940px);
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .studio { letter-spacing: 0.11em; }

  .wordmark {
    width: min(100%, 610px);
  }

  .tagline { margin-top: -3px; }

  .wood-plank {
    min-height: 58px;
    padding-inline: 31px;
  }

  .wood-plank::before { left: 14px; }
  .wood-plank::after { right: 14px; }
  .parchment { margin-top: 34px; }
}

@media (orientation: landscape) and (max-height: 680px) {
  .forest { background-position: center 58%; }

  .hero {
    width: min(100% - 24px, 1100px);
    min-height: 100svh;
    padding: 4px 0;
    justify-content: flex-start;
  }

  .studio {
    margin-bottom: 2px;
    padding-block: 4px;
  }

  .wordmark {
    width: min(64vw, 640px);
    max-height: 30vh;
    object-fit: contain;
  }

  .tagline {
    margin: -5px 0 6px;
    padding-block: 3px;
  }

  .wood-menu {
    width: min(96vw, 920px);
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }

  .wood-plank,
  .plank-about {
    min-height: 46px;
    padding: 7px 24px;
    transform: none;
  }

  .parchment {
    width: min(92vw, 920px);
    margin-top: 10px;
    padding: 9px 26px;
  }

  .parchment h2 {
    display: inline;
    margin-right: 8px;
    font-size: 1.08rem;
  }

  .parchment p {
    display: inline;
    font-size: 0.82rem;
  }

  .device-note,
  footer { display: none; }
}

@media (min-width: 900px) and (min-height: 820px) {
  .wood-menu { width: 590px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .firefly { animation: none; }
  .wood-plank { transition: none; }
}
