:root {
  --ink: #f4f1e8;
  --muted: #b9b7ae;
  --line: rgba(244, 241, 232, 0.35);
  --display: "DM Serif Display", Georgia, serif;
  --sans: "Space Grotesk", sans-serif;
}

@font-face {
  font-family: "Punk Typewriter";
  src: url("punk_typewriter/Punk%20Typewriter.otf") format("opentype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #000;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background: #000;
}

.home-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 6.5rem) clamp(1.5rem, 9vw, 11rem) clamp(8rem, 18vw, 14rem);
  display: flex;
  align-items: center;
  isolation: isolate;
}

.scene-layer,
.text-gradient {
  position: absolute;
  pointer-events: none;
}

.scene-layer {
  z-index: -3;
  user-select: none;
}

.table-layer {
  width: 100%;
  height: auto;
  left: 0;
  bottom: 0;
}

.cup-layer {
  width: min(40vw, 34rem);
  height: auto;
  right: clamp(0rem, 3vw, 4rem);
  bottom: clamp(7rem, 14vw, 13rem);
  z-index: -2;
}

.text-gradient {
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.88) 27%, rgba(0, 0, 0, 0.34) 57%, rgba(0, 0, 0, 0.08) 100%);
}

.home-shell::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: clamp(7rem, 14vw, 13rem);
  z-index: -1;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.5), transparent);
}

.intro {
  position: relative;
  z-index: 1;
  animation: reveal 700ms ease-out both;
}

.eyebrow {
  margin: 0 0 clamp(1.5rem, 4vw, 3.25rem);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Punk Typewriter", var(--display);
  font-size: clamp(2.8rem, 9vw, 10.5rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.82;
  white-space: nowrap;
}

h1 em {
  color: var(--ink);
  font-style: italic;
}

.rule {
  width: clamp(8rem, 24vw, 18rem);
  height: 1px;
  margin: clamp(2rem, 5vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem);
  background: var(--line);
}

.main-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
}

.play-wrap {
  position: relative;
}

.nav-link,
.choice-menu button {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font: 500 clamp(1.25rem, 2.2vw, 1.75rem) / 1.15 var(--sans);
  letter-spacing: -0.035em;
  text-decoration: none;
  cursor: pointer;
  transition: color 180ms ease, transform 180ms ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.choice-menu button:hover,
.choice-menu button:focus-visible {
  color: #ff6962;
  outline: none;
  transform: translateX(0.5rem) scale(1.08);
  transform-origin: left center;
}

.choice-menu {
  position: absolute;
  top: 50%;
  left: calc(100% + clamp(3.5rem, 8vw, 8rem));
  display: flex;
  gap: clamp(1rem, 2vw, 2rem);
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transform: translate(-0.5rem, -50%);
  transition: opacity 200ms ease, transform 200ms ease, visibility 200ms;
}

.choice-menu.is-active,
.play-wrap:hover .unit-menu,
.play-wrap:focus-within .unit-menu,
.play-wrap.is-open .unit-menu {
  visibility: visible;
  opacity: 1;
  transform: translate(0, -50%);
}

.play-wrap.mode-selected .unit-menu {
  visibility: hidden;
  opacity: 0;
  transform: translate(-0.5rem, -50%);
}

.choice-menu button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  white-space: nowrap;
}

.choice-label {
  color: var(--ink);
  font-size: clamp(0.8rem, 1.3vw, 1rem);
  white-space: nowrap;
}

.mode-menu {
  gap: clamp(1rem, 2vw, 2rem);
}

.mode-menu.is-active {
  display: flex;
}

.side-note {
  position: absolute;
  right: clamp(1.5rem, 5vw, 5rem);
  top: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(90deg) translateX(50%);
  transform-origin: right center;
  animation: fade-in 1s 300ms ease-out both;
}

.side-note span:first-child {
  color: #ff6962;
  font-weight: 600;
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(1.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 680px) {
  .home-shell {
    align-items: flex-start;
    padding-top: 18vh;
    padding-bottom: 12rem;
  }

  .side-note {
    display: none;
  }

  .choice-menu {
    position: static;
    margin-top: 1rem;
    margin-left: 0.25rem;
    transform: none;
    flex-wrap: wrap;
    gap: 0.7rem 1.2rem;
  }

  .choice-menu.is-active,
  .play-wrap:hover .unit-menu,
  .play-wrap:focus-within .unit-menu,
  .play-wrap.is-open .unit-menu {
    transform: none;
  }

  .cup-layer {
    width: 62vw;
    right: -2rem;
    bottom: 8rem;
  }

  .text-gradient {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0.82) 58%, rgba(0, 0, 0, 0.2) 100%);
  }
}
