/* /join: a scroll story over a fixed 3D scene (public/js/story-scene.js).
   Dark and large, the way Apple tells a product; readable without the scene. */
:root {
  --jn-bg: #040b08;
  --jn-ink: #eef3e9;
  --jn-muted: #a9b8a8;
  --jn-gold: #f2c77a;
  --jn-gold-deep: #d9a45b;
  --jn-mint: #8fe0c4;
  --jn-green: #304b33;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--jn-bg); }
body.jn {
  margin: 0; background: var(--jn-bg); color: var(--jn-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai", "Sarabun", sans-serif;
  line-height: 1.55; overflow-x: hidden;
}
a { color: inherit; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* The scene sits behind everything. Until it draws (or when it cannot) a
   still night sky stands in. */
.jn-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; opacity: 0; transition: opacity 1.2s ease; }
.jn-canvas.is-live { opacity: 1; }
.jn-sky {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60vmax 45vmax at 50% 38%, #f2c77a22, transparent 60%),
    radial-gradient(80vmax 60vmax at 80% 90%, #8fe0c414, transparent 60%),
    radial-gradient(1px 1px at 20% 30%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 70%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 55%, #fff8 50%, transparent 51%),
    var(--jn-bg);
}

.jn-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(#040b08cc, #040b0800);
}
.jn-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; }
.jn-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #ffffff14; color: var(--jn-gold); }
.jn-bar-cta { padding: 7px 16px; border-radius: 999px; background: #ffffff14; border: 1px solid #ffffff26; font-weight: 700; font-size: .9rem; text-decoration: none; backdrop-filter: blur(8px); }

main { position: relative; z-index: 1; }
.jn-chapter { min-height: 125vh; display: flex; align-items: center; justify-content: center; padding: 18vh 22px; text-align: center; }
.jn-hero { min-height: 100vh; flex-direction: column; padding-top: 12vh; }
.jn-copy { max-width: 760px; }
.jn-chapter .jn-copy { opacity: 0; transform: translateY(40px) scale(.98); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.jn-chapter.is-in .jn-copy { opacity: 1; transform: none; }

.jn-kicker { margin: 0 0 14px; color: var(--jn-gold); font-weight: 700; letter-spacing: .02em; font-size: clamp(.95rem, 3.4vw, 1.15rem); }
h1, .jn-chapter h2 { margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; text-shadow: 0 4px 40px #000c; }
h1 { font-size: clamp(2.6rem, 11vw, 6rem); }
.jn-chapter h2 { font-size: clamp(2.2rem, 9vw, 4.8rem); }
.jn-gold { background: linear-gradient(100deg, #fff3d6, var(--jn-gold) 45%, var(--jn-gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jn-mint { background: linear-gradient(100deg, #e9fff6, var(--jn-mint) 60%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jn-lead { margin: 22px auto 0; max-width: 34em; color: var(--jn-muted); font-size: clamp(1.02rem, 3.8vw, 1.3rem); text-shadow: 0 2px 20px #000; }
.jn-number { font-variant-numeric: tabular-nums; }
.jn-number span { font-size: clamp(5rem, 26vw, 12rem); line-height: 1; background: linear-gradient(180deg, #fff, var(--jn-gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jn-number small { margin-left: 10px; font-size: clamp(1.4rem, 6vw, 2.6rem); color: var(--jn-gold); }

.jn-actions { margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.jn-btn {
  display: inline-block; padding: 16px 30px; border-radius: 999px; font-weight: 800; font-size: clamp(1rem, 4vw, 1.15rem); text-decoration: none;
  color: #1c1405; background: linear-gradient(180deg, #ffe2a8, var(--jn-gold-deep));
  box-shadow: 0 10px 40px #f2c77a55, inset 0 1px 0 #fff8;
}
.jn-btn:focus-visible, .jn-bar-cta:focus-visible, .jn-sticky:focus-visible { outline: 3px solid var(--jn-mint); outline-offset: 3px; }
.jn-note { color: var(--jn-muted); font-size: .9rem; }
.jn-scroll { position: absolute; bottom: 5vh; margin: 0; color: var(--jn-muted); font-size: .85rem; letter-spacing: .1em; animation: jn-bob 2.2s ease-in-out infinite; }
@keyframes jn-bob { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(8px); opacity: 1; } }

.jn-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 30px auto 0; max-width: 560px; }
.jn-facts > div { padding: 14px 8px; border-radius: 18px; background: #ffffff0f; border: 1px solid #ffffff1f; backdrop-filter: blur(10px); }
.jn-facts dt { font-size: .76rem; color: var(--jn-muted); }
.jn-facts dd { margin: 4px 0 0; font-weight: 800; font-size: clamp(1.1rem, 4.6vw, 1.5rem); color: var(--jn-gold); }

/* The last part is plain reading: steps, the final ask, the rules. */
.jn-solid { position: relative; z-index: 1; padding: 80px 22px 120px; background: linear-gradient(#040b0800, var(--jn-bg) 120px); text-align: center; }
.jn-solid h2 { margin: 0 0 22px; font-size: clamp(1.7rem, 7vw, 2.6rem); }
.jn-steps { list-style: none; margin: 0 auto; padding: 0; max-width: 980px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; counter-reset: s; text-align: left; }
.jn-steps li { position: relative; padding: 20px 18px 20px 62px; border-radius: 22px; background: #ffffff0d; border: 1px solid #ffffff1c; counter-increment: s; }
.jn-steps li::before { content: counter(s); position: absolute; left: 16px; top: 18px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(180deg, #ffe2a8, var(--jn-gold-deep)); color: #1c1405; font-weight: 800; }
.jn-steps strong { display: block; }
.jn-steps span { color: var(--jn-muted); font-size: .94rem; }
.jn-final { margin: 70px auto 0; }
.jn-final .jn-note { display: block; margin-top: 12px; }
.jn-footer { margin-top: 70px; color: var(--jn-muted); font-size: .88rem; }
.jn-footer p { margin: 0 0 10px; }
.jn-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-bottom: 10px; }

/* Phones: the ask never scrolls away. */
.jn-sticky { display: none; }
@media (max-width: 720px) {
  .jn-sticky {
    display: block; position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 15px; border-radius: 999px; text-align: center; font-weight: 800; text-decoration: none;
    color: #1c1405; background: linear-gradient(180deg, #ffe2a8, var(--jn-gold-deep)); box-shadow: 0 10px 34px #000a;
    transform: translateY(140%); transition: transform .45s cubic-bezier(.2,.7,.2,1);
  }
  body.jn-past-hero .jn-sticky { transform: none; }
  .jn-facts { grid-template-columns: 1fr; max-width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .jn-chapter .jn-copy { opacity: 1; transform: none; transition: none; }
  .jn-scroll { animation: none; }
}

.jn-chips { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; margin:26px 0 0; padding:0; list-style:none; }
.jn-chips li { padding:8px 16px; border-radius:999px; background:#ffffff12; border:1px solid #f2c77a44; color:var(--jn-gold); font-weight:700; backdrop-filter:blur(8px); }
.jn-note a { color:var(--jn-gold); }

/* The brand icon is its own dark tile. */
.jn-mark { background:none; overflow:hidden; border-radius:8px; }
.jn-mark img { display:block; width:100%; height:100%; }

/* Sponsors: an endless strip of logos (views/landing.ejs). Two identical
   tracks slide left by one track's width, so the seam never shows. */
.jn-sponsors { max-width: 1100px; margin: 0 auto 56px; }
.jn-sponsors[data-kind="tech"] .jn-marquee-track img { height: 36px; }
.jn-sponsors .jn-kicker { margin-bottom: 18px; }
.jn-marquee { display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.jn-marquee-track { flex: none; display: flex; align-items: center; gap: 56px; margin: 0; padding: 0 28px; list-style: none; animation: jn-marquee 32s linear infinite; }
.jn-marquee:hover .jn-marquee-track, .jn-marquee:focus-within .jn-marquee-track { animation-play-state: paused; }
.jn-marquee-track li { flex: none; }
.jn-marquee-track img { display: block; height: 44px; width: auto; max-width: 180px; object-fit: contain; opacity: .8; transition: opacity .2s; }
.jn-marquee-track a:hover img, .jn-marquee-track a:focus-visible img { opacity: 1; }
@keyframes jn-marquee { to { transform: translateX(-100%); } }
@media (max-width: 640px) { .jn-marquee-track { gap: 36px; padding: 0 18px; } .jn-marquee-track img { height: 34px; } }
@media (prefers-reduced-motion: reduce) { .jn-marquee { overflow-x: auto; } .jn-marquee-track { animation: none; } .jn-marquee-track[aria-hidden] { display: none; } }

/* The invitation to partners, above the logo strips: a lit gold card, the
   one warm object on the dark page, so it reads as an offer, not as content. */
.jn-promo { position: relative; max-width: 760px; margin: 0 auto 64px; padding: 40px 28px 32px; border-radius: 28px; overflow: hidden; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, #f2c77a2e, transparent 60%), linear-gradient(180deg, #16140d, #0b0f0c);
  border: 1px solid #f2c77a55; box-shadow: 0 0 0 1px #0006 inset, 0 30px 80px -30px #f2c77a55; }
.jn-promo::before { content: ""; position: absolute; inset: -40% -10% auto; height: 70%; background: conic-gradient(from 180deg at 50% 100%, transparent 0 40%, #f2c77a22 50%, transparent 60% 100%); animation: jn-promo-sweep 9s ease-in-out infinite alternate; pointer-events: none; }
@keyframes jn-promo-sweep { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.jn-promo > * { position: relative; }
.jn-promo h2 { margin: 0 0 14px; font-size: clamp(1.7rem, 6.5vw, 2.5rem); line-height: 1.2; }
.jn-gold { background: linear-gradient(180deg, #ffe2a8, var(--jn-gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.jn-promo-lead { max-width: 520px; margin: 0 auto 18px; color: #ffffffc7; line-height: 1.65; }
.jn-promo-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.jn-promo-points li { padding: 7px 14px; border-radius: 999px; background: #ffffff0d; border: 1px solid #f2c77a3d; color: #ffe9c2; font-size: .92rem; }
.jn-promo-btn { display: inline-block; }
.jn-promo-mail { margin: 12px 0 0; color: #ffffff80; font-size: .88rem; }
@media (prefers-reduced-motion: reduce) { .jn-promo::before { animation: none; } }
