:root {
  --bg:      #0d1117;
  --bg2:     #161b22;
  --bg3:     #1c2330;
  --border:  #30363d;
  --text:    #0f1f3d;   /* JYU deep navy — main text */
  --muted:   #4a5a72;   /* medium navy-grey — readable on white */
  --accent:  #e8500a;   /* JYU flame orange */
  --accent2: #1a2b5e;   /* JYU deep navy */
  --green:   #3fb950;
  --amber:   #d29922;
  --mono:    'IBM Plex Mono', monospace;
  --sans:    'IBM Plex Sans', sans-serif;
  /*--serif:   'Source Serif 4', Georgia, serif;  /* h1/h2 referenced this but it
                                                   was never declared, so every
                                                   heading silently fell back to
                                                   --sans and the Source Serif 4
                                                   webfont was loaded unused. */
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: #fffafada; color: var(--text); font-size: 14px; line-height: 1.65; }

/* Nav */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--accent2);
  height: 52px; padding: 0 2rem;
  display: flex; align-items: center;
  justify-content: space-between;   /* ← flex-start */
  gap: 1rem;                     /* ← space between brand and orange text */
}
.nav-brand { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--accent2); text-decoration: none; letter-spacing: -0.01em; }
.nav-brand span { color: var(--accent); font-weight: 700; }
.nav-links { display: flex; gap: 1.8rem; list-style: none; }
.nav-links a { font-family: var(--sans); font-size: 12px; color: var(--accent2); text-decoration: none; transition: color 0.15s; font-weight: 500; opacity: 0.75; }
.nav-links a:hover { color: var(--accent2); }

/* Hero two-column */
.hero-wrap {
  max-width: 1200px; margin: 0 auto;
  padding: 30px 2rem 3rem;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 3rem; align-items: start;
}
.hero-left {
  padding-top: 3rem;
  padding-left: 1.5rem;
  position: relative;
  /* border-left removed — handled by ::before instead */
}

.hero-left::before {
  content: '';           /* required or it won't show */
  position: absolute;    /* required */
  left: 0;               /* required */
  top: 3rem;             /* move this to push line down */
  height: 560px;         /* length of the line */
  width: 3px;            /* thickness */
  background: var(--accent);
  border-radius: 2px;
}

.hero-tag {
  font-family: var(--sans); font-size: 11px; color: var(--accent); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.hero-tag::before { content:''; width: 3px; height: 16px; background: var(--accent); display: inline-block; border-radius: 2px; }
h1 { font-size: clamp(1.5em,5vw,2.8rem); font-weight: 300; line-height: 1.15; letter-spacing: -0.02em; margin-top: 0rem; margin-bottom: 1.1rem; font-family: var(--serif); color: var(--accent2); }
/*h1 em { font-style: italic; color: var(--accent); font-weight: 400; font-size: clamp(.9em,2vw,2.8rem);} */
h1 em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero-sub { font-size: 0.95rem; color: #2a523b; max-width: 420px; margin-bottom: 2rem; line-height: 1.8; font-weight: 400; }
.hero-buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 2.5rem; width: 100%; }
.hero-buttons .btn {
  flex: 1;               /* each button takes equal share */
  justify-content: center; /* center the text inside */
}
.btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 1rem; border-radius: 6px; font-size: 13px; font-weight: 500; text-decoration: none; transition: all 0.15s; font-family: var(--sans); border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.btn-primary:hover { background: #c94008; box-shadow: 0 4px 14px rgba(232,80,10,0.3); }
/*.btn-primary:hover { background: var(--accent); box-shadow: 0 4px 14px rgba(232,80,10,0.3); }*/
.btn-secondary { background: var(--bg); color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { border-color: var(--accent); background: var(--accent); color: #fff; }
.stats-inline { display: flex; gap: 2rem; flex-wrap: wrap; padding: 1.2rem 1.4rem; background: #ffffff; border-radius: 8px; border: 1px solid var(--border); margin-top: 0.5rem; box-shadow: 0 1px 4px rgba(26,43,94,0.06); }
.stat-n { font-family: var(--mono); font-size: 1.6rem; font-weight: 500; color: var(--accent); display: block; line-height: 1; }
.stat-l { font-family: var(--mono); font-size: 9px; color: var(--accent2); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; opacity: 0.7; }

/* ── Code panel ── */
.code-body {
  position: relative;
  padding-top: 1rem;   /* ← controls space above first line */
  padding-bottom: 1rem;
  overflow: hidden;
  cursor: default;
}

.hero-right {
  position: sticky; top: 64px;
  background: #0d1117; border-radius: 10px; overflow: hidden;
  border: 1px solid #2a3448;
  box-shadow: 0 8px 40px rgba(26,43,94,0.18);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  margin-top: 3rem;   /* push code panel up/down */
}
.code-header {
  background: #1a2535; padding: 0.5rem 1rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #2a3448;
}
.code-dots { display: flex; gap: 5px; }
.code-dots span { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f57; } .dot-y { background: #febc2e; } .dot-g { background: #28c840; }
.code-title { font-family: var(--mono); font-size: 10px; color:#676f79; }

/* ── Brain figure ── */
.brain-figure {
  overflow: hidden;
  grid-column: 2;
  margin-top: 0rem;
  border-radius: 0 0 10px 10px;
  border: 0px solid #2a3448;
  text-align: center;   /* ← centers the image */
  border: 0px solid #2a3448;
}

.brain-figure img {
  display: block;
  height: auto;
  width: auto;
  margin: 0 auto;
  max-width: 100%;
  opacity: 0.92;
}

.figure-banner {
  max-width: 1150px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
  background: #ffffff;
}

.figure-banner img {
  width: 700px;
  max-width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  opacity: 0.95;
  display: block;
  margin: 0 auto;
}


/* All lines */
.code-line {
  display: grid; grid-template-columns: 30px 1fr;
  font-family: var(--mono); font-size: 12px; line-height: 1.9;   /* this line height must match the JS lineH variable for hover to align correctly! */
  padding: 0 1rem 0 0;
  position: relative; z-index: 1;
}
.ln { color: #3a4155; text-align: right; padding-right: 0.8rem; user-select: none; font-size: 10px; padding-top: 2px; }
.lc { color: #e6edf3; white-space: pre; }
.c-c { color: #8b949e; font-style: italic; }
.c-f { color: #79c0ff; }
.c-s { color: #a5d6ff; }
.c-n { color: #79c0ff; }
.c-k { color: #ff7b72; }
.c-v { color: #e6edf3; }
.c-step { color: var(--accent); font-weight: 500; }

/* ── Overlay panels ── */
.overlay-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}
.overlay-container.active {
  pointer-events: auto;
}

.overlay-block {
  position: absolute;
  left: 0; right: 0;
  background: transparent;
  border-radius: 7px;
  border: 1px solid transparent;
  margin: 0 6px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 10px;
  cursor: default;
  transition: background 0.18s ease, border-color 0.18s ease;
  pointer-events: auto;
}

/* Individual hovered block */
.overlay-block.hovered {
  background: rgba(26, 43, 94, 0.75); /* last: transparent fill individual panels */
  backdrop-filter: blur(1.5px);/*to enable backdrop blur */
  -webkit-backdrop-filter: blur(1px);
  border-color: rgba(232,80,10,0.7);
  box-shadow: none;
}

/* When any block is hovered, dim the non-hovered lines via a backdrop */
.overlay-container.any-hovered .overlay-backdrop {
  opacity: 1;
}
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: opacity 0.18s ease;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.overlay-num {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--accent); white-space: nowrap; letter-spacing: 0.05em;
  opacity: 0; transition: opacity 0.18s ease;
}
.overlay-block.hovered .overlay-num { opacity: 1; }

.overlay-label {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: #eef2ff; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
  opacity: 0; transition: opacity 0.18s ease;
}
.overlay-block.hovered .overlay-label { opacity: 1; }

.overlay-divider {
  width: 1px; background: rgba(88,166,255,0.3); align-self: stretch; margin: 6px 0;
  opacity: 0; transition: opacity 0.18s ease;
}
.overlay-block.hovered .overlay-divider { opacity: 1; }

/* Hint */
.code-hint {
  position: absolute; bottom: 8px; right: 12px;
  font-family: var(--mono); font-size: 9px; color: #7d8590;
  opacity: 1; transition: opacity 0.25s;
  pointer-events: none; z-index: 12;
}
.overlay-container.any-hovered ~ .code-hint { opacity: 0; }

/* Sections */
hr.divider { border: none; border-top: 1px solid var(--border); max-width: 1150px; margin: 0 auto; }
.section { max-width: 1150px; margin: 0 auto; padding: 3rem 2rem; }
/*.section:nth-of-type(even) { background: var(--bg2); }*/
.section-label { font-family: var(--mono); font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 0.4rem; font-weight: 600; }
h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 0.5rem; font-family: var(--serif); color: var(--accent2); }
.section-intro { color: #1e3050; font-size: 0.9rem; margin-bottom: 1.8rem; max-width: 520px; font-weight: 400; }

/* Module cards */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 1rem; }
.module-card { background: #ffffff; border: 1px solid var(--border); border-radius: 8px; padding: 1.2rem 1.4rem; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; box-shadow: 0 1px 6px rgba(26,43,94,0.07); }
.module-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 4px 16px rgba(232,80,10,0.1); }
.module-icon { width: 32px; height: 32px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 0.8rem; }
.module-name { font-size: 13px; font-weight: 600; color: var(--accent2); margin-bottom: 0.3rem; }
.module-desc { font-size: 12px; color: #3a4e66; line-height: 1.5; }
.module-fns { margin-top: 0.8rem; font-family: var(--mono); font-size: 10px; color: #1a2b5eaa; line-height: 1.7; }

/* Features */
.feature-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 2.5rem; }
.feature { display: flex; gap: 0.5rem; align-items: flex-start; }
.feature-check { color: var(--accent); font-size: 14px; margin-top: 2px; flex-shrink: 0; font-weight: 700; }
.feature-text { color: #1a2b4a; line-height: 1.6; font-size: 13px; }
.feature-text strong { color: #0f1f3d; font-weight: 700; }

/* Atlas */
.atlas-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.atlas-item { background: #ffffff; padding: 0.45rem 0.8rem; display: flex; justify-content: space-between; align-items: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: background 0.15s; }
.atlas-item:hover { background: #fff5f0; }
.atlas-item:nth-child(2n) { border-right: none; }
.atlas-name { font-size: 12px; color: var(--text); }
.atlas-rois { font-family: var(--mono); font-size: 10px; color: var(--accent2); background: rgba(26,43,94,0.08); padding: 1px 5px; border-radius: 3px; }

.atlas-name a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}
.atlas-name a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
/* Install */
.install-box { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #ffffff; }
.install-row { display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 1rem; padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); transition: background 0.15s;}
.install-row:hover { background: #ff510054; border-left: 3px solid var(--accent); padding-left: calc(1rem - 3px); }
.install-row:last-child { border-bottom: none; }
.install-step { font-family: var(--mono); font-size: 9px; color: var(--accent); font-weight: 600; }
.install-code { font-family: var(--mono); font-size: 12px; color: #1a2b5e; font-weight: 500; }
.install-desc { font-size: 11px; color: #3a4e66; text-align: right; }

#install { background: #1a2b5e; }
#install h2 { color: #ffffff; }
#install .section-label { color: #e8500a; }
#install .section-intro { color: #a0b4d0; }
#install p { color: #d6d2d2; }
#install .install-code { color: #eef2ff; }
#install .install-desc { color: #97999b; }
#install .install-box { background: #243470a2; border-color: #4e67d6; }
#install .install-row { border-color: #4e67d6; }

/* Publications */
.pub-list { display: flex; flex-direction: column; background: #ffffff; border: 1px solid var(--border); border-radius: 8px; padding: 0 1.2rem; }
.pub-item { display: grid; grid-template-columns: 36px 1fr; gap: 0.8rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.pub-item:last-child { border-bottom: none; }
.pub-year { font-family: var(--mono); font-size: 10px; color: var(--accent2); opacity: 0.6; }
.pub-journal { font-size: 9px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.1rem; font-family: var(--mono); }
.pub-title { font-size: 13px; color: var(--accent2); line-height: 1.45; }
.pub-authors { font-size: 11px; color: #4a5a72; margin-top: 0.15rem; }

.pub-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid #c0cce0;
  transition: border-color 0.15s, color 0.15s;
}
.pub-title a:hover {
  color: var(--accent);
  border-color: var(--accent);
}



/* Footer */
footer { border-top: 3px solid var(--accent2); padding: 1.4rem 2rem; text-align: center; color: #3a4e66; font-size: 11px; font-family: var(--mono); max-width: 1150px; margin: 0 auto; background: #f4f6f9; }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Animations */
@keyframes fadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
.hero-left > * { animation: fadeUp 0.55s ease both; }
.hero-left > *:nth-child(1) { animation-delay: 0.05s; }
.hero-left > *:nth-child(2) { animation-delay: 0.13s; }
.hero-left > *:nth-child(3) { animation-delay: 0.21s; }
.hero-left > *:nth-child(4) { animation-delay: 0.29s; }
.hero-left > *:nth-child(5) { animation-delay: 0.37s; }
.hero-right { animation: fadeUp 0.7s ease 0.2s both; }

/* ── Wordmark (was inline styles on the hero div) ── */
.wordmark { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.wordmark-logo { height: 60px; width: auto; flex-shrink: 0; }
.wordmark-text {
  font-family: var(--sans); font-size: 3rem; font-weight: 700;
  color: var(--accent2); line-height: 1.05;
}
.wordmark-text em { color: var(--accent); font-style: normal; }

@media (max-width: 760px) {
  /* nav — keep one line instead of clipping "Publications" */
  nav { padding: 0 1rem; gap: 0.6rem; }
  .nav-brand { white-space: nowrap; }
  .nav-links { gap: 0.7rem; }
  .nav-links a { font-size: 11px; white-space: nowrap; }

  /* hero */
  .hero-wrap { grid-template-columns: 1fr; padding: 30px 1rem 2rem; gap: 2rem; }
  .hero-left { padding-left: 1rem; }
  .hero-right { position: static; margin-top: 0; }
  .hero-sub { max-width: none; }
  .hero-buttons .btn { flex: 1 1 auto; }

  /* wordmark */
  .wordmark { gap: 0.6rem; margin-bottom: 1rem; }
  .wordmark-logo { height: 40px; }
  .wordmark-text { font-size: 1.75rem; }

  /* code panel — scroll the long lines instead of cutting them off */
  .code-body { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }

  /* content grids */
  .atlas-grid { grid-template-columns: 1fr; }
  .feature-cols { grid-template-columns: 1fr; }
  .install-row { grid-template-columns: 18px 1fr; gap: 0.4rem 0.8rem; }
  .install-desc { grid-column: 2; text-align: left; }

  /* gutters */
  .section { padding: 2.5rem 1rem; }
  .figure-banner { padding: 1rem; }
  footer { padding: 1.2rem 1rem; }
}
/* Very narrow phones: the hero wordmark names the site, so the nav brand
   can step aside and leave the full width for the section links. */
@media (max-width: 460px) {
  .nav-brand { display: none; }
  .nav-links { gap: 0.9rem; width: 100%; justify-content: space-between; }
  .nav-links a { font-size: 11px; }
}

/* Long clone URLs and paths must wrap on a phone rather than run off the card. */
@media (max-width: 760px) {
  .install-code { overflow-wrap: anywhere; word-break: break-word; }
}
