:root{
  --bg: #0b0f17;
  --panel: rgba(15,22,36,.76);
  --text: #e8eefc;
  --muted: #a8b3cf;
  --border: rgba(232, 238, 252, 0.12);
  --accent: #6ea8fe;
  --accent2: #7ee787;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 16px;
  --max: 1080px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--sans);
  background: radial-gradient(1200px 800px at 20% 10%, rgba(110,168,254,.07), transparent 60%),
              radial-gradient(1000px 700px at 85% 0%, rgba(126,231,135,.05), transparent 55%),
              var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a{color:inherit}
.container{
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11,15,23,.65);
  border-bottom: 1px solid rgba(232,238,252,.10);
}
.navbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding: 12px 0;
}
.brand{
  text-decoration:none;
  display:flex;
  flex-direction:column;
}
.brand strong{font-weight:800; letter-spacing:.2px}
.small{font-size: 13px; color: var(--muted)}
.mono{font-family: var(--mono)}

.navlinks{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; align-items:center}

.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.badge{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(232,238,252,.04);
  color: var(--muted);
  font-size: 12px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(232,238,252,.06);
  text-decoration:none;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
  font-weight: 650;
}
.btn:hover{transform: translateY(-1px); background: rgba(232,238,252,.10); border-color: rgba(232,238,252,.2)}
.btn.pill{padding:8px 10px; border-radius: 999px; font-weight:700}
.btn.primary{
  background: linear-gradient(135deg, rgba(110,168,254,.30), rgba(126,231,135,.18));
  border-color: rgba(110,168,254,.35);
}

main{padding: 18px 0 44px 0;}
.section{padding: 28px 0;}

.grid{display:grid; gap: 16px;}
@media (min-width: 860px){
  .grid.cols2{grid-template-columns: 1.2fr 1fr;}
  .grid.cols3{grid-template-columns: repeat(3, 1fr);}
}

h1,h2,h3{line-height:1.2;margin:0 0 12px 0}
h1{font-size: clamp(34px, 4vw, 46px);}
h2{font-size: 26px;}
h3{font-size: 18px;}

p{margin: 0 0 14px 0; color: var(--muted);}

hr{
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.list{margin:0; padding-left: 18px; color: var(--muted);}
.list li{margin: 6px 0;}

.proof{display:flex; flex-direction:column; gap:10px; padding:16px;}
.proof b{color: var(--text);}

.footer{
  border-top: 1px solid rgba(232,238,252,.10);
  background: rgba(11,15,23,.55);
  padding: 18px 0;
}

.project-card{padding: 16px;}
.project-card p{margin-bottom: 12px;}
.project-tags{display:flex; flex-wrap:wrap; gap:8px; margin-bottom: 14px;}

.avatar{
  width:72px; height:72px;
  border-radius: 16px;
  border: 1px solid rgba(232,238,252,.14);
  object-fit: cover;
}

/* Large profile avatar for hero card */
.avatar-lg {
  width: 160px;
  height: 200px;
  border-radius: 12px;
  border: 2px solid rgba(110,168,254,.25);
  object-fit: cover;
  object-position: top center;
  box-shadow: var(--shadow);
  display: block;
  margin: 0 auto 14px auto;
}

/* Terminal aesthetic */
.terminal-prompt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  opacity: 0.7;
  letter-spacing: 0.02em;
}

.hero-role {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  opacity: 0.8;
}

/* Terminal-style highlight lines */
.proof-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.proof-line .prompt {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.7;
}

/* Alternating center-axis timeline */
.timeline {
  position: relative;
  margin-top: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), rgba(110,168,254,.15));
  border-radius: 2px;
}
.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding-right: calc(50% + 28px);
  position: relative;
  margin-bottom: 24px;
}
.timeline-item:nth-child(even) {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: calc(50% + 28px);
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(50% - 11px);
  top: 16px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(110,168,254,.12), 0 0 14px rgba(110,168,254,.2);
  z-index: 1;
}
.timeline-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-bottom: 8px;
}
.timeline-body {
  padding-bottom: 4px;
  width: 100%;
}
.timeline-body h2 {
  font-size: 18px;
  margin-bottom: 2px;
}
.timeline-role {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}
.timeline-location {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
@media (max-width: 680px) {
  .timeline::before { left: 18px; transform: none; }
  .timeline-item,
  .timeline-item:nth-child(even) {
    justify-content: flex-start;
    padding-left: 52px;
    padding-right: 0;
  }
  .timeline-item::before { left: 7px; }
}

code, pre{font-family: var(--mono);}
pre{
  overflow:auto;
  background: rgba(232,238,252,.05);
  border: 1px solid rgba(232,238,252,.10);
  border-radius: 14px;
  padding: 12px;
  color: var(--text);
}

.notice{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(110,168,254,.25);
  background: rgba(110,168,254,.08);
  color: var(--muted);
}
input[type="text"],
input[type="email"],
textarea {
  transition: border-color 0.2s ease, background 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: rgba(110,168,254,.5);
  background: rgba(11,15,23,.8);
}

@media (max-width: 859px) {
  .grid.cols2 {
    grid-template-columns: 1fr;
  }
}
/* Accessibility Improvements */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  :root {
    --border: rgba(232, 238, 252, 0.25);
    --muted: #c9d1e1;
  }
  .badge {
    border: 1.5px solid var(--border);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #f0f4fc;
  --panel: rgba(255,255,255,0.88);
  --text: #1a2035;
  --muted: #4a5568;
  --border: rgba(26,32,53,0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.10);
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(110,168,254,.05), transparent 60%),
    radial-gradient(1000px 700px at 85% 0%, rgba(126,231,135,.03), transparent 55%),
    var(--bg);
}
:root[data-theme="light"] header {
  background: rgba(240,244,252,.80);
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 10px;
  line-height: 1;
  transition: background .2s ease, border-color .2s ease;
}
.theme-toggle:hover {
  background: rgba(232,238,252,.10);
  border-color: rgba(232,238,252,.2);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .navlinks {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    right: 20px;
    background: rgba(11,15,23,.96);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    gap: 8px;
    z-index: 100;
    min-width: 160px;
  }
  .navlinks.open { display: flex; }
}
:root[data-theme="light"] .navlinks {
  background: rgba(240,244,252,.98);
}

/* Scroll-triggered card animation */
.card {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .4s ease, transform .4s ease;
}
.card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Experience page */
.experience-item {
  padding: 20px;
  margin-top: 16px;
  position: relative;
  border-left: 3px solid rgba(110,168,254,.3);
  padding-left: 20px;
}
.experience-item:hover {
  border-left-color: rgba(110,168,254,.6);
}
.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.experience-header h2 {
  margin: 0;
  font-size: 20px;
}
.experience-date {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}
.experience-location {
  display: block;
  margin-bottom: 12px;
}

/* Blog */
.blog-list { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }

.blog-card { padding: 0; }
.blog-card-link {
  display: block;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  transition: background .2s ease;
}
.blog-card-link:hover { background: rgba(232,238,252,.05); }
.blog-card-link:hover .blog-read-more { color: var(--accent); }

.blog-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.blog-date { font-family: var(--mono); font-size: 12px; color: var(--accent); opacity: .85; }
.blog-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.blog-title { font-size: 20px; margin: 0 0 8px 0; }
.blog-excerpt { margin: 0 0 12px 0; color: var(--muted); font-size: 15px; }
.blog-read-more { font-size: 13px; color: var(--muted); font-weight: 600; transition: color .2s ease; }

/* Blog post page */
.blog-post-header { margin-bottom: 24px; }
.blog-post-header h1 { font-size: clamp(26px, 4vw, 38px); margin: 12px 0 8px 0; }
.blog-subtitle { font-size: 17px; color: var(--muted); margin: 0; }

.blog-body h2 { margin-top: 28px; }
.blog-body p, .blog-body li { color: var(--muted); line-height: 1.7; }
.blog-body ol.list { padding-left: 22px; }
.blog-body ol.list li { margin: 10px 0; }

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.lang-toggle { font-size: 13px; padding: 6px 10px; }

/* Light mode: form inputs */
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] textarea {
  background: rgba(255,255,255,0.9) !important;
  color: #1a2035 !important;
}
:root[data-theme="light"] input[type="text"]:focus,
:root[data-theme="light"] input[type="email"]:focus,
:root[data-theme="light"] textarea:focus {
  background: #ffffff !important;
}
