/* Merrywick landing page. Static, no JS. Night at the top, morning in the middle, dusk at the Great Tree. */

@font-face { font-family: "Press Start 2P"; src: url("/fonts/PressStart2P-Regular.ttf") format("truetype"); font-display: swap; font-weight: 400; }
@font-face { font-family: "Pixelify Sans"; src: url("/fonts/PixelifySans.ttf") format("truetype"); font-display: swap; font-weight: 400 700; }

:root {
  --night: #131a3a;
  --night-2: #232d63;
  --dusk: #2b2f6b;
  --snow: #f2f7fc;
  --ice: #d3e3f4;
  --ice-2: #a9c4e2;
  --ink: #1a2040;
  --ink-soft: #3d4670;
  --red: #b72f27;
  --red-2: #8d231d;
  --pine: #2b6a4d;
  --pine-2: #1d4a35;
  --gold: #f4b93f;
  --wood: #6b432b;
  --pixel: "Press Start 2P", ui-monospace, Menlo, monospace;
  --body: "Pixelify Sans", ui-monospace, Menlo, monospace;
  --u: 4px;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--snow); color: var(--ink); font: 400 20px/1.55 var(--body); }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--ink); padding: 12px 16px; z-index: 100; font-family: var(--pixel); font-size: 12px; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }

h1, h2, h3 { font-family: var(--pixel); font-weight: 400; margin: 0; line-height: 1.35; text-wrap: balance; }
h2 { font-size: clamp(16px, 2.6vw, 24px); line-height: 1.5; }
h3 { font-size: 12px; line-height: 1.6; }
p { margin: 0; }
.measure { max-width: 34em; }

/* ---------- pixel box: a rectangle with notched corners, no border-radius ---------- */
.box {
  --c: var(--ink);
  box-shadow: 0 calc(-1 * var(--u)) 0 0 var(--c), 0 var(--u) 0 0 var(--c), calc(-1 * var(--u)) 0 0 0 var(--c), var(--u) 0 0 0 var(--c);
  margin: var(--u);
}

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--night); color: #fff; border-bottom: 4px solid #000; }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--pixel); font-size: 12px; margin-right: auto; }
.brand img { width: 32px; height: 32px; image-rendering: pixelated; }
.top nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.top nav a { text-decoration: none; font-size: 18px; }
.top nav a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
.langmenu { position: relative; }
.langmenu summary { list-style: none; cursor: pointer; font-family: var(--pixel); font-size: 10px; padding: 10px 12px; border: 3px solid var(--ice-2); }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu ul { position: absolute; right: 0; top: calc(100% + 6px); margin: 0; padding: 8px; list-style: none; background: var(--night); border: 3px solid var(--ice-2); min-width: 170px; }
.langmenu a { display: block; padding: 8px 10px; text-decoration: none; font-size: 18px; }
.langmenu a:hover, .langmenu a[aria-current] { background: var(--night-2); }
@media (max-width: 760px) { .top nav { display: none; } }

/* ---------- hero (night) ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; color: #fff; background:
  linear-gradient(#0e1330 0%, #1b2552 55%, #33407f 100%); }
.stars { position: absolute; inset: 0; z-index: -1;
  background-image:
    radial-gradient(2px 2px at 40px 60px, #fff 98%, transparent), radial-gradient(2px 2px at 170px 120px, #cfe2ff 98%, transparent),
    radial-gradient(2px 2px at 260px 30px, #fff 98%, transparent), radial-gradient(2px 2px at 330px 190px, #fff 98%, transparent),
    radial-gradient(2px 2px at 90px 220px, #cfe2ff 98%, transparent), radial-gradient(2px 2px at 400px 90px, #fff 98%, transparent);
  background-size: 440px 260px; opacity: .8; mask-image: linear-gradient(#000 40%, transparent); -webkit-mask-image: linear-gradient(#000 40%, transparent); }

/* falling snow: two layers of dots, moved with transform only */
.snow { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.snow::before, .snow::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; animation: fall linear infinite; will-change: transform; }
.snow::before { --t: 380px; top: -380px; background-image:
    radial-gradient(3px 3px at 30px 40px, #fff 98%, transparent), radial-gradient(3px 3px at 170px 150px, #fff 98%, transparent),
    radial-gradient(3px 3px at 290px 270px, #fff 98%, transparent), radial-gradient(3px 3px at 90px 230px, #fff 98%, transparent),
    radial-gradient(3px 3px at 240px 20px, #fff 98%, transparent), radial-gradient(3px 3px at 340px 120px, #fff 98%, transparent),
    radial-gradient(3px 3px at 20px 340px, #fff 98%, transparent);
  background-size: 380px 380px; animation-duration: 16s; opacity: .95; }
.snow::after { --t: 270px; top: -270px; background-image:
    radial-gradient(2px 2px at 70px 70px, #dbe8f7 98%, transparent), radial-gradient(2px 2px at 200px 180px, #dbe8f7 98%, transparent),
    radial-gradient(2px 2px at 20px 210px, #dbe8f7 98%, transparent), radial-gradient(2px 2px at 240px 40px, #dbe8f7 98%, transparent),
    radial-gradient(2px 2px at 130px 250px, #dbe8f7 98%, transparent);
  background-size: 270px 270px; animation-duration: 25s; opacity: .7; }
@keyframes fall { to { transform: translate3d(0, var(--t), 0); } }
@media (prefers-reduced-motion: reduce) { .snow::before, .snow::after { animation: none; transform: none; } html { scroll-behavior: auto; } }

.hero .wrap { display: grid; gap: 40px; padding-block: 56px 0; align-items: end; }
.hero-text { padding-bottom: 56px; align-self: center; }
.hero h1 { font-size: clamp(28px, 7.4vw, 56px); line-height: 1.2; text-shadow: 4px 4px 0 #000; word-break: normal; overflow-wrap: anywhere; }
.hero h1 small { display: block; margin-top: 18px; font-size: clamp(12px, 2.4vw, 20px); color: var(--gold); text-shadow: 3px 3px 0 #000; letter-spacing: .02em; }
.pitch { margin-top: 26px; font-size: clamp(22px, 3vw, 28px); line-height: 1.4; max-width: 24em; }
.sub { margin-top: 12px; color: var(--ice); }
.cta { margin-top: 30px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.btn { --c: #000; display: inline-block; background: var(--red); color: #fff; text-decoration: none; font-family: var(--pixel); font-size: 13px; line-height: 1.5; padding: 18px 22px; border: 0; margin: var(--u); box-shadow: 0 -4px 0 0 var(--c), 0 4px 0 0 var(--c), -4px 0 0 0 var(--c), 4px 0 0 0 var(--c), inset 0 -6px 0 0 var(--red-2); }
.btn:hover { background: #cb3a30; }
.btn:active { transform: translateY(2px); }
.btn.alt { background: var(--snow); color: var(--ink); box-shadow: 0 -4px 0 0 var(--c), 0 4px 0 0 var(--c), -4px 0 0 0 var(--c), 4px 0 0 0 var(--c), inset 0 -6px 0 0 var(--ice-2); }
.btn.alt:hover { background: #fff; }
.coming { font-family: var(--pixel); font-size: 11px; line-height: 1.7; color: var(--gold); }

.hero-phones { display: flex; justify-content: center; gap: 24px; align-items: flex-end; }
.hero-phones figure:last-child { display: none; }
.hero-phones { margin-bottom: -150px; align-items: flex-start; }
@media (min-width: 900px) {
  .hero .wrap { grid-template-columns: 1.15fr 1fr; padding-top: 72px; }
  .hero-text { padding-bottom: 96px; }
  .hero-phones { margin-bottom: -110px; }
  .hero-phones figure:last-child { display: block; margin-top: 64px; }
}

/* snow drift under the hero: stepped pixel edge */
.drift { height: 32px; background: var(--snow); position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; }
.drift::before { content: ""; position: absolute; left: 0; right: 0; top: -24px; height: 24px; background:
  linear-gradient(var(--snow), var(--snow)) 0 100%/100% 8px no-repeat,
  linear-gradient(90deg, var(--snow) 0 48px, transparent 48px 96px) 0 100%/96px 16px repeat-x,
  linear-gradient(90deg, transparent 0 24px, var(--snow) 24px 80px, transparent 80px 160px, var(--snow) 160px 200px, transparent 200px) 0 100%/200px 24px repeat-x; }

/* ---------- phone frame (pure CSS) ---------- */
.phone { --pw: 216px; width: calc(var(--pw) + 24px); padding: 12px; background: #0a0c18; box-shadow: 0 0 0 4px #4a5278, 0 0 0 8px #000, 12px 14px 0 8px rgba(0,0,0,.35); border-radius: 0; position: relative; flex: none; margin: 8px; }
.screen { position: relative; width: var(--pw); aspect-ratio: 216 / 468; background: #0d1230; overflow: hidden; }
.screen img, .screen video { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; object-fit: cover; }
.screen video { z-index: 1; }
@media (prefers-reduced-motion: reduce) { .screen video { display: none; } }
.phone-cap { margin-top: 18px; text-align: center; font-size: 18px; max-width: 260px; margin-inline: auto; }
.on-dark .phone-cap { color: var(--ice); }

/* ---------- sections ---------- */
section { position: relative; }
.sec { padding-block: 88px; }
.sec.tight-top { padding-top: 56px; }
.head { display: grid; gap: 18px; margin-bottom: 44px; }
.head p { color: var(--ink-soft); }

/* doors */
.doors-wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .doors-wrap { grid-template-columns: 1.4fr 1fr; } }
.doors-text { display: grid; gap: 18px; }
.doors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 520px) { .doors { grid-template-columns: repeat(4, 1fr); } }
.door { position: relative; aspect-ratio: 3 / 4; display: grid; place-items: end center; padding-bottom: 10%; font-family: var(--pixel); font-size: clamp(10px, 2.2vw, 16px); color: #fff; text-shadow: 2px 2px 0 rgba(0,0,0,.55);
  background: var(--d, var(--red)); box-shadow: inset 0 0 0 4px rgba(0,0,0,.28), inset 0 0 0 8px rgba(255,255,255,.14), 0 4px 0 0 var(--wood), 0 0 0 4px #000, 0 8px 0 4px #000; }
.door::before { content: ""; position: absolute; top: 14%; left: 22%; right: 22%; height: 30%; background: rgba(0,0,0,.22); box-shadow: inset 0 4px 0 rgba(255,255,255,.2); }
.door::after { content: ""; position: absolute; right: 14%; top: 56%; width: 8%; aspect-ratio: 1; background: var(--gold); }
.door:nth-child(4n+1) { --d: #b72f27; }
.door:nth-child(4n+2) { --d: #2b6a4d; }
.door:nth-child(4n+3) { --d: #3c5ea8; }
.door:nth-child(4n+4) { --d: #8b5a2b; }
.door.tree { --d: #1d4a35; box-shadow: inset 0 0 0 4px var(--gold), inset 0 0 0 8px rgba(0,0,0,.2), 0 0 0 4px #000, 0 8px 0 4px #000; }
.door.tree::before { background: var(--gold); opacity: .9; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 36%); }
.doors-aside { display: grid; place-items: center; }

/* mini-game grid */
.games { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, 216px); justify-content: space-between; gap: 44px 24px; }
@media (min-width: 1240px) { .games { grid-template-columns: repeat(5, 216px); } }
.game { display: grid; gap: 14px; align-content: start; }
.game .shot { --pw: 216px; width: 216px; height: 300px; position: relative; overflow: hidden; background: var(--night); margin-inline: auto; box-shadow: 0 0 0 4px #000, 6px 8px 0 4px rgba(26,32,64,.25); }
.game .shot img { width: 216px; height: 468px; image-rendering: pixelated; position: absolute; left: 0; top: -84px; }
.game h3 { font-size: 12px; }
.game p { color: var(--ink-soft); font-size: 18px; line-height: 1.4; }
@media (max-width: 640px) { .games { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 28px; padding: 8px 20px 28px; margin-inline: -20px; } .game { flex: none; width: 216px; scroll-snap-align: center; } }

/* rows of phones */
.phones { display: flex; justify-content: center; gap: 44px; flex-wrap: wrap; }
@media (max-width: 760px) { .phones.scroll { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 20px 28px; margin-inline: -20px; gap: 28px; } .phones.scroll figure { scroll-snap-align: center; } }
figure { margin: 0; }

/* village */
.village { background: linear-gradient(var(--snow), var(--ice)); }
/* tree / dusk */
.dusk { color: #fff; background: linear-gradient(#161b44, var(--dusk) 60%, #3b3f86); overflow: hidden; isolation: isolate; }
.dusk .head p, .dusk p { color: var(--ice); }
.dusk .wrap { display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .dusk .wrap { grid-template-columns: auto 1fr; gap: 80px; } }
.dusk .text { display: grid; gap: 22px; }
.dusk h2 { color: #fff; text-shadow: 3px 3px 0 #000; }
.dusk .snow::before { animation-duration: 18s; }

/* promises */
.calm { background: var(--pine); color: #fff; }
.calm .wrap { display: grid; gap: 44px; }
.calm h2 { text-shadow: 3px 3px 0 var(--pine-2); }
.promises { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px 40px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.promises li { border-top: 4px solid rgba(255,255,255,.55); padding-top: 18px; display: grid; gap: 10px; align-content: start; }
.promises h3 { color: var(--gold); }
.promises p { color: #eaf6ee; }

/* languages */
.langs { background: var(--ice); }
.langs .wrap { display: grid; gap: 28px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.chips a { display: inline-block; padding: 10px 16px; background: var(--snow); text-decoration: none; font-size: 20px; box-shadow: 0 0 0 3px var(--ink); }
.chips a:hover { background: #fff; }
.chips a[aria-current] { background: var(--ink); color: #fff; }

/* faq */
.faq { display: grid; gap: 0; max-width: 46em; }
.faq details { border-top: 4px solid var(--ink); padding: 18px 0; }
.faq details:last-child { border-bottom: 4px solid var(--ink); }
.faq summary { cursor: pointer; font-family: var(--pixel); font-size: 12px; line-height: 1.7; list-style: none; display: flex; gap: 16px; justify-content: space-between; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 16px; flex: none; }
.faq details[open] summary::after { content: "-"; }
.faq details p { margin-top: 14px; color: var(--ink-soft); max-width: 36em; }

/* press */
.press { background: var(--night); color: #fff; }
.press .wrap { display: grid; gap: 36px; }
.press h2 { text-shadow: 3px 3px 0 #000; }
.press p { color: var(--ice); }
.press-grid { display: grid; gap: 32px; align-items: start; }
.press-text { display: grid; gap: 22px; }
@media (min-width: 900px) { .press-grid { grid-template-columns: 1fr 1fr; } }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; }
.facts dt { color: var(--gold); font-family: var(--pixel); font-size: 10px; line-height: 2.2; }
.facts dd { margin: 0; }
.facts a { color: #fff; }

/* footer */
.foot { background: #0a0d22; color: var(--ice); padding-block: 40px 56px; font-size: 18px; }
.foot .wrap { display: grid; gap: 22px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; }
.foot a { color: #fff; }
.foot small { font-size: 16px; color: var(--ice-2); }

/* big screens: more room, but never fractional hero text */
@media (min-width: 1200px) { body { font-size: 22px; } }

/* small screens: long translated words must never push the page wider */
.press-grid > *, .doors-wrap > *, .dusk .wrap > * { min-width: 0; }
.btn { max-width: calc(100% - 8px); }
.facts dd { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dt { line-height: 1.6; margin-top: 14px; }
  .btn { font-size: 12px; padding: 16px 18px; }
}
