:root {
  --bg: #ffffff;
  --text: #111;
  --muted: #666;
  --accent: #1b4f9c;
  --nav-bg: #111;
  --nav-item: #fff;
  --card-bg: #f8f9fa;
  --maxw: 1100px;
}
* { 
  box-sizing: border-box; 
}

/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  font-size: 16px; /* Base font size for mobile (minimum readable) */
}

/* NAV - Mobile First */
.nav-wrap { 
  background: var(--nav-bg); 
  color: var(--nav-item); 
  position: sticky; 
  top: 0; 
  z-index: 999; 
  box-shadow: 0 1px 0 rgba(0,0,0,0.1); 
}

.nav { 
  max-width: var(--maxw); 
  margin: 0 auto; 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 12px 16px; 
}

.nav .brand { 
  font-weight: 600; 
  color: var(--nav-item); 
  font-size: 16px; 
  text-decoration: none; 
  flex-shrink: 0;
}

.nav .brand a { 
  color: inherit; 
  text-decoration: none; 
}

/* Mobile: Hamburger button */
.hamburger {
  display: block;
  background: none;
  border: none;
  color: var(--nav-item);
  font-size: 24px;
  cursor: pointer;
  padding: 8px 12px;
  min-height: 44px;
  min-width: 44px;
  line-height: 1;
  flex-shrink: 0;
}

.hamburger:focus {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

/* Mobile: Menu hidden by default */
.nav .menu { 
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  flex-direction: column;
  gap: 0;
  padding: 8px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.nav .menu.active {
  display: flex;
}

.nav a, .dropbtn { 
  color: var(--nav-item); 
  text-decoration: none; 
  padding: 12px 16px; 
  display: block; 
  border-radius: 0;
  font-size: 16px; 
  background: none; 
  border: none; 
  font-family: inherit; 
  cursor: pointer; 
  min-height: 44px;
  text-align: left;
  width: 100%;
}

.nav a:focus, .dropbtn:focus {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: -2px;
}

.dropdown { 
  position: static;
  width: 100%;
}

.dropdown-content { 
  display: none; 
  position: static;
  background: rgba(0,0,0,0.3);
  min-width: auto;
  width: 100%;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  z-index: 50; 
}

.dropdown-content a { 
  padding: 12px 32px; 
  display: block; 
  color: rgba(255,255,255,0.9); 
  white-space: normal;
  font-size: 15px; 
  min-height: 44px;
  line-height: 1.4;
}

.dropdown.show .dropdown-content { 
  display: block; 
}

/* Tablet and up: Show horizontal menu */
@media (min-width: 768px) {
  .hamburger {
    display: none;
  }
  
  .nav {
    gap: 12px;
    padding: 8px 16px;
  }
  
  .nav .brand {
    margin-right: 8px;
    font-size: 18px;
  }
  
  .nav .menu {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    flex: 1;
    padding: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
  }
  
  .nav a, .dropbtn {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 15px;
    min-height: 44px;
    width: auto;
    text-align: center;
  }
  
  .nav a:hover, .dropbtn:hover {
    background: rgba(255,255,255,0.06);
  }
  
  .dropdown {
    position: relative;
    width: auto;
  }
  
  .dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #0f1720;
    min-width: 230px;
    border-radius: 6px;
    padding: 8px 0;
    box-shadow: 0 6px 18px rgba(2,6,23,0.6);
    width: auto;
  }
  
  .dropdown-content a {
    padding: 8px 14px;
    white-space: nowrap;
    font-size: 14px;
    min-height: auto;
    line-height: normal;
  }
  
  .dropdown-content a:hover {
    background: rgba(255,255,255,0.04);
  }
}

/* Page layout - Mobile First */
.container { 
  max-width: var(--maxw); 
  margin: 16px auto; 
  padding: 0 16px; 
}

header.hero { 
  padding: 16px 0 12px 0; 
  border-bottom: 1px solid #eee; 
  margin-bottom: 20px; 
}

header.hero h1 { 
  margin: 0; 
  font-size: 24px; 
  line-height: 1.3;
}

header.hero p { 
  margin: 8px 0 0 0; 
  color: var(--muted); 
  font-size: 16px; 
  line-height: 1.5;
}

section.card { 
  background: var(--card-bg); 
  border: 1px solid #dee2e6; 
  border-radius: 8px; 
  padding: 16px; 
  margin: 20px 0; 
}

section.card h2 { 
  margin: 0 0 16px 0; 
  font-size: 20px; 
  color: var(--accent); 
  border-bottom: 1px solid #ddd; 
  padding-bottom: 8px; 
  line-height: 1.3;
}

section.card h3 { 
  margin: 18px 0 10px 0; 
  font-size: 18px; 
  color: var(--text); 
  line-height: 1.3;
}

.content-block ul { 
  margin: 6px 0 14px 20px; 
  padding: 0; 
}

.content-block li { 
  margin-bottom: 10px; 
  line-height: 1.6;
}

.content-block p { 
  margin: 0 0 1em 0; 
  line-height: 1.6;
}

footer { 
  max-width: var(--maxw); 
  margin: 24px auto; 
  padding: 16px; 
  color: var(--muted); 
  text-align: center; 
  font-size: 14px; 
  border-top: 1px solid #eee; 
}

.subpoint { 
  margin-left: 18px; 
  color: var(--muted); 
  font-size: 0.9em; 
}

/* Tablet and up */
@media (min-width: 768px) {
  .container {
    margin: 22px auto;
    padding: 0 18px;
  }
  
  header.hero {
    padding: 18px 0 12px 0;
    margin-bottom: 24px;
  }
  
  header.hero h1 {
    font-size: 32px;
  }
  
  section.card {
    padding: 20px;
    margin: 24px 0;
  }
  
  section.card h2 {
    font-size: 22px;
  }
  
  footer {
    margin: 32px auto;
    padding: 18px;
  }
}

.profile-img {
  max-width: 100%;
  width: 250px;
  height: auto;
  aspect-ratio: 250 / 350;
  border-radius: 10%;
  display: block;
  margin: 0 auto 20px auto;
  object-fit: cover;
}

/* Ensure all images are responsive */
img {
  max-width: 100%;
  height: auto;
}

/* ========================================
   MOBILE TABLE SCROLLING (CSS Only)
   Mobile-First Approach: ≤768px
   ======================================== */

/* Mobile: Make content blocks horizontally scrollable for tables */
/* Base styles apply to mobile (≤768px) */
.content-block {
  /* Enable horizontal scrolling on mobile */
  overflow-x: auto;
  /* Smooth momentum scrolling on iOS/Safari */
  -webkit-overflow-scrolling: touch;
  /* Prevent page-wide overflow */
  max-width: 100%;
  width: 100%;
  /* Ensure proper containment */
  display: block;
}

/* Mobile: Tables maintain natural width inside scrollable container */
.content-block table {
  /* Tables maintain their natural width (based on content) */
  /* This allows tables wider than viewport to be scrollable */
  min-width: 100%;
  /* Preserve table's natural width calculation */
  width: auto;
  /* Keep table structure intact */
  table-layout: auto;
  /* Ensure proper table display */
  display: table;
  /* Prevent table from breaking container */
  border-collapse: inherit;
}

/* Custom scrollbar styling for mobile (optional, improves UX) */
.content-block::-webkit-scrollbar {
  height: 8px;
}

.content-block::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
  margin: 4px 0;
}

.content-block::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.content-block::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Firefox scrollbar styling */
.content-block {
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}

/* ========================================
   DESKTOP (≥768px): Normal Table Behavior
   ======================================== */
@media (min-width: 768px) {
  .content-block {
    /* Desktop: Normal overflow behavior, no horizontal scrolling */
    overflow-x: visible;
    -webkit-overflow-scrolling: auto;
    /* Tables fit within viewport on desktop */
  }
  
  .content-block table {
    /* Desktop: Tables can use width: 100% or any specified width */
    /* This preserves existing table width settings (inline or CSS) */
    width: 100%;
    min-width: auto;
    /* Normal table behavior restored */
  }
}