/* ============================================================
   BASICALLY AI: design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root{
  /* color */
  --bg:        #0a0d13;
  --bg-soft:   #0d1119;
  --surface:   #11151e;
  --surface-2: #161b27;
  --border:    rgba(236,238,243,0.08);
  --border-strong: rgba(236,238,243,0.14);
  --text:      #ecedf3;
  --text-dim:  #aab0c0;
  --text-mute: #6c7283;

  --violet:  #8a7bff;
  --violet-dim: #6258c4;
  --cyan:    #4fd6d0;
  --coral:   #ff8266;
  --amber:   #ffc16a;

  --grad-1: linear-gradient(135deg,#8a7bff 0%,#4fd6d0 100%);
  --grad-2: linear-gradient(135deg,#ff8266 0%,#8a7bff 100%);
  --grad-3: linear-gradient(135deg,#ffc16a 0%,#ff8266 100%);
  --grad-4: linear-gradient(135deg,#4fd6d0 0%,#ffc16a 100%);

  /* type */
  --f-display: 'Manrope', sans-serif;
  --f-body: 'Manrope', sans-serif;
  --f-mono: 'Manrope', sans-serif;

  /* layout */
  --max-w: 1180px;
  --pad: clamp(20px, 5vw, 64px);
  --radius-l: 28px;
  --radius-m: 18px;
  --radius-s: 10px;
}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:var(--f-body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

@media (prefers-reduced-motion: reduce){
  *{animation-duration:0.01ms !important; animation-iteration-count:1 !important; transition-duration:0.01ms !important; scroll-behavior:auto !important;}
}

a{color:inherit; text-decoration:none;}
img{max-width:100%; display:block;}
:focus-visible{outline:2px solid var(--cyan); outline-offset:3px; border-radius:4px;}

::selection{background:var(--cyan); color:var(--bg);}
::-moz-selection{background:var(--cyan); color:var(--bg);}

.wrap{max-width:var(--max-w); margin:0 auto; padding-left:var(--pad); padding-right:var(--pad);}

/* ---------- type scale ---------- */
.eyebrow{
  font-family:var(--f-mono);
  font-size:12.5px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:var(--text-mute);
  display:flex;
  align-items:center;
  gap:10px;
}
.eyebrow::before{
  content:'';
  width:6px; height:6px; border-radius:50%;
  background:var(--grad-1);
  flex-shrink:0;
}

h1,h2,h3,h4{font-family:var(--f-display); font-weight:500; letter-spacing:-0.01em; color:var(--text);}

.h-hero{
  font-size:clamp(2.6rem, 6.4vw, 5.2rem);
  line-height:1.04;
  font-weight:500;
  letter-spacing:-0.025em;
}
.h-section{
  font-size:clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight:500;
  line-height:1.15;
}
.h-card{
  font-size:1.5rem;
  font-weight:500;
  line-height:1.25;
}
p{color:var(--text-dim);}
.lede{font-size:clamp(1.05rem,1.6vw,1.25rem); color:var(--text-dim); max-width:42em; line-height:1.65;}

/* ---------- nav ---------- */
header.site-nav{
  position:fixed; top:0; left:0; right:0; z-index:100;
  padding:22px var(--pad);
  display:flex; align-items:center; justify-content:space-between;
  backdrop-filter:blur(14px);
  background:linear-gradient(to bottom, rgba(10,13,19,0.82), rgba(10,13,19,0));
  transition:background .3s ease, border-color .3s ease;
  border-bottom:1px solid transparent;
}
header.site-nav.scrolled{
  background:rgba(10,13,19,0.78);
  border-bottom:1px solid var(--border);
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-family:var(--f-display); font-size:1.15rem; font-weight:500; letter-spacing:-0.01em;
  color:var(--text);
}
.brand-mark{
  width:24px; height:24px;
  object-fit:contain;
  flex-shrink:0;
}
footer .brand-mark{width:26px; height:26px;}
nav.nav-links{display:flex; gap:34px; align-items:center;}
nav.nav-links a{
  font-size:14px; color:var(--text-dim); font-weight:500;
  position:relative; padding:4px 0;
  transition:color .2s ease;
}
nav.nav-links a:hover{color:var(--text);}
nav.nav-links a::after{
  content:''; position:absolute; left:0; bottom:-2px; height:1px; width:0;
  background:var(--grad-1); transition:width .25s ease;
}
nav.nav-links a:hover::after{width:100%;}
.nav-toggle{display:none; background:none; border:none; color:var(--text); cursor:pointer;}

@media (max-width:820px){
  nav.nav-links{
    position:fixed; top:0; right:0; height:100vh; width:78%; max-width:340px;
    background:var(--bg-soft); border-left:1px solid var(--border);
    flex-direction:column; justify-content:center; align-items:flex-start;
    gap:26px; padding:40px var(--pad);
    transform:translateX(100%); transition:transform .35s cubic-bezier(.65,0,.35,1);
  }
  nav.nav-links.open{transform:translateX(0);}
  nav.nav-links a{font-size:1.15rem;}
  .nav-toggle{display:block;}
}

/* ---------- hero ---------- */
.hero{
  position:relative;
  min-height:100vh;
  display:flex; flex-direction:column; justify-content:center;
  padding-top:120px; padding-bottom:80px;
  overflow:hidden;
}
#bg-canvas{
  position:fixed; inset:0; z-index:-1;
  width:100%; height:100%;
}
.hero-content{position:relative; z-index:2;}
.hero-content .eyebrow{margin-bottom:26px;}
.hero-content h1{margin-bottom:28px; max-width:14ch;}
.hero-cta{display:flex; gap:16px; margin-top:38px; flex-wrap:wrap;}

.typing-caret::after{
  content:'';
  display:inline-block;
  width:2px;
  height:0.9em;
  margin-left:2px;
  vertical-align:-0.1em;
  background:var(--cyan);
  animation:caretBlink 0.9s step-end infinite;
}
@keyframes caretBlink{
  0%, 49%{opacity:1;}
  50%, 100%{opacity:0;}
}

.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:13px 26px; border-radius:100px;
  font-size:14.5px; font-weight:500; font-family:var(--f-body);
  cursor:pointer; border:1px solid transparent;
  transition:transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s ease, background .25s ease;
}
.btn:hover{transform:translateY(-2px);}
.btn-primary{
  background:var(--text); color:var(--bg);
}
.btn-primary:hover{background:#fff;}
.btn-ghost{
  border-color:var(--border-strong); color:var(--text);
  background:rgba(255,255,255,0.02);
}
.btn-ghost:hover{border-color:var(--cyan); background:rgba(79,214,208,0.06);}

.scroll-hint{
  position:absolute; bottom:38px; left:var(--pad);
  font-family:var(--f-mono); font-size:11.5px; color:var(--text-mute);
  display:flex; align-items:center; gap:10px;
  letter-spacing:0.08em; text-transform:uppercase;
}
.scroll-hint .line{width:32px; height:1px; background:var(--text-mute); position:relative; overflow:hidden;}
.scroll-hint .line::after{
  content:''; position:absolute; left:-100%; top:0; bottom:0; width:100%;
  background:var(--cyan); animation:scrollline 2.4s ease-in-out infinite;
}
@keyframes scrollline{0%{left:-100%;}50%{left:0;}100%{left:100%;}}

/* ---------- section frame ---------- */
section{padding:118px 0; position:relative;}
.section-head{
  display:flex; justify-content:space-between; align-items:flex-end;
  gap:40px; margin-bottom:58px; flex-wrap:wrap;
}
.section-head .copy{max-width:560px;}
.section-head h2{margin-top:14px;}
.section-head p{margin-top:14px;}

/* ---------- flagship cards ---------- */
.flagship-list{display:flex; flex-direction:column; gap:26px;}
.flagship-card{
  display:grid; grid-template-columns:1fr 1.1fr;
  gap:0; border:1px solid var(--border); border-radius:var(--radius-l);
  overflow:hidden; background:var(--surface);
  transition:border-color .35s ease, transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease;
  position:relative;
}
.flagship-card:hover{
  border-color:var(--border-strong);
  transform:translateY(-4px);
  box-shadow:0 30px 60px -30px rgba(0,0,0,0.6);
}
.flagship-card:nth-child(even){grid-template-columns:1.1fr 1fr;}
.flagship-card:nth-child(even) .fc-art{order:2;}
.fc-art{
  position:relative; min-height:300px; overflow:hidden;
}
.fc-art canvas, .fc-art svg{width:100%; height:100%; display:block;}
.fc-body{padding:46px 44px; display:flex; flex-direction:column; justify-content:center; gap:18px;}
.fc-status{
  display:inline-flex; align-self:flex-start; align-items:center; gap:7px;
  font-family:var(--f-mono); font-size:11px; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--text-mute); border:1px solid var(--border-strong); border-radius:100px;
  padding:5px 12px 5px 10px;
}
.fc-status .dot{width:6px; height:6px; border-radius:50%; background:var(--cyan);}
.fc-status.live .dot{background:#5fe09a;}
.fc-status.beta .dot{background:var(--amber);}
.fc-links{display:flex; gap:22px; margin-top:6px;}
.fc-links a{font-size:13.5px; font-weight:500; color:var(--text-dim); display:flex; align-items:center; gap:6px; transition:color .2s;}
.fc-links a:hover{color:var(--text);}
.fc-links a svg{width:12px; height:12px; transition:transform .2s;}
.fc-links a:hover svg{transform:translate(2px,-2px);}

@media (max-width:880px){
  .flagship-card, .flagship-card:nth-child(even){grid-template-columns:1fr;}
  .flagship-card:nth-child(even) .fc-art{order:0;}
  .fc-art{min-height:220px;}
  .fc-body{padding:34px 28px;}
}

/* ---------- experiments grid ---------- */
.exp-grid{
  display:grid; grid-template-columns:repeat(3, 1fr); gap:22px;
}
.exp-card{
  border:1px solid var(--border); border-radius:var(--radius-m);
  background:var(--surface); overflow:hidden;
  transition:transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s ease;
  display:flex; flex-direction:column;
}
.exp-card:hover{transform:translateY(-5px); border-color:var(--border-strong);}
.exp-card:nth-child(3n+1){grid-row:span 1;}
.exp-card .ec-art{height:160px; position:relative; overflow:hidden;}
.exp-card .ec-art canvas{width:100%; height:100%;}
.ec-body{padding:26px 26px 30px;}
.ec-tag{font-family:var(--f-mono); font-size:11px; color:var(--text-mute); text-transform:uppercase; letter-spacing:.08em; margin-bottom:10px; display:block;}
.exp-card h3{font-size:1.18rem; margin-bottom:10px; font-weight:500;}
.exp-card p{font-size:14.5px; line-height:1.55;}

@media (max-width:980px){.exp-grid{grid-template-columns:repeat(2,1fr);}}
@media (max-width:620px){.exp-grid{grid-template-columns:1fr;}}

.exp-grid-single{grid-template-columns:minmax(0,480px);}
.exp-grid-single .ec-art{height:240px;}
@media (max-width:980px){.exp-grid-single{grid-template-columns:1fr;}}

/* ---------- research list ---------- */
.research-list{border-top:1px solid var(--border);}
.research-item{
  display:grid; grid-template-columns:120px 1fr auto; gap:28px;
  align-items:center; padding:26px 0; border-bottom:1px solid var(--border);
  transition:padding-left .3s ease;
}
a.research-item{cursor:pointer;}
.research-item:hover{padding-left:10px;}
.research-item .ri-type{
  font-family:var(--f-mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-mute);
}
.research-item .ri-main h3{font-size:1.08rem; font-weight:500; margin-bottom:5px; transition:color .2s ease;}
a.research-item:hover .ri-main h3{color:var(--cyan);}
.research-item .ri-main p{font-size:13.5px; color:var(--text-mute);}
.research-item .ri-meta{font-family:var(--f-mono); font-size:12px; color:var(--text-mute); white-space:nowrap;}

@media (max-width:680px){
  .research-item{grid-template-columns:1fr; gap:8px;}
  .research-item .ri-meta{order:3;}
}

/* ---------- lab notes ---------- */
.notes-list{display:flex; flex-direction:column;}
.note-item{
  display:flex; gap:32px; padding:34px 0; border-bottom:1px solid var(--border);
  align-items:baseline; flex-wrap:wrap;
}
.note-item:first-child{padding-top:0;}
.note-date{font-family:var(--f-mono); font-size:12px; color:var(--text-mute); width:90px; flex-shrink:0;}
.note-main{flex:1; min-width:240px;}
.note-main h3{font-size:1.2rem; font-weight:500; margin-bottom:8px;}
.note-main p{font-size:14.5px;}
.note-main a{display:inline-block; margin-top:12px; font-size:13px; font-weight:500; color:var(--text); border-bottom:1px solid var(--border-strong); padding-bottom:2px;}

/* ---------- footer ---------- */
footer{
  border-top:1px solid var(--border); padding:64px 0 40px;
  margin-top:60px;
}
.footer-top{
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:40px;
  padding-bottom:40px; margin-bottom:30px; border-bottom:1px solid var(--border);
}
.footer-cols{display:flex; gap:70px; flex-wrap:wrap;}
.footer-col h4{font-family:var(--f-mono); font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-mute); font-weight:500; margin-bottom:16px;}
.footer-col a{display:block; font-size:14px; color:var(--text-dim); margin-bottom:11px; transition:color .2s;}
.footer-col a:hover{color:var(--text);}
.footer-bottom{display:flex; justify-content:space-between; font-size:12.5px; color:var(--text-mute); flex-wrap:wrap; gap:10px;}

/* ---------- about page specific ---------- */
.about-hero{padding-top:160px; padding-bottom:80px;}
.about-hero h1{max-width:16ch;}
.principles{display:grid; grid-template-columns:repeat(2,1fr); gap:1px; background:var(--border); border:1px solid var(--border); border-radius:var(--radius-l); overflow:hidden;}
.principle{background:var(--surface); padding:40px; transition:background .3s ease;}
.principle:hover{background:var(--surface-2);}
.principle .eyebrow{margin-bottom:16px;}
.principle h3{font-size:1.25rem; margin-bottom:12px; font-weight:500;}
.principle p{font-size:14.5px;}
@media (max-width:700px){.principles{grid-template-columns:1fr;}}

.about-statement{max-width:780px;}
.about-statement p{font-size:clamp(1.05rem,1.6vw,1.3rem); color:var(--text-dim); line-height:1.75; margin-bottom:24px;}
.about-statement p:first-of-type{color:var(--text); font-family:var(--f-display); font-size:clamp(1.4rem,2.4vw,1.85rem); font-weight:400; line-height:1.5;}

.areas-strip{display:flex; flex-wrap:wrap; gap:12px; margin-top:30px;}
.area-pill{
  font-family:var(--f-mono); font-size:12.5px; padding:9px 18px; border:1px solid var(--border-strong);
  border-radius:100px; color:var(--text-dim);
}

/* ---------- glass surface util ---------- */
.glass{
  background:rgba(255,255,255,0.025);
  backdrop-filter:blur(20px);
  border:1px solid var(--border);
}

/* ---------- reveal-on-scroll ---------- */
.reveal{opacity:0; transform:translateY(28px); transition:opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1);}
.reveal.in{opacity:1; transform:translateY(0);}

/* ============================================================
   RESEARCH ARTICLE
   ============================================================ */
.paper-hero{
  padding-top:152px; padding-bottom:64px; border-bottom:1px solid var(--border);
}
.paper-hero .back-link{
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--f-mono); font-size:12.5px; color:var(--text-mute);
  margin-bottom:34px; transition:color .2s ease;
}
.paper-hero .back-link:hover{color:var(--cyan);}
.paper-hero .back-link svg{transform:rotate(180deg); width:11px; height:11px;}
.paper-hero .eyebrow{margin-bottom:22px;}
.paper-hero h1{font-size:clamp(2rem,4.2vw,3.1rem); line-height:1.12; max-width:18ch;}
.paper-meta{
  display:flex; gap:22px; flex-wrap:wrap; margin-top:26px;
  font-family:var(--f-mono); font-size:12.5px; color:var(--text-mute);
}

.paper-body{padding-top:70px;}
.paper-grid{
  display:grid; grid-template-columns:200px minmax(0,1fr); gap:64px;
  align-items:start;
}
.paper-toc{
  position:sticky; top:120px;
  display:flex; flex-direction:column; gap:13px;
}
.paper-toc .toc-label{font-family:var(--f-mono); font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-mute); margin-bottom:6px;}
.paper-toc a{font-size:13.5px; color:var(--text-mute); transition:color .2s ease; line-height:1.4;}
.paper-toc a:hover, .paper-toc a.active{color:var(--text);}

.paper-content{max-width:720px; color:var(--text-dim);}
.paper-content h2{
  font-size:1.55rem; font-weight:500; color:var(--text);
  margin-top:64px; margin-bottom:20px; padding-top:8px;
  scroll-margin-top:110px;
}
.paper-content h2:first-of-type{margin-top:0;}
.paper-content h3{
  font-size:1.15rem; font-weight:500; color:var(--text);
  margin-top:38px; margin-bottom:14px;
  scroll-margin-top:110px;
}
.paper-content p{font-size:15.5px; line-height:1.75; margin-bottom:18px;}
.paper-content em{color:var(--text-dim); font-style:italic;}
.paper-content strong{color:var(--text); font-weight:600;}
.paper-content ul{margin:0 0 20px 0; padding-left:22px; display:flex; flex-direction:column; gap:9px;}
.paper-content ul li{font-size:15px; line-height:1.65; color:var(--text-dim);}
.paper-content ul li::marker{color:var(--cyan);}
.paper-content hr{border:none; border-top:1px solid var(--border); margin:48px 0;}
.paper-content a{color:var(--text); border-bottom:1px solid var(--border-strong); transition:border-color .2s ease;}
.paper-content a:hover{border-color:var(--cyan);}

.paper-content code{
  font-family:var(--f-mono); font-size:0.86em;
  background:var(--surface-2); border:1px solid var(--border);
  padding:2px 7px; border-radius:5px; color:var(--cyan);
}
.paper-content pre{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-s);
  padding:20px 22px; overflow-x:auto; margin-bottom:22px;
}
.paper-content pre code{
  background:none; border:none; padding:0; color:var(--text-dim); font-size:13.5px; line-height:1.6;
}

.paper-content .mjx-chtml{color:var(--text-dim) !important;}

.results-table{
  width:100%; border-collapse:collapse; font-size:14px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-s);
  overflow:hidden;
}
.results-table thead th{
  text-align:left; font-family:var(--f-mono); font-size:11px; text-transform:uppercase; letter-spacing:.06em;
  color:var(--text-mute); font-weight:500; padding:14px 16px; border-bottom:1px solid var(--border-strong);
  background:var(--surface-2);
}
.results-table tbody td{
  padding:13px 16px; border-bottom:1px solid var(--border); color:var(--text-dim);
  font-variant-numeric:tabular-nums;
}
.results-table tbody tr:last-child td{border-bottom:none;}
.results-table tbody tr:hover{background:rgba(255,255,255,0.015);}
.results-table tbody td:first-child{color:var(--text); font-weight:500;}

@media (max-width:880px){
  .paper-grid{grid-template-columns:1fr;}
  .paper-toc{display:none;}
  .results-table{font-size:12.5px;}
  .results-table thead th, .results-table tbody td{padding:10px 10px;}
}
