/* House Riddles — "Moonlit Window" identity.
   Colours from the game's UI kit and logo: night navy panels, moon cyan, lamp amber, logo copper, ivory ghosts.
   Type from the game: Russo One for titles, Exo 2 for text, Caveat for handwritten notes. */
:root {
  --night: #081827;
  --deep: #0b2236;
  --panel: #10283d;
  --line: #24496a;
  --moon: #49b8e8;
  --moon-soft: #9fdcf5;
  --amber: #f5ac38;
  --amber-hi: #ffca68;
  --copper: #e8742a;
  --ivory: #f1f3f5;
  --muted: #a9bccc;
  --paper: #f3e6cc;
  --ink: #3a2a1c;
  --wax: #b8322a;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ivory);
  font: 400 18px/1.65 "Exo 2", system-ui, sans-serif;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: "Russo One", "Exo 2", sans-serif; font-weight: 400; line-height: 1.1; margin: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--amber); color: var(--night); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 16px; }
:focus-visible { outline: 3px solid var(--amber-hi); outline-offset: 4px; border-radius: 6px; }

/* header: a dark glass bar like the game's HUD panels */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: linear-gradient(#081827ee, #081827b0);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #49b8e822;
}
.brand img { height: 62px; width: auto; filter: drop-shadow(0 4px 8px #0008); }
.top nav { display: flex; gap: 26px; margin-left: auto; font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.top nav a { text-decoration: none; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ivory); border-color: var(--amber); }
.langs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.langs a { text-decoration: none; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: var(--muted); }
.langs a[aria-current] { background: var(--amber); color: var(--night); }

/* hero: the moonlit manor, the title in its empty sky */
.hero { position: relative; min-height: min(100vh, 900px); display: flex; align-items: center; overflow: hidden; isolation: isolate; }
.hero-art, .hero-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 40%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #081827f2 0%, #081827c0 32%, #08182700 62%), linear-gradient(0deg, var(--night) 0%, #08182700 26%);
}
.stars { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(1.5px 1.5px at 12% 22%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 28% 12%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 30%, #fff6 50%, transparent 51%), radial-gradient(1px 1px at 8% 44%, #fff7 50%, transparent 51%);
  animation: twinkle 5s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .5; } to { opacity: 1; } }
.hero-copy { width: min(620px, 100%); padding: 120px clamp(16px, 5vw, 72px) 80px; }
.kicker { margin: 0 0 14px; color: var(--moon-soft); font-weight: 700; font-size: 14px; letter-spacing: 2.5px; text-transform: uppercase; }
.hero h1 { font-size: clamp(40px, 5.6vw, 76px); text-shadow: 0 4px 24px #0009; }
.hero h1::first-line { color: var(--ivory); }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: #dbe6ef; max-width: 520px; margin: 22px 0 32px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: linear-gradient(#ffca68, #f5ac38 55%, #e8902a);
  color: #2a1606; text-decoration: none; font-weight: 800; font-size: 18px;
  padding: 15px 28px; border-radius: 16px;
  box-shadow: 0 2px 0 #ffe2a6 inset, 0 8px 0 #9a5a14, 0 14px 30px #f5ac3844;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 #ffe2a6 inset, 0 6px 0 #9a5a14, 0 10px 24px #f5ac3866; }
.play { width: 0; height: 0; border-left: 13px solid #2a1606; border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.soon { color: var(--muted); font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.soon::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 12px var(--moon); }

/* sections */
section { padding: clamp(64px, 9vw, 120px) clamp(16px, 5vw, 72px); position: relative; }
.sec-head { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.sec-head h2 { font-size: clamp(32px, 4vw, 52px); }
.sec-head > p:last-child:not(.kicker) { color: var(--muted); margin: 16px auto 0; max-width: 600px; }
.ghost { position: absolute; pointer-events: none; filter: drop-shadow(0 10px 18px #0008); }

/* the mystery: the cutaway house and four steps */
.mystery { background: radial-gradient(ellipse at 50% 0%, #10304a 0%, var(--night) 70%); }
.cutaway { position: relative; max-width: 1180px; margin: 0 auto; }
.cutaway > img:first-child { border-radius: var(--radius); box-shadow: 0 30px 80px #0009, 0 0 0 1px #49b8e830; }
.ghost-mag { width: clamp(110px, 15vw, 210px); left: -4%; top: -10%; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-12px) rotate(-3deg); } }
.steps { list-style: none; padding: 0; margin: 72px auto 0; max-width: 1180px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.step {
  position: relative; background: linear-gradient(#10283d, #0b2236); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 64px 22px 26px; text-align: center;
}
.step img { position: absolute; top: -44px; left: 50%; translate: -50% 0; width: 92px; filter: drop-shadow(0 8px 14px #000a); }
.step-n { position: absolute; top: 14px; left: 16px; font-family: "Russo One"; color: var(--amber); font-size: 15px; opacity: .8; }
.step h3 { font-size: 21px; margin-bottom: 10px; color: var(--amber-hi); }
.step p { margin: 0; color: var(--muted); font-size: 16px; }

/* trailer: a lit screen with a ghost shining the torch on it */
.trailer { background: var(--deep); }
.screen { position: relative; max-width: 1040px; margin: 0 auto; }
.screen video { width: 100%; aspect-ratio: 16 / 9; display: block; border-radius: var(--radius); background: #000; box-shadow: 0 0 0 1px #49b8e840, 0 0 90px #49b8e822, 0 30px 70px #000a; }
.ghost-torch { width: clamp(100px, 15vw, 210px); left: -9%; top: -16%; z-index: 2; animation: bob 4.6s ease-in-out infinite; }

/* houses: arched lit windows with name tags */
.houses { background: linear-gradient(var(--night), #0a1d30 50%, var(--night)); }
.house-grid { list-style: none; padding: 0; margin: 0 auto; max-width: 1240px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 40px 22px; }
.house { position: relative; }
.window {
  border-radius: 999px 999px 14px 14px / 160px 160px 14px 14px; overflow: hidden; aspect-ratio: 4 / 4.2;
  border: 6px solid #3b2a1d; outline: 2px solid #6b4a2f; outline-offset: -10px;
  box-shadow: 0 0 0 1px #000, 0 18px 40px #000a, 0 0 40px #f5ac3818;
  transition: transform .25s, box-shadow .25s;
}
.window img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; filter: saturate(1.05); }
.house:hover .window { transform: translateY(-4px); box-shadow: 0 0 0 1px #000, 0 22px 44px #000c, 0 0 60px #f5ac3840; }
.house:hover .window img { transform: scale(1.06); }
.tag {
  position: absolute; left: 50%; bottom: -16px; translate: -50% 0; width: max-content; max-width: 92%;
  background: var(--paper); color: var(--ink); font-weight: 700; font-size: 14px; line-height: 1.25; text-align: center;
  padding: 7px 12px 7px 10px; border-radius: 8px; box-shadow: 0 6px 14px #0008; rotate: -2deg;
  display: flex; align-items: center; gap: 8px;
}
.tag b { font-family: "Russo One"; font-weight: 400; color: var(--copper); }
.house:nth-child(even) .tag { rotate: 2deg; }

/* inside the game: polaroids pinned to a board */
.shots { background: radial-gradient(ellipse at 50% 30%, #13324d, var(--night) 75%); }
.board { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 34px 26px; }
.polaroid { margin: 0; background: #fbf6ec; padding: 10px 10px 4px; border-radius: 4px; rotate: var(--r); box-shadow: 0 16px 30px #000b; transition: rotate .25s, transform .25s; }
.polaroid:hover { rotate: 0deg; transform: scale(1.04); z-index: 2; position: relative; }
.polaroid img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; }
.polaroid figcaption { font-family: "Caveat", cursive; font-weight: 600; font-size: 24px; color: #3a3a46; text-align: center; padding: 4px 4px 6px; line-height: 1.2; }

/* parents: a letter with a wax seal */
.parents { background: var(--deep); }
.letter {
  position: relative; max-width: 760px; margin: 0 auto; color: var(--ink);
  background: radial-gradient(ellipse at 30% 20%, #fbf3e2, var(--paper) 60%, #e6d2ab);
  border-radius: 6px; padding: clamp(28px, 5vw, 60px); box-shadow: 0 30px 70px #000b; rotate: -.6deg;
}
.letter p { margin: 0 0 14px; font-size: 18px; }
.letter p:first-child { font-family: "Caveat", cursive; font-size: 32px; font-weight: 700; color: var(--copper); }
.letter .sign { font-family: "Caveat", cursive; font-size: 28px; text-align: right; margin: 22px 0 0; }
.seal { position: absolute; right: 26px; top: -26px; width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e0574c, var(--wax) 55%, #7d1c16); box-shadow: 0 6px 14px #0008, inset 0 0 0 6px #0002; }
.seal::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font-family: "Russo One"; font-size: 32px; color: #f6c3b4aa; }

/* finale */
.finale { text-align: center; padding-top: 90px; margin-top: 150px; background: radial-gradient(ellipse at 50% 100%, #2a1d10 0%, var(--night) 60%); }
.finale h2 { font-size: clamp(30px, 4vw, 50px); color: var(--amber-hi); }
.finale p { color: var(--muted); margin: 14px 0 0; }
.ghost-peek { width: clamp(120px, 14vw, 180px); left: 50%; top: 0; translate: -50% -86%; }
/* the window sill the ghost peeks over */
.finale::before { content: ""; position: absolute; left: 50%; top: -6px; translate: -50% 0; width: clamp(220px, 26vw, 340px); height: 14px;
  border-radius: 6px; background: linear-gradient(#6b4a2f, #3b2a1d); box-shadow: 0 8px 18px #0009; z-index: 1; }
.finale .ghost-peek { z-index: 0; }

footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 28px clamp(16px, 5vw, 72px); border-top: 1px solid #49b8e822; color: var(--muted); font-size: 14px; }
footer img { height: 70px; width: auto; }
footer nav { display: flex; gap: 22px; }
footer p { margin: 0; }

@media (max-width: 980px) {
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 64px; }
  .board { grid-template-columns: repeat(2, 1fr); }
  .top nav { display: none; }
  .langs { margin-left: auto; }
}
@media (max-width: 760px) {
  .hero { min-height: 92vh; align-items: flex-end; }
  .hero::after { background: linear-gradient(0deg, var(--night) 8%, #081827d0 45%, #08182740 100%); }
  .hero-art img { object-position: 70% 30%; }
  .hero-copy { padding-bottom: 48px; }
  .steps { grid-template-columns: 1fr; }
  .house-grid { grid-template-columns: repeat(2, 1fr); gap: 34px 14px; }
  .tag { font-size: 12px; }
  .board { grid-template-columns: 1fr; }
  .ghost-torch { left: -4%; top: -22%; }
  .ghost-mag { top: -16%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } html { scroll-behavior: auto; } }

/* privacy and terms */
.legal-page .langs { margin-left: auto; }
.legal { max-width: 820px; margin: 0 auto; padding: 130px clamp(16px, 5vw, 48px) 80px; }
.legal .textlink { color: var(--amber-hi); text-decoration: none; font-weight: 700; }
.legal .eyebrow { margin: 28px 0 10px; color: var(--moon-soft); font-weight: 700; font-size: 14px; letter-spacing: 2.5px; }
.legal h1 { font-size: clamp(34px, 4.4vw, 52px); }
.legal .updated { color: var(--muted); margin: 10px 0 34px; }
.legal section { padding: 0; margin: 0 0 26px; }
.legal h2 { font-size: 22px; color: var(--amber-hi); margin-bottom: 8px; }
.legal p, .legal li { color: #dbe6ef; }
.legal a { color: var(--moon-soft); }
