/* ==========================================================
   NishGemHunter — home page sections (after the hero)
   ========================================================== */
.sec { position: relative; padding: clamp(64px, 8vw, 112px) var(--pad); }
/* neighbours sharing a background don't need double padding between them */
.quarry { padding-bottom: clamp(32px, 4vw, 56px); }
.code { padding-top: clamp(32px, 4vw, 56px); }
.bounty { padding-top: 0; }
.hunter { padding-bottom: clamp(32px, 4vw, 56px); }
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap;
  margin-bottom: clamp(36px, 5vw, 64px);
}
.sec h2, .trail h2 {
  margin: 0;
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(2.1rem, 4.6vw, 4rem); line-height: 1.05;
  color: var(--cream);
}
.sec h2, .trail h2 { letter-spacing: -.02em; }
.sec h2 em, .trail h2 em {
  font-style: italic; font-weight: 500; padding-right: .06em;
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 40%, var(--teal) 75%, var(--sapphire-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sec-lede { max-width: 420px; margin: 0; color: var(--muted); font-weight: 300; }
.center { display: flex; justify-content: center; margin-top: 56px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- FRESH FROM THE PIT ---------- */
.finds {
  background:
    radial-gradient(60% 50% at 80% 0%, rgba(47, 91, 234, .22), transparent 70%),
    linear-gradient(180deg, #061033 0%, var(--earth-1) 26%);
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.chip {
  padding: 9px 18px; border-radius: 999px;
  font-size: .82rem; font-weight: 500;
  box-shadow: 0 0 0 1px var(--line) inset; color: var(--muted);
  transition: color .3s, box-shadow .3s, background .3s;
}
.chip span { font-family: var(--f-mono); font-size: .7rem; color: var(--gold); margin-left: 4px; }
.chip:hover { color: var(--ink); box-shadow: 0 0 0 1px rgba(232, 180, 58, .5) inset; }
.chip.is-on { color: #1d1305; background: var(--gold); box-shadow: none; }
.chip.is-on span { color: #1d1305; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  --mx: 50%; --my: 30%;
  position: relative;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  box-shadow: 0 0 0 1px var(--line) inset;
  overflow: hidden;
  transition: transform .5s var(--ease), box-shadow .5s, opacity 1s var(--ease);
}
.card.is-hidden { display: none; }
.card:hover { box-shadow: 0 0 0 1px rgba(232, 180, 58, .45) inset, 0 30px 60px -30px rgba(0, 0, 0, .9); }
.card-art {
  position: relative; aspect-ratio: 1 / .9;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at var(--mx) var(--my), color-mix(in srgb, var(--g1) 30%, transparent), transparent 55%),
    radial-gradient(70% 60% at 50% 100%, rgba(0, 0, 0, .6), transparent),
    #0d0a08;
  overflow: hidden;
}
/* headlamp beam follows the cursor across the tray */
.card-art::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle 120px at var(--mx) var(--my), rgba(255, 230, 180, .16), transparent 70%);
  opacity: 0; transition: opacity .4s;
}
.card:hover .card-art::before { opacity: 1; }
.gem-svg {
  width: 56%; height: auto; overflow: visible;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .6)) drop-shadow(0 0 26px color-mix(in srgb, var(--g1) 45%, transparent));
  transition: transform .8s var(--ease);
  animation: float 6s ease-in-out infinite;
}
.card:nth-child(2n) .gem-svg { animation-delay: -2s; }
.card:nth-child(3n) .gem-svg { animation-delay: -4s; }
.card:hover .gem-svg { transform: scale(1.1) rotate(-4deg); }
@keyframes float { 50% { translate: 0 -8px; } }
.tag {
  position: absolute; top: 14px; left: 14px;
  padding: 5px 10px; border-radius: 999px;
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); background: rgba(111, 214, 207, .1); box-shadow: 0 0 0 1px rgba(111, 214, 207, .3) inset;
}
.tag-gold { color: var(--gold-2); background: rgba(232, 180, 58, .12); box-shadow: 0 0 0 1px rgba(232, 180, 58, .4) inset; }
.tag-rare { color: #ffb0c8; background: rgba(255, 79, 126, .12); box-shadow: 0 0 0 1px rgba(255, 79, 126, .4) inset; }
.tag-earth { color: #e2c7a8; background: rgba(140, 110, 80, .2); box-shadow: 0 0 0 1px rgba(200, 160, 120, .35) inset; }
.lognum { position: absolute; bottom: 12px; right: 14px; font-family: var(--f-mono); font-size: .6rem; letter-spacing: .14em; color: rgba(243, 236, 224, .35); }
.card-body { padding: 18px 20px 20px; }
.card h3 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 1.08rem; line-height: 1.25; color: var(--cream); }
.specs { margin: 6px 0 16px; font-size: .8rem; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; color: var(--gold-2); }
.claim {
  padding: 8px 16px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(232, 180, 58, .5) inset; color: var(--gold-2);
  transition: background .3s, color .3s;
}
.claim:hover { background: var(--gold); color: #1d1305; }
.claim.is-claimed { background: var(--teal); color: #062523; box-shadow: none; }

/* ---------- MARQUEE ---------- */
.marquee {
  overflow: hidden; padding: 26px 0;
  border-block: 1px solid var(--line);
  background: var(--earth-0);
}
.marquee-track { display: flex; gap: 34px; width: max-content; animation: marquee 32s linear infinite; }
.marquee span {
  font-family: var(--f-display); font-size: clamp(1.6rem, 3.5vw, 2.8rem); font-weight: 600; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 244, 214, .45);
}
.marquee span:nth-of-type(4n+1) { color: var(--gold); -webkit-text-stroke: 0; }
.marquee b { align-self: center; color: var(--teal); font-size: 1rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- PICK YOUR QUARRY ---------- */
.quarry { background: var(--earth-1); }
.quarry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.q-tile {
  position: relative; display: block; overflow: hidden;
  min-height: 300px; padding: 28px;
  border-radius: 24px;
  background:
    radial-gradient(70% 70% at 100% 0%, color-mix(in srgb, var(--g2) 30%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform .6s var(--ease), box-shadow .5s, opacity 1s var(--ease);
}
.q-tile .gem-svg { position: absolute; right: -6%; top: 8%; width: 46%; animation: none; transition: transform 1s var(--ease); }
.q-tile:hover { transform: translateY(-6px); box-shadow: 0 0 0 1px color-mix(in srgb, var(--g1) 60%, transparent) inset; }
.q-tile:hover .gem-svg { transform: rotate(-12deg) scale(1.12); }
.q-count { font-family: var(--f-mono); font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.q-tile h3 { position: absolute; left: 28px; bottom: 58px; margin: 0; font-family: var(--f-display); font-size: 1.9rem; color: var(--cream); }
.q-tile p { position: absolute; left: 28px; right: 28px; bottom: 24px; margin: 0; color: var(--muted); font-size: .9rem; }

/* ---------- FROM PIT TO POLISH (pinned horizontal) ---------- */
/* The pinned panel is only as tall as its content (not a full screen) and pins in the
   middle of the viewport, so there is no dead space above or below it. */
.trail {
  --trail-h: min(640px, 100svh);
  position: relative;
  height: calc(var(--trail-h) + 200vh);
  background: linear-gradient(180deg, var(--earth-1), #0b1430 50%, var(--earth-1));
}
.trail-sticky {
  position: sticky; top: calc(50svh - var(--trail-h) / 2);
  height: var(--trail-h); overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 36px;
}
.trail-head { padding: 0 var(--pad); }
.trail-progress { margin-top: 26px; width: min(360px, 60vw); height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.trail-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), var(--teal)); }
.trail-track { display: flex; gap: 24px; padding: 0 var(--pad); width: max-content; will-change: transform; }
.step {
  position: relative; flex: 0 0 auto;
  width: clamp(270px, 30vw, 400px); min-height: 340px;
  padding: 34px 30px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
  box-shadow: 0 0 0 1px var(--line) inset;
}
.step:nth-child(4) {
  background: linear-gradient(160deg, rgba(47, 91, 234, .35), rgba(111, 214, 207, .08));
  box-shadow: 0 0 0 1px rgba(111, 214, 207, .4) inset, 0 0 80px -20px rgba(47, 91, 234, .6);
}
.step-num { font-family: var(--f-display); font-size: 4.6rem; font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(232, 180, 58, .55); }
.step-ico { display: block; width: 52px; height: 52px; margin: 26px 0 18px; fill: none; stroke: var(--teal); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.step h3 { margin: 0 0 10px; font-family: var(--f-display); font-size: 1.5rem; color: var(--cream); }
.step p { margin: 0; color: var(--muted); font-weight: 300; }

/* ---------- THE HUNTER'S CODE ---------- */
.code { background: var(--earth-1); }
.code-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.code-item { padding: 34px 28px 34px 0; border-right: 1px solid var(--line); }
.code-item:not(:first-child) { padding-left: 28px; }
.code-item:last-child { border-right: 0; }
.code-item svg { width: 42px; height: 42px; fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.code-item h3 { margin: 18px 0 8px; font-family: var(--f-display); font-size: 1.2rem; color: var(--cream); }
.code-item p { margin: 0; color: var(--muted); font-size: .92rem; font-weight: 300; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 70px; }
.stat {
  padding: 30px 26px; border-radius: 22px;
  background: radial-gradient(90% 90% at 0% 0%, rgba(232, 180, 58, .12), transparent 70%), rgba(255, 255, 255, .02);
  box-shadow: 0 0 0 1px var(--line) inset;
}
.stat b { display: block; font-family: var(--f-display); font-size: clamp(2.4rem, 4vw, 3.6rem); line-height: 1; color: var(--gold-2); }
.stat span { display: block; margin-top: 10px; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* ---------- MEET THE HUNTER ---------- */
.hunter {
  display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(40px, 7vw, 110px); align-items: center;
  background:
    radial-gradient(50% 60% at 25% 50%, rgba(47, 91, 234, .28), transparent 70%),
    var(--earth-0);
}
.hunter-art { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.hunter-art img { position: relative; width: 82%; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .6)); }
.hunter-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 40s linear infinite; }
.hunter-ring text { font-family: var(--f-mono); font-size: 13px; letter-spacing: 5px; text-transform: uppercase; fill: rgba(255, 244, 214, .5); }
@keyframes spin { to { transform: rotate(360deg); } }
.hunter-copy > p:not(.eyebrow) { color: var(--muted); font-weight: 300; font-size: 1.05rem; max-width: 520px; margin: 20px 0 0; }
.socials { display: flex; gap: 8px; align-items: center; }
.socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: color .3s, box-shadow .3s, transform .3s;
}
.socials a:hover { color: var(--gold-2); box-shadow: 0 0 0 1px var(--gold) inset; transform: translateY(-2px); }
.socials svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- BOUNTY BOARD (parchment notice) ---------- */
.bounty { background: var(--earth-0); }
.bounty-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(30px, 5vw, 80px);
  padding: clamp(28px, 5vw, 70px);
  border-radius: 30px;
  color: #2a1d10;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, .5), transparent 60%),
    radial-gradient(100% 80% at 100% 100%, rgba(196, 127, 22, .25), transparent 60%),
    #f3e2bb;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
}
.bounty-card::after { /* paper fibre */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bounty .eyebrow { color: #8a4b00; }
.bounty h2 { color: #22160b; }
.bounty h2 em { background: linear-gradient(100deg, #b5650a, #1f43c4); -webkit-background-clip: text; background-clip: text; }
.bounty-copy p { color: #5a4630; max-width: 460px; }
.bounty-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.bounty-list li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.bounty-list li::before { content: ""; width: 9px; height: 9px; transform: rotate(45deg); background: #1f43c4; flex-shrink: 0; }
.bounty-form {
  position: relative; z-index: 1;
  display: grid; gap: 16px; align-content: start;
  padding: 30px; border-radius: 20px;
  background: rgba(255, 255, 255, .45);
  border: 2px dashed rgba(90, 60, 20, .35);
}
.wanted {
  justify-self: start;
  font-family: var(--f-display); font-weight: 700; font-size: 1.6rem; letter-spacing: .2em; text-transform: uppercase;
  color: #8a2a12; border: 2px solid #8a2a12; padding: 2px 14px; transform: rotate(-3deg); border-radius: 6px;
}
.bounty-form label { display: grid; gap: 6px; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #5a4630; }
.bounty-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bounty-form input, .bounty-form select {
  font: inherit; font-size: .95rem; letter-spacing: 0; text-transform: none; font-weight: 400;
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(90, 60, 20, .3); background: rgba(255, 252, 244, .85); color: #22160b;
}
.bounty-form input:focus, .bounty-form select:focus { outline: 2px solid #1f43c4; outline-offset: 1px; }
.bounty-form .btn { justify-self: start; margin-top: 4px; }

/* ---------- HUNTER'S LOG ---------- */
.log { background: var(--earth-1); }
.log-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 22px; }
.post { display: flex; flex-direction: column; }
.post-art {
  position: relative; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden;
  background:
    radial-gradient(60% 70% at 30% 30%, color-mix(in srgb, var(--a) 70%, transparent), transparent 70%),
    radial-gradient(60% 60% at 80% 90%, color-mix(in srgb, var(--b) 55%, transparent), transparent 70%),
    #0d1a13;
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform .6s var(--ease);
}
.post:first-child .post-art { aspect-ratio: auto; flex: 1; min-height: 280px; }
.post-art::after { content: ""; position: absolute; inset: 0; background: url("../img/logo-badge.png") center / 28% no-repeat; opacity: .1; }
.post:hover .post-art { transform: scale(.985); }
.play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 1;
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255, 244, 214, .92); transition: transform .4s var(--ease);
}
.play svg { width: 22px; height: 22px; fill: #1d1305; margin-left: 3px; }
.post:hover .play { transform: scale(1.12); }
.post-type {
  position: absolute; left: 16px; bottom: 14px; z-index: 1;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cream); background: rgba(0, 0, 0, .45); padding: 6px 10px; border-radius: 999px; backdrop-filter: blur(6px);
}
.post-meta { margin: 18px 0 6px; font-family: var(--f-mono); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--teal); }
.post h3 { margin: 0; font-family: var(--f-display); font-size: 1.25rem; line-height: 1.3; color: var(--cream); transition: color .3s; }
.post:hover h3 { color: var(--gold-2); }

/* ---------- JOIN THE HUNTING PARTY ---------- */
.party {
  text-align: center;
  background: radial-gradient(50% 70% at 50% 40%, rgba(47, 91, 234, .35), transparent 70%), var(--earth-0);
}
.party-inner { max-width: 640px; margin: 0 auto; display: grid; justify-items: center; }
.party-gem { width: 110px; margin-bottom: 24px; filter: drop-shadow(0 0 30px rgba(109, 141, 255, .7)); animation: float 5s ease-in-out infinite; }
.party .eyebrow::before { display: none; }
.party-inner > p:not(.eyebrow) { color: var(--muted); font-weight: 300; margin: 18px 0 0; }
.party-form {
  display: flex; gap: 10px; width: 100%; max-width: 480px; margin-top: 30px; padding: 6px;
  border-radius: 999px; box-shadow: 0 0 0 1px var(--line) inset; background: rgba(255, 255, 255, .03);
}
.party-form input { flex: 1; min-width: 0; padding: 0 18px; font: inherit; color: var(--ink); background: none; border: 0; }
.party-form input:focus { outline: none; }
.party-form:focus-within { box-shadow: 0 0 0 1px var(--gold) inset; }

/* ---------- FOOTER: BASE CAMP ---------- */
.footer { padding: 80px var(--pad) 30px; background: #050403; border-top: 1px solid var(--line); }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.foot-brand img { width: 240px; }
.foot-brand p { max-width: 300px; color: var(--muted); font-size: .9rem; margin: 16px 0 0; }
.foot-col h4 { margin: 0 0 16px; font-family: var(--f-mono); font-weight: 400; font-size: .66rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.foot-col a { display: block; padding: 5px 0; color: var(--muted); font-size: .92rem; transition: color .3s; }
.foot-col a:hover { color: var(--cream); }
.foot-bottom {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: .78rem; color: rgba(243, 236, 224, .4);
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80;
  translate: -50% calc(100% + 60px);
  visibility: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; border-radius: 999px;
  background: rgba(10, 22, 15, .94); backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px rgba(232, 180, 58, .45) inset, 0 20px 40px -10px rgba(0, 0, 0, .8);
  font-size: .9rem; color: var(--cream); white-space: nowrap;
  transition: translate .6s var(--ease);
}
.toast::before { content: ""; width: 10px; height: 10px; transform: rotate(45deg); background: var(--teal); box-shadow: 0 0 12px var(--teal); }
.toast.is-on { translate: -50% 0; visibility: visible; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .code-grid, .stats { grid-template-columns: repeat(2, 1fr); }
  .code-item:nth-child(2) { border-right: 0; }
  .code-item:nth-child(3) { padding-left: 0; }
  .code-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .foot-top { grid-template-columns: 1fr 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .quarry-grid { grid-template-columns: repeat(2, 1fr); }
  .hunter, .bounty-card { grid-template-columns: 1fr; }
  .hunter-art { max-width: 440px; margin: 0 auto; width: 100%; }
  .log-grid { grid-template-columns: 1fr; }
  .post:first-child .post-art { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
}
@media (max-width: 560px) {
  .grid { gap: 10px; }
  .card-body { padding: 14px; }
  .card h3 { font-size: .95rem; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .claim { text-align: center; }
  .tag { font-size: .52rem; top: 10px; left: 10px; }
  .quarry-grid { grid-template-columns: 1fr; }
  .q-tile { min-height: 220px; }
  .code-grid, .stats { grid-template-columns: 1fr; }
  .code-item, .code-item:not(:first-child) { padding: 26px 0; border-right: 0; border-top: 1px solid var(--line); }
  .bounty-form { padding: 20px; }
  .bounty-form .row { grid-template-columns: 1fr; }
  .party-form { flex-direction: column; border-radius: 20px; }
  .party-form input { padding: 14px 18px; }
  .foot-top { grid-template-columns: 1fr 1fr; }
  .toast { white-space: normal; width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
