/* Base styles — white with blue accents */
:root {
  --blue-600: #0A66C2;  /* primary accent */
  --blue-700: #084F99;
  --blue-50:  #F5F9FF;
  --text-900: #0f172a;
  --text-700: #334155;
  --border-200: #e2e8f0;
  --bg: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text-900);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: .5rem .75rem;
  background: var(--blue-600);
  color: #fff;
  z-index: 10000;
  border-radius: .5rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border-200);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 0;
}
.brand {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--blue-600);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  border-radius: .75rem;
  letter-spacing: .5px;
}

/* Nav */
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-700);
  font-weight: 600;
  padding: .5rem .75rem;
  border-radius: .5rem;
}
.site-nav a:hover,
.site-nav a:focus {
  color: var(--blue-700);
  background: var(--blue-50);
}
.site-nav a.active {
  color: var(--blue-600);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: .25rem;
}
.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-900);
  margin: 5px 0;
  border-radius: 2px;
}

/* Hero */
.hero {
  padding: 4rem 0 2rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: center;
}
.hero-media img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1.25rem;
  border: 1px solid var(--border-200);
  box-shadow: 0 10px 30px rgba(2, 6, 23, .08);
}
.headline {
  font-size: clamp(2rem, 3vw + 1rem, 3rem);
  line-height: 1.15;
  margin: 0 0 .5rem;
}
.kicker {
  margin: 0 0 1rem;
  color: var(--blue-600);
  font-weight: 700;
}
.tagline { font-size: 1.125rem; font-weight: 600; }
.intro { color: var(--text-700); }

.cta-row {
  display: flex;
  gap: .75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: .75rem 1rem;
  text-decoration: none;
  border-radius: .75rem;
  border: 1px solid var(--border-200);
  font-weight: 700;
}
.btn.primary {
  background: var(--blue-600);
  color: #fff;
  border: 1px solid var(--blue-600);
}
.btn.primary:hover { background: var(--blue-700); border-color: var(--blue-700); }
.btn.ghost:hover { border-color: var(--text-900); }

/* Quick links */
.quick-links {
  padding: 2rem 0 4rem;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--border-200);
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover, .card:focus {
  transform: translateY(-2px);
  border-color: var(--blue-600);
  box-shadow: 0 10px 20px rgba(2, 6, 23, .06);
}
.card h3 {
  margin: 0 0 .25rem;
}
.card p {
  margin: 0 0 .5rem;
  color: var(--text-700);
}
.card .arrow { font-weight: 800; color: var(--blue-600); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-200);
  padding: 1rem 0;
  background: #fff;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.site-footer a {
  color: var(--blue-600);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: 2; }
  .hero-copy { order: 1; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: .25rem;
    padding: .5rem 0 0;
  }
  .cards { grid-template-columns: 1fr; }
}


/* Social list & icon hover */
.social-list { list-style: none; padding-left: 0; margin: 0; display: grid; gap: .5rem; }
.icon-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .6rem;
  border-radius: .5rem;
  text-decoration: none;
  color: var(--text-900);
  transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}
.icon-link:hover, .icon-link:focus {
  background: var(--blue-50);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(2,6,23,.06);
}
.icon-img { width: 22px; height: 22px; display: inline-block; }
.icon-link span { font-weight: 600; }


/* Larger-but-compact icon list, two columns on desktop */
.social-list { 
  list-style: none; 
  padding-left: 0; 
  margin: .5rem 0 0; 
  display: grid; 
  gap: .35rem; 
}
@media (min-width: 900px) {
  .social-list { 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    column-gap: .75rem; 
  }
}
.icon-img { width: 28px; height: 28px; }
.icon-link { gap: .6rem; padding: .55rem .65rem; }

/* --- Projects Card Grid --- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px){ .cards { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--border-200); border-radius: 1rem; background: #fff; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--blue-600); box-shadow: 0 10px 20px rgba(2,6,23,.06); }
.card-body { padding: 1rem 1rem 1.1rem; }
.card-title { margin: 0 0 .35rem; font-size: 1.15rem; line-height: 1.35; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--blue-600); text-decoration: underline; }
.card-desc { margin: .35rem 0 .6rem; color: var(--text-700); }
.card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.tag { display: inline-block; padding: .3rem .5rem; border-radius: 999px; border: 1px solid var(--border-200); background: var(--blue-50); color: var(--blue-600); font-weight: 600; font-size: .8rem; }
.cards-featured .card-feature { grid-column: 1 / -1; }
.page-title { margin: 0; }
.page-subtitle { margin: .35rem 0 1.25rem; color: var(--text-700); }
.section-title { margin: 1.25rem 0 .5rem; }

/* --- Filter Bar --- */
.filter-bar{
  display: flex;
  gap: .5rem;
  margin: 1rem 0 1.25rem;
  flex-wrap: wrap;
}
.filter-btn{
  appearance: none;
  border: 1px solid var(--border-200);
  background: #fff;
  color: var(--text-900);
  padding: .45rem .8rem;
  border-radius: .5rem;
  font-weight: 700;
  cursor: pointer;
}
.filter-btn:hover{ border-color: var(--blue-600); }
.filter-btn.active{
  background: var(--blue-600);
  color: #fff;
  border-color: var(--blue-600);
}

/* --- Citation line --- */
.citation{
  display: inline-block;
  margin-left: .35rem;
  color: var(--text-700);
  font-size: .9rem;
  font-style: italic;
}

/* --- Card tag spacing tweaks --- */
.card-tags{ display:flex; gap:.4rem .45rem; flex-wrap:wrap; margin:.5rem 0 .9rem; }
.tag{ font-size:.75rem; padding:.25rem .45rem; }
/* Ensure actions row has breathing room from tags/description */
.card-actions{ margin-top:.5rem; }
.citation{ display:block; margin-top:.35rem; }

/* --- About page enhancements --- */
.about-card{ border:1px solid var(--border-200); border-radius:1rem; padding:1.25rem; background:#fff; margin-bottom:1rem; }
.stat-strip{ display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:.75rem; margin-bottom:1rem; }
.stat{ border:1px solid var(--border-200); border-radius:1rem; background:var(--blue-50); padding:1rem; text-align:center; }
.stat-num{ font-weight:800; color:var(--blue-600); font-size:1.15rem; }
.stat-label{ color:var(--text-700); font-weight:600; }
@media (max-width: 900px){ .stat-strip{ grid-template-columns: 1fr; } }

.timeline{ list-style:none; margin:0; padding:0; position:relative; }
.tl-item{ display:flex; gap:.75rem; padding:.4rem 0; position:relative; }
.tl-item + .tl-item{ border-top:1px dashed var(--border-200); }
.tl-dot{ width:10px; height:10px; border-radius:50%; background:var(--blue-600); margin-top:.55rem; flex:0 0 10px; }
.tl-content h3{ margin:.15rem 0 .15rem; font-size:1.05rem; }
.tl-content p{ margin:0; color:var(--text-700); }

.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
@media (max-width: 900px){ .grid-2{ grid-template-columns:1fr; } }

.chip-row{ display:flex; flex-wrap:wrap; gap:.4rem .5rem; margin:.7rem 0 .2rem; }
.chip{ display:inline-block; border:1px solid var(--border-200); border-radius:999px; padding:.28rem .6rem; background:#fff; color:var(--text-900); font-weight:700; font-size:.8rem; }
.teach-list{ padding-left:1rem; margin:.4rem 0 0; }
.teach-list li{ margin:.3rem 0; }
.teach-list em{ font-style:italic; }

/* CV helpers */
.text-subtle{ color: var(--text-700); }
.cv-header h1 + p { color: var(--text-700); }

/* --- Hero Portrait Styling --- */
.portrait-frame{
  position: relative;
  border-radius: 1.25rem;
  padding: 10px; /* space for the glow ring */
  background: radial-gradient(90% 90% at 30% 20%, rgba(10,102,194,0.22), rgba(10,102,194,0.04) 60%, rgba(10,102,194,0.00) 100%);
  box-shadow: 0 24px 60px rgba(2,6,23,0.12);
  border: 1px solid var(--border-200);
}
.portrait-frame::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1.1rem;
  padding: 2px;
  background: linear-gradient(135deg, rgba(10,102,194,.55), rgba(10,102,194,.15));
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.portrait-img{
  display:block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: 0 10px 28px rgba(2,6,23,0.10);
  background: #fff;
}
/* Subtle hover lift on large screens only */
@media (hover:hover) and (min-width: 900px){
  .portrait-frame{ transition: transform .25s ease, box-shadow .25s ease; }
  .portrait-frame:hover{ transform: translateY(-4px); box-shadow: 0 34px 80px rgba(2,6,23,0.16); }
}
/* Optional soft backdrop behind hero on desktop */
@media (min-width: 900px){
  .hero{ position: relative; }
  .hero::after{
    content:"";
    position: absolute;
    inset: auto 0 -120px 0;
    height: 240px;
    background: radial-gradient(50% 50% at 50% 0%, rgba(10,102,194,0.08), rgba(10,102,194,0));
    pointer-events: none;
  }
}

/* Profile Box */
.profile-box{
  border:1px solid var(--border-200);
  border-radius:1rem;
  background:#fff;
  padding:1.25rem;
  margin:1rem 0 1.25rem;
  box-shadow: 0 6px 14px rgba(2,6,23,.06);
}
.profile-title{
  margin:0 0 .75rem;
  font-size:1.25rem;
}
.profile-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:.75rem 1rem;
}
@media (max-width: 900px){
  .profile-grid{ grid-template-columns: 1fr; }
}
.label{
  color: var(--text-700);
  font-weight:700;
  font-size:.85rem;
  margin-bottom:.1rem;
}
.value{
  color: var(--text-900);
}
.profile-chips{
  display:flex; flex-wrap:wrap; gap:.4rem .5rem;
  margin:.8rem 0 .4rem;
}
.profile-actions{
  display:flex; flex-wrap:wrap; gap:.5rem;
  margin-top:.6rem;
}

/* === Typography Refinements === */
html { scroll-behavior: smooth; }
body { line-height: 1.7; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

h1, h2, h3 { letter-spacing: -0.01em; }
h1 { font-size: clamp(1.85rem, 1.1rem + 2vw, 2.4rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.3rem, 1rem + 1vw, 1.6rem); margin: .25rem 0 .5rem; }
h3 { font-size: 1.15rem; margin: .2rem 0 .35rem; }

p { margin: 0 0 .85rem; color: var(--text-900); }

/* Buttons slightly more comfortable */
.btn { padding: .55rem .85rem; font-weight: 700; border-radius: .65rem; }

/* Section breathing room defaults (safe, minimal) */
.container section { margin-bottom: 1.25rem; }

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border-200);
  background: #fff;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 0;
}
.footer-copy { color: var(--text-700); font-size: .95rem; }
.footer-nav { display: flex; gap: .85rem; flex-wrap: wrap; }
.footer-nav a { color: var(--blue-700); font-weight: 700; }
@media (max-width: 720px){
  .footer-inner { flex-direction: column; align-items: flex-start; }
}


/* === Scroll Reveal === */
[data-reveal]{
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
}
[data-reveal].in{
  opacity: 1;
  transform: translateY(0);
}
.cards [data-reveal] { transition-delay: .03s; }
.cards [data-reveal]:nth-child(2) { transition-delay: .06s; }
.cards [data-reveal]:nth-child(3) { transition-delay: .09s; }
.cards [data-reveal]:nth-child(4) { transition-delay: .12s; }


/* Active nav link — supports <a.active> and <li.active > a> */



/* === Header nav active/hover: BLUE, header-only === */
header nav a {
  transition: color .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}
header nav a:hover {
  color: var(--accent-blue-700, #1d4ed8);
}
header nav a.active,
header nav li.active > a {
  color: var(--accent-blue-700, #1d4ed8) !important;
  font-weight: 700;
  border-bottom: 2px solid var(--accent-blue-700, #1d4ed8) !important;
}

/* === Footer nav: no underlines, no active decoration === */
.footer-nav a {
  text-decoration: none !important;
  border-bottom: 0 !important;
}
.footer-nav a:hover, .footer-nav a:focus {
  text-decoration: none !important;
}


/* === Force CV active style regardless of JS === */
body[data-page="cv"] header nav a[href$="cv.php"],
body[data-page="cv"] header nav a[href$="cv.html"] {
  color: var(--accent-blue-600, #2563eb) !important;
  font-weight: 700 !important;
  border-bottom: 2px solid var(--accent-blue-600, #2563eb) !important;
}


/* === Navigation (Blue 600) === */
:root { --accent-blue-600: #2563eb; --accent-blue-700: #1d4ed8; }

header nav a { transition: color .2s ease, border-color .2s ease; }
header nav a:hover { color: var(--accent-blue-700); }
header nav a.active,
header nav li.active > a { color: var(--accent-blue-700); font-weight: 700; border-bottom: 2px solid var(--accent-blue-700); }

/* Force CV active even without JS (body[data-page]) */
body[data-page="cv"] header nav a[href$="cv.php"],
body[data-page="cv"] header nav a[href$="cv.html"] { color: var(--accent-blue-700) !important; font-weight: 700 !important; border-bottom: 2px solid var(--accent-blue-700) !important; }

/* Footer links clean */
.footer-nav a { text-decoration: none; border: 0; }
.footer-nav a:hover, .footer-nav a:focus { text-decoration: none; }
