/* Merano, the game (merano.html): the valley as the page.
   Self-contained like the other product pages: no merano.css, no merano.js, nothing from another host.
   Every scene is a still from the game with its depth (tools/web_scene.py in the game's repo);
   js/merano-game.js warps the still by its depth with the pointer and the scroll. */

@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/instrument-serif.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/instrument-sans.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("../fonts/jetbrains-mono.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --ground: #0a0d0b;       /* the valley at night */
  --paper: #121613;
  --rule: #242a25;
  --rule-2: #343c35;
  --ink: #ece7db;
  --ink-2: #cdc6b7;
  --ink-3: #a79f90;
  --ink-4: #8a8376;
  --larch: #d9a441;        /* the larch in autumn: the one accent */
  --larch-2: #e8bb62;
  --river: #7fb3bd;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --page: 1240px;
  --gutter: 32px;
  --measure: 560px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; background: var(--ground); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.55; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--larch-2); }
:focus-visible { outline: 2px solid var(--larch-2); outline-offset: 3px; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mg-skip { position: absolute; left: 16px; top: -100px; z-index: 50; padding: 10px 16px; background: var(--ink); color: var(--ground); font-weight: 600; }
.mg-skip:focus { top: 16px; }
.mg-wrap { max-width: var(--page); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.mg-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--larch); }

/* ---------- The bar: the studio's product bar, the game's own take ---------- */

.mg-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; background: rgba(10, 13, 11, 0.55); border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2); transition: background 0.4s; }
.mg-bar.is-solid { background: rgba(10, 13, 11, 0.92); }
/* the strip across the top: one year of the valley, spring to winter */
.mg-bar::before { content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, #4f7a3a 0%, #6fa04c 22%, #9bb24a 40%, #d9a441 62%, #b8742e 74%, #e9eef0 88%, #8fb2c2 100%); opacity: 0.85; }
.mg-bar-inner { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); min-height: 56px; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 0 20px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; }
.mg-crumb { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.mg-crumb a { color: var(--ink-3); text-decoration: none; }
.mg-crumb a[aria-current="page"], .mg-crumb a:last-child { color: var(--ink); }
.mg-crumb a:hover { color: var(--larch-2); }
.mg-crumb-sep { color: #5a6158; }
.mg-nav { margin-left: auto; }
.mg-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 22px; }
.mg-nav a { color: var(--ink-3); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.mg-nav a:hover { color: var(--ink); }
.mg-follow { display: inline-flex; align-items: center; padding: 0 16px; min-height: 36px; background: var(--ink); color: var(--ground);
  border-radius: 999px; text-decoration: none; font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: 0; }
.mg-follow:hover { background: #fff; color: var(--ground); }

.mg-apps { position: relative; }
.mg-apps summary { list-style: none; cursor: pointer; color: var(--ink-3); min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.mg-apps summary:hover { color: var(--ink); }
.mg-apps summary::-webkit-details-marker { display: none; }
.mg-apps summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 0.15s; }
.mg-apps[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.mg-apps-list { position: absolute; left: -16px; top: 46px; width: 270px; margin: 0; padding: 8px 0; list-style: none;
  background: var(--paper); border: 1px solid var(--rule-2); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); }
.mg-apps-list a { display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 0 16px; color: var(--ink-3); }
.mg-apps-list a:hover { color: var(--ink); background: #1a201b; }
.mg-apps-list .mg-no { color: var(--larch); min-width: 3ch; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .mg-bar-inner { font-size: 12px; letter-spacing: 0.05em; gap: 0 12px; }
  .mg-follow { margin-left: auto; }
  .mg-nav { display: none; }
  .mg-apps-list { left: 0; width: min(270px, calc(100vw - 32px)); }
}

/* ---------- Scenes: a still from the game in depth layers, the words scrolling over it ---------- */

.mg-scene-wrap { position: relative; }
.mg-scene { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--ground); isolation: isolate; }
.mg-still { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.mg-depth { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }
.mg-scene.is-depth .mg-depth { opacity: 1; }
/* the scene darkens toward its foot so the words that roll over it read */
.mg-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(10, 13, 11, 0.35) 0%, rgba(10, 13, 11, 0) 22%, rgba(10, 13, 11, 0) 55%, rgba(10, 13, 11, 0.78) 100%); }
.mg-scene-wrap.is-light .mg-scene::after { background: linear-gradient(to bottom, rgba(10, 13, 11, 0.25) 0%, rgba(10, 13, 11, 0) 20%, rgba(10, 13, 11, 0) 60%, rgba(10, 13, 11, 0.7) 100%); }

/* the hero: the title over the scene's foot */
.mg-hero .mg-title { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding-bottom: clamp(40px, 7vh, 88px); }
.mg-hero h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 9.5vw, 148px); line-height: 0.94; letter-spacing: -0.015em; color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45); }
.mg-hero h1 em { font-style: italic; color: var(--larch-2); }
.mg-eyebrow { margin: 0 0 22px; font-family: var(--mono); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.mg-hero-lede { margin: 26px 0 0; max-width: 620px; font-size: 20px; line-height: 1.5; color: var(--ink); text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7); }
.mg-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 30px; }
.mg-button { display: inline-flex; align-items: center; justify-content: center; padding: 14px 26px; min-height: 48px; border-radius: 999px;
  background: var(--ink); color: var(--ground); font-weight: 600; font-size: 16px; text-decoration: none; border: 0; cursor: pointer; font-family: var(--sans); }
.mg-button:hover { background: #fff; color: var(--ground); }
.mg-button-larch { background: var(--larch); color: #1a1206; }
.mg-button-larch:hover { background: var(--larch-2); color: #1a1206; }
.mg-cta-note { font-family: var(--mono); font-size: 13px; color: var(--ink-2); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7); }
.mg-scroll-cue { position: absolute; right: var(--gutter); bottom: 28px; z-index: 3; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3); writing-mode: vertical-rl; display: flex; align-items: center; gap: 12px; }
.mg-scroll-cue::after { content: ""; width: 1px; height: 48px; background: linear-gradient(to bottom, var(--ink-3), transparent); }
@media (prefers-reduced-motion: no-preference) { .mg-scroll-cue::after { animation: mg-cue 2.4s ease-in-out infinite; } }
@keyframes mg-cue { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(10px); opacity: 0.4; } }

/* the words: a column that rolls up over the scene, then stands on the ground */
.mg-copy { position: relative; z-index: 2; margin-top: -34vh; padding-bottom: clamp(72px, 12vh, 140px); }
.mg-copy-inner { max-width: var(--measure); padding: 36px 0 0; }
.mg-copy .mg-label { display: block; margin: 0 0 18px; }
.mg-copy h2 { margin: 0 0 22px; text-wrap: balance; font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5.2vw, 66px); line-height: 1.02; letter-spacing: -0.01em; color: #fff; }
.mg-copy h2 em { font-style: italic; color: var(--larch-2); }
.mg-copy p { margin: 0 0 18px; font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.mg-copy p:last-child { margin-bottom: 0; }
.mg-copy-right .mg-copy-inner { margin-left: auto; }
/* a dark glass behind the words only while they are over the picture */
.mg-copy-inner { background: linear-gradient(to bottom, rgba(10, 13, 11, 0) 0, rgba(10, 13, 11, 0.55) 90px, rgba(10, 13, 11, 0.55)); 
  padding: 60px 28px 28px; margin-left: -28px; border-radius: 0 0 4px 4px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mg-copy-right .mg-copy-inner { margin-left: auto; margin-right: -28px; }

/* ---------- Plain sections on the ground ---------- */

.mg-ground { position: relative; z-index: 2; background: var(--ground); }
.mg-section { padding-top: clamp(72px, 10vh, 120px); padding-bottom: clamp(72px, 10vh, 120px); }
.mg-section .mg-label { display: block; margin-bottom: 18px; }
.mg-section h2 { margin: 0 0 22px; max-width: 820px; text-wrap: balance; font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 5.2vw, 66px); line-height: 1.02; letter-spacing: -0.01em; color: #fff; }
.mg-section h2 em { font-style: italic; color: var(--larch-2); }
.mg-section p { margin: 0 0 18px; max-width: var(--measure); font-size: 18px; line-height: 1.6; color: var(--ink-2); }
.mg-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 44px; }
.mg-columns h3 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 26px; color: #fff; }
.mg-columns p { font-size: 16px; color: var(--ink-3); }
.mg-facts { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 32px; border-top: 1px solid var(--rule); padding-top: 24px; }
.mg-facts li { font-size: 15px; color: var(--ink-3); line-height: 1.5; }
.mg-facts strong { display: block; color: var(--ink); font-weight: 500; }

/* the boards: four valleys as four cards */
.mg-boards { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.mg-board { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 4px; background: var(--paper); border: 1px solid var(--rule); }
.mg-board img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; }
.mg-board:hover img { transform: scale(1.04); }
.mg-board figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 18px 16px; background: linear-gradient(to top, rgba(10, 13, 11, 0.9), rgba(10, 13, 11, 0));
  font-family: var(--serif); font-size: 24px; color: #fff; line-height: 1.1; }
.mg-board figcaption small { display: block; margin-top: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- The wipe ---------- */

.mg-wipe-section p { max-width: 720px; }
.mg-wipe { position: relative; margin-top: 36px; overflow: hidden; border-radius: 4px; background: var(--paper); user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.mg-wipe img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.mg-wipe-game { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.mg-wipe-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); pointer-events: none; }
.mg-wipe-handle span { position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(10, 13, 11, 0.7); border: 2px solid #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mg-wipe-handle span::before, .mg-wipe-handle span::after { content: ""; position: absolute; top: 50%; width: 8px; height: 8px; border-top: 2px solid #fff; border-left: 2px solid #fff; margin-top: -5px; }
.mg-wipe-handle span::before { left: 11px; transform: rotate(-45deg); }
.mg-wipe-handle span::after { right: 11px; transform: rotate(135deg); }
.mg-wipe-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.mg-wipe-range:focus-visible + .mg-wipe-tag { outline: 2px solid var(--larch-2); }
.mg-wipe-tag { position: absolute; bottom: 14px; padding: 6px 12px; border-radius: 999px; background: rgba(10, 13, 11, 0.7); color: var(--ink); font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mg-wipe-tag-l { left: 14px; }
.mg-wipe-tag-r { right: 14px; }

/* ---------- Follow ---------- */

.mg-followbox { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.mg-form { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; max-width: 620px; }
.mg-form input[type="email"] { flex: 1 1 260px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--rule-2); background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; }
.mg-form input[type="email"]::placeholder { color: var(--ink-4); }
.mg-form input[type="email"]:focus { border-color: var(--larch); outline: none; }
.mg-form-note { margin-top: 14px; font-family: var(--mono); font-size: 13px; color: var(--ink-4); }
.mg-form-status { margin-top: 14px; font-size: 15px; color: var(--larch-2); min-height: 1.5em; }
.mg-hp { position: absolute; left: -9999px; }

/* ---------- Footer ---------- */

.mg-footer { border-top: 1px solid var(--rule); }
.mg-footer .mg-wrap { padding-top: 32px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; font-size: 14px; color: var(--ink-4); }
.mg-footer p { margin: 0; }
.mg-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.mg-footer a { color: var(--ink-3); }
.mg-footer a:hover { color: var(--larch-2); }
.mg-credits { width: 100%; font-size: 12px; line-height: 1.5; color: #6c665b; max-width: 900px; }

@media (max-width: 960px) {
  .mg-columns { grid-template-columns: 1fr; gap: 24px; }
  .mg-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .mg-copy { margin-top: -28vh; }
  .mg-copy-inner, .mg-copy-right .mg-copy-inner { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 48px var(--gutter) 24px; border-radius: 0; }
  .mg-hero-lede { font-size: 18px; }
  .mg-scroll-cue { display: none; }
}
