/* ============ Base ============ */
:root {
  --bg: #0b1020;
  --bg-soft: #101736;
  --surface: #ffffff;
  --surface-alt: #f4f6fb;
  --ink: #131a2e;
  --ink-soft: #4a5470;
  --accent: #4f6df5;
  --accent-2: #22c8dd;
  --line: #dfe4f0;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.6;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }

/* ============ Nav ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
  background: rgba(11, 16, 32, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-brand { display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none; }

.nav-logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-tag { color: #8b94b8; font-size: 0.78rem; }

.nav-links { display: flex; gap: 1.4rem; }
.nav-links a {
  color: #c9d0e8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}
.nav-links a:hover { color: #ffffff; }

/* ============ Hero ============ */
.hero {
  background:
    radial-gradient(1000px 500px at 75% -10%, rgba(79, 109, 245, 0.35), transparent 60%),
    radial-gradient(800px 400px at 15% 110%, rgba(34, 200, 221, 0.18), transparent 60%),
    var(--bg);
  color: #ffffff;
  padding: 6rem 2rem 4rem;
}

.hero-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 3.5rem;
  align-items: center;
}

.hero-inner { text-align: left; }

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--accent-2);
  margin-bottom: 1.2rem;
}

.hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 800; }
.hero-colon { color: var(--accent-2); }

.hero-sub {
  margin: 1.4rem 0 0;
  max-width: 560px;
  color: #b9c1dc;
  font-size: 1.02rem;
}

.hero-media-placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: #8b94b8;
  font-size: 0.9rem;
}

.hero-media-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.1rem;
  color: #c9d0e8;
  padding-left: 4px;
}

/* ============ Sections ============ */
.section { padding: 4.5rem 2rem; max-width: 1080px; margin: 0 auto; }

.section-alt {
  max-width: none;
  background: var(--surface-alt);
  padding-left: max(2rem, calc((100% - 1080px) / 2 + 2rem));
  padding-right: max(2rem, calc((100% - 1080px) / 2 + 2rem));
}

.section h2 { font-size: 1.9rem; margin-bottom: 1rem; }

.section-lead { color: var(--ink-soft); max-width: 760px; margin-bottom: 2.2rem; }

/* ============ Nested loop figure ============ */
.fig-title {
  text-align: center;
  font-size: 1.25rem;
  margin-bottom: 1.4rem;
  color: var(--ink);
}

.fig-outer {
  position: relative;
  background: #eaf3fc;
  border: 2px solid #4a90e2;
  border-radius: 18px;
  padding: 1.1rem 2.6rem 1.2rem 1.2rem;
}

.fig-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.fig-outer-title {
  text-align: center;
  font-weight: 700;
  color: #1d4e8f;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.fig-inner {
  background: #edf8ef;
  border: 2px dashed #4ca866;
  border-radius: 14px;
  padding: 1rem 1.2rem 1.2rem;
}
.fig-inner-title {
  text-align: center;
  font-weight: 700;
  color: #1c6b35;
  font-size: 0.98rem;
  margin-bottom: 1rem;
}

.fig-row { display: flex; justify-content: center; align-items: center; gap: 3rem; }
.fig-row-bottom { flex-wrap: wrap; }
.fig-row-center { margin-bottom: 1.7rem; }

.fig-inner { margin-bottom: 1.7rem; }

.fig-cycle {
  display: grid;
  grid-template-columns: 1fr minmax(1.5rem, 4rem) 1fr;
  gap: 1.6rem 0;
  align-items: center;
  justify-items: center;
}
.fig-cycle .fig-box { width: 100%; max-width: 360px; }
.fig-span {
  grid-column: 1 / -1;
  width: auto;
  min-width: 300px;
}

.fig-box {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0.9rem 1.15rem;
  border-radius: 10px;
  border: 1.5px solid;
  font: inherit;
  font-weight: 600;
  font-size: 0.97rem;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.12s;
}
.fig-box:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(19, 26, 46, 0.12); }
.fig-box.active { box-shadow: 0 0 0 3px rgba(79, 109, 245, 0.45); }

.fig-icon { font-size: 1.25rem; }

.t-blue   { background: #e8f1fc; border-color: #9ec4ec; }
.t-purple { background: #f1ecfb; border-color: #c9b6ea; }
.t-yellow { background: #fdf6e3; border-color: #e6d193; }
.t-green  { background: #e9f7ec; border-color: #a4d8b3; }
.t-teal   { background: #e6f6f4; border-color: #9dd6cf; }

.fig-detail {
  margin-top: 1.4rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  background: var(--surface);
}
.fig-detail h3 { color: var(--accent); font-size: 1.02rem; margin-bottom: 0.4rem; }
.fig-detail p { color: var(--ink-soft); font-size: 0.92rem; }

/* ============ Workflow ============ */
.workflow { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }

.workflow-svg {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfcff, #f2f5fc);
}

.wf-lines path {
  stroke: #aab6d8;
  stroke-width: 2;
  fill: none;
  marker-end: none;
}
.wf-return { stroke-dasharray: 6 5; }

.wf-node { cursor: pointer; }
.wf-node rect {
  fill: #ffffff;
  stroke: #c3cce6;
  stroke-width: 1.5;
  transition: stroke 0.15s, fill 0.15s;
}
.wf-node text {
  text-anchor: middle;
  font-size: 15px;
  font-weight: 600;
  fill: var(--ink);
  pointer-events: none;
}
.wf-node .wf-small { font-size: 11px; font-weight: 400; fill: var(--ink-soft); }
.wf-node:hover rect, .wf-node:focus rect { stroke: var(--accent); }
.wf-node.active rect { stroke: var(--accent); stroke-width: 2.5; fill: #eef1ff; }

.workflow-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  background: var(--surface);
  min-height: 200px;
}
.workflow-detail h3 { color: var(--accent); font-size: 1.05rem; margin-bottom: 0.6rem; }
.workflow-detail p { color: var(--ink-soft); font-size: 0.9rem; }

/* paper / team */
.team-affil { color: var(--ink-soft); font-size: 0.92rem; }
.team-note { font-size: 0.82rem; }

/* ============ Footer ============ */
.footer {
  background: var(--bg);
  color: #a9b2d0;
  padding: 3rem 2rem 1.5rem;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-inner p { max-width: 380px; font-size: 0.88rem; margin-top: 0.5rem; }
.footer-links { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-links a { color: #c9d0e8; text-decoration: none; font-size: 0.88rem; }
.footer-links a:hover { color: #ffffff; }
.footer-copy {
  max-width: 1080px;
  margin: 2.5rem auto 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.2rem;
  font-size: 0.8rem;
}

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .nav { padding: 0.8rem 1rem; }
  .nav-tag { display: none; }
  .nav-links { gap: 0.9rem; flex-wrap: wrap; }
  .workflow { grid-template-columns: 1fr; }
  .hero { padding: 4rem 1.5rem 3rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .fig-box { white-space: normal; font-size: 0.88rem; }
  .fig-span { min-width: 0; }
}
