/* =========================================================
   PROJECT PAGES — UNIFIED SHARED CSS
   Used by: Bank Loan, Coffee Shop, HR Analysis,
            Online Retail, Road Accident, Writing Tracker
   ========================================================= */

/* --- Variables (unified with style.css) --- */
:root {
  --navy:       #2D3142;
  --navy-hover: #3a3f54;
  --navy-dark:  #1b1f2e;
  --blue-lt:    #B3E0FF;
  --blue-mid:   #7ec8f0;
  --accent:     #4a90d9;
  --text:       #334155;
  --text-lt:    #5e6b7b;
  --text-dark:  #0c122b;
  --bg:         #F5F5F5;
  --white:      #ffffff;
  --radius-sm:  8px;
  --radius-md:  12px;
  --shadow-sm:  0 2px 8px rgba(13,18,30,.07);
  --shadow-md:  0 6px 20px rgba(13,18,30,.10);
  --shadow-lg:  0 16px 40px rgba(13,18,30,.14);
  --transition: 220ms ease;
  --header-h:   64px;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: 'Poppins', Arial, sans-serif;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  background-image: url('https://i.ibb.co/RQxYzBK/background.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  padding-top: var(--header-h);      /* offset for fixed header */
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
ul, ol { padding-left: 20px; }
a { color: inherit; }
dl dt { font-weight: 700; color: var(--navy); margin-top: 10px; }
dl dd { margin-left: 16px; margin-bottom: 6px; }

/* =========================================================
   ACCESSIBILITY
   ========================================================= */
:focus-visible {
  outline: 3px solid var(--blue-mid);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =========================================================
   CONTAINER
   ========================================================= */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* =========================================================
   HEADER — always visible on doc pages
   ========================================================= */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background-color: var(--navy);
  color: var(--white);
  z-index: 9999;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

/* Neutralise the hide-on-scroll class — keep header always visible */
header.scrolled { top: 0 !important; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
  gap: 12px;
}

.logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
  text-transform: none;
}

nav ul { list-style: none; display: flex; gap: 4px; padding-left: 0; }

nav a {
  color: var(--white);
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: block;
  transition: background var(--transition);
}
nav a:hover { background: rgba(255,255,255,.12); }

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: transform 280ms ease, opacity 280ms ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   SECTIONS
   ========================================================= */
section {
  padding: 52px 20px;
  background-color: rgba(245,245,245,.93);
  margin: 32px 0;
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
}
section h1 { font-size: clamp(1.5rem,4vw,2rem); font-weight: 700; color: var(--navy); text-align: center; margin-bottom: 20px; }
section h2 { font-size: clamp(1.3rem,3.5vw,1.75rem); font-weight: 700; color: var(--navy); text-align: center; margin-bottom: 20px; }
section > .container > p,
section > p { max-width: 820px; margin: 0 auto 16px; font-size: 1.05rem; line-height: 1.75; }

/* Summary sub-sections */
.summary-container { max-width: 860px; margin: 0 auto; }
.summary-section { margin-bottom: 32px; }
.summary-section h2 {
  text-align: left; font-size: 1.25rem; margin-bottom: 10px;
  border-bottom: 2px solid rgba(45,49,66,.15); padding-bottom: 6px;
}
.summary-section p { margin-bottom: 14px; line-height: 1.8; font-size: 1.05rem; }

/* Insights list */
.insights-list { max-width: 820px; margin: 0 auto; }
.insights-list li { margin-bottom: 10px; line-height: 1.7; }

/* =========================================================
   POWER BI EMBED & DASHBOARD PREVIEW — responsive 16:9
   ========================================================= */
.embed-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 28px auto;
  position: relative;
  padding-bottom: 56.25%;   /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 2px solid var(--navy);
  background: var(--white);
}
.embed-wrapper iframe {
  position: absolute; top: 0; left: 0;
  width: 100% !important; height: 100% !important;
  border: none;
}

/* Dashboard Preview (Workshop style) */
.dashboard-preview {
  background: linear-gradient(135deg, var(--navy-dark) 0%, rgba(45,49,66, 0.95) 100%);
  color: var(--white);
  padding: 30px 20px;
  border-radius: var(--radius-md);
  margin: 30px auto;
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 1100px;
}
.dashboard-preview::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 300px;
  height: 300px;
  background: rgba(179,224,255, 0.05);
  border-radius: 50%;
}
.dashboard-preview h3 {
  color: var(--white);
  margin-bottom: 20px;
  font-size: 1.4rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.dashboard-preview img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  background-color: var(--white);
}
.live-demo-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue-mid); color: var(--navy-dark);
  padding: 12px 30px; text-decoration: none; border-radius: 50px;
  font-weight: 700; transition: all var(--transition);
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  margin-top: 25px;
  position: relative;
  z-index: 1;
}
.live-demo-btn:hover {
  background: var(--blue-lt);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

/* Legacy zoom-container for Tableau embeds */
.viz-zoom-container {
  width: 100%;
  max-width: 1100px;
  margin: 24px auto;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 2px solid var(--navy);
  background: var(--white);
}

/* Fix old dashboard-embed (remove red background, proper sizing) */
.dashboard-embed {
  width: clamp(300px, 100%, 1100px);
  margin: 24px auto;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--navy);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  display: block;
}
.dashboard-embed object,
.dashboard-embed iframe,
.dashboard-embed img {
  width: 100% !important;
  height: 100% !important;
  border: none;
  display: block;
}

/* Image-only dashboard (Road Accident) */
.dashboard-embed.image-only {
  aspect-ratio: unset;
  height: auto;
}
.dashboard-embed.image-only img {
  width: 100%;
  height: auto;
}

/* Video embed */
.video-embed {
  width: 100%;
  max-width: 1100px;
  margin: 20px auto;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--navy);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.video-embed iframe { width: 100%; height: 100%; border: none; display: block; }

/* Tableau placeholder wrapper */
#dashboard .tableauPlaceholder {
  width: 100% !important;
  max-width: 1100px;
  margin: 24px auto;
  overflow: hidden;
  position: relative;
  zoom: 1 !important;  /* reset zoom—handled by wrapper sizing */
}

/* =========================================================
   COLLAPSIBLE TOC
   ========================================================= */
.toc-container {
  background: rgba(245,245,245,.98);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 24px 0 0;
  box-shadow: var(--shadow-sm);
}

.toc-section {
  border: 1.5px solid rgba(45,49,66,.18);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--white);
}

.toc-header {
  padding: 14px 20px;
  background-color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: background var(--transition);
  min-height: 52px;
  user-select: none;
}
.toc-header:hover { background-color: var(--navy-hover); }

.toc-header h3 {
  margin: 0;
  color: var(--white);
  font-size: clamp(0.88rem, 2.5vw, 1.05rem);
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-width: 0;
}

.arrow {
  font-size: .85rem;
  color: var(--white);
  transition: transform 300ms ease;
  flex-shrink: 0;
}
.toc-section.active .arrow { transform: rotate(180deg); }

.toc-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 480ms cubic-bezier(.4,0,.2,1);
  padding: 0 20px;
  background: var(--white);
}
/* Remove nested-scroll anti-pattern — let content expand naturally */
.toc-section.active .toc-content { max-height: 99999px; padding: 20px; }
/* Override any overflow-y:auto on sub-sections */
.sub-section.active .sub-content { overflow-y: visible !important; }

.toc-content p  { margin-bottom: 12px; line-height: 1.75; color: var(--text); word-break: break-word; overflow-wrap: anywhere; }
.toc-content h4 { color: var(--navy); font-size: clamp(0.9rem, 2.5vw, 1rem); font-weight: 600; margin: 14px 0 8px; word-break: break-word; }
.toc-content h5 { color: var(--navy-hover); font-size: clamp(0.85rem, 2.2vw, .95rem); font-weight: 600; margin: 10px 0 6px; }
.toc-content ul,
.toc-content ol { padding-left: 20px; margin-bottom: 12px; }
.toc-content li { margin-bottom: 6px; line-height: 1.65; color: var(--text); word-break: break-word; overflow-wrap: anywhere; }

/* TOC controls */
.toc-controls {
  display: flex; gap: 10px; margin-bottom: 14px;
  justify-content: flex-end; flex-wrap: wrap;
}
.toc-controls button {
  background: var(--navy); color: var(--white);
  border: none; padding: 9px 18px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .9rem;
  transition: background var(--transition); min-height: 40px;
}
.toc-controls button:hover { background: var(--navy-hover); }

/* =========================================================
   SUB-SECTIONS (second-level collapsibles)
   ========================================================= */
.sub-section {
  margin: 10px 0;
  border-radius: var(--radius-sm);
  background: rgba(245,245,245,.6);
  border: 1px solid rgba(45,49,66,.1);
}
.sub-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; cursor: pointer; padding: 10px 16px;
  background-color: #e8eaf0;
  border-radius: var(--radius-sm); transition: background var(--transition);
  min-height: 44px; user-select: none;
}
.sub-header:hover { background-color: #d8dce8; }
.sub-header h4 {
  margin: 0; font-size: clamp(0.85rem, 2.3vw, .97rem); color: var(--navy);
  font-weight: 600; line-height: 1.3;
  word-break: break-word; overflow-wrap: anywhere; min-width: 0;
}
.sub-header .arrow { font-size: .8rem; color: var(--navy); }
.sub-content {
  max-height: 0; overflow: hidden;
  transition: max-height 400ms cubic-bezier(.4,0,.2,1);
  padding: 0 16px;
}
.sub-section.active .sub-content { max-height: 99999px; padding: 14px 16px; }
.sub-section.active .sub-header .arrow { transform: rotate(180deg); }

/* =========================================================
   CODE BLOCKS
   ========================================================= */
pre.code-block,
div.code-block {
  background: #0f1724;
  color: #e6eef6;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
  margin: 12px 0;
  border-left: 3px solid var(--navy);
  position: relative;
}
pre.code-block code,
div.code-block code { color: inherit; background: transparent; font-family: inherit; font-size: inherit; white-space: pre; }

pre.code-block::-webkit-scrollbar,
div.code-block::-webkit-scrollbar { height: 8px; }
pre.code-block::-webkit-scrollbar-thumb,
div.code-block::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* GitHub-style light code blocks (Bank Loan inline style) */
.code-block-light {
  background: #f6f8fa;
  border: 1px solid #d1d5da;
  border-radius: var(--radius-sm);
  font-family: "Courier New", monospace;
  font-size: .9rem;
  color: #24292e;
  overflow-x: auto;
  padding: 16px;
  margin: 14px 0;
  line-height: 1.5;
}

/* Inline code */
code:not(pre code):not(div.code-block code) {
  background: rgba(45,49,66,.09);
  color: var(--navy);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .87em;
}

/* Copy button */
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.1); border: none;
  border-radius: 4px; color: #e6eef6; padding: 5px 8px;
  cursor: pointer; opacity: 0;
  transition: opacity 200ms ease, background 200ms ease; font-size: 12px;
}
pre.code-block:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: rgba(255,255,255,.2); }

/* =========================================================
   NOTE BOX
   ========================================================= */
.note-box {
  background: #fff8e6; border-left: 4px solid #ffc107;
  padding: 14px 16px; margin: 16px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note-box h4 { margin: 0 0 8px; color: #7d6608; display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.note-box h4 i { color: #ffc107; }

/* =========================================================
   FORMULA (Excel/inline formula display)
   ========================================================= */
.formula {
  font-family: 'Courier New', monospace;
  background: #f8f9fa;
  border: 1px solid #e1e4e8;
  border-radius: 4px;
  padding: 8px 12px;
  margin: 8px 0;
  color: #d63384;
  font-size: .95rem;
  display: inline-block;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

/* =========================================================
   SKILL BOXES
   ========================================================= */
.skills-container { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; justify-content: center; }
.skill-box {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  min-width: 170px; box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.skill-box:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.skill-box i { font-size: 1.4rem; flex-shrink: 0; }
.skill-box span { font-size: .95rem; font-weight: 600; color: var(--navy); }

/* =========================================================
   PHASE BLOCKS
   ========================================================= */
.phase {
  margin: 16px 0; padding: 14px 18px;
  border-left: 4px solid var(--navy);
  background: rgba(245,245,245,.6);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.phase h4 { color: var(--navy); margin: 0 0 10px; font-size: 1.05rem; font-weight: 600; }

/* Sub-lists */
.sub-list { margin-left: 20px; list-style: none; padding-left: 0; }
.sub-list li { position: relative; padding-left: 20px; margin-bottom: 8px; line-height: 1.65; }
.sub-list li::before { content: "•"; color: var(--navy); font-weight: 700; position: absolute; left: 6px; }

/* =========================================================
   SPEC ITEMS
   ========================================================= */
.spec-item { display: flex; flex-wrap: wrap; margin-bottom: 10px; gap: 6px; align-items: baseline; }
.spec-item .spec-name { font-weight: 600; min-width: 170px; color: var(--text-dark); flex-shrink: 0; }
.spec-item .spec-value { flex: 1; color: var(--text); }

/* Nested content */
.nested-content { margin-left: 15px; padding-left: 15px; border-left: 2px dashed #d1d5db; }

/* =========================================================
   DASHBOARD IMAGES (screenshots inside TOC)
   ========================================================= */
.dashboard-image {
  width: 100%; max-width: 860px; margin: 16px auto;
  display: block; border-radius: var(--radius-sm);
  border: 1px solid rgba(45,49,66,.12);
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   DATA DICTIONARY TABLE
   ========================================================= */
table.data-dictionary { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .95rem; }
table.data-dictionary th { background: var(--navy); color: var(--white); padding: 10px 14px; text-align: left; font-weight: 600; }
table.data-dictionary td { padding: 9px 14px; border-bottom: 1px solid rgba(45,49,66,.1); }
table.data-dictionary tr:nth-child(even) td { background: rgba(245,245,245,.6); }
table.data-dictionary tr:last-child td { border-bottom: none; }

/* =========================================================
   DOWNLOAD ASSETS
   ========================================================= */
.download-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap: 20px; margin: 20px 0;
}
.asset-card {
  background: var(--bg); padding: 24px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(45,49,66,.2);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.asset-card img { width: 56px; height: 56px; object-fit: contain; margin: 0 auto; }
.asset-card i.fab, .asset-card i.fas { font-size: 2.5rem; color: var(--navy); margin-bottom: 8px; }
.asset-card h4 { color: var(--navy); font-size: 1rem; font-weight: 700; margin: 0; }
.asset-card p  { font-size: .9rem; color: var(--text); margin: 0; }

.download-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; background: var(--navy);
  color: var(--white) !important; text-decoration: none;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
  transition: background var(--transition), transform var(--transition);
  margin-top: 4px;
}
.download-btn:hover { background: var(--navy-hover); transform: translateY(-2px); }

.github-note {
  text-align: center; margin-top: 28px; padding-top: 22px;
  border-top: 1px solid rgba(45,49,66,.12);
}
.github-note p { margin-bottom: 14px; font-size: .95rem; }
.github-link {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--navy) !important; font-weight: 600; font-size: .95rem;
  text-decoration: none; padding: 11px 28px;
  border: 2px solid var(--navy); border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.github-link:hover { background: var(--navy); color: var(--white) !important; }

/* =========================================================
   DATA SOURCE LINK (HR page)
   ========================================================= */
.data-source-link { margin-top: 14px; text-align: left; }
.data-source-link a { color: var(--navy); font-weight: 600; text-decoration: underline; }

/* =========================================================
   PRESENTATION PANEL (HR page inline video)
   ========================================================= */
.presentation-inline-wrapper { width: 100%; }
.view-dashboard-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; font-size: 1rem;
  background: #134d51; color: white;
  text-decoration: none; border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
  border: none; cursor: pointer; font-family: 'Poppins', sans-serif; font-weight: 600;
}
.view-dashboard-btn:hover { background: #0d3538; transform: translateY(-2px); }
.view-dashboard-btn:active { transform: scale(.98); }

.presentation-panel {
  width: 100%; max-height: 0; overflow: hidden;
  transition: max-height 600ms cubic-bezier(.2,.9,.2,1);
}
.presentation-box {
  width: 100%; max-width: 1100px; margin: 20px auto;
  background: var(--white); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.presentation-close {
  position: absolute; top: 8px; right: 10px;
  background: transparent; border: none; font-size: 28px;
  color: var(--navy); cursor: pointer; z-index: 10; line-height: 1;
}
.video-frame iframe,
.video-frame video { width: 100%; height: 100%; border: none; display: block; }
.expand-video { width: 100%; height: auto; display: block; object-fit: cover; background: black; border-radius: var(--radius-sm); }

/* =========================================================
   CONTACT SECTION
   ========================================================= */
.contact-section {
  text-align: center;
  padding: 44px 20px !important;
  background-color: rgba(245,245,245,.95);
}
.contact-divider {
  margin: 28px auto; width: 60%;
  border: none; height: 1px;
  background-color: rgba(45,49,66,.18);
}
.contact-message {
  max-width: 600px; margin: 16px auto 24px;
  font-size: 1.05rem; color: var(--text);
}
.contact-icons { display: flex; justify-content: center; gap: 28px; margin: 24px 0; }
.contact-icons a {
  font-size: 2.1rem; color: #5e6b7b;
  transition: color var(--transition), transform var(--transition);
  display: inline-flex;
}
.contact-icons a:hover { color: var(--navy); transform: translateY(-3px); }

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  background-color: var(--navy);
  color: rgba(255,255,255,.85);
  text-align: center;
  padding: 24px 20px;
  font-size: .9rem;
}
.quick-links { margin-bottom: 10px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.quick-links a {
  color: rgba(255,255,255,.85); text-decoration: none;
  padding: 4px 10px; border-radius: 4px; font-weight: 600;
  transition: background var(--transition);
}
.quick-links a:hover { background: rgba(255,255,255,.1); }

/* =========================================================
   FADE-IN (scroll-triggered via IntersectionObserver in JS)
   ========================================================= */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Override old CSS-animation fade-in so it doesn't conflict */
@keyframes fadeInUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }

/* =========================================================
   RESPONSIVE — Tablet ≤ 768px
   ========================================================= */
@media (max-width: 768px) {
  .container { max-width: 100%; padding: 0 20px; }
  section { padding: 40px 20px; margin: 24px 0; border-radius: var(--radius-sm); }
  
  .download-links { grid-template-columns: 1fr; gap: 16px; }
  .asset-card { padding: 20px; }
  
  .contact-divider { width: 80%; }
  .contact-icons a { font-size: 1.8rem; }
  
  table.data-dictionary { display: block; overflow-x: auto; font-size: .85rem; }
  
  .spec-item { flex-direction: column; gap: 4px; padding: 10px 0; }
  .spec-item .spec-name { min-width: auto; }
  
  .toc-controls { justify-content: center; }
  .toc-header { padding: 14px 16px; gap: 10px; }
  .toc-content { word-break: break-word; }
  .sub-header { padding: 12px 14px; }
  
  .summary-section p { font-size: 0.95rem; }
  section h1 { font-size: 2rem; margin-bottom: 12px; }
  section h2 { font-size: 1.6rem; margin-bottom: 24px; }
}

/* =========================================================
   RESPONSIVE — Mobile ≤ 640px
   ========================================================= */
@media (max-width: 640px) {
  /* Header / Nav */
  .nav-toggle { display: flex; }

  nav {
    position: absolute;
    top: var(--header-h); left: 0; right: 0;
    background: var(--navy);
    max-height: 0; overflow: hidden;
    transition: max-height 350ms ease, box-shadow 350ms ease;
    box-shadow: none;
  }
  nav.is-open { max-height: 400px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
  nav ul { flex-direction: column; gap: 0; padding: 12px 16px 16px; }
  nav a { font-size: 0.95rem; padding: 12px 14px; min-height: 44px; display: flex; align-items: center; border-radius: var(--radius-sm); }
  
  .logo { font-size: 0.95rem; max-width: 75%; }
  
  /* Global typography */
  body { font-size: 15px; line-height: 1.6; }
  .container { padding: 0 16px; }

  /* Sections */
  section { padding: 32px 16px; margin: 20px 0; }
  section h1 { font-size: 1.65rem; margin-bottom: 12px; }
  section h2 { font-size: 1.4rem; margin-bottom: 20px; }
  section p { font-size: 0.92rem; line-height: 1.65; margin-bottom: 16px; }

  /* Skills / Tools Container */
  .skills-container { gap: 10px; }
  .skill-box { min-width: 0; flex: 1 1 45%; padding: 10px 12px; font-size: 0.85rem; }
  .skill-box i { font-size: 1.1rem; }

  /* Dashboard Embeds */
  .dashboard-embed { margin: 16px auto; }
  .dashboard-preview { padding: 20px 14px; margin: 20px auto; }
  .dashboard-preview h3 { font-size: 1.1rem; margin-bottom: 14px; }
  .live-demo-btn { padding: 10px 20px; font-size: 0.9rem; }

  /* TOC layout */
  .toc-container { padding: 14px; margin: 20px 0 0; }
  .toc-header { padding: 12px 14px; min-height: 44px; }
  .toc-header h3 { font-size: 0.95rem; }
  .toc-section.active .toc-content { padding: 16px 14px; }
  
  .sub-header { padding: 10px 12px; }
  .sub-header h4 { font-size: 0.9rem; }
  .sub-section.active .sub-content { padding: 12px 12px; }
  
  .toc-content p { font-size: 0.92rem; line-height: 1.65; margin-bottom: 10px; }
  .toc-content li { font-size: 0.92rem; margin-bottom: 6px; }
  .toc-content h4 { font-size: 0.98rem; margin: 16px 0 8px; }
  
  pre.code-block, div.code-block { font-size: 12px; padding: 12px; }
  
  .toc-controls button { font-size: 0.85rem; padding: 8px 14px; min-height: 38px; }
  
  .asset-card { padding: 16px; }
  .asset-card h4 { font-size: 1rem; }
  .asset-card p { font-size: 0.88rem; }
  .download-btn { font-size: 0.88rem; padding: 10px; }
}

/* =========================================================
   RESPONSIVE — Small phone ≤ 480px
   ========================================================= */
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  section { padding: 28px 14px; margin: 16px 0; }
  
  section h1 { font-size: 1.45rem; }
  section h2 { font-size: 1.25rem; margin-bottom: 16px; }
  section p { font-size: 0.88rem; }

  .skill-box { flex: 1 1 100%; }

  .toc-container { padding: 12px; }
  .toc-header { padding: 10px 12px; }
  .toc-header h3 { font-size: 0.88rem; }
  .toc-section.active .toc-content { padding: 14px 12px; }
  
  .sub-header { padding: 8px 10px; }
  .sub-header h4 { font-size: 0.85rem; }
  .sub-section.active .sub-content { padding: 10px 10px; }
  
  .toc-content p, .toc-content li { font-size: 0.88rem; }
  
  .toc-controls { flex-direction: column; width: 100%; gap: 8px; }
  .toc-controls button { width: 100%; justify-content: center; }

  .dashboard-preview h3 { font-size: 1rem; }
  .live-demo-btn { width: 100%; text-align: center; justify-content: center; }
}

/* =========================================================
   RESPONSIVE — Very small ≤ 380px
   ========================================================= */
@media (max-width: 380px) {
  .container { padding: 0 10px; }
  section { padding: 24px 10px; }
  
  .logo { font-size: 0.85rem; max-width: 68%; }
  
  section h1 { font-size: 1.35rem; }
  section h2 { font-size: 1.15rem; }
  
  .toc-container { padding: 10px; }
  .toc-header { padding: 8px 10px; }
  .toc-header h3 { font-size: 0.82rem; }
  .toc-section.active .toc-content { padding: 12px 10px; }
  
  .toc-content p, .toc-content li { font-size: 0.85rem; }
  
  pre.code-block, div.code-block { font-size: 11px; padding: 10px; }
}
