/* Laryen landing. Mobile first; desktop layout above 700 px (mockups/out/spec.md). */
:root {
  --paper: #F4F1EA;
  --paper-2: #E9E4D8;
  --ink: #0D0A14;
  --ink-2: rgba(13, 10, 20, .70);
  --rule: rgba(13, 10, 20, .26);
  --gold: #FFCC3D;
  --gold-hover: #FFDA73;
  --gold-pressed: #E6AD23;
  --magenta: #E0389B;
  --white: #F7FAFF;
  --gutter: 24px;
  /* Hangul falls through to the Korean faces (Google serves only the glyph ranges a page uses). */
  --display: "Barlow Condensed", "Black Han Sans", "Arial Narrow", sans-serif;
  --body: "Barlow", "Noto Sans KR", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.4 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.wrap { width: calc(100% - 2 * var(--gutter)); max-width: 1264px; margin-inline: auto; }

/* Type */
.display { font: 900 72px/.86 var(--display); letter-spacing: -1.2px; text-transform: uppercase; }

/* Hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; color: var(--white); background: var(--ink); overflow: hidden; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -1; background: var(--ink) url("/media/poster-tall-v2.webp") center / cover no-repeat; }
.hero__video { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.hero__video.is-playing { opacity: 1; }
.hero__media::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(13,10,20,.98) 0%, rgba(13,10,20,.90) 25%, rgba(13,10,20,.42) 52%, rgba(13,10,20,.1) 76%, rgba(13,10,20,.46) 100%); }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(22px + env(safe-area-inset-top)) var(--gutter) 0; }
.topbar__logo img { width: 105px; height: auto; }

/* Floating corner, fixed top right above every section and the Enter screen: language switch + mute. */
.corner { position: fixed; z-index: 60; top: calc(14px + env(safe-area-inset-top)); right: 16px; display: flex; align-items: stretch; gap: 6px; }
.lang { padding: 0 12px; color: var(--white); background: rgba(13,10,20,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 0; font: 800 12px/1 var(--display); letter-spacing: 1px; cursor: pointer; }
.lang:hover { background: rgba(13,10,20,.8); }
.sound { display: flex; align-items: center; gap: 8px;
  padding: 5px 5px 5px 12px; color: var(--white); background: rgba(13,10,20,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sound__label { font: 800 10px/1 var(--display); letter-spacing: 1.4px; text-transform: uppercase; }
.sound__box { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(247,250,255,.55); transition: border-color .2s; }
.sound:hover .sound__box { border-color: var(--white); }
.eq { display: none; align-items: center; gap: 3px; height: 16px; }
.eq i { width: 2px; background: var(--magenta); height: var(--h); }
.eq i:nth-child(1) { --h: 8px; } .eq i:nth-child(2) { --h: 16px; } .eq i:nth-child(3) { --h: 11px; } .eq i:nth-child(4) { --h: 6px; }
.sound.is-on .eq { display: flex; }
.sound.is-on .sound__off { display: none; }
.sound.is-playing .eq i { animation: eq .9s ease-in-out infinite alternate; }
.sound.is-playing .eq i:nth-child(2) { animation-delay: -.3s; }
.sound.is-playing .eq i:nth-child(3) { animation-delay: -.6s; }
.sound.is-playing .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { from { height: 4px; } to { height: var(--h); } }

.hero__content { margin-top: auto; padding: 48px 0 calc(72px + env(safe-area-inset-bottom)); }
.hero__lede { margin-top: 18px; max-width: 30em; font: 400 15px/21px var(--body); }
.hero .cta-row { margin-top: 22px; }

/* Primary button: gold face with a clipped corner inside a thin gold frame. */
.cta-row { display: flex; align-items: center; gap: 24px; }
.cta { width: 100%; }
.btn { position: relative; display: block; padding: 5px; text-decoration: none; }
.btn::before { content: ""; position: absolute; inset: 0; background: var(--gold);
  clip-path: polygon(evenodd, 0 0, 100% 0, 100% calc(100% - 17px), calc(100% - 17px) 100%, 0 100%, 0 0,
    1px 1px, 1px calc(100% - 1px), calc(100% - 17.4px) calc(100% - 1px), calc(100% - 1px) calc(100% - 17.4px), calc(100% - 1px) 1px, 1px 1px); }
.btn__face { display: flex; align-items: center; justify-content: center; gap: 12px; height: 60px; background: var(--gold); color: var(--ink);
  font: 900 22px/1 var(--display); letter-spacing: 1.1px; text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); transition: background-color .15s, transform .1s; }
.btn:hover .btn__face { background: var(--gold-hover); }
.btn:active .btn__face { background: var(--gold-pressed); transform: translate(2px, 2px); }
.cta__note { margin: 10px 0 0 5px; font: 400 11px/16px var(--body); opacity: .8; }

/* QR beside the Download button (desktop only): a white card lifted off the page. */
.qr { position: relative; display: none; align-items: center; gap: 18px; flex: none; margin: 0; padding: 14px 22px 14px 14px; background: #fff; color: var(--ink);
  box-shadow: 0 18px 48px rgba(13,10,20,.45), 0 2px 6px rgba(13,10,20,.25); transform: translateY(-4px); }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.qr figcaption { display: grid; gap: 6px; max-width: 130px; }
.qr strong { font: 900 22px/1 var(--display); letter-spacing: .65px; text-transform: uppercase; }
.qr span { font: 400 13px/17px var(--body); color: var(--ink-2); }
/* Store badges: the official App Store and Google Play badges plus a Steam badge in the same format, at one height. */
.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.stores a { display: block; transition: opacity .15s, transform .1s; }
.stores a:hover { opacity: .85; }
.stores a:active { transform: translate(1px, 1px); }
.stores img { width: auto; height: 44px; } /* 44 px: Apple's minimum touch target */
[data-platform="android"] .stores [data-platform="android"], [data-platform="ios"] .stores [data-platform="ios"],
[data-platform="desktop"] .stores [data-platform="desktop"] { order: -1; } /* set by main.js */


/* Scroll cue: a framed square with a bold gold chevron that bobs, so the page below is obvious. */
.scroll-cue { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); display: grid; place-items: center; width: 44px; height: 44px;
  margin-left: -22px; color: var(--gold); border: 1.5px solid rgba(247,250,255,.7); background: rgba(13,10,20,.45); animation: cue 1.8s ease-in-out infinite; }
.scroll-cue:hover { border-color: var(--gold); }
@keyframes cue { 50% { transform: translateY(6px); } }

/* Sections */
.section { padding: 72px 0; }
.section--alt { background: var(--paper-2); }
.sec-head { position: relative; padding-top: 18px; border-top: 1px solid var(--rule); margin-bottom: 24px; }
.sec-title { position: relative; z-index: 1; margin-top: 30px; font: 900 49px/.92 var(--display); letter-spacing: -.6px; text-transform: uppercase; }
/* Outlined section word. Its stroke is ink at 50 % (about 3.5:1 on paper, the WCAG minimum for large text is 3:1);
   on the phone it sits small above the headline (the title's top margin) so it never overlaps it. */
.ghost { position: absolute; top: 9px; right: 0; font: 900 34px/1 var(--display); letter-spacing: 0; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1.2px rgba(13,10,20,.5); white-space: nowrap; pointer-events: none; user-select: none; }

/* Hero cards: a swipe row on the phone, three across on desktop. */
.cards { display: flex; gap: 12px; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cards::-webkit-scrollbar { display: none; }
.card { position: relative; flex: none; width: 288px; aspect-ratio: 288 / 380; scroll-snap-align: start; overflow: hidden; color: var(--white); background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%); }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover img { transform: scale(1.04); }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(13,10,20,.96), rgba(13,10,20,.18) 44%, rgba(13,10,20,.08)); }
.card__text { position: absolute; z-index: 1; left: 20px; right: 20px; bottom: 22px; }
.card h3 { font: 900 38px/39px var(--display); letter-spacing: .15px; text-transform: uppercase; }
.card p { font: 400 14px/20px var(--body); color: rgba(247,250,255,.8); }
.dots { display: flex; gap: 6px; margin-top: 18px; }
.dots i { width: 5px; height: 5px; background: var(--rule); transition: width .25s, background-color .25s; }
.dots i.is-active { width: 20px; background: var(--gold); }

.features { display: grid; gap: 32px; }
.feature figure { position: relative; aspect-ratio: 342 / 198; margin-bottom: 16px; background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%); }
.feature img { width: 100%; height: 100%; object-fit: cover; }
.feature h3 { font: 900 27px/29px var(--display); letter-spacing: .15px; text-transform: uppercase; }
.feature p { margin-top: 5px; font: 400 15px/21px var(--body); color: var(--ink-2); }

.steps li { display: grid; grid-template-columns: 70px 1fr; column-gap: 20px; align-items: start; padding: 17px 0 22px; border-top: 1px solid rgba(13,10,20,.28); }
.step__num { font: 900 70px/.88 var(--display); color: transparent; -webkit-text-stroke: 1.2px var(--ink); }
.steps p { margin-top: 3px; font: 400 15px/22px var(--body); }

.final { position: relative; isolation: isolate; padding: 72px 0 76px; color: var(--white);
  background: linear-gradient(90deg, rgba(13,10,20,.97), rgba(13,10,20,.86) 52%, rgba(13,10,20,.72)), var(--ink) url("/media/town-v2.webp") 54% center / cover no-repeat; }
.final__title { font: 900 57px/.9 var(--display); letter-spacing: -.7px; text-transform: uppercase; }
.final .cta-row { margin-top: 28px; }

.footer { padding: 30px 0; }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; } /* phones: links drop below the logo */
.footer__logo { flex: none; width: 100px; aspect-ratio: 640 / 223; background: var(--ink);
  -webkit-mask: url("/media/logo.png") center / contain no-repeat; mask: url("/media/logo.png") center / contain no-repeat; }
.footer p { font: 400 11px/18px var(--body); color: var(--ink-2); }

/* Desktop */
@media (min-width: 701px) {
  :root { --gutter: 88px; }
  .display { font-size: 130px; line-height: .82; letter-spacing: -2.4px; }
  /* Logo and Mute line up with the content column (.wrap). */
  .topbar { width: calc(100% - 2 * var(--gutter)); max-width: 1264px; margin-inline: auto; padding: 36px 0 0; }
  .topbar__logo img { width: 137px; }
  .corner { top: 28px; right: max(var(--gutter), calc((100% - 1264px) / 2));   /* % of the viewport without its scrollbar, like .wrap */ }
  .sound { gap: 12px; }
  .lang { padding: 0 16px; font-size: 13px; }
  .sound__label { font-size: 12px; letter-spacing: 1.8px; }
  .sound__box { width: 42px; height: 42px; }
  .hero { min-height: max(650px, 100vh); }
  .hero__media { background-image: url("/media/poster-wide-v3.webp"); }
  .hero__media::after { background: linear-gradient(90deg, rgba(13,10,20,.94) 0%, rgba(13,10,20,.84) 30%, rgba(13,10,20,.34) 65%, rgba(13,10,20,.12) 100%),
    linear-gradient(0deg, rgba(13,10,20,.74), transparent 56%); }
  .hero__content { padding-bottom: 98px; }
  .hero__lede { margin-top: 25px; font-size: 18px; line-height: 26px; }
  .hero .cta-row { margin-top: 27px; }
  .cta { width: 286px; flex: none; }
  [data-channel="store"] .cta { width: auto; } /* the badge row is wider than the Download button */
  .cta .btn--ghost { width: 286px; }
  .qr { display: flex; }
  .stores { gap: 12px; }
  .stores img { height: 48px; }
  .btn__face { height: 66px; font-size: 23px; }
  .cta__note { margin-top: 11px; font-size: 12px; }
  .scroll-cue { bottom: 28px; width: 52px; height: 52px; margin-left: -26px; }
  .scroll-cue svg { width: 26px; height: 26px; }

  .section { padding: 112px 0; }
  .sec-head { padding-top: 22px; margin-bottom: 42px; min-height: 155px; }
  .sec-title { font-size: 76px; line-height: .92; letter-spacing: -1.1px; }
  .ghost { top: 23px; font-size: 145px; letter-spacing: -2px; -webkit-text-stroke-width: 1.6px; }
  .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-right: 0; padding-right: 0; overflow: visible; }
  .card { width: auto; aspect-ratio: 408 / 460; }
  .card__text { left: 24px; bottom: 25px; }
  .card h3 { font-size: 42px; line-height: 42px; }
  .card p { font-size: 15px; }
  .dots { display: none; }
  .features { grid-template-columns: 1fr 1fr; gap: 48px 24px; }
  .feature figure { aspect-ratio: 620 / 260; margin-bottom: 20px; }
  .feature h3 { font-size: 30px; line-height: 32px; }
  .feature p { margin-top: 7px; line-height: 22px; }
  .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .steps li { display: block; padding: 20px 0 0; }
  .step__num { display: block; font-size: 106px; line-height: .9; }
  .steps p { margin-top: 20px; max-width: 310px; font-size: 16px; line-height: 24px; }
  .final { padding: 93px 0 98px; background-position: center, center 48%; }
  .final__title { font-size: 82px; letter-spacing: -1.1px; }
  .final .cta-row { margin-top: 30px; }
  .footer { padding: 37px 0; }
  .footer__logo { width: 124px; }
  .footer p { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sound.is-playing .eq i, .scroll-cue { animation: none; }
  .card img, .hero__video { transition: none; }
}

/* Enter screen: shown only with JavaScript; the tap on Enter starts the music. */
.gate { display: none; }
.js .gate { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 36px; padding: var(--gutter);
  color: var(--white); background: rgba(13,10,20,.78); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: opacity .5s ease; }
.js .gate.is-leaving { opacity: 0; pointer-events: none; }
.js.gate-open { overflow: hidden; }
.gate__logo { width: min(280px, 70vw); height: auto; }
.gate__enter { width: 240px; }
.gate__note { font: 600 11px/1 var(--body); letter-spacing: 2px; text-transform: uppercase; opacity: .75; }

/* Secondary button (Join the Discord): same clipped frame in white, translucent face. */
.btn--ghost { margin-top: 14px; }
.btn--ghost::before { background: rgba(247,250,255,.6); }
.btn--ghost .btn__face { height: 48px; gap: 10px; background: rgba(247,250,255,.08); color: var(--white); font-size: 18px; }
.btn--ghost:hover .btn__face { background: rgba(247,250,255,.18); }
.btn--ghost:active .btn__face { background: rgba(247,250,255,.26); }

.footer__links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
/* Social links (Discord, Facebook): each sets --brand, its hover colour. */
.footer__social { display: flex; align-items: center; gap: 8px; font: 800 13px/1 var(--display); letter-spacing: 1px; text-transform: uppercase; text-decoration: none; }
.footer__social:hover { color: var(--brand); }
/* Legal links (landing footer and the legal pages' footer). */
.footer__legal { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; }
.footer__row + .footer__legal { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--rule); }
.footer__legal a { padding: 3px 0; font: 600 11px/18px var(--body); color: var(--ink-2); text-decoration: none; }
.footer__legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 701px) { .footer__legal a { font-size: 12px; } }

/* Korean: Hangul breaks between words, and the Latin headline tracking is too tight for it. */
:lang(ko) body { word-break: keep-all; font-synthesis: none; }   /* Black Han Sans has one (heavy) weight: no faux bold over it */
:lang(ko) .display, :lang(ko) .sec-title, :lang(ko) .final__title, :lang(ko) .card h3, :lang(ko) .feature h3 { letter-spacing: 0; line-height: 1.05; }
