/* Nodus — nodus.trade
   Palette from Nodus.App Resources/Symbols.xaml:
   Normal = Orange (#FFA500), NormalPale = #693410, NormalDimmed = #291707,
   Faded = #303030, Inactive = DarkGray (#A9A9A9), Khaki = #F0E68C.
   Settings accent #E68A00 and panel #1E1E1E from ChartSettingsStyles (BorderlessCombo);
   base #141414 / #242424 from the Telegram Mini App page.
   Fonts follow the app's FormFont2 (Segoe UI Light) and CodeFont (Cascadia Mono). */

:root {
  --bg: #141414;
  --bg-2: #1E1E1E;
  --panel: #242424;
  --faded: #303030;
  --orange: #FFA500;
  --accent: #E68A00;
  --orange-pale: #693410;
  --orange-dim: #291707;
  --khaki: #F0E68C;
  --inactive: #A9A9A9;
  --text: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.62);
  --dim: rgba(255, 255, 255, 0.38);
  --sans: "Segoe UI", -apple-system, "SF Pro Text", "Helvetica Neue", Roboto, system-ui, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", monospace;
  --gutter: clamp(20px, 5vw, 72px);
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-weight: 300; line-height: 1.5; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 300; letter-spacing: -0.01em; line-height: 1.06; text-wrap: balance; }
p { margin: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background .35s ease;
}
.nav.is-solid { background: rgba(20, 20, 20, 0.96); }
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav__mark { width: 28px; height: 28px; }
.nav__word { font-size: 18px; letter-spacing: 0.18em; text-transform: uppercase; }
.nav__cta {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: var(--text);
  border: 1px solid var(--orange-pale); border-radius: 999px; padding: 9px 16px;
  background: var(--orange-dim);
  transition: border-color .2s, background .2s;
}
.nav__cta:hover { border-color: var(--accent); background: var(--orange-pale); }

/* ---------- scenes + holds (layered pinning) ---------- */
.scene { position: relative; width: 100%; min-height: 100vh; min-height: 100svh; overflow: hidden; background: var(--bg); }
.hold { position: relative; height: 120vh; pointer-events: none; }
.hold[data-hold="hero"] { height: 220vh; }
.scene__dim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 5; }
/* every card that slides over another gets a real edge */
.scene--feature, .scene--rail, .scene--contact {
  border-radius: 28px 28px 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 -30px 90px rgba(0,0,0,0.65);
}

/* hero */
.scene--hero { height: 100vh; height: 100svh; background: #0c0c0c; }
.fold {
  position: absolute; inset: 0;
  display: flex;
  perspective: 1500px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  will-change: transform;
}
.strip {
  flex: 1 0 0;
  height: 100%;
  background-image: url("/assets/hero.webp");
  background-size: 600% 100%;
  background-repeat: no-repeat;
  backface-visibility: hidden;
  position: relative;
  will-change: transform;
}
.strip::after {
  content: ""; position: absolute; inset: 0;
  background: #000; opacity: var(--shade, 0);
  pointer-events: none;
}
.hero__veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(12,12,12,0.85) 0%, rgba(12,12,12,0.4) 45%, rgba(12,12,12,0.05) 100%),
    linear-gradient(180deg, rgba(12,12,12,0.5) 0%, rgba(12,12,12,0) 25%, rgba(12,12,12,0) 75%, rgba(12,12,12,0.6) 100%);
}
.hero__scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%; pointer-events: none;
  background: radial-gradient(70% 100% at 0% 100%, rgba(12,12,12,0.92) 0%, rgba(12,12,12,0.55) 45%, rgba(12,12,12,0) 100%);
}
.hero__copy {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0 var(--gutter);
  width: min(58%, 760px);
  pointer-events: none;
}
.hero__title { font-size: clamp(38px, 5.6vw, 84px); line-height: 1.0; letter-spacing: -0.02em; }
.hero__lead { margin-top: 26px; max-width: 520px; font-size: clamp(16px, 1.4vw, 19px); color: var(--muted); }
.hero__hint {
  margin-top: 44px; display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--dim);
}
.hero__hint span { display: block; width: 44px; height: 1px; background: var(--accent); transform-origin: left; animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0% { transform: scaleX(0); opacity: 0 } 40% { transform: scaleX(1); opacity: 1 } 100% { transform: scaleX(1) translateX(24px); opacity: 0 } }
.hero__caption {
  position: absolute; left: var(--gutter); bottom: clamp(56px, 11vh, 110px);
  font-size: clamp(22px, 3vw, 40px); letter-spacing: -0.01em; opacity: 0;
  text-shadow: 0 2px 24px rgba(0,0,0,0.9);
}

/* feature scenes */
.scene--feature { height: 100vh; height: 100svh; display: flex; align-items: center; }
.scene__inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(300px, 5.5fr) minmax(0, 6.5fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  padding: var(--nav-h) var(--gutter) 0;
}
.scene--feature[data-side="left"] .scene__inner { grid-template-columns: minmax(0, 6.5fr) minmax(300px, 5.5fr); }
.scene--feature[data-side="left"] .scene__copy { order: 2; }
.scene--feature[data-side="left"] .scene__media { order: 1; }
.scene__copy h2 { font-size: clamp(28px, 3.1vw, 46px); }
.scene__copy p:not(.eyebrow) { margin-top: 22px; max-width: 460px; font-size: clamp(15px, 1.2vw, 17px); color: var(--muted); }
.scene__media { margin: 0; min-width: 0; }
.media__frame {
  aspect-ratio: var(--ar, 16 / 10);
  width: 100%;
  border-radius: 14px; overflow: hidden;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 40px 120px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.6);
  will-change: transform, clip-path;
}
.media__frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; will-change: transform; }

/* the Mini App: two phones held sideways (the app is used in landscape), front and back */
.scene--phone .scene__media { display: flex; justify-content: center; }
.phones { position: relative; width: min(680px, 100%); aspect-ratio: 19.5 / 12.6; }
.phone {
  position: absolute; left: 0; top: 0;
  width: 86%; aspect-ratio: 19.5 / 9;
  border-radius: 34px; padding: 10px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 50px 120px rgba(0,0,0,0.7), inset 0 0 0 2px #1a1a1a;
  will-change: transform;
}
.phone::before {
  /* camera island, on the left when the phone is held sideways */
  content: ""; position: absolute; left: 20px; top: 50%; width: 22px; height: 78px; margin-top: -39px;
  border-radius: 11px; background: #050505; z-index: 2;
}
.phone--front { left: 14%; top: 0; transform: rotate(-2deg); z-index: 2; }
.phone--back { left: 0; top: 34%; transform: rotate(2.5deg) scale(0.95); z-index: 1; opacity: 0.82; }
.phone__screen { width: 100%; height: 100%; border-radius: 26px; overflow: hidden; background: var(--bg-2); }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* rail */
.scene--rail { height: 100vh; height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.rail__head { padding: var(--nav-h) var(--gutter) 0; }
.rail__head h2 { font-size: clamp(28px, 3.1vw, 46px); }
.rail__track {
  margin-top: 36px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 2.2 * var(--gutter)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--gutter), #000 calc(100% - 2.2 * var(--gutter)), transparent 100%);
}
.rail { display: flex; gap: clamp(16px, 2vw, 28px); padding: 0 var(--gutter); will-change: transform; width: max-content; }
.card {
  flex: 0 0 auto; width: clamp(260px, 30vw, 380px);
  padding: 28px 28px 32px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid rgba(255,255,255,0.08);
}
.card__n { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--accent); }
.card h3 { margin-top: 18px; font-size: 24px; }
.card p { margin-top: 12px; color: var(--muted); font-size: 15px; }
.rail__progress { margin: 36px var(--gutter) 0; height: 2px; background: rgba(255,255,255,0.12); }
.rail__progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }

/* contact */
.scene--contact { display: flex; flex-direction: column; }
.contact__inner {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 60px;
}
.contact__text h2 { font-size: clamp(36px, 5vw, 76px); max-width: 12ch; }
.contact__text > p:not(.eyebrow) { margin-top: 24px; max-width: 520px; color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); }
.contact__links { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 14px; }
.contact__mark {
  width: min(320px, 28vw); height: auto; justify-self: center;
  filter: drop-shadow(0 0 60px rgba(57, 255, 20, 0.18));
}
.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em;
  padding: 14px 22px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18); color: var(--text);
  transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--accent); }
.btn--primary { background: var(--orange); border-color: var(--orange); color: #141414; }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }
.footer {
  padding: 28px var(--gutter) 34px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--dim);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  :root { --nav-h: 56px; }
  .nav__word { display: none; }
  .hero__veil {
    background:
      linear-gradient(180deg, rgba(12,12,12,0.55) 0%, rgba(12,12,12,0.05) 30%, rgba(12,12,12,0.2) 55%, rgba(12,12,12,0.9) 100%);
  }
  .hero__copy { width: 100%; justify-content: flex-end; padding-bottom: 7vh; }
  .hero__title { font-size: clamp(30px, 8.8vw, 42px); }
  .hero__lead { margin-top: 16px; font-size: 14px; max-width: 34ch; }
  .hero__hint { margin-top: 20px; }
  .scene--feature, .scene--rail, .scene--contact { border-radius: 22px 22px 0 0; }
  .hero__caption { bottom: 64px; }
  .scene__inner, .scene--feature[data-side="left"] .scene__inner {
    grid-template-columns: 1fr;
    gap: 22px;
    align-content: center;
    padding-top: calc(var(--nav-h) + 8px);
    padding-bottom: 24px;
  }
  .scene--feature[data-side="left"] .scene__copy { order: 1; }
  .scene--feature[data-side="left"] .scene__media { order: 2; }
  .scene__copy p:not(.eyebrow) { font-size: 15px; }
  .media__frame { max-height: 42svh; }
  .phones { width: 100%; aspect-ratio: 19.5 / 12.6; }
  .phone { border-radius: 24px; padding: 7px; }
  .phone::before { left: 12px; width: 14px; height: 50px; margin-top: -25px; }
  .phone__screen { border-radius: 18px; }
  .rail__track { margin-top: 24px; }
  .rail__progress { margin-top: 24px; }
  .contact__inner { grid-template-columns: 1fr; padding-top: calc(var(--nav-h) + 12px); padding-bottom: 20px; }
  .contact__text h2 { font-size: clamp(30px, 8.8vw, 40px); }
  .contact__links { margin-top: 24px; }
  .contact__mark { width: 72px; justify-self: start; margin-top: 4px; }
  .footer { padding: 18px var(--gutter) 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__hint span { animation: none; }
  .hold { height: 0 !important; }
}
