:root {
    --bg: #070b12; --bg2: #0b111c; --surface: #101724; --surface2: #18223a;
    --border: rgba(255,255,255,0.07); --border2: rgba(255,255,255,0.13);
    --text: #eef2fa; --muted: #7c8cae; --soft: #475873;
    --accent: #2dd4bf; --accent2: #38bdf8;
    --accent-dim: rgba(45,212,191,0.12); --sky-dim: rgba(56,189,248,0.12);
    --note: #2a3038;
    --nav-h: 56px;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }

  /* SKIP LINK */
  .skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--accent); color: #04231f; padding: 10px 16px; border-radius: 0 0 8px 0; font-size: 13px; font-weight: 600; text-decoration: none; }
  .skip-link:focus { left: 0; }

  /* NAV */
  #nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 100; display: flex; align-items: center; padding: 0 32px; background: rgba(7,11,18,0.86); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); transform: translateY(-110%); opacity: 0; pointer-events: none; transition: transform 0.5s cubic-bezier(0.34,1.4,0.5,1), opacity 0.35s ease; }
  #nav.nav-visible { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-logo { font-size: 13px; font-weight: 600; letter-spacing: 0.3px; color: var(--text); white-space: nowrap; margin-right: 24px; flex-shrink: 0; }
  .nav-logo .brand { color: var(--accent); }
  .nav-logo .sep { color: var(--muted); }
  .nav-track { flex: 1; display: flex; align-items: center; justify-content: center; gap: 28px; overflow: hidden; }
  .nav-item { display: flex; align-items: center; height: var(--nav-h); cursor: pointer; border: none; background: none; color: var(--soft); font-size: 12.5px; font-weight: 500; letter-spacing: 0.2px; white-space: nowrap; text-decoration: none; opacity: 0; transform: translateY(-8px); transition: color 0.25s; }
  #nav.nav-visible .nav-item { animation: navPop 0.5s cubic-bezier(0.34,1.5,0.5,1) forwards; }
  #nav.nav-visible .nav-item:nth-child(1) { animation-delay: 0.10s; }
  #nav.nav-visible .nav-item:nth-child(2) { animation-delay: 0.16s; }
  #nav.nav-visible .nav-item:nth-child(3) { animation-delay: 0.22s; }
  #nav.nav-visible .nav-item:nth-child(4) { animation-delay: 0.28s; }
  #nav.nav-visible .nav-item:nth-child(5) { animation-delay: 0.34s; }
  #nav.nav-visible .nav-item:nth-child(6) { animation-delay: 0.40s; }
  @keyframes navPop { from { opacity: 0; transform: translateY(-8px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
  .nav-item:hover { color: var(--muted); }
  .nav-item.active { color: var(--accent); }

  /* SECTIONS */
  section { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--nav-h) + 40px) 0 64px; position: relative; scroll-margin-top: var(--nav-h); }
  .inner { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 40px; }
  section::before { content: ''; position: absolute; inset: 0; pointer-events: none; }
  #s-hero::before { background: radial-gradient(ellipse 60% 50% at 72% 38%, rgba(56,189,248,0.08) 0%, transparent 70%), radial-gradient(ellipse 42% 32% at 18% 72%, rgba(45,212,191,0.06) 0%, transparent 62%); }
  #s-pharma::before { background: radial-gradient(ellipse 60% 50% at 20% 50%, rgba(56,189,248,0.07) 0%, transparent 70%); }
  #s-api::before    { background: radial-gradient(ellipse 50% 60% at 78% 55%, rgba(45,212,191,0.06) 0%, transparent 66%); }
  #s-connect::before{ background: radial-gradient(ellipse 60% 50% at 28% 42%, rgba(56,189,248,0.07) 0%, transparent 70%); }
  #s-modules::before{ background: radial-gradient(ellipse 50% 60% at 72% 50%, rgba(45,212,191,0.06) 0%, transparent 66%); }
  #s-next::before   { background: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(56,189,248,0.07) 0%, transparent 70%); }

  /* REVEAL */
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1), transform 0.65s cubic-bezier(0.4,0,0.2,1); }
  .reveal.visible { opacity: 1; transform: none; }
  .reveal-d1 { transition-delay: 0.08s; } .reveal-d2 { transition-delay: 0.16s; } .reveal-d3 { transition-delay: 0.24s; }
  .reveal-d4 { transition-delay: 0.32s; } .reveal-d5 { transition-delay: 0.40s; }

  /* TYPO */
  .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
  .eyebrow::before { content: ''; display: block; width: 24px; height: 1px; background: var(--accent); flex-shrink: 0; }
  h1 { font-size: clamp(38px, 5vw, 58px); font-weight: 700; line-height: 1.1; letter-spacing: -1.5px; color: var(--text); margin-bottom: 22px; }
  h1 em, h2 em { color: var(--accent); font-style: normal; }
  h1 b, h2 b { color: var(--accent2); font-weight: 700; }
  h2 { font-size: clamp(28px, 3.5vw, 42px); font-weight: 700; line-height: 1.15; letter-spacing: -1px; color: var(--text); margin-bottom: 18px; }
  .lead { font-size: 17px; color: var(--muted); line-height: 1.7; max-width: 640px; margin-bottom: 40px; }

  /* HERO */
  .scroll-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--soft); font-size: 11px; letter-spacing: 0.5px; animation: fadeUp 1s 1.4s both; }
  .scroll-hint svg { animation: bob 2s 2s infinite; }
  @keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
  @keyframes fadeUp { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

  /* AGENDA */
  .agenda-title { font-size: 13px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--soft); margin-bottom: 12px; }
  .agenda { display: flex; flex-direction: column; }
  .agenda-item { display: flex; align-items: flex-start; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border); position: relative; }
  .agenda-item:last-child { border-bottom: none; }
  .agenda-num { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(45,212,191,0.2); border-radius: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; letter-spacing: -0.5px; }
  .agenda-content { flex: 1; }
  a.agenda-content { text-decoration: none; display: block; }
  a.agenda-content .t { transition: color 0.15s; }
  a.agenda-content:hover .t { color: var(--accent); }
  .agenda-content .t { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
  .agenda-content .d { font-size: 13px; color: var(--muted); line-height: 1.5; }
  .agenda-line { position: absolute; left: 18px; top: 54px; bottom: -1px; width: 1px; background: linear-gradient(to bottom, rgba(45,212,191,0.3), transparent); }
  .agenda-item:last-child .agenda-line { display: none; }
  .agenda-note { border: 1px solid var(--border2); background: var(--surface); color: var(--soft); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 3px; transition: 0.15s; opacity: 0.55; }
  .agenda-item:hover .agenda-note { opacity: 1; }
  .agenda-note:hover { border-color: var(--accent); color: var(--accent); }

  /* CARDS */
  .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
  .card { background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; padding: 22px; position: relative; overflow: hidden; transition: border-color 0.3s, transform 0.3s; }
  .card:hover { border-color: rgba(45,212,191,0.3); transform: translateY(-2px); }
  .card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(45,212,191,0.4), transparent); opacity: 0; transition: opacity 0.3s; }
  .card:hover::before { opacity: 1; }
  .card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
  .card-icon.teal { background: var(--accent-dim); color: var(--accent); }
  .card-icon.sky  { background: var(--sky-dim); color: var(--accent2); }
  .card-icon.cyan { background: rgba(34,211,238,0.12); color: #22d3ee; }
  .card .card-t { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
  .card .card-b { font-size: 13px; color: var(--muted); line-height: 1.6; }
  .card-accent { border-color: rgba(45,212,191,0.25); background: linear-gradient(150deg, var(--surface) 0%, rgba(45,212,191,0.05) 100%); }
  .highlight { background: var(--accent-dim); border: 1px solid rgba(45,212,191,0.2); border-radius: 12px; padding: 16px 20px; margin-top: 22px; font-size: 14px; color: var(--muted); line-height: 1.65; }
  .highlight strong { color: var(--accent); font-weight: 600; }

  /* DEMO CTA */
  .demo-cta { display: flex; align-items: center; gap: 16px; margin-top: 24px; background: linear-gradient(135deg, rgba(45,212,191,0.14), rgba(56,189,248,0.10)); border: 1px solid rgba(45,212,191,0.3); border-radius: 14px; padding: 18px 22px; text-decoration: none; transition: 0.2s; }
  .demo-cta:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(45,212,191,0.16); }
  .demo-cta-ic { width: 44px; height: 44px; border-radius: 11px; background: var(--accent); color: #04231f; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .demo-cta-tx { display: flex; flex-direction: column; flex: 1; min-width: 0; }
  .demo-cta-title { font-size: 16px; font-weight: 600; color: var(--text); }
  .demo-cta-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
  .demo-cta-arrow { color: var(--accent); flex-shrink: 0; transition: transform 0.2s; }
  .demo-cta:hover .demo-cta-arrow { transform: translateX(4px); }

  /* VS */
  .vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; margin-top: 30px; }
  .vs-col { display: flex; flex-direction: column; gap: 8px; }
  .vs-head { padding: 12px 16px; border-radius: 10px 10px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 0.3px; }
  .vs-head.legacy { background: rgba(120,120,120,0.1); border: 1px solid rgba(255,255,255,0.08); color: var(--soft); }
  .vs-head.modern { background: var(--accent-dim); border: 1px solid rgba(45,212,191,0.25); color: var(--accent); }
  .vs-row { padding: 11px 14px; border-radius: 8px; font-size: 13px; line-height: 1.45; display: flex; align-items: flex-start; gap: 9px; }
  .vs-row.bad { background: rgba(255,255,255,0.03); border: 1px solid var(--border); color: var(--muted); }
  .vs-row.good { background: rgba(45,212,191,0.06); border: 1px solid rgba(45,212,191,0.15); color: var(--text); }
  .vs-ic { flex-shrink: 0; margin-top: 1px; }
  .vs-sep { display: flex; align-items: center; justify-content: center; padding-top: 54px; }
  .vs-badge { background: var(--surface2); border: 1px solid var(--border2); border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); }

  /* FLOW */
  .flow { margin-top: 36px; background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; padding: 24px; }
  .flow-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--soft); margin-bottom: 14px; }
  .flow-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; row-gap: 8px; }
  .flow-node { background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
  .flow-node.ours { background: var(--accent-dim); border-color: rgba(45,212,191,0.35); color: var(--accent); font-weight: 600; }
  .flow-arrow { color: var(--soft); font-size: 14px; flex-shrink: 0; }

  /* CONFIGS */
  .configs { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
  .config-card { background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; padding: 22px 24px; }
  .config-head { font-size: 14.5px; font-weight: 600; color: var(--text); margin-bottom: 18px; }
  .config-head .l { color: var(--accent); font-weight: 700; margin-right: 4px; }
  .cflow { margin-bottom: 16px; }
  .cflow:last-child { margin-bottom: 0; }
  .cflow-dir { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--accent); margin-bottom: 9px; display: flex; align-items: center; gap: 7px; font-weight: 600; }
  .cflow-dir.back { color: var(--accent2); }
  .cflow-note { font-size: 12px; color: var(--soft); margin-top: 9px; line-height: 1.5; }

  /* MODULES */
  .modules { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
  .module { display: grid; grid-template-columns: 44px 1fr auto; gap: 20px; align-items: start; background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; padding: 20px 24px; transition: border-color 0.3s, transform 0.3s; }
  .module:hover { border-color: rgba(45,212,191,0.25); transform: translateX(4px); }
  .module-step { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(45,212,191,0.2); flex-shrink: 0; }
  .m-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
  .m-sub { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-bottom: 9px; }
  .m-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; background: var(--sky-dim); border: 1px solid rgba(56,189,248,0.2); color: var(--accent2); border-radius: 6px; padding: 3px 9px; font-weight: 500; }
  .m-bench { font-size: 11.5px; color: var(--soft); text-align: right; line-height: 1.5; white-space: nowrap; }
  .m-bench strong { color: var(--muted); display: block; font-size: 12px; margin-bottom: 1px; font-weight: 600; }

  /* OPEN */
  .open-box { background: var(--surface); border: 1px solid rgba(56,189,248,0.2); border-radius: 20px; padding: 40px; position: relative; overflow: hidden; margin-top: 30px; text-align: center; }
  .open-box::before { content: ''; position: absolute; top: -1px; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent2), transparent); }
  .open-box .q-ic { width: 54px; height: 54px; border-radius: 14px; background: var(--sky-dim); color: var(--accent2); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
  .open-box h3 { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; margin-bottom: 10px; }
  .open-box p { font-size: 14.5px; color: var(--muted); max-width: 460px; margin: 0 auto; line-height: 1.6; }

  /* FOOTER */
  footer { padding: 24px 40px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; max-width: 880px; margin: 0 auto; width: 100%; }
  footer .logo { font-size: 13px; color: var(--soft); }
  footer .logo .brand { color: var(--accent); }
  footer .copy { font-size: 12px; color: var(--soft); }

  /* PINNED NOTES */
  #note-space { position: static; }
  .note { position: absolute; width: 280px; background: var(--note); border: 1px solid rgba(255,255,255,0.1); border-top: 3px solid var(--accent); border-radius: 11px; box-shadow: 0 14px 34px rgba(0,0,0,0.5); padding: 11px 14px 14px; z-index: 60; animation: noteIn 0.24s ease; }
  @keyframes noteIn { from { opacity: 0; transform: translateY(-6px) scale(0.97); } to { opacity: 1; transform: none; } }
  .note-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; cursor: move; user-select: none; touch-action: none; }
  .note-tag { font-size: 10.5px; font-weight: 600; color: var(--accent); background: rgba(45,212,191,0.16); border-radius: 5px; padding: 2px 8px; letter-spacing: 0.2px; }
  .note-close { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 19px; line-height: 1; padding: 0 2px; }
  .note-close:hover { color: #f87171; }
  .note-body { width: 100%; border: none; background: none; resize: none; outline: none; color: #e7ecf2; font-family: inherit; font-size: 18px; line-height: 1.45; padding: 0; overflow: hidden; display: block; }
  .note-body::placeholder { color: #8b94a1; }
  .note-fab { position: fixed; bottom: 22px; right: 22px; z-index: 85; width: 50px; height: 50px; border-radius: 50%; background: var(--accent); color: #04231f; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(45,212,191,0.3); transition: transform 0.2s, box-shadow 0.2s; }
  .note-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 30px rgba(45,212,191,0.4); }

  /* ADMIN */
  #admin-app { display: none; min-height: 100vh; padding: 48px 0; }
  .admin-wrap { max-width: 720px; margin: 0 auto; padding: 0 24px; }
  .admin-back { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 24px; }
  .admin-back:hover { color: var(--accent); }
  .admin-h { font-size: 26px; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 6px; }
  .admin-h span { color: var(--accent); }
  .admin-note { font-size: 13px; color: var(--soft); margin-bottom: 28px; line-height: 1.6; }
  .admin-card { background: var(--surface); border: 1px solid var(--border2); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
  .admin-card label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--soft); margin-bottom: 7px; }
  .admin-card textarea, .admin-card select { width: 100%; background: var(--bg2); border: 1px solid var(--border2); border-radius: 9px; color: var(--text); font-family: inherit; font-size: 14px; padding: 11px 13px; margin-bottom: 14px; resize: vertical; }
  .admin-card textarea:focus, .admin-card select:focus { outline: none; border-color: var(--accent); }
  .admin-card textarea { min-height: 90px; }
  .btn { border: 1px solid var(--border2); background: var(--surface2); color: var(--text); padding: 10px 18px; border-radius: 9px; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: 0.15s; display: inline-flex; align-items: center; gap: 7px; }
  .btn:hover { border-color: var(--accent); }
  .btn-primary { background: var(--accent); border-color: var(--accent); color: #04231f; font-weight: 600; }
  .btn-primary:hover { background: #4fe0cd; }
  .btn-ghost { background: none; }
  .btn-danger:hover { border-color: #ef4444; color: #f87171; }
  .admin-list-h { font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--soft); margin: 32px 0 14px; }
  .admin-item { background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; }
  .admin-item .ai-tag { display: inline-flex; font-size: 11px; background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(45,212,191,0.2); border-radius: 6px; padding: 2px 8px; font-weight: 500; margin-bottom: 8px; }
  .admin-item .ai-b { font-size: 13.5px; color: var(--muted); line-height: 1.6; white-space: pre-wrap; margin-bottom: 10px; }
  .admin-item .ai-actions { display: flex; gap: 8px; }
  .admin-item .btn { padding: 6px 12px; font-size: 12.5px; }
  .notes-empty { font-size: 14px; color: var(--soft); }
  .admin-tools { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid var(--border); }
  .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #04231f; padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 13px; z-index: 200; opacity: 0; transition: 0.25s; pointer-events: none; }
  .toast.show { opacity: 1; }

  .modal-overlay { position: fixed; inset: 0; background: rgba(3,6,12,0.72); backdrop-filter: blur(4px); z-index: 300; display: none; align-items: center; justify-content: center; padding: 24px; }
  .modal-overlay.show { display: flex; }
  .modal { background: var(--surface); border: 1px solid var(--border2); border-radius: 16px; padding: 28px; max-width: 430px; width: 100%; }
  .modal-t { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
  .modal-p { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 22px; }
  .modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .btn-danger-solid { background: #dc2626; border-color: #dc2626; color: #fff; font-weight: 600; }
  .btn-danger-solid:hover { background: #ef4444; border-color: #ef4444; }
  @media (max-width: 860px) {
    .grid3 { grid-template-columns: 1fr; }
    .grid2, .vs { grid-template-columns: 1fr; }
    .vs-sep { display: none; }
    .inner { padding: 0 20px; }
    #nav { padding: 0 14px; }
    .nav-logo { margin-right: 10px; font-size: 12px; }
    .nav-track { gap: 16px; }
    .nav-item { font-size: 11px; }
    h1 { font-size: 30px; }
    h2 { font-size: 24px; }
    .module { grid-template-columns: 44px 1fr; }
    .m-bench { display: none; }
    footer { flex-direction: column; gap: 8px; text-align: center; }
  }
