:root{
  /* Dark theme as default to better match reference */
  --bg: #0b0f1a;
  --fg: #edf1f7;
  --muted: #9aa3b2;
  --card: #0f172a;
  --border: #1f2a37;
  --accent: #e5e7eb;
  --accent-weak: #0c1222;
  --radius: 12px;
  --col-gap: 40px;
  --content-w: 760px;
}
@media (prefers-color-scheme: light){
  :root{
    --bg: #ffffff;
    --fg: #0a0a0a;
    --muted: #6b7280;
    --card: #f8fafc;
    --border: #e5e7eb;
    --accent: #111827;
    --accent-weak: #f3f4f6;
  }
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg); color: var(--fg); line-height: 1.6;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a img{ max-width: 100%; height: auto }
img{ max-width: 100%; height: auto }
a,button{transition: all .15s ease}
a{color: inherit; text-decoration: none}
a:hover{ text-decoration: underline; text-underline-offset: 3px }

.layout{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: var(--col-gap);
  max-width: calc(320px + var(--col-gap) + var(--content-w));
  padding: 32px 24px 64px;
  margin: 0 auto;
}
@media (max-width: 960px){
  .layout{
    grid-template-columns: 1fr;
    max-width: 820px;
    gap: 24px;
  }
}

.sidebar{
  position: sticky; top: 24px; align-self: start;
  display:flex; flex-direction: column; gap: 20px;
}
.id{display:flex; align-items:center; gap: 14px}
.avatar{width:56px; height:56px; border-radius: 50%; border:1px solid var(--border); background: var(--card); object-fit: cover}
h1{font-size: 1.4rem; line-height: 1.2; margin: 0}
.muted{color: var(--muted)}
.small{font-size: .9rem}

.nav{display:flex; flex-direction:column; gap: 6px; margin-top: 8px}
.nav a{
  padding: 6px 10px; border-radius: 999px; border: 1px solid transparent; width: fit-content;
}
.nav a.active{ border-color: var(--border); background: var(--accent-weak) }
.nav a:hover{ border-color: var(--border) }

.social{display:flex; gap:8px; flex-wrap: wrap}
.social a{
  padding: 6px 10px; border-radius:999px; border:1px solid var(--border);
  background: var(--bg);
  background: color-mix(in oklab, var(--bg) 94%, transparent);
}
.social a:hover{ background: var(--accent-weak) }

.bio{ margin-top: 8px }

.content{ min-width: 0 }

.section{ margin-bottom: 40px }
.section-head{ display:flex; align-items:center; justify-content: space-between; gap: 12px; margin-bottom: 10px }
h2{ font-size: 1.05rem; text-transform: none; letter-spacing: 0; margin: 0 }

.grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
@media (max-width: 720px){
  .grid{ grid-template-columns: 1fr }
}

.card{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 14px;
}
.card h3{ margin: 0 0 4px; font-size: 1rem }
.card p{ margin: 0 0 8px; color: var(--muted) }
.badges{ display:flex; flex-wrap: wrap; gap: 6px; margin-top: 6px }
.badge{
  background: var(--bg); border:1px solid var(--border); color: var(--muted);
  padding: 2px 8px; border-radius: 999px; font-size: .8rem
}

.list{ display:flex; flex-direction: column; gap: 10px; padding:0; margin:0; list-style:none }
.list li{ padding: 12px; border:1px solid var(--border); border-radius: var(--radius); background: var(--card) }
.list .meta{ color: var(--muted); font-size:.9rem; margin-top: 4px }
.list.compact li{ display:flex; align-items:center; justify-content: space-between; gap: 8px }

.filters{ display:flex; gap: 8px; flex-wrap: wrap }
.filter{
  padding: 6px 10px; border:1px solid var(--border); border-radius: 999px; cursor: pointer; background: var(--bg);
}
.filter.active{ border-color: var(--fg); background: var(--accent-weak) }

/* Smooth anchors */
html{ scroll-behavior: smooth }

/* Timeline visuals — centered line with alternating cards */
#timeline-list{ position: relative; list-style: none; padding: 10px 0; margin: 0 }
#timeline-list::before{
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--border); transform: translateX(-50%);
}
#timeline-list .t-item{ display:grid; grid-template-columns: 1fr 40px 1fr; align-items: center; gap: 14px; margin: 22px 0 }
#timeline-list .t-col.mid{ display:flex; align-items:center; justify-content:center }
/* Side-aligned dot with pulse (doesn't cross the line) */
#timeline-list .t-dot{ position: relative; width: 10px; height: 10px; border-radius: 999px; background: var(--bg); border: 2px solid var(--fg) }
#timeline-list .t-item.left .t-dot{ transform: translateX(-10px) }
#timeline-list .t-item.right .t-dot{ transform: translateX(10px) }
#timeline-list .t-dot::after{
  content: ""; position: absolute; inset: -8px; border-radius: 999px;
  border: 2px solid color-mix(in oklab, var(--fg) 60%, transparent);
  opacity: 0.7; animation: pulse 2.2s ease-out infinite;
}
#timeline-list .t-item.left .t-dot::after{ clip-path: inset(-8px 50% -8px -8px) }
#timeline-list .t-item.right .t-dot::after{ clip-path: inset(-8px -8px -8px 50%) }
@keyframes pulse{ 0%{ transform: scale(.6); opacity:.7 } 70%{ transform: scale(1.25); opacity:0 } 100%{ transform: scale(.6); opacity:0 } }
#timeline-list .t-card{ border:1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 14px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease }
#timeline-list .t-card:hover{ transform: translateY(-1px); border-color: color-mix(in oklab, var(--border) 50%, var(--fg) 10%); box-shadow: 0 6px 16px rgba(0,0,0,.25) }
#timeline-list .t-card h3{ margin: 0 0 4px; font-size: 1rem }
#timeline-list .t-card .meta{ color: var(--muted); margin-top: 2px }
#timeline-list .t-card ul{ list-style: none; margin: 8px 0 0; padding: 0; display:flex; flex-direction: column; gap: 8px }
#timeline-list .t-card li{ position: relative; padding-left: 22px; color: var(--fg) }
#timeline-list .t-card li::before{
  content: ""; position: absolute; left: 0; top: .58em; width: 9px; height: 9px; border-radius: 999px;
  background: transparent; border: 2px solid color-mix(in oklab, var(--fg) 70%, transparent);
}
#timeline-list .t-date{ color: var(--muted); font-size: .85rem; text-align: right; padding: 0 8px }
#timeline-list .t-date span{
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--bg);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  border:1px solid var(--border);
}
#timeline-list .t-item.right .t-date{ text-align: left }
#timeline-list .t-badges{ display:flex; flex-wrap: wrap; gap: 6px; margin-top: 6px }
#timeline-list .badge{ background: var(--bg); border:1px solid var(--border); color: var(--muted); padding: 2px 8px; border-radius: 999px; font-size: .8rem }

/* Mobile: left line with dot; single column cards */
@media (max-width: 768px){
  #timeline-list::before{ left: 24px; transform: none }
  #timeline-list .t-item{ grid-template-columns: 24px 1fr; gap: 12px }
  /* Place the dot column on the left spanning the stack */
  #timeline-list .t-col.mid{ align-self: flex-start; justify-content: center; grid-column: 1; grid-row: 1 / span 2 }
  #timeline-list .t-dot{ transform: none }
  /* Stack both date and card in the content column for all items using explicit rows */
  #timeline-list .t-col.left, #timeline-list .t-col.right{ grid-column: 2 }
  /* For left-side items: date is in .t-col.right (row 1), card is in .t-col.left (row 2) */
  #timeline-list .t-item.left .t-col.right{ grid-row: 1 }
  #timeline-list .t-item.left .t-col.left{ grid-row: 2 }
  /* For right-side items: date is in .t-col.left (row 1), card is in .t-col.right (row 2) */
  #timeline-list .t-item.right .t-col.left{ grid-row: 1 }
  #timeline-list .t-item.right .t-col.right{ grid-row: 2 }
  #timeline-list .t-date{ text-align: left; margin: 0 0 6px 0 }
  /* Prevent long text from overflowing on narrow screens */
  #timeline-list .t-card, #timeline-list .t-card h3, #timeline-list .t-card li, #timeline-list .t-card .meta{
    word-break: break-word; overflow-wrap: anywhere;
  }
}

/* Skills grid tighter like badge groups */
#skills-grid .card{ padding: 12px }
#skills-grid h3{ margin: 0 0 6px }
#skills-grid .badges .badge{ background: var(--bg) }

/* Education labels */
.edu-label{ display:inline-block; margin-top: 8px; margin-right: 8px; color: var(--muted); font-size: .85rem }

/* Projects grid similar to timeline cards */
#projects-grid .card{ border:1px solid var(--border); border-radius: var(--radius); background: var(--card) }

/* New header/hero layout */
.container{ max-width: 1000px; margin: 0 auto; padding: 0 20px }
.header{ position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); border-bottom:1px solid var(--border); background: var(--bg); background: color-mix(in oklab, var(--bg) 88%, transparent) }
.header-inner{ display:flex; align-items:center; justify-content: space-between; padding: 10px 0 }
.profile-mini{ display:flex; align-items:center; gap:10px }
.avatar.small{ width:36px; height:36px; border-radius:50%; border:1px solid var(--border); background: var(--card); object-fit: cover }
.name{ font-weight:600 }
.top-nav{ display:none; gap:16px }
@media(min-width:768px){ .top-nav{ display:flex } }
.top-social{ display:none; gap:10px }
@media(min-width:1024px){ .top-social{ display:flex } }

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

/* Icon buttons in top-right social */
.top-social a{ width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; border:1px solid var(--border); background: var(--bg); background: color-mix(in oklab, var(--bg) 94%, transparent) }
.top-social a{ color: var(--fg) }
.top-social a:hover{ background: var(--accent-weak); border-color: var(--fg) }
.top-social svg{ width:18px; height:18px; display:block }
.top-social .contact-pill{ display:inline-flex; align-items:center; gap:8px; padding: 6px 10px; border-radius: 999px; border:1px solid var(--border); background: var(--bg); background: color-mix(in oklab, var(--bg) 94%, transparent); color: var(--fg); font-size: .95rem; line-height: 1; user-select: text }
.top-social .contact-pill:hover{ background: var(--accent-weak); border-color: var(--fg) }
.top-social .contact-pill svg{ width:18px; height:18px; display:block }
.top-social .contact-pill .contact-text{ font-weight: 500; letter-spacing: 0.01em }
.top-social .icon-github svg{ fill: var(--fg) }
.top-social .icon-linkedin svg{ fill: var(--fg) }
.top-social .icon-mail svg{ stroke: var(--fg); fill: none }
.top-social .icon-phone svg{ stroke: var(--fg); fill: none }

.hero{ padding: 56px 0 }
.hero-inner{ display:grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: start }
.hero-photo img{ width: 160px; height: 160px; border-radius: 50%; border: 2px solid var(--border); object-fit: cover; background: var(--card) }
/* Elevate the hero heading to feel like an H1 */
.hero-quote blockquote{
  margin: 0 0 8px; color: var(--fg);
  font-weight: 600; letter-spacing: -0.01em;
  font-size: clamp(1.25rem, 1.05rem + 1.0vw, 1.8rem);
  line-height: 1.2;
  white-space: normal;
}
@media (min-width: 1024px){ .hero-quote blockquote{ white-space: nowrap } }
.hero-summary{ margin-top: 10px; display:flex; flex-wrap: wrap; gap: 8px }
.hero-summary .badge{ background: var(--bg); background: color-mix(in oklab, var(--bg) 90%, transparent); border-color: var(--border); font-size: .9rem; padding: 6px 10px }
.notice{ margin-top: 10px; display:flex; flex-direction: column; gap: 6px }
.notice .line{ display:flex; align-items: center; gap: 8px }
.notice .emph{ font-weight: 700 }
.notice .muted{ color: var(--muted) }
.notice .icon{ font-size: 18px; line-height: 1; flex: 0 0 auto }

/* Inline resume note */
.inline-note{ margin-top: 10px; display:flex; align-items:center; gap:10px }
.inline-note .icon{ font-size: 18px; line-height: 1 }
.inline-note a{ color: #3aa3e3 }
.hero-cta{ display:flex; gap:10px; margin-top: 12px }
.btn{ display:inline-block; padding: 10px 14px; border-radius: 999px; border:1px solid var(--fg); background: transparent }
.btn:hover{ background: var(--fg); color: var(--bg) }
.btn.ghost{ border-color: var(--border) }
.btn.ghost:hover{ background: var(--accent-weak); color: var(--fg) }

/* Mobile responsiveness tweaks */
@media (max-width: 700px){
  .hero-inner{ grid-template-columns: 1fr }
  .hero-photo{ display:flex; justify-content:center }
  .hero-photo img{ width: 120px; height: 120px }
}
@media (max-width: 600px){
  .header-inner{ flex-wrap: wrap; gap: 10px }
  .top-nav{ order: 3; width: 100%; justify-content: center }
  .profile-mini{ flex: 1 }
}

.footer{ border-top:1px solid var(--border); padding: 20px 0; color: var(--muted) }

/* Contact section */
.contact-grid{ display:grid; grid-template-columns: 1fr; gap: 20px }
@media(min-width:900px){ .contact-grid{ grid-template-columns: 1fr 1fr } }
.contact-left h3, .contact-right h3{ margin: 0 0 12px; font-size: 1.1rem }
.contact-links{ display:flex; flex-direction: column; gap: 10px; margin-bottom: 16px }
.contact-links a{ display:flex; align-items:center; gap: 10px; color: var(--fg); border:1px solid var(--border); background: var(--card); padding: 10px 12px; border-radius: var(--radius) }
.contact-links a:hover{ border-color: var(--fg) }
.contact-links svg{ width:18px; height:18px }
.contact-links .contact-item{ display:none }
.contact-left .contact-subhead{ margin: 14px 0 8px; font-size: 1.2rem; font-weight: 700; color: var(--fg) }
.location-row{ display:flex; align-items:center; gap:10px; color: var(--muted); }
.location-row svg{ width:18px; height:18px }
.contact-form{ display:flex; flex-direction: column; gap: 10px }
.label{ display:block; margin-bottom: 6px; color: var(--muted); font-size: .9rem }
.input, .textarea{ width:100%; border:1px solid var(--border); border-radius: var(--radius); background: var(--card); color: var(--fg); padding: 10px 12px }
.input:focus, .textarea:focus{ outline:none; border-color: var(--fg) }
.location{ margin-top: 10px }
