/* ─────────────────────────────────────────────
   Nebula Trading — site styles
   ───────────────────────────────────────────── */
:root {
  --bg: #050608;
  --bg-2: #0a0c10;
  --panel: #0d1015;
  --fg: #f2f3f5;
  --muted: #9097a3;
  --dim: #5a606b;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --accent: #6ea8ff;
  --accent-2: #a6c8ff;
  --up: #5fe0a8;
  --down: #ff7d8c;
  --radius: 16px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --sans: "Geist", "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 16px; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: rgba(110, 168, 255, .35); }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h2, h3 { font-weight: 500; letter-spacing: -0.03em; line-height: 1.08; }
em { font-style: normal; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--fg); color: var(--bg); border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* Reveal on scroll (only hidden once JS has marked the page) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease) var(--d, 0s), transform .9s var(--ease) var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero .reveal { opacity: 1; transform: none; transition: none; animation: rise 1s var(--ease) var(--d, 0s) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ───────── Nav ───────── */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .3s ease, border-color .3s ease; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(5, 6, 8, 0.7); backdrop-filter: saturate(150%) blur(16px); -webkit-backdrop-filter: saturate(150%) blur(16px); border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; height: 72px; gap: 40px; }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { width: 24px; height: 24px; color: var(--fg); flex: none; }
.wordmark { font-family: "Montserrat", var(--sans); font-weight: 700; font-size: 14.5px; letter-spacing: 0.05em; }
.nav-links { display: flex; gap: 32px; margin: 0 auto; font-size: 14px; color: var(--muted); }
.nav-links a { transition: color .2s ease; }
.nav-links a:hover { color: var(--fg); }
.nav-cta { font-size: 14px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px; transition: background .2s ease, color .2s ease; }
.nav-cta:hover { background: var(--fg); color: var(--bg); }

/* ───────── Buttons ───────── */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap; transition: transform .25s var(--ease), background .2s ease, border-color .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-light { background: var(--fg); color: var(--bg); }
.btn-light:hover { background: #fff; }
.btn-line { border: 1px solid var(--line-2); color: var(--fg); }
.btn-line:hover { border-color: rgba(255,255,255,.4); }

/* ───────── Hero ───────── */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 140px 0 0; overflow: hidden; isolation: isolate; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-vignette {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 70% 40%, transparent 30%, var(--bg) 85%),
    linear-gradient(180deg, rgba(5,6,8,.2) 0%, transparent 30%, transparent 60%, var(--bg) 100%);
}
.hero-inner { padding-bottom: 72px; will-change: transform, opacity; }
.hero-kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hero-kicker .sep { color: var(--dim); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(110,168,255,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(110,168,255,.55); } 70% { box-shadow: 0 0 0 10px rgba(110,168,255,0); } 100% { box-shadow: 0 0 0 0 rgba(110,168,255,0); } }
.hero-title { margin-top: 28px; font-size: clamp(64px, 11.5vw, 176px); font-weight: 500; line-height: 0.92; letter-spacing: -0.055em; }
.hero-title em { background: linear-gradient(92deg, #fff 0%, var(--accent-2) 45%, var(--accent) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; margin-top: 48px; }
.hero-lede { max-width: 480px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-index { display: flex; align-items: center; border-top: 1px solid var(--line); }
.hero-index a { flex: 1; display: flex; gap: 14px; align-items: baseline; padding: 22px 0; font-size: 15px; color: var(--muted); transition: color .2s ease; }
.hero-index a + a { padding-left: 24px; border-left: 1px solid var(--line); }
.hero-index a:hover { color: var(--fg); }
.hero-index a span { font-size: 12px; color: var(--dim); }
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; padding-left: 24px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.scroll-cue i { position: relative; width: 1px; height: 28px; background: var(--line-2); overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--fg); animation: drip 2s var(--ease) infinite; }
@keyframes drip { to { top: 100%; } }

/* ───────── Marquee ───────── */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: var(--bg-2); }
.marquee-track { display: flex; width: max-content; gap: 36px; padding: 20px 0; animation: marquee 48s linear infinite; font-size: 15px; color: var(--muted); white-space: nowrap; }
.marquee-track b { color: var(--accent); font-size: 9px; align-self: center; font-weight: 400; opacity: .7; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ───────── Statement ───────── */
.statement { padding: 180px 0 160px; }
.statement .label { margin-bottom: 36px; }
.statement-text { max-width: 1080px; font-size: clamp(30px, 4.1vw, 56px); font-weight: 400; line-height: 1.16; letter-spacing: -0.035em; }
.statement-text .w { opacity: .16; transition: opacity .5s ease; }
.statement-text .w.on { opacity: 1; }

/* ───────── Sections ───────── */
.section { padding: 140px 0; }
.section-tint { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { margin-bottom: 72px; }
.sec-head .label { margin-bottom: 20px; }
.sec-head h2 { font-size: clamp(40px, 5.4vw, 76px); letter-spacing: -0.045em; line-height: 1.0; }
.sec-head.split { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; }
.sec-lede { max-width: 400px; font-size: 17px; color: var(--muted); }

/* ───────── Business rows ───────── */
.biz-list { border-top: 1px solid var(--line); }
.biz-row { display: grid; grid-template-columns: 80px 1fr 380px; gap: 40px; align-items: center; padding: 48px 0; border-bottom: 1px solid var(--line); position: relative; }
.biz-row::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 200px at 70% 50%, rgba(110,168,255,.06), transparent 70%); opacity: 0; transition: opacity .4s ease; pointer-events: none; }
.biz-row:hover::before { opacity: 1; }
.biz-no { align-self: start; padding-top: 10px; font-size: 13px; color: var(--dim); }
.biz-copy h3 { font-size: clamp(26px, 2.6vw, 36px); }
.biz-copy p { margin-top: 16px; max-width: 560px; font-size: 16.5px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tags li { padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 999px; }
.biz-vis { position: relative; margin: 0; height: 210px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)); overflow: hidden; }
.biz-vis canvas, .cell-canvas { display: block; width: 100%; height: 100%; }
/* ───────── Order flow heatmap ───────── */
.flow { padding: 40px 0 140px; }
.flow-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; margin-bottom: 56px; }
.flow-head .label { margin-bottom: 20px; }
.flow-head h2 { font-size: clamp(40px, 5.4vw, 76px); letter-spacing: -0.045em; line-height: 1.0; }
.flow-stage { position: relative; height: clamp(360px, 46vw, 620px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #050608; }
.flow-stage canvas { display: block; width: 100%; height: 100%; }
.flow-legend { display: flex; flex-wrap: wrap; gap: 10px 28px; padding-top: 20px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.flow-legend span { display: inline-flex; align-items: center; gap: 8px; }
.flow-legend i { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.flow-legend .lg-liq { background: linear-gradient(90deg, #102248, #2a62c8, #a6c8ff); }
.flow-legend .lg-px { height: 2px; background: #fff; }
.flow-legend .lg-buy { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--up); background: rgba(95,224,168,.25); }
.flow-legend .lg-sell { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--down); background: rgba(255,125,140,.25); }
.flow-legend .sim { margin-left: auto; color: var(--muted); }

/* Cursor spotlight on cards */
.spot { position: relative; }
.spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(110,168,255,.11), transparent 60%); opacity: 0; transition: opacity .35s ease; }
.spot:hover::after { opacity: 1; }

/* ───────── Products showcase ───────── */
.showcase { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; padding: 56px; border: 1px solid var(--line-2); border-radius: 24px; background: radial-gradient(700px 360px at 100% 0%, rgba(110,168,255,.10), transparent 70%), var(--panel); }
.osi-logo { display: block; height: 60px; width: auto; margin-left: -4px; }
.showcase-tag { margin-top: 16px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.showcase-desc { margin-top: 18px; font-size: 17px; color: var(--muted); }
.showcase-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 28px 0 32px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.showcase-meta dt { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.showcase-meta dd { margin: 4px 0 0; font-size: 15px; }
.device { border: 1px solid var(--line-2); border-radius: 18px; background: #090b0f; box-shadow: 0 50px 100px -40px rgba(0,0,0,.9), 0 0 120px -40px rgba(110,168,255,.35); overflow: hidden; }
.device-bar { display: flex; align-items: center; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.device-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.12); }
.device-bar span { margin-left: 10px; font-size: 12px; color: var(--dim); }
.feed { margin: 0; padding: 6px 0; list-style: none; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; }
.feed li + li { border-top: 1px solid var(--line); }
.feed b { display: block; font-weight: 500; font-size: 14.5px; }
.feed div span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--dim); }
.mk { font-size: 10.5px; padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.mk.us { color: var(--accent-2); border-color: rgba(110,168,255,.35); }
.sig { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.sig.up { color: var(--up); background: rgba(95,224,168,.1); }
.sig.down { color: var(--down); background: rgba(255,125,140,.1); }
.sig.flat { color: var(--muted); background: rgba(255,255,255,.06); }
.device-foot { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--dim); }

/* ───────── Technology bento ───────── */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cell { position: relative; padding: 32px; min-height: 280px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.005)); overflow: hidden; display: flex; flex-direction: column; }
.cell-wide { grid-column: span 2; }
.cell-no { font-size: 12px; color: var(--dim); }
.cell h3 { margin-top: 14px; font-size: 26px; }
.cell p { margin-top: 10px; max-width: 420px; font-size: 15px; color: var(--muted); }
.cell-vis { margin-top: auto; }
.cell-canvas { margin-top: auto; height: 120px; }
.vis-radar, .vis-route { width: 120px; height: 120px; align-self: flex-end; }
.vis-radar circle { fill: none; stroke: var(--line-2); }
.vis-radar .sweep { fill: rgba(110,168,255,.18); transform-origin: 60px 60px; animation: spin 4s linear infinite; }
.vis-radar .blip { fill: var(--accent); stroke: none; animation: blink 4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }
.vis-route circle { fill: var(--panel); stroke: var(--muted); }
.vis-route path { fill: none; stroke: var(--line-2); stroke-width: 1.4; }
.vis-route .flow { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 10 110; animation: flow 2.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -120; } }
.limits { margin-top: auto; display: grid; gap: 14px; padding-top: 24px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.limits div { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 16px; }
.limits i { position: relative; height: 4px; border-radius: 999px; background: rgba(255,255,255,.07); }
.limits i::before { content: ""; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; transform-origin: left; transition: transform 1.4s var(--ease) .3s, width .9s var(--ease); }
.limits i::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: 80%; width: 1px; background: var(--down); opacity: .8; }
.js .limits i::before { transform: scaleX(0); }
.js .cell.in .limits i::before { transform: scaleX(1); }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 72px 0 0; padding: 32px 0 0; list-style: none; border-top: 1px solid var(--line); font-size: 16px; color: var(--muted); }
.principles span { color: var(--accent); margin-right: 10px; }
.principles b { color: var(--fg); font-weight: 500; }

/* ───────── CTA ───────── */
.cta { position: relative; padding: 140px 0 160px; border-top: 1px solid var(--line); overflow: hidden; isolation: isolate; }
.cta-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .7; -webkit-mask-image: radial-gradient(60% 70% at 80% 50%, #000 20%, transparent 80%); mask-image: radial-gradient(60% 70% at 80% 50%, #000 20%, transparent 80%); }
.cta-title { margin-top: 24px; font-size: clamp(60px, 9.5vw, 150px); font-weight: 500; letter-spacing: -0.055em; line-height: .92; }
.cta-title em { color: var(--dim); }
.cta-mail { display: inline-flex; gap: 10px; margin-top: 48px; font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -0.02em; border-bottom: 1px solid var(--line-2); padding-bottom: 6px; transition: border-color .2s ease, color .2s ease; }
.cta-mail:hover { border-color: var(--fg); color: #fff; }
.cta-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 36px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.cta-meta a { color: var(--muted); }

/* ───────── Footer ───────── */
.footer { padding: 56px 0 40px; border-top: 1px solid var(--line); }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 28px; font-size: 14px; color: var(--muted); }
.footer-links a:hover { color: var(--fg); }
.biz-info { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 32px; margin: 44px 0 0; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.biz-info dt { color: var(--dim); }
.biz-info dd { margin: 3px 0 0; color: var(--muted); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 24px; font-size: 12.5px; color: var(--dim); }

/* ───────── 404 ───────── */
.notfound { min-height: 100vh; display: grid; place-content: center; text-align: center; gap: 20px; }

/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
  .biz-row { grid-template-columns: 56px 1fr; }
  .biz-vis { grid-column: 2; height: 180px; }
  .showcase { grid-template-columns: 1fr; padding: 40px; }
  .bento { grid-template-columns: 1fr 1fr; }
  .cell-wide { grid-column: span 2; }
  .biz-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; height: 64px; }
  .hero { padding-top: 120px; }
  .hero-inner { padding-bottom: 48px; }
  .hero-foot { flex-direction: column; align-items: flex-start; gap: 28px; margin-top: 32px; }
  .hero-lede { font-size: 16.5px; }
  .hero-index { flex-direction: column; align-items: stretch; }
  .hero-index a { padding: 14px 0; }
  .hero-index a + a { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .scroll-cue { display: none; }
  .statement { padding: 112px 0 96px; }
  .flow { padding: 24px 0 96px; }
  .flow-head { flex-direction: column; align-items: flex-start; gap: 20px; margin-bottom: 36px; }
  .flow-legend .sim { margin-left: 0; }
  .section { padding: 96px 0; }
  .sec-head { margin-bottom: 48px; }
  .sec-head.split { flex-direction: column; align-items: flex-start; gap: 20px; }
  .biz-row { grid-template-columns: 1fr; gap: 20px; padding: 36px 0; }
  .biz-no { padding-top: 0; }
  .biz-vis { grid-column: auto; height: 170px; }
  .showcase { padding: 24px 20px; gap: 40px; border-radius: 20px; }
  .showcase-meta { grid-template-columns: 1fr; }
  .feed li { grid-template-columns: auto 1fr; }
  .feed .sig { grid-column: 2; justify-self: start; }
  .bento { grid-template-columns: 1fr; }
  .cell-wide { grid-column: auto; }
  .cell { padding: 26px 22px; min-height: 0; }
  .vis-radar, .vis-route { margin-top: 20px; }
  .principles { grid-template-columns: 1fr; gap: 16px; }
  .cta { padding: 120px 0 112px; }
  .cta-mail { font-size: 19px; }
  .biz-info { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .js .limits i::before { transform: none; }
  .statement-text .w { opacity: 1; }
}
