:root{
  --sidebar-w: 220px;
  --bg-soft: #FBFEFE;
  --text: #243344;
  --muted: #6f7a82;
  --accent: #0B6FAF;
  --max-content: 1100px;
}

/* ---------------- Reset / base ---------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Prevent accidental horizontal scroll on all pages */
.app, .content {
  max-width: 100%;
  overflow-x: hidden;
}

/* Layout */
.app {
  display:flex;
  min-height:100vh;
  width:100%;
}

/* ---------------- SIDEBAR (desktop only) ---------------- */
.sidebar {
  width:var(--sidebar-w);
  min-width:var(--sidebar-w);
  background:#fff;
  border-right:1px solid rgba(0,0,0,0.06);
  padding:22px 18px 80px;
  position:fixed;
  top:0; left:0; bottom:0;
  display:flex;
  flex-direction:column;
  gap:18px;
  overflow-y:auto;
  z-index:999;
}

.logo img { max-width:160px; display:block; }

/* NAV */
.primary-nav ul {
  list-style:none; margin:0; padding:0;
  display:flex; flex-direction:column; gap:8px;
}
.primary-nav a {
  color:var(--text);
  padding:10px 12px;
  text-decoration:none;
  border-radius:8px;
  display:block;
  font-weight:500;
  transition:0.15s;
}
.primary-nav a:hover { background:rgba(11,111,175,0.05); color:var(--accent); }
.primary-nav a.active { color:var(--accent) !important; font-weight:600; }

/* COPYRIGHT */
.sidebar .copyright { position:absolute; bottom:18px; font-size:13px; color:var(--muted); }

/* CONTENT */
.content {
  flex:1;
  min-height:100vh;
  padding:36px 36px;
  margin-left:var(--sidebar-w);
  overflow:visible !important;
}

main {
  max-width:var(--max-content);
  margin:0 auto;
  width:100%;
}

/* Sections */
section { margin-bottom:42px; }
section h2 {
  font-size:26px;
  margin:18px 0;
  color:#20223D;
}
section p { margin-bottom:16px; }

/* ---------------- Tech row (two-column with image) ---------------- */
.tech-row {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:24px;
  margin:24px 0;
}

/* text grows, image fixed block but responsive */
.tech-text { flex:1; min-width:0; }
.tech-image {
    flex: 0 0 auto;
    width: 100% !important;
    max-width: 100% !important;
  }

  .tech-image img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
  }

/* Fallback block for non-image rows */
.block { margin: 16px 0; }

/* ---------------- Two-column images container (used in other pages) ---------------- */
.tech-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 24px 0;
}

/* Desktop: force 50/50 layout */
@media (min-width: 901px) {
  .tech-text {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .tech-image {
    flex: 0 0 50%;
    max-width: 50%;
    display: flex;
    justify-content: center; /* center image */
  }

  .tech-image img {
    width: 100%;
    max-width: 380px;  /* adjust if you want larger / smaller */
    height: auto;
  }
}


/* ---------------- Mobile styles (<=900px) ---------------- */
@media (max-width:900px) {

  /* Hide desktop sidebar */
  .sidebar { display:none; }

  /* Mobile header */
  .mobile-top {
    display:block;
    background:white;
    padding:12px 14px;
    border-bottom:1px solid rgba(0,0,0,0.08);
    position:sticky;
    top:0;
    z-index:1000;
    text-align:center;
  }

  .mobile-logo {
    width:140px; height:auto; margin:0 auto 10px; display:block;
  }

  .mobile-tabs {
    display:flex;
    justify-content:space-around;
    gap:6px;
    background:#fff;
  }

  .mobile-tabs a {
    flex:1;
    text-align:center;
    text-decoration:none;
    padding:8px 10px;
    background:#f2f5f7;
    border-radius:6px;
    font-size:14px;
    font-weight:600;
    color:#243344;
  }

  .mobile-tabs a.active {
    background:var(--accent);
    color:#fff;
  }

  /* ensure fixed behavior is handled by JS but allow CSS polish */
  .mobile-top.mobile-fixed {
    position:fixed !important;
    top:0; left:0; right:0;
    z-index:1100;
    box-shadow: 0 6px 18px rgba(10,20,30,0.06);
  }

  /* Stack tech rows */
  .tech-row {
    flex-direction: column;
    text-align: center;
  }
  .tech-image { flex: 0 0 auto; width: 100%; max-width: 360px; margin: 8px auto 0; }
  .tech-image img { width: 90%; max-width:360px; }

  /* Stack two-col images */
  .two-col-images { flex-direction: column; gap:12px; }
  .two-col-images img { max-width: 90%; margin: 0 auto; }

  /* Content padding on mobile */
  .content { margin-left:0; padding:20px; }

  /* anchor offset so headings are not hidden behind fixed header */
  section { scroll-margin-top: 140px; }
}

/* ---------------- Desktop-only two-image precise fix (safe & minimal) ---------------- */
@media (min-width: 901px) {
  .two-col-images {
    display:flex;
    gap:20px;
    justify-content:flex-start;
    align-items:flex-start;
    flex-wrap:nowrap;
  }
  .two-col-images img {
    flex: 0 0 48%;
    max-width:48%;
    height:auto;
  }
   .mobile-top {
    display: none !important;
  }
  /* ensure tech-image doesn't overflow if image is huge */
  .tech-image img {
    width: auto;            /* Allow natural width */
    max-width: 100%;        /* Don't exceed column width */
    max-height: 320px;      /* LIMIT HEIGHT — key fix */
    object-fit: contain;    /* Keep full image without cropping */
    border-radius: 10px;
    border: 2px solid #e5e5e5;
  }
}

/* accessibility focus */
a:focus {
  outline:3px solid rgba(11,111,175,0.2);
  outline-offset:3px;
}
