/* =========================================================
   HUNGRY MAMMOTH — homepage styles
   Mobile-first. Animations use transform/opacity only.
   ========================================================= */

:root {
  --yellow: #fed136;
  --yellow-dark: #fec503;
  --ink: #1a1a1a;
  --ink-soft: #2b2b2b;
  --gray: #6f6f6f;
  --paper: #faf9f6;
  --white: #ffffff;

  /* game accents */
  --c-degul: #17b8a6;
  --c-match: #ff5d8f;
  --c-flip:  #ff7a1a;
  --c-one:   #6c5ce7;

  --maxw: 1160px;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px -18px rgba(0,0,0,.35);
  --shadow-lg: 0 30px 70px -24px rgba(0,0,0,.45);

  --font-display: "Poppins", "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  overflow-x: hidden;              /* guard against any horizontal bleed */
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 12vw, 130px) clamp(20px, 5vw, 40px);
}

.section__head { text-align: center; max-width: 720px; margin: 0 auto clamp(40px, 6vw, 64px); }
.section__eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--yellow-dark);
  margin: 0 0 12px;
}
.section__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  line-height: 1.12;
  margin: 0 0 18px;
  letter-spacing: -.01em;
}
.section__title .accent { color: var(--yellow-dark); }
.section__sub { font-size: clamp(1rem, 2.4vw, 1.15rem); color: var(--gray); margin: 0; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700;
  padding: 15px 30px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; font-size: 1rem; line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
  will-change: transform;
}
.btn--primary { background: var(--ink); color: var(--yellow); box-shadow: var(--shadow); }
.btn--primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { transform: translateY(-3px); background: var(--ink); color: var(--yellow); }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background-color .25s ease, box-shadow .25s ease, backdrop-filter .25s ease;
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 36px);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav__logo img { height: 40px; width: auto; }
.nav.is-scrolled { background: rgba(250,249,246,.92); box-shadow: 0 8px 30px -18px rgba(0,0,0,.4); backdrop-filter: blur(10px); }

.nav__links { display: flex; align-items: center; gap: clamp(18px, 3vw, 34px); }
.nav__links > a {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  position: relative; padding: 4px 0;
}
.nav__links > a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 3px; width: 0;
  background: var(--yellow); border-radius: 3px; transition: width .22s ease;
}
.nav__links > a:hover::after { width: 100%; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  padding: 8px 12px; border-radius: 999px;
}
.lang-toggle__opt { opacity: .5; transition: opacity .2s, color .2s; }
.lang-toggle__opt.is-active { opacity: 1; color: var(--yellow); }
.lang-toggle__sep { opacity: .4; }

.nav__burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav__burger span {
  display: block; width: 26px; height: 3px; background: var(--ink); border-radius: 3px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav__burger span + span { margin-top: 5px; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px clamp(20px, 5vw, 40px) 80px;
  background:
    radial-gradient(120% 120% at 80% 0%, #ffe58a 0%, var(--yellow) 42%, var(--yellow-dark) 100%);
  text-align: center;
}
.hero__inner { position: relative; z-index: 3; max-width: 820px; }

.hero__eyebrow {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  letter-spacing: .3em; font-size: clamp(.72rem, 2vw, .9rem);
  color: var(--ink); opacity: .72; margin: 0 0 14px;
}
.hero__title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(3rem, 15vw, 8.5rem);
  line-height: .92; letter-spacing: -.02em; margin: 0;
  color: var(--ink);
  text-shadow: 6px 6px 0 rgba(255,255,255,.55);
}
.hero__title-line { display: block; }
.hero__lead {
  font-size: clamp(1rem, 2.6vw, 1.3rem); color: var(--ink-soft);
  max-width: 30ch; margin: 22px auto 30px; font-weight: 500;
}
.hero__cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero__mascot { margin: 34px auto 0; width: clamp(140px, 34vw, 220px); }
.hero__mascot img {
  width: 100%; height: auto;
  filter: drop-shadow(0 20px 24px rgba(0,0,0,.22));
  animation: bob 3.4s ease-in-out infinite;
}

/* decorative background blobs */
.hero__blobs { position: absolute; inset: 0; z-index: 1; }
.blob { position: absolute; border-radius: 50%; filter: blur(6px); opacity: .5; }
.blob--1 { width: 340px; height: 340px; background: #fff4c2; top: -80px; left: -80px; animation: float 9s ease-in-out infinite; }
.blob--2 { width: 260px; height: 260px; background: #ffdd66; bottom: -60px; right: -40px; animation: float 11s ease-in-out infinite reverse; }
.blob--3 { width: 180px; height: 180px; background: #fff; top: 30%; right: 12%; opacity: .35; animation: float 7s ease-in-out infinite; }

/* floating game icons */
.hero__floaters { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.floater {
  position: absolute; width: clamp(48px, 9vw, 92px); height: auto;
  border-radius: 22%; box-shadow: 0 14px 30px -10px rgba(0,0,0,.35);
  animation: float 8s ease-in-out infinite;
}
.floater--a { top: 16%; left: 8%; animation-duration: 8.5s; }
.floater--b { top: 24%; right: 10%; animation-duration: 7s; animation-direction: reverse; }
.floater--c { bottom: 20%; left: 12%; animation-duration: 9.5s; }
.floater--d { bottom: 15%; right: 8%; animation-duration: 8s; animation-direction: reverse; }

.hero__scroll { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 3; }
.hero__scroll span {
  display: block; width: 26px; height: 42px; border: 3px solid var(--ink); border-radius: 999px; position: relative; opacity: .6;
}
.hero__scroll span::after {
  content: ""; position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  background: var(--ink); border-radius: 3px; animation: scrolldot 1.6s ease-in-out infinite;
}

@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-14px) rotate(1deg); } }
@keyframes float { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-22px) translateX(6px); } }
@keyframes scrolldot { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* =========================================================
   ABOUT
   ========================================================= */
.about { position: relative; }
.pillars { display: grid; gap: clamp(18px, 3vw, 28px); grid-template-columns: 1fr; }
.pillar {
  background: var(--white); border-radius: var(--radius);
  padding: clamp(28px, 4vw, 40px); box-shadow: var(--shadow);
  border: 2px solid #f0ede4; text-align: center;
  transition: transform .25s ease, box-shadow .25s ease;
}
.pillar:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.pillar__icon {
  font-size: 2.4rem; width: 74px; height: 74px; margin: 0 auto 18px;
  display: grid; place-items: center; border-radius: 20px;
  background: var(--yellow); box-shadow: 0 10px 24px -10px var(--yellow-dark);
}
.pillar h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; margin: 0 0 10px; letter-spacing: .04em; }
.pillar p { margin: 0; color: var(--gray); font-size: 1rem; }

/* =========================================================
   GAMES  (image-forward cards)
   ========================================================= */
.games__grid { display: grid; grid-template-columns: 1fr; gap: clamp(22px, 3vw, 32px); }

.game-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius); background: var(--white);
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; flex-direction: column;
  transform-style: preserve-3d;
  transition: transform .28s cubic-bezier(.2,.8,.25,1), box-shadow .28s ease;
  will-change: transform;
}
.game-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }

.game-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #ececec; }
.game-card__banner {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.8,.25,1);
}
.game-card:hover .game-card__banner { transform: scale(1.06); }
.game-card__badge {
  position: absolute; bottom: -26px; left: 22px; width: 66px; height: 66px;
  border-radius: 22%; object-fit: cover; border: 4px solid var(--white);
  box-shadow: 0 12px 24px -8px rgba(0,0,0,.45); z-index: 2;
}
.game-card__chips { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  font-family: var(--font-display); font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 6px 12px; border-radius: 999px;
  background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px rgba(0,0,0,.5);
}
.chip--soon { background: rgba(0,0,0,.62); color: #fff; backdrop-filter: blur(4px); }

.game-card__body { padding: 34px clamp(20px, 2.5vw, 26px) clamp(20px, 2.5vw, 26px); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.game-card__name {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.35rem, 3.4vw, 1.75rem); margin: 0; line-height: 1.14; color: var(--ink);
}
.game-card__en { font-size: .92rem; font-weight: 600; margin: 0; color: color-mix(in srgb, var(--accent) 72%, #000); }
.game-card__desc { margin: 8px 0 0; color: var(--gray); font-size: 1rem; }
.game-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.game-card__more {
  font-family: var(--font-display); font-weight: 700; color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; font-size: .98rem;
}
.game-card__more .arrow { transition: transform .2s ease; }
.game-card:hover .game-card__more .arrow { transform: translateX(4px); }
.store-mini { display: flex; gap: 8px; align-items: center; }
.store-mini .store-btn { transition: transform .18s ease; }
.store-mini .store-btn:hover { transform: translateY(-2px); }
.store-mini img { height: 36px; width: auto; display: block; }
.badge-soon {
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  background: color-mix(in srgb, var(--accent) 14%, #f2f2f2); color: color-mix(in srgb, var(--accent) 65%, #000);
  padding: 9px 16px; border-radius: 999px;
}

/* team doodle */
.doodle {
  margin: clamp(48px, 7vw, 80px) 0 0; padding: 0;
  border-radius: var(--radius); overflow: hidden;
  background: var(--yellow); box-shadow: var(--shadow);
}
.doodle img { width: 100%; height: auto; display: block; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--ink); color: #cfcfcf; margin-top: 40px; }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 48px clamp(20px, 5vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__brand img { width: 52px; height: 52px; display: block; }
.footer__word {
  font-family: var(--font-display); font-weight: 900; color: #fff;
  font-size: 1.15rem; line-height: 1; letter-spacing: .01em;
}
.footer__meta { text-align: right; }
.footer__social { font-family: var(--font-display); font-weight: 700; color: var(--yellow); }
.footer__social:hover { text-decoration: underline; }
.footer__copy { margin: 6px 0 0; font-size: .85rem; opacity: .7; }

/* =========================================================
   MODAL
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20,18,10,.6); backdrop-filter: blur(4px); animation: fade .2s ease; }
.modal__panel {
  position: relative; z-index: 2; background: var(--paper);
  width: min(720px, 100%); max-height: 88vh; overflow-y: auto;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: pop .28s cubic-bezier(.2,.9,.3,1);
  -webkit-overflow-scrolling: touch;
}
.modal__close {
  position: absolute; top: 16px; right: 16px;
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: 1.6rem; line-height: 1; z-index: 5;
  backdrop-filter: blur(4px); transition: background-color .2s ease;
}
.modal__close:hover { background: rgba(0,0,0,.8); }
.modal__hero { position: relative; min-height: 210px; display: flex; align-items: flex-end; color: #fff; overflow: hidden; }
.modal__banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.modal__herofade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,.05) 75%); }
.modal__heroinfo { position: relative; display: flex; align-items: flex-end; gap: 18px; padding: 30px; width: 100%; }
.modal__icon { width: 84px; height: 84px; border-radius: 22%; box-shadow: 0 14px 30px -10px rgba(0,0,0,.7); border: 3px solid rgba(255,255,255,.9); flex: none; }
.modal__titles h3 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 4vw, 1.8rem); margin: 0; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.modal__titles .en { opacity: .88; font-weight: 600; }
.modal__titles .meta { margin: 8px 0 0; font-size: .82rem; font-family: var(--font-display); font-weight: 600; letter-spacing: .04em; opacity: .92; }
.modal__content { padding: 26px 30px 34px; }
.modal__content p { white-space: pre-line; color: var(--ink-soft); margin: 0 0 14px; }
.modal__shots { display: grid; gap: 12px; margin: 4px 0 16px; }
.modal__shots img { width: 100%; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.modal__video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; margin: 6px 0 18px; box-shadow: var(--shadow); }
.modal__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal__stores { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.modal__stores img { height: 46px; width: auto; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* =========================================================
   LEGAL / PRIVACY PAGE
   ========================================================= */
.legal { max-width: 820px; margin: 0 auto; padding: clamp(110px, 16vw, 160px) clamp(20px, 5vw, 40px) clamp(60px, 10vw, 100px); }
.legal__head { margin-bottom: clamp(32px, 5vw, 48px); }
.legal__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 6vw, 3rem); margin: 8px 0 10px; letter-spacing: -.01em; }
.legal__date { color: var(--gray); font-size: .95rem; margin: 0; }
.legal__lead { font-size: clamp(1.02rem, 2.4vw, 1.15rem); color: var(--ink-soft); margin: 22px 0 0; }
.legal section { margin-top: clamp(30px, 5vw, 44px); }
.legal h2 {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.25rem, 3.5vw, 1.6rem);
  margin: 0 0 12px; display: flex; align-items: baseline; gap: 12px;
}
.legal h2 .num { color: var(--yellow-dark); font-size: .9em; }
.legal p, .legal li { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.75; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 1.2em; }
.legal li { margin: 6px 0; }
.legal a { color: var(--yellow-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.legal .card {
  background: var(--white); border: 2px solid #f0ede4; border-radius: var(--radius-sm);
  padding: clamp(18px, 3vw, 26px); box-shadow: var(--shadow); margin-top: 8px;
}
.legal .card p { margin: 4px 0; }
.legal__games { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.legal__games li {
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  background: color-mix(in srgb, var(--yellow) 30%, #fff); color: var(--ink);
  padding: 7px 13px; border-radius: 999px; margin: 0;
}

/* footer legal link */
.footer__links { display: flex; gap: 16px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.footer__links a { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.footer__links a.footer__social { color: var(--yellow); }
.footer__links a.footer__legal { color: #cfcfcf; }
.footer__links a:hover { text-decoration: underline; }

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.25,1); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in-view { opacity: 1; transform: none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 720px) {
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .games__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .game-card--wide { grid-column: span 2; flex-direction: row; }
  .game-card--wide .game-card__media { flex: 0 0 58%; aspect-ratio: auto; }
  .game-card--wide .game-card__badge { bottom: 22px; }
  .game-card--wide .game-card__body { flex: 1; justify-content: center; gap: 6px; padding: clamp(24px, 3vw, 40px); }
  .game-card--wide .game-card__desc { font-size: 1.1rem; }
}

/* mobile nav */
@media (max-width: 860px) {
  .nav__burger { display: block; }
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: min(80vw, 320px);
    background: var(--paper); flex-direction: column; align-items: flex-start; justify-content: center;
    gap: 26px; padding: 40px; box-shadow: -20px 0 50px -20px rgba(0,0,0,.4);
    transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.8,.25,1);
  }
  .nav__links.is-open { transform: translateX(0); }
  .nav__links > a { font-size: 1.4rem; }
  body.nav-open { overflow: hidden; }
  .nav.is-open .nav__burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav.is-open .nav__burger span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* pointer-fine only: tilt handled in JS; nothing heavy on touch */

/* reduced motion — kill all non-essential animation */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero__mascot img, .floater, .blob { animation: none !important; }
}
