/* Karelia Games — "Into the Wilds" */
:root {
  --spruce: #0b1418;
  --spruce-2: #0f1c21;
  --lake: #19313a;
  --birch: #f3efe6;
  --snow: #b9c8c8;
  --parchment: #ae9b78;
  --aurora: #78b8a1;
  --ember: #e8a33d;
  --ember-hot: #f2b552;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 6vw, 88px);
  --maxw: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--spruce);
  color: var(--birch);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: rgba(120, 184, 161, .35); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--birch); color: var(--spruce); padding: 10px 16px; border-radius: 6px;
  font-weight: 600; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--aurora); outline-offset: 3px; border-radius: 4px; }

.eyebrow {
  margin: 0 0 22px;
  font: 500 13px/1 var(--sans);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--snow);
}

/* ---------- Header ---------- */
.site-header {
  position: absolute; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px var(--gutter) 22px;
}
.site-header::after {
  content: ""; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0;
  height: 1px; background: linear-gradient(90deg, rgba(243,239,230,.28), rgba(243,239,230,.12));
}
.brand {
  font: 500 clamp(22px, 2vw, 28px)/1 var(--serif);
  text-decoration: none; letter-spacing: .01em;
}
.site-nav { display: flex; gap: clamp(20px, 3vw, 44px); }
.site-nav a {
  font: 500 15px/1 var(--sans); text-decoration: none; opacity: .88;
  position: relative; padding: 6px 0;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--aurora); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.site-nav a:hover { opacity: 1; }
.site-nav a:hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  isolation: isolate;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; z-index: -1; background: #050a0c; }
.hero-poster, .hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 50%;
}
.hero-video { opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-video.is-visible { opacity: 1; }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 70% at 50% 34%, rgba(11,20,24,0) 30%, rgba(11,20,24,.35) 100%),
    linear-gradient(180deg, rgba(11,20,24,.55) 0%, rgba(11,20,24,0) 22%, rgba(11,20,24,0) 62%, rgba(11,20,24,.85) 92%, var(--spruce) 100%);
}
.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero-content {
  text-align: center; padding: 0 var(--gutter);
  transform: translateY(-9vh);
}
.wordmark {
  margin: 0;
  font: 500 clamp(64px, 11.5vw, 172px)/.95 var(--serif);
  letter-spacing: -.01em;
  text-shadow: 0 2px 40px rgba(5,10,12,.55);
}
.wordmark span { display: inline-block; opacity: 0; transform: translateY(18px); animation: rise 1.6s var(--ease) forwards; }
.wordmark span + span { animation-delay: .18s; }
.pitch {
  margin: clamp(18px, 2.5vh, 30px) 0 0;
  font: 400 clamp(17px, 1.6vw, 22px)/1.4 var(--sans);
  color: rgba(243,239,230,.92);
  text-shadow: 0 1px 18px rgba(5,10,12,.8);
  opacity: 0; animation: fade 1.4s .9s var(--ease) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: clamp(24px, 5vh, 48px); transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px;
  font: 500 13px/1 var(--sans); letter-spacing: .06em; text-decoration: none; color: rgba(243,239,230,.8);
  opacity: 0; animation: fade 1s 1.6s forwards;
}
.scroll-cue svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(5px); } }

.motion-toggle {
  position: absolute; right: var(--gutter); bottom: clamp(24px, 5vh, 48px);
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(11,20,24,.35); border: 1px solid rgba(243,239,230,.28); color: var(--birch);
  cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .2s, border-color .2s;
}
.motion-toggle:hover { background: rgba(11,20,24,.6); border-color: rgba(243,239,230,.5); }
.motion-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.motion-toggle .icon-play { fill: currentColor; stroke: none; display: none; }
.motion-toggle[aria-pressed="true"] .icon-pause { display: none; }
.motion-toggle[aria-pressed="true"] .icon-play { display: block; }

/* ---------- Studio ---------- */
.studio {
  position: relative;
  padding: clamp(110px, 16vh, 180px) 0 clamp(120px, 18vh, 200px);
  isolation: isolate;
  overflow: hidden;
}
.studio-map {
  position: absolute; z-index: -2;
  inset: 4% -6% 2% -6%;
  background: url("/assets/img/map-fragment.webp") center / cover no-repeat;
  opacity: .9;
  -webkit-mask-image: radial-gradient(85% 80% at 55% 50%, #000 62%, transparent 100%);
          mask-image: radial-gradient(85% 80% at 55% 50%, #000 62%, transparent 100%);
  transform: translate3d(0, var(--parallax, 0px), 0) scale(1.06);
  will-change: transform;
}
.studio::before {
  /* keeps the left text column calm and readable over the map */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(11,20,24,.82) 0%, rgba(11,20,24,.55) 48%, rgba(11,20,24,.15) 100%);
}
.tracks {
  position: absolute; right: clamp(-40px, 4vw, 90px); top: 12%; z-index: -1;
  width: clamp(80px, 9vw, 130px); height: auto;
  color: var(--parchment); opacity: .45; transform: rotate(-14deg);
  filter: invert(70%) sepia(18%) saturate(380%) hue-rotate(2deg) brightness(.9);
}
.statement {
  margin: 0;
  font: 500 clamp(46px, 6.6vw, 96px)/1.02 var(--serif);
  letter-spacing: -.012em;
}
@media (max-width: 640px) { .statement br { display: none; } }
.studio-lede {
  margin: clamp(28px, 4vh, 44px) 0 0;
  max-width: 34em;
  font-size: clamp(18px, 1.55vw, 22px); line-height: 1.6;
  color: rgba(243,239,230,.9);
}
.values {
  list-style: none; margin: clamp(44px, 6vh, 70px) 0 0; padding: 0;
  max-width: 760px;
  border-top: 1px solid rgba(243,239,230,.18);
}
.values li {
  display: flex; align-items: baseline; gap: clamp(22px, 4vw, 56px);
  padding: clamp(18px, 2.6vh, 26px) 0;
  border-bottom: 1px solid rgba(243,239,230,.18);
  font: 500 clamp(24px, 2.6vw, 36px)/1.2 var(--serif);
}
.values .idx { font: 500 15px/1 var(--sans); letter-spacing: .12em; color: var(--aurora); min-width: 2.2em; }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  padding: clamp(100px, 14vh, 160px) 0 clamp(90px, 12vh, 140px);
  isolation: isolate;
  overflow: hidden;
}
.contact-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, var(--spruce) 0%, rgba(11,20,24,0) 18%, rgba(11,20,24,0) 80%, var(--spruce) 100%),
    url("/assets/img/contact-clearing.webp") 18% 50% / cover no-repeat;
}
.contact-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,20,24,0) 30%, rgba(11,20,24,.45) 60%, rgba(11,20,24,.65) 100%);
}
/* warm flicker over the painted campfire; position is tuned to the artwork */
.fire-glow {
  position: absolute; z-index: 1;
  left: var(--fire-x, 27%); top: var(--fire-y, 74%);
  width: clamp(220px, 26vw, 420px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242,181,82,.55) 0%, rgba(232,163,61,.28) 28%, rgba(232,120,40,.08) 55%, transparent 70%);
  mix-blend-mode: screen;
  animation: flicker 2.6s infinite;
  pointer-events: none;
}
@keyframes flicker {
  0%, 100% { opacity: .85; transform: translate(-50%, -50%) scale(1); }
  12% { opacity: .65; transform: translate(-50%, -51%) scale(.97); }
  27% { opacity: .95; transform: translate(-50%, -50%) scale(1.03); }
  41% { opacity: .72; }
  58% { opacity: 1; transform: translate(-50%, -50.5%) scale(1.02); }
  73% { opacity: .7; transform: translate(-50%, -50%) scale(.98); }
  88% { opacity: .92; }
}
.embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

.contact-inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 80px); align-items: end;
}
.contact-inner > .form-panel { grid-column: 2; }

.form-panel {
  position: relative;
  padding: clamp(28px, 4vw, 54px);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(25,49,58,.55), rgba(11,20,24,.62));
  border: 1px solid rgba(243,239,230,.18);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(243,239,230,.08);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.form-panel::before {
  /* faint frost along the top edge */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(60% 40% at 15% 0%, rgba(185,200,200,.14), transparent 70%);
}
.contact-title { margin: 0 0 clamp(26px, 3.5vh, 38px); font: 500 clamp(48px, 5.5vw, 72px)/1 var(--serif); }

.contact-form { display: grid; gap: 20px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { position: relative; display: grid; gap: 8px; }
.field label { font: 500 15px/1.2 var(--sans); color: rgba(243,239,230,.92); }
.optional { color: rgba(185,200,200,.75); font-weight: 400; }
.field input, .field textarea {
  width: 100%;
  font: 400 16px/1.5 var(--sans); color: var(--birch);
  background: rgba(11,20,24,.5);
  border: 1px solid rgba(185,200,200,.3);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input { height: 54px; }
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: rgba(185,200,200,.5); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--aurora); background: rgba(11,20,24,.7);
  box-shadow: 0 0 0 3px rgba(120,184,161,.18);
}
.field [aria-invalid="true"] { border-color: #e07a6a; box-shadow: 0 0 0 3px rgba(224,122,106,.15); }
.counter { position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: rgba(185,200,200,.6); pointer-events: none; }

.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 6px; }
.btn-send {
  display: inline-flex; align-items: center; gap: 12px;
  height: 54px; padding: 0 26px;
  font: 600 16px/1 var(--sans); color: #1a1208;
  background: var(--ember); border: 0; border-radius: 8px; cursor: pointer;
  box-shadow: 0 10px 30px -10px rgba(232,163,61,.65);
  transition: background .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease); }
.btn-send:hover { background: var(--ember-hot); transform: translateY(-1px); box-shadow: 0 14px 36px -10px rgba(232,163,61,.8); }
.btn-send:hover svg { transform: translateX(3px); }
.btn-send:disabled { opacity: .7; cursor: progress; transform: none; }
.form-note { margin: 0; font-size: 14px; color: rgba(185,200,200,.85); }
.form-status { margin: 0; min-height: 1.4em; font-size: 15px; }
.form-status.is-ok { color: var(--aurora); }
.form-status.is-error { color: #f0a090; }

/* ---------- Footer ---------- */
.site-footer { padding: 0 0 34px; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-top: 26px; border-top: 1px solid rgba(243,239,230,.16);
  font-size: 14px; color: rgba(185,200,200,.85);
}
.footer-mark { width: 160px; height: auto; opacity: .45; filter: invert(1); }

/* ---------- 404 ---------- */
.page-404 .wordmark { font-size: clamp(56px, 9vw, 128px); }
.page-404 .wordmark span, .page-404 .pitch { opacity: 1; transform: none; animation: none; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.values li.reveal:nth-child(2) { transition-delay: .1s; }
.values li.reveal:nth-child(3) { transition-delay: .2s; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .contact { padding-top: min(92vw, 640px); }
  .contact-inner { grid-template-columns: 1fr; }
  .contact-inner > .form-panel { grid-column: 1; }
  .contact-bg {
    background:
      linear-gradient(180deg, var(--spruce) 0%, rgba(11,20,24,0) 8%, rgba(11,20,24,0) 30%, rgba(11,20,24,.75) 55%, var(--spruce) 75%),
      url("/assets/img/contact-clearing-mobile.webp") 50% 0 / 100% auto no-repeat var(--spruce);
  }
  .contact-bg::after { display: none; }
  .studio::before { background: linear-gradient(180deg, rgba(11,20,24,.55), rgba(11,20,24,.8)); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-header { padding-top: 20px; }
  .hero { place-items: start center; }
  .hero-poster, .hero-video { object-position: 27% 50%; }
  .hero-content { transform: none; padding-top: clamp(120px, 17svh, 170px); }
  .wordmark { font-size: clamp(64px, 21vw, 96px); line-height: .9; }
  .pitch { max-width: 15em; margin-left: auto; margin-right: auto; }
  .hero-scrim {
    background:
      linear-gradient(180deg, rgba(11,20,24,.65) 0%, rgba(11,20,24,.25) 38%, rgba(11,20,24,0) 55%, rgba(11,20,24,.8) 90%, var(--spruce) 100%);
  }
  .wordmark span { display: block; }
  .field-row { grid-template-columns: 1fr; }
  .tracks { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-mark { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal, .wordmark span, .pitch, .scroll-cue { opacity: 1; transform: none; }
  .studio-map { transform: scale(1.06); }
}
