/* =========================================================
   Knock on Wood Studios
   Palette derived from the carved-wood crest:
   deep bark ground, parchment text, moss-green + brass accents.
   ========================================================= */

:root {
  --ground:    #14110B;   /* deep warm bark, near-black */
  --ground-2:  #1E1810;   /* raised bark / surface */
  --ground-3:  #2A2114;   /* card / inset */
  --text:      #ECE1C8;   /* warm parchment */
  --text-dim:  #B6A988;   /* faded parchment */
  --text-faint:#7C6F55;   /* low-contrast labels */
  --accent:    #84AB4E;   /* moss / forest green */
  --accent-lo: #5C7C37;   /* deeper moss */
  --brass:     #C99A4C;   /* brass / bronze banner */
  --brass-lo:  #9C7332;

  --line:      rgba(201, 154, 76, 0.22);   /* hairline = aged brass */
  --line-soft: rgba(236, 225, 200, 0.10);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --maxw: 1180px;
  --pad: clamp(1.25rem, 5vw, 4rem);

  --step--1: clamp(0.78rem, 0.74rem + 0.2vw, 0.9rem);
  --step-0:  clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  --step-1:  clamp(1.3rem, 1.1rem + 0.9vw, 1.7rem);
  --step-2:  clamp(1.8rem, 1.4rem + 1.9vw, 2.9rem);
  --step-3:  clamp(2rem, 1.3rem + 3.4vw, 4.6rem);
  --step-4:  clamp(2.4rem, 1.3rem + 5.4vw, 6.6rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* subtle woodgrain stripes + warm depth */
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(132, 171, 78, 0.10), transparent 55%),
    repeating-linear-gradient(92deg,
      rgba(0,0,0,0) 0px, rgba(0,0,0,0) 5px,
      rgba(0,0,0,0.05) 6px, rgba(0,0,0,0) 9px),
    repeating-linear-gradient(89deg,
      rgba(255, 230, 180, 0.012) 0px, rgba(255,230,180,0.012) 22px,
      rgba(0,0,0,0.05) 26px, rgba(0,0,0,0) 60px);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #11140a; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--brass); color: #1a1305; padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0; font-family: var(--font-mono); font-size: 0.8rem;
}
.skip-link:focus { left: 0; }

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

/* ---------- atmosphere layers ---------- */
.embers {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(130% 100% at 50% 38%, transparent 42%, rgba(0,0,0,0.55) 100%);
  mix-blend-mode: multiply;
}
main, .nav, .foot { position: relative; z-index: 2; }

/* ---------- shared bits ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1.1rem;
}
.eyebrow--center { text-align: center; }

.section-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: var(--step-3);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0 0 0.9rem;
  overflow-wrap: break-word;
}
.section-sub {
  color: var(--text-dim);
  max-width: 46ch;
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.4;
}
.section-head { max-width: var(--maxw); margin: 0 auto; }

.ink { color: var(--accent); font-style: italic; }

/* buttons */
.btn {
  --b: var(--brass);
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-decoration: none;
  padding: 0.85em 1.5em;
  border-radius: 100px;
  border: 1.5px solid var(--b);
  color: var(--text);
  transition: transform .25s cubic-bezier(.2,.7,.3,1), background-color .25s, color .25s, box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--brass); border-color: var(--brass); color: #1a1305; font-weight: 700; }
.btn--solid:hover { box-shadow: 0 10px 30px -8px rgba(201,154,76,.5); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: rgba(236,225,200,.06); }
.btn--lg { font-size: var(--step-0); padding: 1em 1.8em; }
.btn--knock {
  --b: var(--accent);
  color: var(--accent);
}
.btn--knock:hover { background: var(--accent); color: #11140a; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem var(--pad);
  transition: background-color .3s, backdrop-filter .3s, border-color .3s, padding .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(15, 12, 7, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
  padding-top: 0.65rem; padding-bottom: 0.65rem;
}
.nav__brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--text);
}
.nav__knock { color: var(--brass); display: grid; place-items: center; transition: transform .4s; }
.nav__brand:hover .nav__knock { transform: rotate(-12deg); }
.nav__name {
  font-family: var(--font-display); font-weight: 900; font-size: 1.15rem;
  line-height: 0.95; letter-spacing: -0.01em; display: flex; flex-direction: column;
}
.nav__name-sub {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.58rem;
  letter-spacing: 0.45em; color: var(--brass); text-transform: uppercase; margin-top: 2px;
}
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.nav__links > a:not(.btn) {
  color: var(--text-dim); text-decoration: none;
  font-size: var(--step--1); letter-spacing: 0.02em;
  transition: color .2s;
}
.nav__links > a:not(.btn):hover { color: var(--text); }

@media (max-width: 720px) {
  .nav__links > a:not(.btn) { display: none; }
  .nav__name-sub { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 7rem var(--pad) 5rem;
}
.hero__glow {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%,-50%);
  width: min(900px, 92vw); aspect-ratio: 1; z-index: -1;
  background: radial-gradient(circle, rgba(132,171,78,.20), rgba(201,154,76,.10) 35%, transparent 68%);
  filter: blur(10px);
}
.hero__inner { max-width: 940px; display: flex; flex-direction: column; align-items: center; }
.hero__crest {
  margin: 0 0 2.2rem; width: min(720px, 90vw);
  filter: drop-shadow(0 30px 60px rgba(0,0,0,.65));
}
.hero__crest img { border-radius: 18px; }
.hero__headline {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 900;
  font-size: var(--step-4);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 0 0 1.4rem;
  max-width: min(16ch, 100%);
  overflow-wrap: break-word;
}
.hero__headline em { color: var(--accent); font-style: italic; font-weight: 500; }
.hero__lede {
  color: var(--text-dim); font-size: var(--step-1); line-height: 1.45;
  max-width: 52ch; margin: 0 0 2.2rem;
}
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }

.hero__scroll {
  position: absolute; bottom: 1.8rem; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--line);
  border-radius: 14px; display: grid; place-items: start center; padding-top: 7px;
}
.hero__scroll span {
  width: 4px; height: 8px; background: var(--brass); border-radius: 2px;
  animation: scrolldot 1.8s ease-in-out infinite;
}
@keyframes scrolldot { 0%,100% { transform: translateY(0); opacity:.4 } 50% { transform: translateY(8px); opacity:1 } }

/* ---------- manifesto ---------- */
.manifesto {
  max-width: 1000px; margin: 0 auto;
  padding: clamp(5rem, 12vw, 9rem) var(--pad);
  text-align: center;
}
.manifesto__quote {
  font-family: var(--font-display); font-weight: 400; font-style: italic;
  font-size: var(--step-2); line-height: 1.32; letter-spacing: -0.01em;
  color: var(--text);
}
.manifesto__quote .ink { font-weight: 600; }

/* ---------- section rhythm ---------- */
.forge, .work, .workshop {
  padding: clamp(4rem, 9vw, 7.5rem) var(--pad);
  max-width: calc(var(--maxw) + var(--pad) * 2);
  margin: 0 auto;
}
.section-head { margin-bottom: clamp(2.5rem, 6vw, 4rem); }

/* ---------- forge / crafts ---------- */
.forge__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(1rem, 2vw, 1.4rem);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.craft {
  position: relative;
  background: linear-gradient(160deg, var(--ground-2), var(--ground));
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 1.8rem 1.6rem 2rem;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .35s, box-shadow .35s;
}
.craft::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-lo), var(--brass));
  transform: scaleX(0); transform-origin: left; transition: transform .4s ease;
}
.craft:hover {
  transform: translateY(-6px);
  border-color: var(--line);
  box-shadow: 0 24px 50px -24px rgba(0,0,0,.8);
}
.craft:hover::before { transform: scaleX(1); }
.craft__num {
  font-family: var(--font-mono); font-size: var(--step--1);
  color: var(--text-faint); letter-spacing: 0.1em;
}
.craft__icon {
  display: block; color: var(--accent); margin: 1rem 0 1.1rem; width: 48px;
}
.craft__icon svg { width: 48px; height: 48px; }
.craft:hover .craft__icon { color: var(--brass); }
.craft__icon { transition: color .35s; }
.craft__title {
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-1);
  margin: 0 0 0.6rem; letter-spacing: -0.01em;
}
.craft__copy { margin: 0; color: var(--text-dim); font-size: var(--step--1); line-height: 1.55; }

/* ---------- work ---------- */
.work__grid {
  display: grid; gap: clamp(1rem, 2vw, 1.4rem);
  grid-template-columns: repeat(2, 1fr);
}
.piece {
  background: var(--ground-2);
  border: 1px solid var(--line-soft);
  border-radius: 16px; overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .35s;
}
.piece:hover { transform: translateY(-5px); border-color: var(--line); }
.piece--feature { grid-column: 1 / -1; }
.piece__thumb {
  aspect-ratio: 16 / 7; width: 100%;
  background: var(--ground-3);
  position: relative; overflow: hidden;
}
.piece--feature .piece__thumb { aspect-ratio: 21 / 7; }
/* generative thumb tints — each piece its own mood */
.piece__thumb[data-art="hollowwood"] { background:
  radial-gradient(80% 120% at 20% 10%, rgba(132,171,78,.35), transparent 60%),
  radial-gradient(60% 100% at 90% 90%, rgba(201,154,76,.22), transparent 55%),
  linear-gradient(160deg, #1c2415, #120f0a); }
.piece__thumb[data-art="saints"] { background:
  radial-gradient(70% 100% at 80% 20%, rgba(201,154,76,.4), transparent 60%),
  linear-gradient(160deg, #251a10, #120f0a); }
.piece__thumb[data-art="knocking"] { background:
  radial-gradient(90% 120% at 50% 120%, rgba(132,171,78,.22), transparent 60%),
  linear-gradient(200deg, #1a130d, #0b0906); }
.piece__thumb[data-art="fieldnotes"] { background:
  repeating-linear-gradient(135deg, rgba(236,225,200,.04) 0 10px, transparent 10px 20px),
  linear-gradient(160deg, #20180f, #120f0a); }
.piece__thumb::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at center, transparent 60%, rgba(0,0,0,.4));
}
.piece__body { padding: 1.4rem 1.5rem 1.6rem; }
.piece__meta { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.7rem; }
.chip {
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent-lo); border-radius: 100px; padding: 0.25em 0.8em;
}
.piece__year { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint); }
.piece__title {
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-1);
  margin: 0 0 0.4rem;
}
.piece--feature .piece__title { font-size: var(--step-2); }
.piece__copy { margin: 0; color: var(--text-dim); font-size: var(--step--1); }
.work__note {
  text-align: center; margin: 2rem 0 0; color: var(--text-faint);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em;
}
@media (max-width: 640px) { .work__grid { grid-template-columns: 1fr; } }

/* ---------- workshop ---------- */
.workshop { border-top: 1px solid var(--line-soft); }
.workshop__grid {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: 1.1fr 0.9fr; align-items: start;
}
.workshop__copy { color: var(--text-dim); max-width: 50ch; margin: 0 0 1.1rem; }
.workshop__values { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.workshop__values li {
  display: grid; gap: 0.3rem; padding: 1.3rem 0;
  border-top: 1px solid var(--line-soft);
}
.workshop__values li:last-child { border-bottom: 1px solid var(--line-soft); }
.value__k {
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-1);
  color: var(--text);
}
.value__v { color: var(--text-dim); font-size: var(--step--1); }
@media (max-width: 820px) { .workshop__grid { grid-template-columns: 1fr; } }

/* ---------- knock / contact ---------- */
.knock {
  text-align: center;
  padding: clamp(5rem, 12vw, 9rem) var(--pad) clamp(4rem, 9vw, 7rem);
  position: relative;
}
.knock::before {
  content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: min(700px, 80vw); height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.knock__inner { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.knock__door {
  background: none; border: none; cursor: pointer; color: var(--brass);
  margin: 0 0 1.5rem; padding: 0; line-height: 0;
  transition: color .3s;
}
.knock__door:hover { color: var(--accent); }
.knock__door.is-knocking { animation: knock 0.5s ease; transform-origin: 50% 10%; }
@keyframes knock {
  0%,100% { transform: rotate(0) }
  20% { transform: rotate(-9deg) }
  45% { transform: rotate(7deg) }
  70% { transform: rotate(-4deg) }
}
.knock__title {
  font-family: var(--font-display); font-weight: 900; font-size: var(--step-3);
  letter-spacing: -0.02em; margin: 0 0 0.8rem; line-height: 1;
}
.knock__copy { color: var(--text-dim); font-size: var(--step-1); line-height: 1.4; margin: 0 0 2rem; max-width: 40ch; }
.knock__social {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; justify-content: center;
  margin: 2rem 0 0; padding: 0;
}
.knock__social a {
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em;
  color: var(--text-dim); text-decoration: none; position: relative;
}
.knock__social a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 100%; height: 1px;
  background: var(--brass); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.knock__social a:hover { color: var(--text); }
.knock__social a:hover::after { transform: scaleX(1); }

/* ---------- footer ---------- */
.foot {
  border-top: 1px solid var(--line-soft);
  padding: 2.5rem var(--pad);
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem;
  align-items: baseline; justify-content: space-between;
}
.foot__brand { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; }
.foot__tag { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; }
.foot__year { color: var(--text-faint); font-family: var(--font-mono); font-size: 0.72rem; }

/* ---------- reveal (JS-driven; safe default visible) ---------- */
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .hero__scroll span { animation: none; }
}

/* =========================================================
   3D SCROLL JOURNEY  (added for the interactive build)
   ========================================================= */

.scene {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block;
}
.has-3d .embers { display: none; }   /* 2D embers only used in fallback */

/* the tall scroll region that drives the tree's growth */
.experience {
  position: relative;
  height: 460vh;
  z-index: 2;
}
.experience__sticky {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; place-items: center;
  overflow: hidden;
}
.experience .stage {
  position: absolute;
  left: 0; right: 0;
  margin: 0 auto;
  max-width: 920px;
  padding: 5.5rem var(--pad) 4rem;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  opacity: 0;                 /* JS scrubs this; hero starts visible below */
  will-change: opacity, transform;
}
.experience .stage--hero { opacity: 1; }

.stage--hero .hero__crest {
  margin: 0 0 1.2rem;
  filter: drop-shadow(0 22px 50px rgba(0,0,0,.55)) drop-shadow(0 0 46px rgba(132,171,78,.14));
}
.stage--hero .hero__crest img {
  width: auto; height: auto;
  max-width: min(600px, 86vw);
  max-height: 48vh;
  border-radius: 0;
}
.stage--hero .hero__headline {
  font-family: var(--font-display); font-weight: 900;
  font-size: var(--step-4); line-height: 0.96; letter-spacing: -0.03em;
  margin: 0; max-width: 16ch; overflow-wrap: break-word;
}
.stage--hero .hero__headline em { color: var(--accent); font-style: italic; font-weight: 500; }

.stage__title {
  font-family: var(--font-display); font-weight: 900;
  font-size: var(--step-3); line-height: 1.0; letter-spacing: -0.02em;
  margin: 0.5rem 0 0.9rem; max-width: 16ch; overflow-wrap: break-word;
  text-shadow: 0 4px 40px rgba(0,0,0,.6);
}
.stage__title--big { font-size: var(--step-4); }
.stage__title em { color: var(--accent); font-style: italic; font-weight: 500; }
.stage__copy {
  color: var(--text); font-size: var(--step-1); line-height: 1.4;
  max-width: 42ch; margin: 0 0 1.4rem; text-shadow: 0 2px 20px rgba(0,0,0,.7);
}
.scroll-cue {
  font-family: var(--font-mono); font-size: var(--step--1);
  letter-spacing: 0.14em; color: var(--brass); margin: 1.6rem 0 0;
  animation: cuePulse 2.4s ease-in-out infinite;
}
@keyframes cuePulse { 0%,100% { opacity: .5; transform: translateY(0) } 50% { opacity: 1; transform: translateY(4px) } }

/* floating label shown when a canopy "fruit" is hovered */
.scene-label {
  position: fixed; bottom: 11%; left: 50%; transform: translateX(-50%) translateY(8px);
  z-index: 5; pointer-events: none;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ground);
  background: var(--brass); padding: 0.5em 1.1em; border-radius: 100px;
  opacity: 0; transition: opacity .25s, transform .25s;
}
.scene-label.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* readable content sits on opaque bark; smooth handoff from the 3D above */
.content { position: relative; z-index: 2; background: var(--ground); }
.content::before {
  content: ""; position: absolute; top: -34vh; left: 0; right: 0; height: 34vh;
  background: linear-gradient(to bottom, transparent, var(--ground) 92%);
  pointer-events: none; z-index: 1;
}

.craft__link {
  display: inline-block; margin-top: 1rem;
  font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.04em;
  color: var(--accent); text-decoration: none;
}
.craft__link:hover { color: var(--brass); }

/* ---------- fallback: no WebGL / reduced motion ---------- */
.no-3d .scene { display: none; }
.no-3d .experience { height: auto; }
.no-3d .experience__sticky {
  position: relative; height: auto; min-height: 100svh;
  padding: 7rem 0 4rem;
}
.no-3d .experience .stage { position: relative; opacity: 1 !important; transform: none !important; }
.no-3d .experience .stage:not(.stage--hero) { display: none; }

@media (prefers-reduced-motion: reduce) {
  .scroll-cue { animation: none; }
}

@media (max-width: 720px) {
  .experience { height: 420vh; }
  .stage--hero .hero__headline { font-size: clamp(1.5rem, 7vw, 2.3rem); max-width: 13ch; }
  .stage__title { font-size: var(--step-2); max-width: 14ch; }
  .stage__title--big { font-size: var(--step-3); }
  .stage__copy { font-size: var(--step-0); max-width: 32ch; }
}

/* mobile nav / CTA polish — keep everything inside the viewport */
@media (max-width: 560px) {
  .nav { padding-left: 1rem; padding-right: 1rem; }
  .nav__name { font-size: 1rem; }
  .nav .btn--knock { display: none; }              /* contact CTA lives in-page */
  .hero__cta, .arcade-hero__cta { flex-direction: column; align-items: stretch; width: 100%; }
  .hero__cta .btn, .arcade-hero__cta .btn { justify-content: center; width: 100%; }
  .arcade-hero__title { font-size: clamp(2.2rem, 13vw, 3rem); }
  .eyebrow { letter-spacing: 0.2em; }
  .arcade-hero { padding-left: 1.25rem; padding-right: 1.25rem; }
}
