/* ══════════════════════════════════════════════════════════
   CUSTOM PROPERTIES  (matching Claude Design values)
══════════════════════════════════════════════════════════ */
:root {
  --paper:      #ecebe5;
  --paper-2:    #e3e1d8;
  --ink:        #2a2a28;
  --ink-soft:   #5d5d57;
  --line:       #2a2a28;
  --night-h:    222;
  --mask:       0.78;
  --accent:     #34506f;
  --accent-ink: #f3efe3;
  --steam:      #2a3f5c;
}

/* ══════════════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Kalam', cursive;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
/* Scene layers must overflow their container — reset max-width */
.layer { max-width: none; }
a   { text-decoration: none; color: inherit; }

/* ══════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;       /* ULTIMATE CLIP for everything */
  isolation: isolate;
}

/* Rocky landscape atmosphere behind everything */
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('WebsiteBackground.png') center 38% / cover no-repeat;
  filter: saturate(.9);
}

/*
 * Dark night-sky mask.
 * Radial gradient centered at 50% 30% with --night-h:222 (blue-indigo).
 * Stronger at edges → left column looks dark purple/navy.
 * Lighter in center → stage area shows through.
 */
.hero-mask {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    125% 120% at 50% 30%,
    hsla(var(--night-h), 46%, 12%, calc(var(--mask) * .8))   0%,
    hsla(var(--night-h), 52%,  9%, calc(var(--mask) * .96)) 55%,
    hsla(var(--night-h), 55%,  6%, var(--mask))             100%
  );
}

/* Fine grain texture */
.hero-grain {
  position: absolute;
  inset: 0;
  opacity: .04;
  mix-blend-mode: overlay;
  background-image: radial-gradient(rgba(255,255,255,.6) .5px, transparent .5px);
  background-size: 3px 3px;
}

/* ── NAVIGATION ─────────────────────────────────────────── */
.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 20px clamp(20px, 4vw, 56px);
  color: #e9e7df;
  text-shadow: 0 1px 4px rgba(8,10,22,.55);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand .mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  overflow: hidden;
  display: block;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}

.brand .mark img {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  font-family: 'Space Mono', monospace;
  font-size: 12.5px;
  letter-spacing: .4px;
  color: rgba(233,231,223,.82);
  padding: 6px 11px;
  border-radius: 7px;
  text-transform: uppercase;
  position: relative;
  transition: color .15s ease, background .15s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 11px; right: 11px; bottom: 3px;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}

.nav-links a:hover        { color: #fff; }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active       { color: #fff; }
.nav-links a.active::after {
  transform: scaleX(1);
  background: var(--accent-ink);
}

/* ── HERO INNER — flex row ──────────────────────────────── */
.hero-inner {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
}

/* columns hidden by default, re-enabled by data-layout */
.left-col, .right-col { display: none; }

[data-layout="leftcontent"] .hero-inner  { padding-top: 84px; }
[data-layout="leftcontent"] .left-col   { display: flex; }
[data-layout="leftcontent"] .right-col  { display: block; }

/* ── LEFT COLUMN ────────────────────────────────────────── */
.left-col {
  width: 39%;
  min-width: 300px;
  flex-shrink: 0;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(20px, 3.2vw, 56px) 40px clamp(24px, 4vw, 64px);
}

/* ── RIGHT COLUMN ───────────────────────────────────────── */
.right-col {
  position: relative;
  flex: 1;
  min-width: 0;          /* prevent flex blowout */
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 34px;     /* gap between nav area and stage top */
}

/* ══════════════════════════════════════════════════════════
   STAGE — contained illustration box

   • Sits inside .right-col (in-flow, not absolutely positioned)
   • Width fills the right column, capped at 1040 px
   • Height auto-set via aspect-ratio — no distortion
   • overflow:hidden clips every layer including the lighthouse
   • Layers use calc(100% * 1097/1040) so they stay 5.5 %
     wider than the stage at every scale, giving the scene crop
══════════════════════════════════════════════════════════ */
.stage {
  position: relative;          /* containing block for layers  */
  flex-shrink: 0;
  width: min(1040px, 100%);    /* fills right-col, max 1040 px */
  aspect-ratio: 1040 / 560;    /* proportional height, no stretch */
  border-radius: 16px;
  background: #f4dfe8;
  box-shadow:
    0 30px 70px -30px rgba(0,0,0,.7),
    0 0 0 2px rgba(255,255,255,.06);
  overflow: hidden;            /* all layers clipped here */
}

/* ── SCRIM (left-dark → right-transparent gradient) ─────── */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(8,12,26,.74) 0%,
    rgba(8,12,26,.36) 27%,
    rgba(8,12,26,0)   56%
  );
}

/* ── ALL LAYERS ──────────────────────────────────────────── */
/*
 * Anchored bottom-right.
 * Width = 105.5 % of stage — slightly wider for the scene crop.
 * height:auto preserves the native 16∶9 image ratio.
 * max-width:none overrides the global img { max-width:100% }.
 */
.layer {
  position: absolute;
  right: 0;
  bottom: 0;
  width: calc(100% * 1097 / 1040);
  height: auto;
  display: block;
  max-width: none;
}

.layer.bg        { z-index: 1; }
.layer.permanent { z-index: 2; bottom: -2%;   right: 0%; }   /* shifted left */
.layer.woodmill  { z-index: 4; bottom: -1.8%; right: 0%; }   /* shifted left */

/*
 * Lighthouse — smaller and fully contained inside the stage.
 * width:75% of stage → visually smaller character.
 * top:50% + translateY(-50%) centres it vertically so both
 *   the top and bottom of the tower are visible at rest.
 * transform-origin:50% 100% makes the bob animation pivot
 *   from the base of the tower (natural sway).
 * The bob-lh animation keeps the combined centering offset
 *   intact through every keyframe.
 */
.layer.lighthouse {
  z-index: 5;
  width: 100%;               /* smaller than the scene layers */
  right: 0%;                /* shifted left alongside the others */
  bottom: auto;             /* override .layer default */
  top: 50%;                 /* begin vertical centering */
  transform: translateY(-50%);          /* finish vertical centering */
  transform-origin: 50% 100%;           /* sway from tower base */
}

/* ── ANIMATIONS ─────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .layer.lighthouse {
    /* dedicated keyframes keep the centering translateY intact */
    animation: bob-lh 6.5s ease-in-out infinite;
  }
  .layer.woodmill {
    transform-origin: 80% 100%;
    animation: sway 7.5s ease-in-out infinite;
  }
  .layer.permanent {
    transform-origin: 40% 100%;
    animation: breathe 9s ease-in-out infinite;
  }
}

/*
 * bob-lh: each keyframe carries translateY(-50%) to keep the
 * lighthouse centred, PLUS the small upward float (-1.5% of
 * element height ≈ 5–6 px) that stays well within the 50 px
 * margin on both top and bottom.
 */
@keyframes bob-lh {
  0%, 100% { transform: translateY(-50%)              rotate(0deg); }
  50%       { transform: translateY(calc(-50% - 1.5%)) rotate(.4deg); }
}
@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50%       { transform: rotate(-1.4deg); }
}
@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-.4%); }
}

/* ── INSET BORDER ────────────────────────────────────────── */
.stage .frameline {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255,255,255,.16);
  border-radius: inherit;
  pointer-events: none;
  z-index: 6;
}

/* ── HERO CONTENT BLOCK ─────────────────────────────────── */
.content {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.eyebrow {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #ffd9a8;
}

.gamelogo {
  width: clamp(260px, 36vw, 500px);   /* noticeably larger at all desktop widths */
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.55));
}

.tagline {
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.45;
  color: #f0ede4;
  max-width: 30ch;
  font-weight: 400;
}

/* ── CTA BUTTONS ────────────────────────────────────────── */
.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.btn {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 11px 9px 12px 9px;
  cursor: pointer;
  border: 2px solid #1d2433;
  background: rgba(243,239,227,.95);
  color: #1d2433;
  box-shadow: 3px 3px 0 rgba(20,26,40,.55);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover  { transform: translate(-1px,-2px); box-shadow: 5px 6px 0 rgba(20,26,40,.55); }
.btn:active { transform: translate(1px,1px);   box-shadow: 1px 1px 0 rgba(20,26,40,.55); }
.btn.primary { background: var(--steam); color: #eaf1fb; border-color: #0f1726; }

.btn .ico { width: 15px; height: 15px; display: inline-grid; place-items: center; }
.btn .tri { width:0; height:0; border-left:10px solid currentColor; border-top:6px solid transparent; border-bottom:6px solid transparent; }
.btn .sq  { width:12px; height:12px; border:2px solid currentColor; border-radius:3px; }

/* ══════════════════════════════════════════════════════════
   NEWSLETTER
══════════════════════════════════════════════════════════ */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.newsletter {
  background: var(--paper-2);
  border-top: 2px dashed var(--line);
  padding: clamp(56px,9vw,110px) clamp(20px,5vw,80px);
}

.nl-wrap {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nl-title {
  font-size: clamp(30px, 4.2vw, 50px);
  font-weight: 700;
  line-height: 1.16;
  margin: 0 0 20px;
}

.nl-sub {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 30px;
  max-width: 42ch;
}

/* Outer form: column so the consent row sits below email+button */
.nl-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 480px;
}

/* Email + button row */
.nl-row {
  display: flex;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.nl-input {
  flex: 1;
  min-width: 200px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  padding: 13px 16px;
  border: 2px solid var(--line);
  border-radius: 10px 9px 11px 8px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color .2s;
}
.nl-input::placeholder { color: #9a978d; }
.nl-input:focus        { border-color: var(--accent); }

.nl-btn {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 16px;
  padding: 13px 26px;
  border: 2px solid #0f1726;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  border-radius: 11px 9px 12px 9px;
  box-shadow: 3px 3px 0 rgba(20,26,40,.5);
  transition: transform .12s ease, box-shadow .12s ease;
}
.nl-btn:hover { transform: translate(-1px,-2px); box-shadow: 5px 6px 0 rgba(20,26,40,.5); }

/* Consent checkbox row */
.nl-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
  cursor: pointer;
  user-select: none;
  text-align: left;
}
.nl-consent input[type="checkbox"] {
  position: absolute;
  opacity: 0; width: 0; height: 0;
}
.nl-consent-box {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.6px solid rgba(42,42,40,.4);
  background: var(--paper);
  display: grid; place-items: center;
  margin-top: 1px;
  transition: background .15s ease, border-color .15s ease;
}
.nl-consent-box svg {
  width: 12px; height: 12px;
  opacity: 0; transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
  color: var(--paper);
}
.nl-consent input:checked + .nl-consent-box {
  background: var(--accent);
  border-color: var(--accent);
}
.nl-consent input:checked + .nl-consent-box svg {
  opacity: 1; transform: scale(1);
}
.nl-consent input:focus-visible + .nl-consent-box {
  box-shadow: 0 0 0 3px rgba(52,80,111,.22);
}
.nl-consent-text {
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.nl-consent-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Honeypot — hidden from humans */
.nl-hp {
  position: absolute;
  left: -9999px; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

.nl-note {
  margin-top: 14px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: #9a978d;
}

.nl-msg {
  margin-top: 12px;
  font-family: 'Space Mono', monospace;
  font-size: 12.5px;
  min-height: 18px;
  font-weight: 700;
  max-width: 480px;
  text-align: center;
  line-height: 1.5;
}
.nl-msg.is-error   { color: #b00020; }
.nl-msg.is-success { color: var(--accent); }

/* ══════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════ */
footer {
  background: var(--ink);
  color: #d9d7cd;
  padding: clamp(44px,6vw,72px) clamp(20px,5vw,80px) 30px;
}

.ft-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 34px;
}

.ft-brand h4 { font-family: 'Nunito', system-ui, sans-serif; font-size: 20px; margin: 0 0 8px; }
.ft-brand p  {
  font-family: 'Space Mono', monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: #9a988d;
  margin: 0;
  max-width: 30ch;
}

.ft-col h5 {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #8d8b80;
  margin: 0 0 14px;
}
.ft-col a {
  display: block;
  font-family: 'Nunito', system-ui, sans-serif;
  color: #d9d7cd;
  font-size: 15px;
  padding: 5px 0;
  transition: color .14s ease, padding .14s ease;
}
.ft-col a:hover { color: #fff; padding-left: 5px; }

.ft-social { display: flex; gap: 10px; margin-top: 18px; }
.ft-social a {
  width: 34px; height: 34px;
  border: 1.5px solid rgba(217,215,205,.5);
  border-radius: 9px 8px 10px 7px;
  display: grid;
  place-items: center;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: #bdbbb0;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.ft-social a:hover { background: rgba(217,215,205,.14); color: #fff; }

.ft-bottom {
  max-width: 1120px;
  margin: 38px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(217,215,205,.18);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: #8d8b80;
}
.ft-bottom a       { color: #8d8b80; }
.ft-bottom a:hover { color: #d9d7cd; }

/* ══════════════════════════════════════════════════════════
   HAMBURGER BUTTON
   position:fixed so it always sits above the overlay (z:110)
   and above the hero layers (z:40).
══════════════════════════════════════════════════════════ */
.nav-burger {
  display: none;                  /* desktop: hidden */
  position: fixed;
  top: 14px;
  right: clamp(16px, 4vw, 48px);
  z-index: 110;
  width: 46px;
  height: 46px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 1.5px solid rgba(255,255,255,.22);
  border-radius: 13px 11px 14px 10px;
  background: rgba(8,12,26,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #e9e7df;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.nav-burger:hover {
  background: rgba(8,12,26,.8);
  border-color: rgba(255,255,255,.4);
}

/* three lines */
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .28s ease, opacity .2s ease;
}

/* morph to × when open */
.nav-burger.is-open span:nth-child(1) { transform: translateY(8px)  rotate(45deg);  }
.nav-burger.is-open span:nth-child(2) { transform: scaleX(0);       opacity: 0;     }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ══════════════════════════════════════════════════════════
   MOBILE NAVIGATION OVERLAY
══════════════════════════════════════════════════════════ */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    130% 120% at 50% 0%,
    hsla(222, 46%, 12%, .97) 0%,
    hsla(222, 52%,  7%, .99) 100%
  );
  /* closed state */
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.mobile-nav.is-open {
  opacity: 1;
  pointer-events: all;
}

/* grain texture (matches hero atmosphere) */
.mobile-nav::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .04;
  mix-blend-mode: overlay;
  background-image: radial-gradient(rgba(255,255,255,.6) .5px, transparent .5px);
  background-size: 3px 3px;
  pointer-events: none;
}

/* links list */
.mobile-nav-links {
  position: relative;             /* above ::before grain */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.mobile-nav-links a {
  font-family: 'Space Mono', monospace;
  font-size: clamp(17px, 5vw, 24px);
  letter-spacing: .6px;
  text-transform: uppercase;
  color: rgba(233,231,223,.72);
  padding: 13px 32px;
  border-radius: 9px;
  /* slide-up + fade stagger — starts hidden */
  opacity: 0;
  transform: translateY(16px);
  transition:
    color      .15s ease,
    background .15s ease,
    opacity    .32s ease,
    transform  .32s ease;
}

/* stagger each link 45 ms apart */
.mobile-nav-links a:nth-child(1) { transition-delay: .05s; }
.mobile-nav-links a:nth-child(2) { transition-delay: .10s; }
.mobile-nav-links a:nth-child(3) { transition-delay: .15s; }
.mobile-nav-links a:nth-child(4) { transition-delay: .20s; }
.mobile-nav-links a:nth-child(5) { transition-delay: .25s; }
.mobile-nav-links a:nth-child(6) { transition-delay: .30s; }

.mobile-nav.is-open .mobile-nav-links a {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-links a:hover { color: #fff; background: rgba(255,255,255,.06); }
.mobile-nav-links a.active {
  color: #fff;
  position: relative;
}
.mobile-nav-links a.active::after {
  content: '';
  display: block;
  height: 2px;
  background: rgba(255,210,140,.65);
  border-radius: 2px;
  margin-top: 3px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 780px)

   Hide the stage entirely; the hero-bg + mask provide
   atmosphere behind the content column.
══════════════════════════════════════════════════════════ */
@media (max-width: 780px) {
  .ft-grid { grid-template-columns: 1fr 1fr; }

  /* show the hamburger button on mobile */
  .nav-burger { display: flex; }

  [data-layout="leftcontent"] .hero-inner {
    flex-direction: column;
    padding-top: 0;
  }

  [data-layout="leftcontent"] .left-col {
    display: flex;
    width: 100%;
    min-width: 0;
    padding: 96px clamp(20px,6vw,36px) 48px;
    justify-content: flex-end;
  }

  [data-layout="leftcontent"] .right-col { display: none; }

  .nav-links { display: none; }

  /* Logo stays prominent on small screens */
  .gamelogo { width: min(76vw, 420px); }

  .nl-row { flex-direction: column; }
  .nl-input { min-width: 0; }

  .ft-grid { grid-template-columns: 1fr 1fr; }
  .ft-bottom { flex-direction: column; gap: 8px; }
}
