/* =========================================================
   Beyond Research — site stylesheet
   ========================================================= */
:root {
  --bg: #05070d;
  --bg-2: #0a0e18;
  --panel: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e8edf5;
  --muted: #8a94a8;
  --accent: #3ef2c4;
  --accent-2: #4da3ff;
  --warn: #ff5c7a;
  --radius: 14px;
  --maxw: 1200px;
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }

::selection { background: var(--accent); color: var(--bg); }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: var(--accent); color: #031612;
  box-shadow: 0 0 0 0 rgba(62, 242, 196, .5), 0 10px 30px -10px rgba(62, 242, 196, .6);
}
.btn--primary:hover { box-shadow: 0 0 0 6px rgba(62, 242, 196, .12), 0 14px 40px -10px rgba(62, 242, 196, .8); }
.btn--ghost { border-color: var(--line-2); color: var(--text); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 8px 18px; font-size: 14px; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(5, 7, 13, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.brand__mark { width: 30px; height: 30px; }
.brand__text { font-weight: 800; letter-spacing: .18em; font-size: 14px; color: var(--text); }
.brand__text span { color: var(--muted); font-weight: 500; margin-left: .45em; }
.nav__links { display: flex; align-items: center; gap: 32px; font-size: 14.5px; }
.nav__links a:not(.btn) { color: var(--muted); position: relative; transition: color .2s; }
.nav__links a:not(.btn):hover,
.nav__links a.is-active { color: var(--text); }
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--accent); transition: width .25s ease;
}
.nav__links a:not(.btn):hover::after,
.nav__links a.is-active::after { width: 100%; }
.nav__toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--text); transition: transform .3s, top .3s; }
.nav__toggle span:first-child { top: 15px; }
.nav__toggle span:last-child { top: 23px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 19px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 19px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; overflow: hidden; padding: 120px 0 80px;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__fade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 45% 45% at 22% 48%, rgba(5,7,13,.85), transparent 75%),
    linear-gradient(to bottom, transparent 70%, var(--bg));
}
.hero__content { position: relative; z-index: 2; display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); padding: 6px 14px; border: 1px solid rgba(62,242,196,.25);
  border-radius: 999px; background: rgba(62,242,196,.06); margin-bottom: 26px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.hero__title { font-size: clamp(42px, 7vw, 84px); font-weight: 800; letter-spacing: -0.035em; }
.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 60%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { margin-top: 26px; max-width: 560px; font-size: 18px; color: var(--muted); }
.hero__cta { margin-top: 38px; display: flex; gap: 14px; flex-wrap: wrap; }

.hero__terminal {
  background: rgba(10, 14, 24, .78); border: 1px solid var(--line-2); border-radius: var(--radius);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(62,242,196,.04);
  overflow: hidden; font-family: var(--mono); font-size: 13px;
}
.term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.term__bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a3142; }
.term__bar i:nth-child(1) { background: #ff5f57; }
.term__bar i:nth-child(2) { background: #febc2e; }
.term__bar i:nth-child(3) { background: #28c840; }
.term__bar span { margin-left: 8px; }
.term__body { margin: 0; padding: 18px 20px; min-height: 290px; white-space: pre-wrap; color: #c9d3e3; line-height: 1.7; }
.term__body .k { color: #c792ea; }
.term__body .f { color: var(--accent-2); }
.term__body .s { color: #c3e88d; }
.term__body .c { color: #5c6780; }
.term__body .n { color: #f78c6c; }
.term__body .ok { color: var(--accent); }
.caret { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__scroll { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2; width: 26px; height: 42px; border: 1.5px solid var(--line-2); border-radius: 14px; }
.hero__scroll span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); animation: scrollDot 1.8s infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Tape ---------- */
.tape { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); overflow: hidden; white-space: nowrap; }
.tape__track { display: inline-flex; animation: tape 60s linear infinite; padding: 14px 0; }
.tape__item { font-family: var(--mono); font-size: 13px; color: var(--muted); padding: 0 28px; display: inline-flex; gap: 10px; align-items: center; }
.tape__item b { color: var(--text); font-weight: 600; }
.tape__item .up { color: var(--accent); }
.tape__item .down { color: var(--warn); }
@keyframes tape { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: 130px 0; position: relative; }
.section--alt { background: linear-gradient(to bottom, var(--bg-2), var(--bg)); border-top: 1px solid var(--line); }
.kicker { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: .1em; margin-bottom: 18px; }
.section__title { font-size: clamp(32px, 4.4vw, 52px); font-weight: 750; max-width: 760px; }
.section__lead { margin-top: 22px; color: var(--muted); font-size: 17.5px; max-width: 640px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; }
.grid-2--center { align-items: center; }

/* About */
.about__body > p { color: var(--muted); font-size: 17px; margin-bottom: 18px; }
.about__body > p:first-child { color: var(--text); font-size: 19px; }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
.pillar { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); transition: border-color .3s, transform .3s; }
.pillar:hover { border-color: rgba(62,242,196,.35); transform: translateY(-4px); }
.pillar__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(62,242,196,.1); color: var(--accent); font-size: 18px; margin-bottom: 14px; }
.pillar h3 { font-size: 16px; margin-bottom: 6px; }
.pillar p { font-size: 14px; color: var(--muted); line-height: 1.55; }

/* Pipeline */
.pipeline { list-style: none; padding: 0; margin: 64px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: s; position: relative; }
.pipeline::before {
  content: ""; position: absolute; top: 74px; left: 6%; right: 6%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); opacity: .35;
}
.stage { position: relative; padding: 28px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(10,14,24,.7); transition: border-color .3s, transform .3s, box-shadow .3s; }
.stage:hover { border-color: rgba(62,242,196,.4); transform: translateY(-6px); box-shadow: 0 20px 50px -25px rgba(62,242,196,.35); }
.stage__num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.stage__icon { width: 52px; height: 52px; margin: 14px 0 20px; border-radius: 12px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line-2); position: relative; z-index: 1; }
.stage__icon svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage h3 { font-size: 19px; margin-bottom: 10px; }
.stage p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* Technology */
.techlist { list-style: none; padding: 0; margin: 36px 0 0; }
.techlist li { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.techlist li:last-child { border-bottom: 1px solid var(--line); }
.techlist b { font-weight: 600; }
.techlist span { color: var(--muted); font-size: 15px; }

.viz { border: 1px solid var(--line-2); border-radius: var(--radius); background: rgba(10,14,24,.8); padding: 22px; box-shadow: 0 40px 90px -40px rgba(77,163,255,.35); }
.viz__head, .viz__foot { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.viz__live { display: inline-flex; align-items: center; gap: 6px; }
.viz__live i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.5s infinite; }
.heatmap { display: grid; gap: 3px; margin: 18px 0; aspect-ratio: 1; }
.heatmap div { border-radius: 3px; transition: background-color 1.2s ease; }
.viz__foot { gap: 12px; }
.viz__scale { flex: 1; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #ff5c7a, #1a2030 50%, #3ef2c4); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 100px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.metric { padding: 36px 28px; border-right: 1px solid var(--line); background: var(--panel); }
.metric:last-child { border-right: 0; }
.metric__val { display: block; font-family: var(--mono); font-size: clamp(32px, 4vw, 46px); font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.metric__label { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }

/* Culture */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 56px; }
.card {
  padding: 30px 26px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--panel); position: relative; overflow: hidden; transition: border-color .3s, transform .3s;
}
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(62,242,196,.12), transparent 45%);
}
.card:hover { border-color: var(--line-2); transform: translateY(-4px); }
.card:hover::before { opacity: 1; }
.card h3 { font-size: 18px; margin-bottom: 12px; position: relative; }
.card p { color: var(--muted); font-size: 15px; position: relative; }

/* Careers */
.careers__head { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: end; }
.roles { margin-top: 56px; border-top: 1px solid var(--line); }
.role { display: flex; justify-content: space-between; align-items: center; padding: 28px 8px; border-bottom: 1px solid var(--line); transition: padding .3s, background .3s; }
.role h3 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; transition: color .3s; }
.role p { color: var(--muted); font-size: 14px; margin-top: 4px; font-family: var(--mono); }
.role__arrow { font-size: 26px; color: var(--muted); transition: transform .3s, color .3s; }
.role:hover { padding-left: 24px; padding-right: 24px; background: rgba(62,242,196,.03); }
.role:hover h3, .role:hover .role__arrow { color: var(--accent); }
.role:hover .role__arrow { transform: translateX(6px); }

/* Contact */
.address { margin-top: 40px; padding: 26px 28px; border-left: 2px solid var(--accent); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; }
.address__label { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.address address { font-style: normal; margin-top: 10px; line-height: 1.8; color: var(--muted); }
.address strong { color: var(--text); letter-spacing: .04em; }

.form { display: flex; flex-direction: column; gap: 18px; padding: 34px; border: 1px solid var(--line-2); border-radius: var(--radius); background: rgba(10,14,24,.75); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); font-family: var(--mono); letter-spacing: .04em; }
.form input, .form select, .form textarea {
  font: inherit; font-family: var(--font); font-size: 15px; color: var(--text); letter-spacing: 0;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px;
  outline: none; transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62,242,196,.12); }
.form .is-invalid { border-color: var(--warn); }
.form button { align-self: flex-start; }
.form__note { font-size: 14px; min-height: 1.4em; color: var(--accent); }
.form__note.is-error { color: var(--warn); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 56px 0 36px; background: var(--bg); }
.footer__inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; }
.footer__brand p { color: var(--muted); font-size: 14px; margin-top: 8px; }
.footer__links { display: flex; gap: 28px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.footer__links a:hover { color: var(--accent); }
.footer__legal { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.disclaimer { margin-top: 10px; font-size: 12px; opacity: .7; max-width: 900px; line-height: 1.6; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .tape__track, .dot, .caret, .hero__scroll span { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero__content { grid-template-columns: 1fr; }
  .hero__terminal { max-width: 560px; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline::before { display: none; }
  .stage:last-child { grid-column: span 2; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; top: 72px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0;
    padding: 12px 24px 28px; background: rgba(5,7,13,.97); border-bottom: 1px solid var(--line);
    transform: translateY(-120%); opacity: 0; transition: transform .35s ease, opacity .35s ease; pointer-events: none;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a:not(.btn) { padding: 14px 0; width: 100%; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav__links a:not(.btn)::after { display: none; }
  .nav__links .btn { margin-top: 18px; }
  .nav:has(.nav__links.is-open) { background: rgba(5,7,13,.97); }

  .section { padding: 96px 0; }
  .grid-2, .careers__head { grid-template-columns: 1fr; gap: 40px; }
  .pillars { grid-template-columns: 1fr; }
  .techlist li { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 560px) {
  .hero__lead { font-size: 16.5px; }
  .term__body { font-size: 11.5px; min-height: 250px; }
  .pipeline, .cards { grid-template-columns: 1fr; }
  .stage:last-child { grid-column: auto; }
  .metrics { grid-template-columns: 1fr; }
  .metric { border-right: 0; border-bottom: 1px solid var(--line); }
  .metric:last-child { border-bottom: 0; }
  .form { padding: 24px; }
  .form__row { grid-template-columns: 1fr; }
}
