/* =====================================================================
   BitLanka — bitlanka.lk
   Tokens first: colours and type live here and nowhere else.
   ===================================================================== */
:root {
  --bg: #05070d;
  --bg-2: #080b14;
  --panel: rgba(13, 18, 32, .62);
  --panel-solid: #0d1220;
  --line: rgba(160, 190, 255, .12);
  --line-2: rgba(160, 190, 255, .22);
  --ink: #e9eef7;
  --ink-2: #b6c0d4;
  --muted: #7f8aa3;

  --cyan: #4ff0d2;
  --gold: #ffb547;
  --violet: #9b8cff;
  --emerald: #10b981;
  --accent: var(--cyan);

  --f-display: "Unbounded", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r: 20px;
  --r-sm: 12px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
b { font-weight: 600; color: var(--ink); }
::selection { background: var(--cyan); color: var(--bg); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--cyan); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- type ---------- */
.display-xl, .display-l, .display-m { font-family: var(--f-display); font-weight: 400; letter-spacing: -.02em; margin: 0; }
.display-xl { font-size: clamp(2.2rem, 6.4vw, 5.6rem); line-height: 1.02; }
.display-l { font-size: clamp(1.9rem, 4.6vw, 3.6rem); line-height: 1.06; }
.display-m { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.1; }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.2rem); color: var(--ink-2); max-width: 36em; margin: 1.2rem 0 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em; margin: 0 0 1.2rem;
  font: 500 .76rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.grad {
  background: linear-gradient(100deg, var(--cyan) 0%, #8fd8ff 45%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- buttons ---------- */
.btn {
  --b: var(--cyan);
  position: relative; display: inline-flex; align-items: center; gap: .6em;
  padding: .95em 1.4em; border-radius: 999px; border: 1px solid transparent;
  background: var(--b); color: #021310; font: 600 .95rem/1 var(--f-body); cursor: pointer;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--b) 50%, transparent), 0 10px 40px -10px color-mix(in srgb, var(--b) 70%, transparent);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 6px color-mix(in srgb, var(--b) 18%, transparent), 0 14px 50px -10px color-mix(in srgb, var(--b) 90%, transparent); }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn--sm { padding: .7em 1.1em; font-size: .86rem; }
.btn--ghost { background: rgba(255, 255, 255, .04); color: var(--ink); border-color: var(--line-2); box-shadow: none; backdrop-filter: blur(8px); }
.btn--ghost:hover { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(79, 240, 210, .1); }
.btn--accent { --b: var(--accent); }
.btn--quiet { background: transparent; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

/* ---------- glass ---------- */
.glass {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 30px 80px -40px rgba(0, 0, 0, .8);
}
.glass::before { /* pointer spotlight, driven by --mx/--my from main.js */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
}
.glass:hover::before { opacity: 1; }

/* =====================================================================
   STAGE (3D world)
   ===================================================================== */
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stage canvas { width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s var(--ease); }
.stage.is-ready canvas { opacity: 1; }
.stage__fallback {
  position: absolute; inset: 0; opacity: 1; transition: opacity 1s;
  background:
    radial-gradient(60% 50% at 70% 40%, rgba(79, 240, 210, .14), transparent 70%),
    radial-gradient(50% 40% at 20% 80%, rgba(155, 140, 255, .14), transparent 70%),
    radial-gradient(40% 30% at 85% 85%, rgba(255, 181, 71, .1), transparent 70%),
    var(--bg);
}
.stage__fallback::after { /* faint grid so the page never looks empty */
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 60% at 50% 60%, #000, transparent);
}
.stage.is-ready .stage__fallback { opacity: 0; }
.stage__vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55)); }
.stage__labels { position: absolute; inset: 0; }
.tag3d {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); white-space: nowrap;
  font: 500 .72rem/1 var(--f-mono); letter-spacing: .06em; color: var(--ink);
  padding: 6px 9px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--c) 50%, transparent);
  background: rgba(5, 7, 13, .72); box-shadow: 0 0 20px -4px color-mix(in srgb, var(--c) 60%, transparent);
  opacity: 0; transition: opacity .4s, border-color .3s, background .3s;
}
.tag3d::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 8px var(--c); }
.tag3d.is-hot { background: color-mix(in srgb, var(--c) 22%, rgba(5, 7, 13, .9)); border-color: var(--c); }

main, .footer, .nav, .rail { position: relative; z-index: 1; }

/* =====================================================================
   NAV
   ===================================================================== */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; }
.nav__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  max-width: var(--wrap); margin: 14px auto 0; padding: 10px 12px 10px 20px;
  width: calc(100% - 2 * var(--gutter) + 24px);
  border-radius: 999px; border: 1px solid transparent; transition: background .4s, border-color .4s, backdrop-filter .4s;
}
.nav.is-scrolled .nav__bar { background: rgba(8, 11, 20, .7); border-color: var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand__mark { width: 30px; height: 30px; }
.brand__word { font: 400 1.18rem/1 var(--f-display); letter-spacing: -.02em; }
.brand__word b { font-weight: 600; }
.nav__links { display: flex; gap: 4px; }
.nav__links a { padding: .55em 1em; border-radius: 999px; font-size: .92rem; color: var(--ink-2); transition: color .2s, background .2s; }
.nav__links a:hover, .nav__links a.is-current { color: var(--ink); background: rgba(255, 255, 255, .06); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.nav__menu { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); cursor: pointer; }
.nav__burger, .nav__burger::before, .nav__burger::after { display: block; width: 18px; height: 1.6px; background: var(--ink); margin: 0 auto; transition: transform .3s var(--ease); position: relative; }
.nav__burger::before, .nav__burger::after { content: ""; position: absolute; left: 0; }
.nav__burger::before { top: -6px; } .nav__burger::after { top: 6px; }
.nav__menu[aria-expanded="true"] .nav__burger { background: transparent; }
.nav__menu[aria-expanded="true"] .nav__burger::before { transform: translateY(6px) rotate(45deg); }
.nav__menu[aria-expanded="true"] .nav__burger::after { transform: translateY(-6px) rotate(-45deg); }
.nav__sheet {
  display: flex; flex-direction: column; gap: 4px; margin: 8px var(--gutter) 0; padding: 14px;
  border-radius: var(--r); background: rgba(8, 11, 20, .94); border: 1px solid var(--line); backdrop-filter: blur(16px);
}
.nav__sheet[hidden] { display: none; }
.nav__sheet a:not(.btn) { padding: 14px 10px; font: 400 1.2rem/1 var(--f-display); border-bottom: 1px solid var(--line); }
.nav__sheet .btn { margin-top: 10px; justify-content: center; }
html:not(.js) .nav__sheet[hidden] { display: flex; }

.rail { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 15; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rail li { position: relative; width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .2); transition: background .3s, box-shadow .3s, transform .3s; }
.rail li.is-on { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); transform: scale(1.25); }
.rail span { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font: 500 .66rem/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.rail:hover span { opacity: 1; }

/* =====================================================================
   HERO
   ===================================================================== */
.hero { min-height: 190vh; }
.hero__pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.hero__inner { padding-top: 60px; }
.hero__title { max-width: 14ch; text-shadow: 0 4px 40px rgba(0, 0, 0, .6); }
.hero__tail { color: var(--ink-2); }
.rotator { position: relative; display: inline-grid; vertical-align: top; }
.rotator__item {
  grid-area: 1 / 1; opacity: 0; transform: translateY(.4em); filter: blur(8px);
  transition: opacity .7s var(--ease), transform .7s var(--ease), filter .7s var(--ease);
  background: linear-gradient(100deg, var(--cyan), #8fd8ff 55%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.rotator__item.is-active { opacity: 1; transform: none; filter: none; }
.rotator__item.is-leaving { opacity: 0; transform: translateY(-.4em); filter: blur(8px); }
.hero__lead { max-width: 33em; }

.hud { position: absolute; top: 92px; display: flex; flex-direction: column; gap: 6px; font: 400 .68rem/1 var(--f-mono); letter-spacing: .14em; color: var(--muted); }
.hud--tl { left: var(--gutter); }
.hud--tr { right: calc(var(--gutter) + 26px); text-align: right; align-items: flex-end; }
.hud__live { color: var(--cyan); display: inline-flex; gap: 8px; align-items: center; }
.hud__live i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.hero__ticker { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; list-style: none; margin: 0 auto; padding: 0; max-width: calc(var(--wrap) - 2 * var(--gutter)); display: flex; gap: 10px; flex-wrap: wrap; }
.hero__ticker li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(8, 11, 20, .55); backdrop-filter: blur(10px); font: 500 .8rem/1 var(--f-body); }
.hero__ticker i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.hero__ticker em { font: 400 .7rem/1 var(--f-mono); font-style: normal; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.scroll-cue { position: absolute; right: calc(var(--gutter) + 26px); bottom: 34px; display: flex; align-items: center; gap: 10px; font: 400 .68rem/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.scroll-cue span { width: 1px; height: 38px; background: linear-gradient(var(--cyan), transparent); animation: cue 2s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* =====================================================================
   PRODUCTS
   ===================================================================== */
.products { padding-top: 22vh; }
.products__head { min-height: 70vh; }
.stop { position: relative; min-height: 165vh; max-width: var(--wrap); margin: 0 auto; padding: 0 calc(var(--gutter) + 40px) 0 var(--gutter); }
.stop__card { position: sticky; top: max(96px, calc(50vh - 290px)); width: min(470px, 100%); padding: 30px; }
.stop[data-side="right"] .stop__card { margin-left: auto; }
.stop__card { border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.stop__card::after { content: ""; position: absolute; left: 30px; right: 30px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.stop__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.stop__logo { width: 44px; height: 44px; }
.stop__glyph { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font: 600 1rem/1 var(--f-display); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.stop__num { margin: 0 0 6px; font: 400 .72rem/1 var(--f-mono); letter-spacing: .16em; color: var(--accent); }
.stop h3 .si { font: 400 .5em/1 var(--f-body); color: var(--muted); letter-spacing: 0; vertical-align: middle; }
.stop__tag { margin: .5rem 0 .9rem; font-size: 1.1rem; color: var(--ink); font-weight: 500; }
.stop p { color: var(--ink-2); }
.stop__url { margin: 14px 0 0; font: 400 .74rem/1 var(--f-mono); color: var(--muted) !important; letter-spacing: .04em; }
.stop .btn { margin-top: 8px; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 11px; border-radius: 999px; font: 500 .68rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; border: 1px solid currentColor; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: blink 1.6s infinite; }
.status--live { color: var(--emerald); }
.status--soon { color: var(--gold); }
.status--pilot { color: var(--violet); }
.chips { list-style: none; padding: 0; margin: 16px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 6px 10px; border-radius: 8px; font-size: .8rem; color: var(--ink-2); background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }

/* =====================================================================
   PLATFORM
   ===================================================================== */
.platform { min-height: 210vh; }
.platform__pin { position: sticky; top: 0; min-height: 100vh; display: flex; align-items: center; padding: 100px 0 40px; }
.platform__copy { max-width: 540px; }
.term { margin-top: 2rem; padding: 0 0 8px; overflow: hidden; font: 400 .82rem/1.2 var(--f-mono); }
.term__bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.term__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.term__bar span { margin-left: 8px; }
.term__row { display: grid; grid-template-columns: 1.25fr 1fr auto; gap: 12px; align-items: center; padding: 11px 16px; color: var(--ink-2); transition: background .3s, color .3s; }
.term__row.is-hot { background: rgba(79, 240, 210, .07); color: var(--ink); }
.term__host { color: var(--ink); }
.term .ok { color: var(--cyan); } .term .soon { color: var(--gold); } .term .invite { color: var(--violet); }

/* =====================================================================
   SOLID SECTIONS
   ===================================================================== */
.solid { background: linear-gradient(to bottom, transparent 0, var(--bg) 26vh); padding: 30vh 0 14vh; }
.solid + .solid { background: var(--bg); padding-top: 10vh; }
.section-head { margin-bottom: 56px; }

.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.principle { padding: 26px 22px; }
.principle__n { font: 400 .72rem/1 var(--f-mono); color: var(--cyan); letter-spacing: .14em; }
.principle h3 { margin: 26px 0 10px; font: 400 1.25rem/1.2 var(--f-display); }
.principle p { margin: 0; color: var(--ink-2); font-size: .95rem; }

.contact { padding-bottom: 12vh; }
.contact__grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; }
.contact__list { list-style: none; margin: 0; padding: 8px 26px; }
.contact__list li { display: grid; grid-template-columns: 110px 1fr; padding: 16px 0; border-top: 1px solid var(--line); }
.contact__list li:first-child { border-top: 0; }
.contact__list span { font: 400 .72rem/1.8 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.contact__list a { color: var(--cyan); }

.footer { border-top: 1px solid var(--line); background: var(--bg); padding: 36px 0; }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 20px; font-size: .9rem; color: var(--ink-2); }
.footer__links a:hover { color: var(--ink); }
.footer__legal { margin: 0; font-size: .82rem; color: var(--muted); width: 100%; }

/* ---------- reveals ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .rotator__item, .btn { transition: none; }
  .scroll-cue span, .hud__live i, .status i { animation: none; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1080px) {
  .principles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav__links, .nav__actions .btn, .rail { display: none; }
  .nav__menu { display: block; }
  .nav__bar { padding-left: 16px; }
  .hud--tr { right: var(--gutter); }
  .hud { top: 84px; }
  .hero__inner { padding-top: 40px; }
  .scroll-cue { display: none; }

  .products__head { min-height: 50vh; }
  .stop { min-height: 0; padding-top: 62vh; padding-bottom: 18vh; }
  .stop__card { position: relative; top: 0; margin: 0 !important; padding: 24px; }

  .platform { min-height: 0; }
  .platform__pin { position: relative; min-height: 0; padding: 48vh 0 10vh; }
  .term__row { grid-template-columns: 1fr auto; }
  .term__row span:nth-child(2) { display: none; }

  .contact__grid { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .principles { grid-template-columns: 1fr; }
  .hero__ticker li { font-size: .74rem; padding: 7px 11px; }
  .hud--tl span:last-child { display: none; }
  .solid { padding-top: 22vh; }
}
