/* =========================================================================
   BeyondOS Lab — page styles
   Research-lab landing page. Dark, austere, mint-warmed; built on the
   Makermint design tokens in tokens.css. Modeled on the General Intuition
   structure, in the Beyond / Makermint brand.
   ========================================================================= */

/* ───────────────────────── THEME (dark, mint-warmed) ───────────────────────── */
:root {
  --ink:        14 14 18;     /* page base */
  --ink-2:      20 21 26;     /* panels */
  --ink-3:      28 30 37;     /* raised */
  --paper:      245 245 247;  /* primary text */
  --muted:      150 153 163;  /* secondary text */
  --faint:      99 103 114;   /* tertiary / mono labels */
  --hair:       255 255 255;  /* hairlines (low alpha) */
  --accent:     106 187 141;  /* mint */
  --accent-2:   252 213 115;  /* yellow, used sparingly */
  --maxw:       1180px;
  --pad:        clamp(20px, 5vw, 64px);
}
html[data-mode="light"] {
  --ink: 247 247 245; --ink-2: 255 255 255; --ink-3: 240 240 238;
  --paper: 24 24 28; --muted: 92 96 104; --faint: 130 134 142; --hair: 0 0 0;
  --accent: 60 150 104;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: rgb(var(--ink));
  color: rgb(var(--paper));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: rgb(var(--accent) / .3); }

/* hero pixel scene — sits below the glyph field, scrolls away with the hero */
#hero-scene {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100svh;
  z-index: 0; pointer-events: none;
  image-rendering: pixelated;
}
/* field backdrop */
#field {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 1;
  opacity: .9;
}
/* vignette + bottom fade so text always reads */
.veil {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgb(var(--ink) / .62) 0%, rgb(var(--ink) / 0) 16%),
    radial-gradient(115% 82% at 50% 4%, transparent 46%, rgb(var(--ink) / .5) 100%),
    linear-gradient(rgb(var(--ink) / .22), rgb(var(--ink) / .22));
}
.shell { position: relative; z-index: 3; }

/* ───────────────────────── TYPE HELPERS ───────────────────────── */
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgb(var(--accent));
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 1px; background: rgb(var(--accent) / .6);
}
.idx {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px;
  color: rgb(var(--faint)); text-transform: uppercase;
}
.display {
  font-weight: 800; letter-spacing: -2px; line-height: .98;
  font-size: clamp(38px, 6.2vw, 92px);
  text-wrap: balance; margin: 0;
}
.display .mint { color: rgb(var(--accent)); }
h2.h {
  font-weight: 700; letter-spacing: -1.2px; line-height: 1.02;
  font-size: clamp(30px, 4.4vw, 58px); margin: 0; text-wrap: balance;
}
.lede {
  font-size: clamp(18px, 1.9vw, 24px); line-height: 1.5;
  color: rgb(var(--paper)); font-weight: 400; max-width: 30ch;
}
p.body { font-size: clamp(16px, 1.25vw, 18.5px); line-height: 1.62; color: rgb(var(--muted)); max-width: 62ch; }
p.body strong { color: rgb(var(--paper)); font-weight: 600; }

/* ───────────────────────── LAYOUT ───────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
section { position: relative; }
.hairline { border: 0; border-top: 1px solid rgb(var(--hair) / .1); margin: 0; }

/* ───────────────────────── TOP CHROME ───────────────────────── */
header.chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
header.chrome[data-stuck="1"] {
  background: rgb(var(--ink) / .72);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: rgb(var(--hair) / .08);
}
.brand { display: inline-flex; align-items: center; font-family: "Nunito", var(--font-sans); font-weight: 700;
         letter-spacing: -.4px; font-size: 24px; line-height: 1; color: rgb(var(--paper)); }
.brand .mark { width: 13px; height: 13px; background: rgb(var(--accent)); border-radius: 3px;
               box-shadow: 0 0 16px rgb(var(--accent) / .7); }
nav.links { display: flex; align-items: center; gap: 4px; }
nav.links a {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase;
  color: rgb(var(--muted)); padding: 9px 13px; border-radius: 999px; transition: color .2s, background .2s;
}
nav.links a:hover { color: rgb(var(--paper)); background: rgb(var(--hair) / .07); }
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  padding: 11px 18px; border-radius: 999px; border: 1px solid rgb(var(--accent) / .5);
  color: rgb(var(--accent)); background: rgb(var(--accent) / .07); transition: all .2s; white-space: nowrap;
}
.btn:hover { background: rgb(var(--accent)); color: rgb(var(--ink)); border-color: rgb(var(--accent)); }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(3px); }
@media (max-width: 860px) { nav.links a:not(.btn) { display: none; } }
/* top tabs */
.tabs { display: flex; gap: 4px; }
.tabs-break { display: none; }
.tab {
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase;
  color: rgb(var(--muted)); padding: 9px 14px; border-radius: 999px; position: relative;
  transition: color .2s, background .2s;
}
.tab:hover { color: rgb(var(--paper)); background: rgb(var(--hair) / .07); }
.tab.on { color: rgb(var(--paper)); }
.tab.on::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px;
  background: rgb(var(--accent)); border-radius: 2px;
}
/* product pills (Makermint / Enterprise) */
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 1px; text-transform: uppercase;
  color: rgb(var(--accent)); margin-left: 2px;
  border: 1px solid rgb(var(--accent)); border-radius: 999px; padding: 6px 13px;
  transition: color .2s, border-color .2s, background .2s;
}
.pill:hover { background: rgb(var(--accent) / .12); }
.pill .mlogo { height: 11px; width: auto; display: block; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  z-index: 100; pointer-events: none;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase;
  color: rgb(var(--paper));
  background: rgb(var(--ink-2) / .96); backdrop-filter: blur(12px);
  border: 1px solid rgb(var(--accent) / .4); border-radius: 999px;
  padding: 11px 20px; box-shadow: 0 18px 50px rgb(0 0 0 / .5);
  opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility .25s;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.toast .dot { width: 7px; height: 7px; border-radius: 999px; background: rgb(var(--accent));
              box-shadow: 0 0 8px rgb(var(--accent)); }
@media (max-width: 760px) {
  /* stack into two centred rows: brand on top, tabs as a horizontal row beneath */
  header.chrome { flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px var(--pad) 10px; }
  .brand { justify-content: center; }
  /* two centred rows: Mission · Research, then the two product tabs beneath */
  .tabs { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center;
          gap: 4px 6px; width: 100%; }
  .tabs-break { display: block; flex-basis: 100%; height: 0; }
  .tab { padding: 6px 9px; white-space: nowrap; }
  .tab.on::after { left: 9px; right: 9px; bottom: 1px; }
  /* on mobile, show the product tabs as plain text — not pills */
  .pill { border: 0; border-radius: 0; background: none; padding: 6px 7px; margin-left: 0; }
  .pill:hover { background: none; }
  /* the header is now 3 rows tall — extend the top fade down so the green labels read */
  .veil {
    background:
      linear-gradient(180deg, rgb(var(--ink) / .74) 0%, rgb(var(--ink) / .52) 13%, rgb(var(--ink) / 0) 30%),
      radial-gradient(115% 82% at 50% 4%, transparent 46%, rgb(var(--ink) / .5) 100%),
      linear-gradient(rgb(var(--ink) / .22), rgb(var(--ink) / .22));
  }
}

/* ───────────────────────── HERO ───────────────────────── */
.hero { min-height: 100svh; display: flex; align-items: flex-end;
        padding: 120px var(--pad) clamp(40px, 7vh, 78px); }
.hero-card {
  position: relative; width: 100%; max-width: 538px;
  background: rgb(var(--ink-2));
  border: 1px solid rgb(var(--hair) / .1);
  border-radius: 18px;
  padding: clamp(22px, 2.75vw, 38px);
  box-shadow: 0 36px 90px rgb(0 0 0 / .5);
}
html[data-mode="light"] .hero-card { box-shadow: 0 30px 70px rgb(0 0 0 / .14); }
.hc-text {
  margin: 0; font-weight: 500; letter-spacing: -.35px;
  font-size: clamp(17px, 1.7vw, 22px); line-height: 1.42;
  color: rgb(var(--paper)); text-wrap: pretty;
}
.hc-text + .hc-text { margin-top: clamp(12px, 1.6vw, 20px); }
.hc-text .mint { color: rgb(var(--accent)); }
.hc-investors {
  margin-top: clamp(20px, 2.75vw, 32px);
  padding-top: clamp(15px, 2vw, 22px);
  border-top: 1px solid rgb(var(--hair) / .1);
}
.hc-investors .lbl {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; color: rgb(var(--faint));
  display: block; margin-bottom: 14px;
}
.logos { display: flex; flex-wrap: nowrap; align-items: center; gap: 11px 16px; }
.logos .slot {
  font-family: var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: -.2px;
  color: rgb(var(--muted)); transition: color .2s; white-space: nowrap;
}
@media (max-width: 760px) {
  .logos { flex-wrap: wrap; gap: 11px 22px; }
  .logos .slot { font-size: 16px; }
}
.logos .slot:hover { color: rgb(var(--paper)); }
@media (max-width: 540px) { .hero-card { border-radius: 16px; } }

/* ───────────────────────── GENERIC SECTION ───────────────────────── */
.sec { padding-block: clamp(80px, 13vh, 150px); }
.sec-head { display: flex; gap: 16px; align-items: baseline; margin-bottom: clamp(34px, 5vh, 56px); }
.sec-head .idx { flex: none; padding-top: 6px; }

/* mission essay grid */
.mission-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(34px, 6vw, 90px); align-items: start; }
.mission-grid .col-r { display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 820px) { .mission-grid { grid-template-columns: 1fr; gap: 36px; } }

.essay-link {
  margin-top: 10px; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 12px;
  border: 1px solid rgb(var(--hair) / .14); border-radius: 14px;
  padding: 16px 20px; transition: border-color .2s, background .2s, transform .2s;
}
.essay-link:hover { border-color: rgb(var(--accent) / .5); background: rgb(var(--accent) / .05); transform: translateY(-2px); }
.essay-link .t { font-weight: 600; font-size: 15px; }
.essay-link .s { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: rgb(var(--faint)); margin-top: 3px; }
.essay-link .arr { margin-left: 6px; color: rgb(var(--accent)); }

/* ── mission section — GI-style split: full-width title, text rows | glyph-art panel ── */
.mission-sec { padding-top: clamp(70px, 11vh, 130px); padding-bottom: 0; overflow: hidden; }
.mission-head { max-width: none; margin: 0 0 clamp(26px, 4vh, 46px); padding-inline: var(--pad); }
.mission-head .idx { display: block; margin-bottom: 18px; }
.mission-title {
  margin: 0; font-weight: 800; letter-spacing: -2px; line-height: 1.0;
  font-size: clamp(34px, 5.4vw, 78px); max-width: 19ch; text-wrap: balance;
}
.mission-title .mint { color: rgb(var(--accent)); }
.mission-split {
  display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  border-top: 1px solid rgb(var(--hair) / .12);
}
.mission-text { display: flex; flex-direction: column; }
.mrow {
  padding: clamp(22px, 3vw, 36px) clamp(26px, 3.4vw, 52px) clamp(22px, 3vw, 36px) var(--pad);
  border-bottom: 1px solid rgb(var(--hair) / .1);
}
.mrow:last-child { border-bottom: 0; }
.mrow.hl { background: rgb(var(--hair) / .035); }
.mrow p { margin: 0; }
.mrow p strong { color: rgb(var(--paper)); font-weight: 600; }
a.mlink {
  display: flex; flex-direction: column; gap: 5px; margin-top: auto;
  transition: background .2s, padding-left .2s;
}
a.mlink:hover { background: rgb(var(--accent) / .06); padding-left: calc(var(--pad) + 10px); }
a.mlink .ml-t {
  font-family: var(--font-mono); font-weight: 600; font-size: 15px;
  letter-spacing: 1.5px; text-transform: uppercase; color: rgb(var(--paper));
  display: inline-flex; align-items: center; gap: 10px;
}
a.mlink:hover .ml-t { color: rgb(var(--accent)); }
a.mlink .ml-t .arr { color: rgb(var(--accent)); }
a.mlink .ml-s { font-size: 14px; color: rgb(var(--muted)); }
.mission-art {
  position: relative; min-height: 460px; overflow: hidden;
  border-left: 1px solid rgb(var(--hair) / .12);
  background: radial-gradient(125% 100% at 82% 22%, rgb(var(--accent) / .08), rgb(var(--ink-2)) 62%);
}
.mission-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#mission-field { opacity: .42; }
.mission-art::after { /* edge vignette to seat the art */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 80px 10px rgb(var(--ink) / .5);
}
@media (max-width: 820px) {
  .mission-split { grid-template-columns: 1fr; position: relative; --art-h: 340px; }
  /* game-like background moves to the top of the section */
  .mission-art {
    min-height: var(--art-h); border-left: 0; order: -1;
    border-bottom: 1px solid rgb(var(--hair) / .12);
  }
  .mrow { padding-inline: var(--pad); }
  /* hyperlink overlaid on the BOTTOM of the game bg */
  a.mlink {
    position: absolute; top: var(--art-h); left: 0; right: 0; z-index: 5;
    transform: translateY(-100%);
    margin: 0; padding: clamp(24px, 7vw, 40px) var(--pad) clamp(14px, 4vw, 20px);
    background: linear-gradient(0deg, rgb(var(--ink) / .85) 0%, rgb(var(--ink) / .5) 55%, rgb(var(--ink) / 0) 100%);
  }
  a.mlink:hover {
    padding-left: var(--pad);
    background: linear-gradient(0deg, rgb(var(--ink) / .85) 0%, rgb(var(--ink) / .5) 55%, rgb(var(--ink) / 0) 100%);
  }
}

/* ── research cards · tilted horizontal carousel ── */
.patents-sec { padding-top: clamp(64px, 9vh, 110px); padding-bottom: clamp(20px, 3.5vh, 44px); border-top: 1px solid rgb(var(--hair) / .12); }
.patents-head { max-width: none; margin: 0 0 clamp(16px, 2.5vh, 28px); padding-inline: var(--pad); }
.patents-title { margin: 0; font-weight: 800; letter-spacing: -2px; line-height: 1.0;
                 font-size: clamp(34px, 5.4vw, 78px); max-width: 19ch; text-wrap: balance; }
.patents-title .mint { color: rgb(var(--accent)); }

.patents-list { max-width: none; margin: 0; position: relative; }
.pcards {
  display: flex; gap: clamp(16px, 2vw, 26px);
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 50px var(--pad) 83px;
}
.pcards::-webkit-scrollbar { display: none; }

.pcard {
  flex: 0 0 clamp(280px, 30vw, 350px); scroll-snap-align: center;
  background: rgb(var(--ink-2)); border: 1px solid rgb(var(--hair) / .1);
  border-radius: 24px; padding: 22px; display: flex; flex-direction: column;
  transform-origin: 50% 100%; will-change: transform;     /* arch transform set by JS */
  transition: border-color .25s, background .25s, box-shadow .3s;
}
.pcard:hover {
  border-color: rgb(var(--accent) / .4); background: rgb(var(--ink-3));
  box-shadow: 0 28px 56px rgb(0 0 0 / .45);
}

/* granted card links to the patent PDF */
.pcard--link { position: relative; cursor: pointer; }
.pcard--link, .pcard--link:hover, .pcard--link * { text-decoration: none; }
.pcard__open { position: absolute; top: 18px; right: 20px; font-family: var(--font-mono);
               font-size: 16px; line-height: 1; color: rgb(var(--accent) / .55); z-index: 2;
               transition: color .2s, transform .2s; }
.pcard--link:hover .pcard__open { color: rgb(var(--accent)); transform: translate(2px, -2px); }
.pcard__step { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
               text-transform: uppercase; color: rgb(var(--accent)); }
.pcard__title { font-size: 21px; font-weight: 800; letter-spacing: -.5px; margin: 8px 0 7px; line-height: 1.1; }
.pcard__desc { font-size: 13.5px; line-height: 1.5; color: rgb(var(--muted)); margin: 0 0 20px; min-height: 60px; }
.pcard__desc .em { color: rgb(var(--paper)); font-weight: 600; }

.pcard__stage { margin-top: auto; aspect-ratio: 4 / 3; border-radius: 16px; position: relative; overflow: hidden;
  border: 1px solid rgb(var(--hair) / .08); background: rgb(var(--ink)); }
.pcard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* carousel nav arrows */
.pcards-nav { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; gap: 12px; z-index: 120; }
.pnav { width: 46px; height: 46px; border-radius: 999px; cursor: pointer; padding: 0;
  display: grid; place-items: center; font-size: 22px; line-height: 1; font-family: var(--font-sans);
  background: transparent; color: rgb(var(--muted));
  border: 1px solid rgb(var(--hair) / .2); transition: color .2s, border-color .2s, background .2s; }
.pnav:hover { color: rgb(var(--accent)); border-color: rgb(var(--accent) / .5); background: rgb(var(--accent) / .08); }

@media (max-width: 760px) {
  .pcard { flex-basis: 80%; }
}

/* ── team section · GI-style "Team | Background" split ── */
.team-sec { padding-block: clamp(60px, 9vh, 110px) clamp(36px, 5vh, 72px); border-top: 1px solid rgb(var(--hair) / .12); }
.team-split { display: grid; grid-template-columns: 1.12fr 1fr;
  border-top: 1px solid rgb(var(--hair) / .12); border-bottom: 1px solid rgb(var(--hair) / .12); }
.team-col { padding-block: clamp(20px, 3vw, 38px); }
.team-people { padding-inline: var(--pad) clamp(22px, 3vw, 46px); }
.team-bg { border-left: 1px solid rgb(var(--hair) / .12); padding-inline: clamp(22px, 3vw, 46px) var(--pad); }
.col-label { font-size: clamp(19px, 1.9vw, 24px); font-weight: 500; letter-spacing: -.2px;
  color: rgb(var(--faint)); margin: 0 0 clamp(22px, 3.5vh, 38px); }
.team-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(18px, 3vw, 46px); }
.team-member { padding: 14px 0; border-top: 1px solid rgb(var(--hair) / .09); }
.team-member:nth-child(-n+2) { border-top: 0; }
.team-member .nm { font-size: clamp(15.5px, 1.35vw, 18px); font-weight: 500; letter-spacing: -.2px; color: rgb(var(--paper)); }
.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.bg-slot { display: grid; place-items: center; min-height: 96px; padding: 14px 16px;
  border: 1px solid rgb(var(--hair) / .12); border-radius: 12px; background: rgb(var(--ink-2) / .5);
  transition: border-color .2s, background .2s; }
.bg-slot:hover { border-color: rgb(var(--hair) / .22); background: rgb(var(--ink-2)); }
.bg-slot img { max-width: 82%; max-height: 44px; width: auto; height: auto; object-fit: contain; opacity: .8; transition: opacity .2s; }
/* tall crest-style logos read larger */
.bg-slot img.tall { max-height: 68px; max-width: 90%; }
.bg-slot:hover img { opacity: 1; }
@media (max-width: 860px) {
  .team-split { grid-template-columns: 1fr; }
  .team-people { padding-inline: var(--pad); }
  .team-bg { border-left: 0; border-top: 1px solid rgb(var(--hair) / .12); padding-inline: var(--pad); }
}
/* footer — minimal centered */
footer { padding-block: clamp(36px, 5vh, 60px) 40px; position: relative; z-index: 2; background: rgb(var(--ink)); }
footer.foot-min .wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.foot-icons { display: flex; gap: 24px; align-items: center; }
.foot-icons a { color: rgb(var(--faint)); display: inline-flex; transition: color .2s, transform .2s; }
.foot-icons a:hover { color: rgb(var(--paper)); transform: translateY(-2px); }
.foot-icons svg { width: 21px; height: 21px; fill: currentColor; display: block; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 12px; font-size: 15px; color: rgb(var(--muted)); }
.foot-legal a { color: rgb(var(--muted)); transition: color .2s; }
.foot-legal a:hover { color: rgb(var(--paper)); }
.foot-legal .sep { color: rgb(var(--faint)); }
