:root{
  /* Professional enterprise palette */
  --bg: #f6f7f9;
  --bg-alt: #ffffff;
  --text: #111827; /* near-black */
  --muted: #6b7280; /* gray-500 */
  --primary: #0a2540; /* deep navy */
  --primary-600: #081d32;
  --accent: #2e77ff; /* subtle accent for hovers */
  --primary-100: #e8eef7;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(16,24,40,0.08);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img{max-width:100%;display:block}

.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.skip-link:focus{left:1rem;top:1rem;width:auto;height:auto;padding:.5rem .75rem;background:#000;color:#fff;border-radius:.5rem;z-index:999}

.site-header{position:sticky;top:0;background:var(--card);border-bottom:1px solid var(--border);box-shadow:var(--shadow);z-index:10}
.nav{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.9rem 1rem;max-width:1200px;margin:0 auto}
.brand{font-weight:800;text-decoration:none;color:var(--primary);letter-spacing:.2px;line-height:1.2}
.nav-toggle{font-size:1.1rem;background:none;border:2px solid var(--border);border-radius:.6rem;padding:.25rem .5rem;color:var(--text)}
.nav-menu{display:flex;gap:.25rem;list-style:none;margin:0;padding:0}
.nav-menu a{color:var(--text);text-decoration:none;padding:.6rem .8rem;border-radius:.5rem}
.nav-menu a:hover,.nav-menu a:focus{background:var(--primary-100);color:var(--primary)}
.nav-menu a.active{background:var(--primary);color:#fff}

@media (max-width: 800px){
  .nav-menu{display:flex;flex-direction:column;gap:.25rem;background:var(--card);border:1px solid var(--border);padding:.5rem;border-radius:.75rem;position:absolute;right:1rem;top:3.25rem;box-shadow:var(--shadow)}
}

.hero{position:relative;overflow:hidden;border-bottom:1px solid var(--border);background:linear-gradient(180deg, var(--card), var(--bg))}
.hero-inner{display:grid;grid-template-columns: 260px 1fr;gap:2rem;align-items:center;max-width:1100px;margin:0 auto;padding:2.5rem 1rem}
.hero-photo{border:4px solid var(--card);box-shadow:var(--shadow);border-radius:1rem;background:var(--card)}
.hero-text h1{font-size:clamp(1.8rem, 2.6vw + 1rem, 2.8rem);margin:.25rem 0 .25rem}
.headline{color:var(--muted);margin:.25rem 0 .5rem;font-weight:600}
.tagline{font-size:1.05rem;color:var(--text);margin:.25rem 0 1rem}
.quick-facts{margin:0 0 1rem 1rem}
.quick-facts li{color:var(--text)}
.cta{display:flex;gap:.75rem;margin-top:.5rem;flex-wrap:wrap}
.btn{display:inline-block;padding:.7rem 1rem;border-radius:.6rem;text-decoration:none;font-weight:700;border:1px solid transparent}
.btn.primary{background:var(--primary);color:#fff;border-color:var(--primary)}
.btn.primary:hover{background:var(--primary-600)}
.btn.ghost{border-color:var(--primary);color:var(--primary);background:transparent}
.btn.ghost:hover{background:var(--primary-100)}

.section{padding:3rem 1rem}
.section.alt{background:var(--bg-alt)}
.container{max-width:1200px;margin:0 auto}

h1{font-size:clamp(1.8rem, 2.6vw + 1rem, 3rem);margin:0 0 .75rem;letter-spacing:.2px}
h2{font-size:clamp(1.5rem, 1.8vw + .6rem, 2.1rem);margin:0 0 1rem}
.muted{color:var(--muted)}
.note{color:#18324d;background:#eef5fd;border-left:4px solid var(--primary);padding:.5rem .75rem;border-radius:.5rem}

.timeline{list-style:none;padding:0;margin:0;display:grid;gap:1.25rem}
.timeline li{display:grid;grid-template-columns:24px 1fr;gap:1rem;align-items:start}
.timeline .dot{width:12px;height:12px;border-radius:50%;margin-top:.45rem;background:var(--primary);box-shadow:0 0 0 6px rgba(11,92,171,.12)}
.timeline .content{background:var(--card);border:1px solid var(--border);border-radius:.75rem;box-shadow:var(--shadow);padding:1rem}

.card{background:var(--card);border:1px solid var(--border);border-radius:.75rem;box-shadow:var(--shadow);padding:1rem;margin:.9rem 0}

.grid{display:grid;grid-template-columns:repeat(3, 1fr);gap:1rem;align-items:stretch}
.project{background:var(--card);border:1px solid var(--border);border-radius:.75rem;box-shadow:var(--shadow);padding:1rem;border-top:4px solid var(--primary);display:flex;flex-direction:column;height:100%}
.tags{display:flex;gap:.5rem;list-style:none;padding:0;margin:.5rem 0 0}
.tags li{background:#f4f7fb;border:1px solid var(--border);border-radius:999px;padding:.25rem .6rem;font-size:.85rem;color:#0a2e57}
.link{color:var(--primary);text-decoration:none}
.link:hover{text-decoration:underline}

.skill-list{display:grid;grid-template-columns:1fr 1fr;gap:1rem}
.skill-list li{margin:.25rem 0}

.cert-list{columns:2;gap:2rem}
.cert-list li{break-inside:avoid;margin:.25rem 0}

.contact-cards{display:flex;flex-wrap:wrap;gap:.75rem;margin:1rem 0}
.contact-card{display:inline-block;padding:.6rem .8rem;border:1px solid var(--border);border-radius:.6rem;background:var(--card);color:var(--text);text-decoration:none}
.contact-card:hover{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-100)}

.site-footer{padding:1.5rem 1rem;text-align:center;border-top:1px solid var(--border);color:var(--muted);background:var(--card)}

/* Responsive tweaks */
@media (max-width: 900px){
  .hero-inner{grid-template-columns:1fr;}
  .hero-photo{max-width:320px}
}
@media (max-width: 800px){
  .grid{grid-template-columns:1fr 1fr}
  .cert-list{columns:1}
}
@media (max-width: 520px){
  .grid{grid-template-columns:1fr}
  .skill-list{grid-template-columns:1fr}
}


/* Responsive YouTube embeds */
.video-embed{position:relative;width:100%;aspect-ratio:16/9;background:#000;border-radius:.6rem;overflow:hidden;box-shadow:var(--shadow);margin-top:.75rem}
.video-embed iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

/* Theme variants */
:root{
  /* Existing variables define the Light theme */
}

/* Explicit Light theme (overrides system preference when selected) */
:root[data-theme='light']{
  --bg: #f6f7f9;
  --bg-alt: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #0a2540;
  --primary-600: #081d32;
  --accent: #2e77ff;
  --primary-100: #e8eef7;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(16,24,40,0.08);
}

/* Dark theme */
:root[data-theme='dark']{
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --text: #e5e7eb;
  --muted: #9aa3b2;
  --primary: #5ea1ff;
  --primary-600: #3c7ae6;
  --accent: #8ab6ff;
  --primary-100: #12223d;
  --card: #0f172a;
  --border: #1f2a44;
  --shadow: 0 12px 30px rgba(0,0,0,0.45);
}

/* Color‑blind friendly high‑contrast theme (blue/orange, avoids red/green reliance) */
:root[data-theme='cb']{
  --bg: #ffffff;
  --bg-alt: #f7f7f7;
  --text: #111111;
  --muted: #4b5563;
  --primary: #004e98; /* deep blue */
  --primary-600: #003c75;
  --accent: #f28f3b; /* orange accent */
  --primary-100: #e6f0fb;
  --card: #ffffff;
  --border: #d1d5db;
  --shadow: 0 10px 28px rgba(17,24,39,0.10);
}

/* Prefer system dark when no explicit choice (script sets data-theme when chosen) */
@media (prefers-color-scheme: dark){
  :root:not([data-theme]){
    --bg: #0b1220;
    --bg-alt: #0f172a;
    --text: #e5e7eb;
    --muted: #9aa3b2;
    --primary: #5ea1ff;
    --primary-600: #3c7ae6;
    --accent: #8ab6ff;
    --primary-100: #12223d;
    --card: #0f172a;
    --border: #1f2a44;
    --shadow: 0 12px 30px rgba(0,0,0,0.45);
  }
}

/* Theme control */
.theme-control{margin-left:auto;display:flex;align-items:center;gap:.5rem}
.theme-select{appearance:none;padding:.45rem .65rem;border:1px solid var(--border);border-radius:.5rem;background:var(--card);color:var(--text);box-shadow:var(--shadow);min-width:8.5rem}
.theme-select:focus{outline:3px solid var(--primary-100);border-color:var(--primary)}

/* Accessibility helpers */
.visually-hidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}

/* Project video alignment helpers */
.project .video-embed{margin-top:auto}


/* Standardize project text line counts for alignment */
.project h3{
  line-height:1.3;
  display:-webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* show exactly two lines */
  overflow:hidden;
  min-height: calc(1.3em * 2); /* reserve space so all titles align */
}
.project p{
  line-height:1.6;
  display:-webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* show exactly three lines */
  overflow:hidden;
  min-height: calc(1.6em * 3); /* equalize description height across cards */
}


/* Theme selector fix: correct :root selectors to ensure theme works on all pages */
:root{
  --bg: #f6f7f9;
  --bg-alt: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #0a2540;
  --primary-600: #081d32;
  --accent: #2e77ff;
  --primary-100: #e8eef7;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(16,24,40,0.08);
}

:root[data-theme='light']{
  --bg: #f6f7f9;
  --bg-alt: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --primary: #0a2540;
  --primary-600: #081d32;
  --accent: #2e77ff;
  --primary-100: #e8eef7;
  --card: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(16,24,40,0.08);
}

:root[data-theme='dark']{
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --text: #e5e7eb;
  --muted: #9aa3b2;
  --primary: #5ea1ff;
  --primary-600: #3c7ae6;
  --accent: #8ab6ff;
  --primary-100: #12223d;
  --card: #0f172a;
  --border: #1f2a44;
  --shadow: 0 12px 30px rgba(0,0,0,0.45);
}

:root[data-theme='cb']{
  --bg: #ffffff;
  --bg-alt: #f7f7f7;
  --text: #111111;
  --muted: #4b5563;
  --primary: #004e98;
  --primary-600: #003c75;
  --accent: #f28f3b;
  --primary-100: #e6f0fb;
  --card: #ffffff;
  --border: #d1d5db;
  --shadow: 0 10px 28px rgba(17,24,39,0.10);
}
