/*
  HelixPoint Biomedical Lab — Layout System
  Modern app shell, floating top navigation, sidebar, main workspace, 2-col task grids
*/

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 6% 6%, rgba(108, 92, 231, 0.08), transparent 30rem),
    radial-gradient(circle at 92% 10%, rgba(22, 184, 196, 0.09), transparent 28rem),
    radial-gradient(circle at 50% 85%, rgba(108, 92, 231, 0.04), transparent 32rem),
    linear-gradient(180deg, var(--bg-gradient-1) 0%, var(--bg) 45%, var(--bg-gradient-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  accent-color: var(--brand);
}

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 18px 22px 36px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================
   TOP NAVIGATION
   ========================================= */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 10px 14px 10px 18px;
  border: 1px solid rgba(210, 222, 234, 0.85);
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), #8A7CFF 55%, var(--brand-2));
  box-shadow: 0 10px 22px rgba(108, 92, 231, 0.26);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.brand:hover .brand-mark {
  transform: scale(1.04);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-copy span {
  display: block;
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 12px;
  min-height: 42px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 650;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.nav-btn:hover {
  background: rgba(240, 244, 250, 0.9);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-border);
}

.nav-btn:focus-visible,
.icon-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: #f4f6fa;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* =========================================
   WORKSPACE GRID & SIDEBAR
   ========================================= */
.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 102px;
  align-self: start;
  padding: 20px;
  border: 1px solid var(--border);
  background: var(--surface-translucent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eyebrow::before {
  content: "";
  width: 16px;
  height: 2.5px;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.sidebar h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 10px 0 6px;
  color: var(--text-primary);
}

.sidebar p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.stage-list {
  display: grid;
  gap: 8px;
}

.stage {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--text-secondary);
  background: transparent;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.stage:hover {
  background: #f7f9fc;
  color: var(--text-primary);
}

.stage.active {
  background: var(--brand-soft);
  border-color: var(--brand-border);
  color: var(--brand);
}

.stage-num {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #EDF2F7;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 12px;
  transition: all var(--transition-fast);
}

.stage.active .stage-num {
  background: linear-gradient(135deg, var(--brand), #8C7FFF);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.28);
}

.stage.completed .stage-num {
  background: var(--green-soft);
  color: var(--green-dark);
}

.stage-title {
  font-size: 13.5px;
  font-weight: 750;
  display: block;
}

.stage-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 1px;
  display: block;
}

.stage.active .stage-sub {
  color: #796be6;
}

.check {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
}

/* Sidebar Score Meter */
.score-card {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--brand-2-border);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, var(--brand-2-soft), #FBFFFF);
}

.score-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-end;
}

.score-card strong {
  font-size: 24px;
  font-weight: 850;
  color: var(--brand-2-dark);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.score-card span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5C768A;
}

.meter {
  height: 8px;
  border-radius: var(--radius-pill);
  background: #DFECEF;
  overflow: hidden;
  margin-top: 10px;
}

.meter > i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-2), #5EE2D8);
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================
   MAIN APPLICATION WORKSPACE
   ========================================= */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.22s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   HERO / INTRO SECTION
   ========================================= */
.hero {
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 24px;
  padding: 34px 36px;
  border: 1px solid var(--border);
  background: var(--surface-translucent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -100px;
  top: -120px;
  border-radius: 50%;
  border: 44px solid rgba(108, 92, 231, 0.055);
  box-shadow: 0 0 0 46px rgba(22, 184, 196, 0.03);
  pointer-events: none;
}

.status-pill {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-2-soft);
  color: var(--brand-2-dark);
  border: 1px solid var(--brand-2-border);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #20B38C;
  box-shadow: 0 0 0 4px rgba(32, 179, 140, 0.16);
  animation: pulseDot 2.4s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.hero h1 {
  max-width: 780px;
  margin: 18px 0 14px;
  font-size: clamp(30px, 3.8vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 850;
  color: var(--text-primary);
}

.hero h1 span {
  color: transparent;
  background: linear-gradient(90deg, var(--brand), #7E6FF4 45%, var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
}

.hero p {
  max-width: 740px;
  margin: 0;
  color: var(--text-muted);
  font-size: 15.5px;
  line-height: 1.68;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.lab-visual {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.orbital {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #ffffff 0 28%, transparent 29%),
    radial-gradient(circle at 50% 50%, rgba(108, 92, 231, 0.12) 0 48%, transparent 49%),
    linear-gradient(135deg, #F0F1FF, #E7FBFB);
  border: 1px solid #DFE7F2;
  box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 20px 48px rgba(45, 66, 91, 0.10);
}

.orbital::before,
.orbital::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  border: 1.5px dashed rgba(108, 92, 231, 0.35);
  animation: spin 20s linear infinite;
}

.orbital::after {
  inset: 56px;
  border-color: rgba(22, 184, 196, 0.45);
  animation-direction: reverse;
  animation-duration: 14s;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.flask {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  color: var(--brand);
}

.molecule {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(35, 63, 89, 0.14);
}

.m1 { left: 10px; top: 76px; background: #6C5CE7; }
.m2 { right: 14px; top: 40px; background: #16B8C4; }
.m3 { right: 36px; bottom: 16px; background: #EB7BB3; }

/* =========================================
   TWO-COLUMN TASK & FEEDBACK LAYOUT
   ========================================= */
.task-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 18px;
}

.task-panel,
.feedback-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--surface-2);
}

.feedback-panel {
  background: linear-gradient(160deg, #FAF9FF, #F2FCFC);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.task-panel h3,
.feedback-panel h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--text-primary);
}

/* =========================================
   FOOTER DISCLAIMER
   ========================================= */
.footer-note {
  text-align: center;
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.6;
  padding: 30px 14px 10px;
  margin-top: auto;
  border-top: 1px solid rgba(223, 231, 239, 0.6);
}
