@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #1d1d1f;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

/* ========== HEADER ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  z-index: 1000;
}

.header-inner {
  max-width: 1020px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  letter-spacing: -0.035em;
  display: inline-flex;
  align-items: baseline;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.7;
}

.logo-dot {
  color: #41c9e3;
  font-weight: 700;
  margin-left: -1px;
  margin-right: 1px;
  position: relative;
  top: -0.5px;
}

/* Desktop nav */
.desktop-nav {
  display: flex;
  gap: 0.15rem;
}

.nav-link {
  position: relative;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #4b5563;
  background: none;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: #111;
  background: #f3f4f6;
}

.nav-link.active {
  color: #0e7490;
}

.nav-link.active::after {
  content: "";
  position: absolute;
  left: 1.1rem;
  right: 1.1rem;
  bottom: 6px;
  height: 2px;
  background: #41c9e3;
  border-radius: 1px;
}

.nav-link[aria-expanded="true"] {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.12);
}

/* Hamburger */
.hamburger {
  display: none;
  position: relative;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
}

.hamburger span {
  display: block;
  position: absolute;
  left: 7px;
  width: 22px;
  height: 2px;
  background: #111;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}

.hamburger span:nth-child(1) { top: 11px; }
.hamburger span:nth-child(2) { top: 17px; }
.hamburger span:nth-child(3) { top: 23px; }

.hamburger.open span:nth-child(1) {
  top: 17px;
  transform: rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  top: 17px;
  transform: rotate(-45deg);
}

/* ========== MENU OVERLAY ========== */
.menu-overlay {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 850;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ========== SIDE PANEL MENU ========== */
.fullscreen-menu {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 560px;
  background: #f4f5f7;
  z-index: 900;
  transform: translateX(100%);
  visibility: hidden;
  overflow-y: auto;
  border-left: 1px solid #e5e7eb;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.1);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.32s;
}

.fullscreen-menu.open {
  transform: translateX(0);
  visibility: visible;
}

.menu-inner {
  position: relative;
  max-width: 100%;
  margin: 0;
  padding: 0 1.5rem 2.5rem;
}

.menu-content {
  max-width: 100%;
  margin: 0;
  padding: 0.2rem 0 1rem;
}

.menu-close-btn {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.menu-close-btn:hover {
  background: #e5e7eb;
  color: #111;
}

.menu-heading {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin: 1.5rem 0 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e5e7eb;
  letter-spacing: -0.01em;
  text-align: left;
}

.back-to-main {
  display: none;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0e7490;
  background: none;
  border: none;
  padding: 0.8rem 0 0.3rem;
  margin-bottom: 0.4rem;
  cursor: pointer;
  text-align: left;
}

.back-to-main:hover {
  color: #155e75;
}

.mobile-top-link {
  display: block;
  width: 100%;
  text-align: left;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #374151;
  background: none;
  border: none;
  padding: 1rem 0;
  cursor: pointer;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-top-link:hover {
  color: #111;
}

/* ========== ACCORDION ========== */
.menu-group {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.1rem 0;
}

.menu-group:last-child {
  border-bottom: none;
}

.menu-toggle {
  position: relative;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  color: #374151;
  padding: 0.7rem 2rem 0.7rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.menu-toggle:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.04);
}

.menu-toggle.active {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.07);
}

.menu-toggle::after {
  content: "";
  position: absolute;
  right: 0.6rem;
  top: 50%;
  width: 6.5px;
  height: 6.5px;
  border-right: 1.6px solid #9ca3af;
  border-bottom: 1.6px solid #9ca3af;
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.25s ease, border-color 0.15s;
}

.menu-toggle.active::after {
  transform: translateY(-40%) rotate(-135deg);
  border-color: #0e7490;
}

.menu-toggle:hover::after {
  border-color: #6b7280;
}

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s ease;
}

.submenu.open {
  max-height: 800px;
}

.submenu a {
  display: block;
  padding: 0.38rem 0 0.38rem 1.1rem;
  color: #4b5563;
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 2px solid transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.submenu a:hover {
  color: #111;
}

.submenu a.current {
  color: #0f766e;
  font-weight: 600;
  background: #ccfbf1;
  border-left: 4px solid #14b8a6;
  padding-left: 1.05rem;
  margin-left: -1px;
  border-radius: 0 6px 6px 0;
}

.topic-num {
  display: inline-block;
  min-width: 1.5rem;
  color: #6b7280;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-right: 0.3rem;
}

.menu-toggle:hover .topic-num,
.menu-toggle.active .topic-num {
  color: #4b5563;
}

/* ========== TITLE BAR ========== */
.title-bar {
  margin-top: 64px;
  height: 180px;
  background: #f3f4f6;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.title-bar h1 {
  position: relative;
  z-index: 1;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111;
  margin: 0;
  text-align: center;
  max-width: 900px;
}

/* ========== CONTENT ========== */
.content {
  max-width: 680px;
  margin: 3.5rem auto 5rem;
  padding: 0 1.5rem;
}

.content h1 {
  display: none;
}

.content h2 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  margin: 3rem 0 1.1rem;
  color: #111;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.content h3 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.4rem 0 0.9rem;
  color: #111;
}

.content h4 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.7rem;
  color: #111;
}

.content p {
  margin: 0 0 1.4rem;
}

.content ul,
.content ol {
  margin: 0 0 1.7rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.5rem;
  padding-left: 0.15rem;
}

.content ul li::marker {
  color: #0e7490;
}

.content a {
  color: #0e7490;
  text-decoration: underline;
  text-decoration-color: #99f6e4;
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.content a:hover {
  color: #0f766e;
  text-decoration-color: #0f766e;
}

/* Blockquote */
.content blockquote {
  margin: 2rem 0;
  padding: 1.1rem 1.4rem;
  background: #f0fdfa;
  border-left: 4px solid #14b8a6;
  border-radius: 0 8px 8px 0;
  color: #134e4a;
}

.content blockquote p {
  margin: 0;
}

/* Tables */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.98rem;
}

.content th,
.content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.content th {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 600;
  background: #f8fafc;
  color: #111;
}

.content tr:last-child td {
  border-bottom: none;
}

/* Code */
.content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: #0f172a;
}

.content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem 1.4rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.8rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Figures */
.content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.8rem 0 0.4rem;
  display: block;
}

.content em {
  display: block;
  font-size: 0.92rem;
  color: #64748b;
  margin: 0 0 1.8rem;
  font-style: italic;
  line-height: 1.5;
}

/* Horizontal rule */
.content hr {
  border: none;
  border-top: 1px solid #d1d5db;
  margin: 3.2rem 0;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: #0e7490;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s ease;
  z-index: 800;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #0f766e;
  transform: translateY(-2px);
}

/* ========== FOOTER ========== */
footer {
  text-align: center;
  padding: 3rem 1rem;
  color: #6e6e73;
  font-size: 0.9rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  font-family: 'Outfit', system-ui, sans-serif;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .title-bar {
    height: 140px;
  }

  .title-bar h1 {
    font-size: 1.55rem;
  }

  .menu-close-btn {
    display: none;
  }

  .fullscreen-menu {
    max-width: 100%;
    box-shadow: none;
    border-left: none;
  }

  .content {
    margin-top: 2.5rem;
  }

  .content h2 {
    font-size: 1.35rem;
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* ========== HOME HERO ========== */
.home-hero {
  min-height: calc(100vh - 64px);
  background: #0e7490;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 5rem;
  margin-top: 64px;
  position: relative;
}

.home-hero-inner {
  max-width: 680px;
  text-align: center;
}

.home-hero-title {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: clamp(2.25rem, 5.5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.home-hero-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: #41c9e3;
  margin: 1.25rem auto 1.75rem;
  border-radius: 2px;
}

.home-hero-subtitle {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(1.05rem, 2.1vw, 1.2rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 auto;
  max-width: 520px;
}
