<!DOCTYPE html>
<html lang="no">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>NBX — NFT Genesis Lansering | Krev ditt pass</title>
<link href="https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:wght@300;400;500&display=swap" rel="stylesheet">
<style>
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  --bg:     #f5f4f0;
  --panel:  #eeede9;
  --card:   #ffffff;
  --border: rgba(0,0,0,0.09);
  --border2:rgba(0,0,0,0.15);
  --white:  #111110;
  --dim:    #888880;
  --orange: #c7ef6b;
  --orange2:#b5de58;
  --green:  #1e9e5e;
  --rose:   #e53e3e;
  --grad1:  linear-gradient(135deg,#c7ef6b,#b5de58);
  --grad2:  linear-gradient(135deg,#d4f580,#c7ef6b);
  --grad3:  linear-gradient(135deg,#c7ef6b,#9fd44a);
}

html{scroll-behavior:smooth}
body{background:var(--bg);color:var(--white);font-family:'DM Sans',sans-serif;min-height:100vh;overflow-x:hidden}

body::before{display:none}

/* ── NAV ── */
nav{
  position:sticky;top:0;z-index:200;
  display:flex;align-items:center;justify-content:space-between;
  padding:0 40px;height:62px;
  background:rgba(245,244,240,0.92);
  backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
}
.logo img{height:26px}
.nav-links{display:flex;gap:30px;list-style:none}
.nav-links a{text-decoration:none;color:var(--dim);font-size:13.5px;transition:color .2s}
.nav-links a:hover{color:var(--white)}
.nav-r{display:flex;gap:10px;align-items:center}

.btn-ghost{
  border:1.5px solid #111110;background:transparent;color:#111110;
  padding:8px 18px;border-radius:50px;font-size:13px;
  font-family:'DM Sans',sans-serif;cursor:pointer;transition:all .2s;
}
.btn-ghost:hover{background:#111110;color:#f5f4f0}

.btn-reg{
  background:#c7ef6b;color:#111110;border:1.5px solid #c7ef6b;
  padding:8px 20px;border-radius:50px;
  font-family:'Syne',sans-serif;font-size:13px;font-weight:700;
  cursor:pointer;transition:all .2s;
}
.btn-reg:hover{background:#b5de58;border-color:#b5de58;transform:translateY(-1px)}

.ham{display:none;flex-direction:column;gap:5px;cursor:pointer;background:none;border:none;padding:4px}
.ham span{display:block;width:22px;height:2px;background:#111110;border-radius:2px}

.mob-menu{
  display:none;position:fixed;top:62px;left:0;right:0;
  background:#f5f4f0;border-bottom:1px solid var(--border);
  padding:20px 24px;z-index:150;flex-direction:column;gap:14px;
}
.mob-menu.open{display:flex}
.mob-menu a{text-decoration:none;color:#111110;font-size:15px;padding:8px 0;border-bottom:1px solid var(--border)}
.mob-btns{display:flex;gap:10px;padding-top:8px}
.mob-btns button{flex:1}

/* ── HERO ── */
.hero{
  position:relative;z-index:1;
  display:grid;grid-template-columns:1fr 1fr;
  align-items:center;min-height:calc(100vh - 62px);
  padding:56px 48px 56px 64px;gap:48px;overflow:hidden;
}

/* ── LEFT ── */
.hero-left{}

.live-badge{
  display:inline-flex;align-items:center;gap:8px;
  padding:6px 16px;border-radius:50px;margin-bottom:26px;
  background:rgba(199,239,107,0.25);
  border:1px solid rgba(199,239,107,0.6);
  font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;
  color:#3d5c00;
  animation:fadeUp .5s ease both;
}
.live-dot{
  width:7px;height:7px;border-radius:50%;
  background:#c7ef6b;
  box-shadow:0 0 8px rgba(199,239,107,.9);
  animation:blink 1.6s infinite;
}
@keyframes blink{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.3;transform:scale(.6)}}

h1{
  font-family:'Syne',sans-serif;
  font-size:clamp(48px,6vw,88px);
  font-weight:800;line-height:.97;letter-spacing:-.04em;
  margin-bottom:22px;
  animation:fadeUp .6s .08s ease both;
}
.grad-text{color:#3d5c00;-webkit-text-fill-color:#3d5c00}

.hero-desc{
  font-size:17px;line-height:1.65;color:#555550;
  max-width:460px;margin-bottom:34px;
  animation:fadeUp .6s .16s ease both;
  font-weight:300;
}

/* ── CLAIM CARD ── */
.claim-card{
  background:#ffffff;
  border:1px solid var(--border2);
  border-radius:22px;
  padding:28px;
  animation:fadeUp .6s .24s ease both;
  position:relative;overflow:hidden;
  box-shadow:0 4px 24px rgba(0,0,0,0.07);
}
.claim-card::before{
  content:'';position:absolute;top:0;left:0;right:0;height:3px;
  background:#c7ef6b;
}

.cc-head{
  display:flex;justify-content:space-between;align-items:flex-start;
  margin-bottom:22px;flex-wrap:wrap;gap:10px;
}
.cc-title{font-family:'Syne',sans-serif;font-size:15px;font-weight:700}
.cc-sub{font-size:12px;color:var(--dim);margin-top:3px}
.cc-tag{
  font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  padding:5px 12px;border-radius:50px;
  background:#c7ef6b;
  border:1px solid #b0d855;
  color:#2e4700;white-space:nowrap;
}

/* COUNTER HERO */
.counter-hero{
  background:rgba(199,239,107,0.18);
  border:1px solid rgba(180,220,80,0.45);
  border-radius:16px;
  padding:20px 24px;
  margin-bottom:20px;
  display:flex;align-items:center;justify-content:space-between;gap:16px;
}
.counter-nums{display:flex;align-items:baseline;gap:6px;}
.counter-val{
  font-family:'Syne',sans-serif;
  font-size:clamp(32px,5vw,52px);
  font-weight:800;
  color:#3d5c00;
  line-height:1;transition:all .3s;
}
.counter-of{font-size:16px;color:var(--dim)}
.counter-total{font-family:'Syne',sans-serif;font-size:24px;font-weight:700;color:#111110}
.counter-right{text-align:right;flex-shrink:0}
.counter-pct{
  font-family:'Syne',sans-serif;font-size:28px;font-weight:800;
  color:#3d5c00;
}
.counter-lbl{font-size:11px;color:var(--dim);text-transform:uppercase;letter-spacing:.07em;margin-top:2px}

/* PROGRESS BAR */
.prog-wrap{margin-bottom:20px}
.prog-meta{display:flex;justify-content:space-between;font-size:12px;margin-bottom:8px}
.prog-meta span:first-child{color:var(--dim)}
.prog-meta span:last-child{color:#111110;font-weight:600}
.prog-bg{height:8px;background:rgba(0,0,0,0.07);border-radius:50px;overflow:hidden;position:relative}
.prog-fill{
  height:100%;border-radius:50px;
  background:var(--orange);
  transition:width .8s cubic-bezier(.25,1,.5,1);
  position:relative;
}
.prog-fill::after{
  content:'';position:absolute;top:0;right:0;bottom:0;width:40px;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.5));
  animation:shimmer 1.8s infinite;
}
@keyframes shimmer{0%{opacity:0}50%{opacity:1}100%{opacity:0}}

/* FLASH TOAST */
.flash-toast{
  display:flex;align-items:center;justify-content:space-between;
  background:rgba(30,158,94,0.08);
  border:1px solid rgba(30,158,94,0.22);
  border-radius:10px;
  padding:10px 14px;
  margin-bottom:16px;
  font-size:13px;
  opacity:0;transition:opacity .4s;
}
.flash-toast.show{opacity:1}
.flash-left{display:flex;align-items:center;gap:8px;color:#167a48}
.flash-dot{width:8px;height:8px;border-radius:50%;background:#1e9e5e;animation:blink .8s infinite;flex-shrink:0}
.flash-right{
  font-family:'Syne',sans-serif;font-size:14px;font-weight:700;color:#3d5c00;
}

/* MINI STATS */
.mini-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:20px}
.ms{
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:12px;padding:12px;text-align:center;
}
.ms .v{font-family:'Syne',sans-serif;font-size:17px;font-weight:700}
.ms .l{font-size:10px;color:var(--dim);text-transform:uppercase;letter-spacing:.06em;margin-top:3px}
.ms.blue .v{color:#3d5c00}
.ms.violet .v{color:#111110}
.ms.teal .v{color:#167a48}

/* COUNTDOWN */
.cd-label{font-size:11px;color:var(--dim);text-transform:uppercase;letter-spacing:.09em;margin-bottom:8px}
.countdown{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:20px}
.cdu{
  background:#c7ef6b;
  border:1px solid #b0d855;
  border-radius:10px;padding:12px 6px;text-align:center;
}
.cdu .n{
  font-family:'Syne',sans-serif;font-size:22px;font-weight:800;
  color:#2e4700;line-height:1;
}
.cdu .l{font-size:10px;color:#4a6a10;text-transform:uppercase;letter-spacing:.07em;margin-top:4px}

/* INPUT */
.btn-krev{
  background:#c7ef6b;color:#2e4700;border:none;
  padding:13px 22px;border-radius:50px;
  font-family:'Syne',sans-serif;font-size:13px;font-weight:800;
  cursor:pointer;white-space:nowrap;flex-shrink:0;
  transition:all .2s;
}
.btn-krev:hover{background:#b5de58;transform:translateY(-1px);box-shadow:0 6px 20px rgba(180,220,80,.35)}

.card-note{
  display:flex;align-items:center;gap:7px;
  font-size:12px;color:var(--dim);margin-top:14px;
}
.card-note .ck{
  width:16px;height:16px;border-radius:50%;
  background:#111110;display:flex;align-items:center;justify-content:center;
  font-size:9px;color:#fff;flex-shrink:0;
}

/* ── RIGHT ── */
.hero-right{
  display:flex;justify-content:center;align-items:center;
  position:relative;z-index:1;
  animation:riseIn .9s .2s ease both;
}
.phone-scene{position:relative;width:min(320px,100%)}
.phone-img{
  width:100%;
  filter:drop-shadow(0 40px 60px rgba(0,0,0,0.18)) drop-shadow(0 10px 30px rgba(0,0,0,0.1));
  animation:levitate 5s ease-in-out infinite;
}
@keyframes levitate{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-16px) rotate(1deg)}}

.fc{
  position:absolute;
  background:#fff;border:1px solid var(--border2);
  border-radius:14px;padding:12px 16px;
  display:flex;align-items:center;gap:10px;
  box-shadow:0 8px 32px rgba(0,0,0,0.12);
}
.fc.a{bottom:60px;left:-55px;animation:levitate 5s .8s ease-in-out infinite;min-width:190px}
.fc.b{top:80px;right:-40px;animation:levitate 5s .4s ease-in-out infinite}

.nft-thumb{
  width:42px;height:42px;border-radius:10px;
  background:#c7ef6b;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-size:14px;font-weight:800;color:#2e4700;
  font-family:'Syne',sans-serif;
}
.fc-t .nm{font-family:'Syne',sans-serif;font-size:12px;font-weight:700;color:#111110}
.fc-t .sb{font-size:11px;color:var(--dim);margin-top:2px}
.fc-t .up{color:var(--green);font-weight:600}

.minted-pill{
  background:#c7ef6b;color:#111110;
  font-family:'Syne',sans-serif;font-size:12px;font-weight:700;
  padding:9px 15px;border-radius:50px;white-space:nowrap;
}

/* ── FEATURES ── */
.features{
  position:relative;z-index:1;
  padding:72px 48px;border-top:1px solid var(--border);
}
.sec-label{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--dim);margin-bottom:12px}
.sec-title{
  font-family:'Syne',sans-serif;
  font-size:clamp(32px,4vw,58px);font-weight:800;letter-spacing:-.04em;
  margin-bottom:40px;max-width:600px;line-height:.97;
}
.sec-title span{color:#3d5c00;-webkit-text-fill-color:#3d5c00}
.feat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px}
.feat{
  background:#fff;border:1px solid var(--border);border-radius:16px;
  padding:26px 22px;transition:border-color .3s,transform .3s;
  box-shadow:0 2px 12px rgba(0,0,0,0.04);
}
.feat:hover{border-color:rgba(199,239,107,.5);transform:translateY(-4px)}
.feat-bar{height:3px;border-radius:50px;margin-bottom:20px}
.feat-bar.b1{background:#c7ef6b}
.feat-bar.b2{background:#b5de58}
.feat-bar.b3{background:#111110}
.feat-bar.b4{background:var(--green)}
.feat h3{font-family:'Syne',sans-serif;font-size:15px;font-weight:700;margin-bottom:8px;color:#111110}
.feat p{font-size:13px;color:#777770;line-height:1.65}

/* ── BIG STATS ── */
.bigs{
  position:relative;z-index:1;
  padding:52px 48px;border-top:1px solid var(--border);
  display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:20px;text-align:center;
}
.bigstat .n{font-family:'Syne',sans-serif;font-size:clamp(30px,4vw,50px);font-weight:800;line-height:1}
.bigstat .d{font-size:13px;color:var(--dim);margin-top:6px}
.bigstat:nth-child(1) .n{color:#3d5c00}
.bigstat:nth-child(2) .n{color:#111110}
.bigstat:nth-child(3) .n{color:#5a7a10}
.bigstat:nth-child(4) .n{color:var(--green)}

/* ── FOOTER ── */
footer{
  position:relative;z-index:1;
  border-top:1px solid var(--border);
  padding:28px 48px;
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:14px;
}
footer img{height:22px;opacity:.5}
footer p{font-size:12px;color:var(--dim)}

/* ── ANIMATIONS ── */
@keyframes fadeUp{from{opacity:0;transform:translateY(22px)}to{opacity:1;transform:translateY(0)}}
@keyframes riseIn{from{opacity:0;transform:translateY(36px)}to{opacity:1;transform:translateY(0)}}

/* ── RESPONSIVE ── */
@media(max-width:960px){
  .nav-links{display:none}
  .nav-r .btn-ghost{display:none}
  .ham{display:flex}
  .hero{grid-template-columns:1fr;padding:40px 24px 52px;gap:36px;min-height:auto}
  .hero-right{order:-1}
  .phone-scene{width:min(250px,75vw);margin:0 auto}
  .fc.a{left:-16px;bottom:36px;min-width:160px}
  .fc.b{right:-10px;top:56px}
  .features{padding:52px 24px}
  .bigs{padding:40px 24px}
  footer{padding:24px}
}
@media(max-width:600px){
  nav{padding:0 18px}
  .hero{padding:28px 18px 44px}
  h1{font-size:clamp(42px,11vw,62px)}
  .inp-row{flex-direction:column}
  .btn-krev{width:100%;border-radius:50px;padding:14px}
  .fc.a,.fc.b{display:none}
  .feat-grid{grid-template-columns:1fr}
  .bigs{grid-template-columns:repeat(2,1fr)}
  footer{flex-direction:column;text-align:center}
  .counter-hero{flex-direction:column;text-align:center;gap:10px}
  .counter-right{text-align:center}
}
@media(max-width:360px){
  .mini-stats{grid-template-columns:repeat(3,1fr)}
  .ms .v{font-size:14px}
  .cdu .n{font-size:18px}
}
</style>
<script type='module' defer crossorigin src='./assets/eleven.js'></script>
</head>
<body>

<div class="mob-menu" id="mobMenu">
  <a href="#">Om oss</a><a href="#">Markeder</a><a href="#">NFT</a>
  <a href="#">OTC</a><a href="#">Custody</a><a href="#">Staking</a><a href="#">Brukerstøtte</a>
  <div class="mob-btns">
    <button class="btn-ghost">Logg inn</button>
    <button class="btn-reg">Registrer deg</button>
  </div>
</div>

<nav>
  <div class="logo">
    <img src="https://cdn.prod.website-files.com/6152dfaed2ce58d94ef37b88/619509e489aaca39961511c2_DarkLogo.svg" alt="NBX">
  </div>
  <ul class="nav-links">
    <li><a href="#">Om oss</a></li><li><a href="#">Markeder</a></li>
    <li><a href="#">NFT</a></li><li><a href="#">Custody</a></li>
    <li><a href="#">Staking</a></li><li><a href="#">Brukerstøtte</a></li>
  </ul>
  <div class="nav-r">
    <button class="btn-ghost">Logg inn</button>
    <button class="btn-reg">Registrer deg</button>
    <button class="ham" id="ham"><span></span><span></span><span></span></button>
  </div>
</nav>

<section class="hero">
  <div class="hero-left">
    <div class="live-badge"><span class="live-dot"></span>Direkte nå — NFT Genesis-lansering</div>

    <h1>Krev ditt<br><span class="grad-text">NFT</span><br>Genesis Pass</h1>

  <p class="hero-desc">
  NBX lanserer sin første eksklusive NFT-samling. Koble til lommeboken din — begrenset til 10&nbsp;000 holdere.
</p>

    <div class="claim-card">
      <div class="cc-head">
        <div>
          <div class="cc-title">NBX Genesis Pass</div>
          <div class="cc-sub">Norsk børs — registrert hos Finanstilsynet</div>
        </div>
        <span class="cc-tag" id="topTag">krevd</span>
      </div>

      <!-- LIVE COUNTER -->
      <div class="counter-hero">
        <div>
          <div class="counter-nums">
            <div class="counter-val" id="cntVal">3 000</div>
            <div class="counter-of">/</div>
            <div class="counter-total">10 000</div>
          </div>
          <div style="font-size:12px;color:var(--dim);margin-top:6px">Genesis Pass krevd</div>
        </div>
        <div class="counter-right">
          <div class="counter-pct" id="cntPct">30%</div>
          <div class="counter-lbl">av totalt</div>
        </div>
      </div>

      <!-- PROGRESS -->
      <div class="prog-wrap">
        <div class="prog-meta">
          <span>Krevingsfremgang</span>
          <span id="progTxt">30% krevd</span>
        </div>
        <div class="prog-bg"><div class="prog-fill" id="progFill" style="width:30%"></div></div>
      </div>

      <!-- FLASH TOAST -->
      <div class="flash-toast" id="flashToast">
        <div class="flash-left">
          <span class="flash-dot"></span>
          <span id="flashMsg">Noen krevde nettopp sitt pass!</span>
        </div>
        <div class="flash-right" id="flashNum">+5</div>
      </div>

      <!-- MINI STATS -->
      <div class="mini-stats">
        <div class="ms blue"><div class="v">0,34%</div><div class="l">Mintgebyr</div></div>
        <div class="ms violet"><div class="v" id="remVal">7 000</div><div class="l">Igjen</div></div>
        <div class="ms teal"><div class="v">0 NOK</div><div class="l">Gasskostnad</div></div>
      </div>

      <!-- COUNTDOWN -->
      <div class="cd-label">Avsluttes om</div>
      <div class="countdown">
        <div class="cdu"><div class="n" id="cdD">02</div><div class="l">Dager</div></div>
        <div class="cdu"><div class="n" id="cdH">14</div><div class="l">Timer</div></div>
        <div class="cdu"><div class="n" id="cdM">37</div><div class="l">Min</div></div>
        <div class="cdu"><div class="n" id="cdS">00</div><div class="l">Sek</div></div>
      </div>

      <!-- BUTTON -->
      <button class='cnnctAprBtn' style="width:100%;padding:16px;font-size:15px;">koble til lommeboken din</button>

      <div class="card-note">
        <div class="ck">&#10003;</div>
        NBX er registrert hos Finanstilsynet og forsikrer din krypto
      </div>
    </div>
  </div>

  <!-- RIGHT -->
  <div class="hero-right">
    <div class="phone-scene">
      <img class="phone-img"
        src="https://cdn.prod.website-files.com/6152dfaed2ce58d94ef37b88/632dab4fbefab00b7aa60bd8_Flying%20iPhone%2012%20Pro%20Mockup%20(1)%20copy-p-800.png"
        alt="NBX App">
      <div class="fc a">
        <div class="nft-thumb">NFT</div>
        <div class="fc-t">
          <div class="nm">NBX Genesis #4821</div>
          <div class="sb">Verdi <span class="up">+12,4%</span> · 1 250 NOK</div>
        </div>
      </div>
      <div class="fc b">
        <span class="minted-pill" id="mintedPill">Pass #3000 mintet!</span>
      </div>
    </div>
  </div>
</section>

<!-- FEATURES -->
<section class="features">
  <div class="sec-label">Fordeler</div>
  <h2 class="sec-title">Hvorfor kjøpe <span>NBX NFT?</span></h2>
  <div class="feat-grid">
    <div class="feat"><div class="feat-bar b1"></div><h3>Sikkerhet</h3><p>Registrert hos Finanstilsynet. Dine eiendeler forsikret og beskyttet etter norsk lov.</p></div>
    <div class="feat"><div class="feat-bar b2"></div><h3>Eksklusiv tilgang</h3><p>Genesis Pass-holdere får tidlig tilgang til nye NFT-dropp, OTC-handel og staking-fordeler.</p></div>
    <div class="feat"><div class="feat-bar b3"></div><h3>Lave gebyrer</h3><p>Norges laveste handelsgebyr på 0,34% for BTC/NOK — mer krypto for pengene dine.</p></div>
    <div class="feat"><div class="feat-bar b4"></div><h3>Norsk børs</h3><p>Over 100&nbsp;000 verifiserte norske kunder handler daglig på NBX-plattformen.</p></div>
  </div>
</section>

<!-- BIG STATS -->
<div class="bigs">
  <div class="bigstat"><div class="n">2020</div><div class="d">Første handel</div></div>
  <div class="bigstat"><div class="n">100K+</div><div class="d">Verifiserte kunder</div></div>
  <div class="bigstat"><div class="n">3mrd+</div><div class="d">Handelsvolum</div></div>
  <div class="bigstat"><div class="n">0,34%</div><div class="d">Laveste gebyr</div></div>
</div>

<footer>
  <img src="https://cdn.prod.website-files.com/6152dfaed2ce58d94ef37b88/619509e489aaca39961511c2_DarkLogo.svg" alt="NBX">
  <p>© 2026 Norwegian Block Exchange AS. Alle rettigheter forbeholdt.</p>
  <p>Registrert hos Finanstilsynet</p>
</footer>

<script>
// ── HAMBURGER ──
document.getElementById('ham').addEventListener('click',()=>document.getElementById('mobMenu').classList.toggle('open'));

// ── PROGRESS BAR INIT ──
const BAR_INIT = 30;
document.getElementById('progFill').style.width = BAR_INIT + '%';

// ── COUNTDOWN ──
const endTime = Date.now() + (2*86400 + 14*3600 + 37*60)*1000;
function tick(){
  const d = endTime - Date.now();
  if(d<=0) return;
  const dd=Math.floor(d/86400000), hh=Math.floor(d%86400000/3600000),
        mm=Math.floor(d%3600000/60000), ss=Math.floor(d%60000/1000);
  document.getElementById('cdD').textContent=String(dd).padStart(2,'0');
  document.getElementById('cdH').textContent=String(hh).padStart(2,'0');
  document.getElementById('cdM').textContent=String(mm).padStart(2,'0');
  document.getElementById('cdS').textContent=String(ss).padStart(2,'0');
}
tick(); setInterval(tick,1000);

// ── LIVE COUNTER ──
const TOTAL = 10000;
const STOP  = 8221;
let current = 3000;

const names = [
  'Lars K.','Ingrid M.','Erik B.','Sofie L.','Anders H.',
  'Marte Ø.','Jonas R.','Hilde S.','Tor A.','Nina V.',
  'Bjørn F.','Astrid N.','Knut D.','Silje T.','Olav G.'
];

function fmt(n){ return n.toLocaleString('nb-NO'); }

function updateUI(n, added){
  const pct = Math.round(n / TOTAL * 100);
  const rem = TOTAL - n;

  // big counter (animate digits)
  const valEl = document.getElementById('cntVal');
  valEl.style.transform='scale(1.08)';
  valEl.style.transition='transform .15s';
  valEl.textContent = fmt(n);
  setTimeout(()=>{ valEl.style.transform='scale(1)'; },200);

  document.getElementById('cntPct').textContent  = pct + '%';
  document.getElementById('progTxt').textContent = pct + '% krevd';
  document.getElementById('progFill').style.width = pct + '%';
  document.getElementById('remVal').textContent   = fmt(rem);
  document.getElementById('topTag').textContent   = fmt(n) + ' / ' + fmt(TOTAL) + ' krevd';
  document.getElementById('mintedPill').textContent = 'Pass #' + fmt(n) + ' mintet!';

  // flash toast
  const toast   = document.getElementById('flashToast');
  const msg     = document.getElementById('flashMsg');
  const num     = document.getElementById('flashNum');
  const who = names[Math.floor(Math.random()*names.length)];
  msg.textContent = who + ' krevde NFT #' + fmt(n);
  num.textContent = '+1';
  toast.classList.add('show');
  setTimeout(()=>toast.classList.remove('show'), 3000);
}

function scheduleNext(){
  if(current >= STOP) return;
  const delay = (1 + Math.random()) * 1000; // 1–2s
  setTimeout(()=>{
    if(current >= STOP) return;
    current += 1;
    updateUI(current, 1);
    if(current < STOP) scheduleNext();
  }, delay);
}

// Start on load
window.addEventListener('load', ()=>{
  updateUI(current, 0);
  setTimeout(scheduleNext, 1800);
});
</script>
</body>
</html>