/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #f7f9ff;
  --bg-alt:  #eef2fb;
  --surface: #ffffff;
  --border:  #d8e2f5;
  --border2: #c4d2ee;
  --navy:    #0d1f45;
  --blue:    #1d4ed8;
  --blue2:   #6d28d9;
  --text:    #0f172a;
  --muted:   #4e5f7a;
  --green:   #059669;
  --amber:   #d97706;
  --red:     #ef4444;
  --radius:  12px;
  --shadow:  0 2px 16px rgba(29,78,216,.1);
  --shadow-lg: 0 8px 40px rgba(29,78,216,.14);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  /* Subtle circuit-grid dot pattern over the whole page */
  background-image:
    radial-gradient(circle, rgba(29,78,216,.13) 1px, transparent 1px),
    linear-gradient(rgba(29,78,216,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,78,216,.035) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px, 32px 32px;
  background-attachment: fixed;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
#navbar {
  position: fixed; top: 0; width: 100%; z-index: 900;
  background: rgba(247,249,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(29,78,216,.07);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 2rem;
  padding: .85rem 2rem;
}
.nav-logo {
  font-weight: 700; font-size: .95rem; white-space: nowrap; color: var(--navy);
  letter-spacing: -.01em;
}
.nav-logo span { color: var(--blue); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-size: .85rem; font-weight: 500;
  transition: color .18s; letter-spacing: .01em;
}
.nav-links a:hover { color: var(--blue); text-decoration: none; }
.chat-nav-btn {
  background: var(--blue); color: #fff; border: none;
  padding: .42rem 1.1rem; border-radius: 6px; font-size: .83rem; font-weight: 600;
  cursor: pointer; transition: background .18s; letter-spacing: .01em;
}
.chat-nav-btn:hover { background: #1a44c2; }

/* ── Hero ── */
#hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: space-between;
  gap: 4rem; padding: 7rem 2rem 5rem;
  max-width: 1120px; margin: 0 auto;
  position: relative;
}

/* Circuit accent lines in hero bg */
#hero::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(29,78,216,.07) 49.5%, rgba(29,78,216,.07) 50.5%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(29,78,216,.07) 49.5%, rgba(29,78,216,.07) 50.5%, transparent 50.5%);
  background-size: 160px 160px;
  mask-image: radial-gradient(ellipse 80% 80% at 60% 50%, black 30%, transparent 80%);
}

.hero-content { max-width: 540px; position: relative; z-index: 1; }

.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(29,78,216,.08); border: 1px solid rgba(29,78,216,.22);
  color: var(--blue); padding: .3rem .9rem; border-radius: 20px;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 1.3rem;
}
.hero-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.35; } }

#hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.12; margin-bottom: 1rem; color: var(--navy);
  letter-spacing: -.02em;
}
.hero-tagline {
  color: var(--muted); font-size: 1rem; margin-bottom: 1.6rem; line-height: 1.65;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: .6rem 1.4rem;
  font-size: .82rem; color: var(--muted); margin-bottom: 2rem;
}
.hero-meta a { color: var(--muted); }
.hero-meta a:hover { color: var(--blue); }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
  background: var(--blue); color: #fff; padding: .65rem 1.5rem;
  border-radius: 8px; font-weight: 600; font-size: .9rem;
  border: none; cursor: pointer; transition: background .18s;
  display: inline-block; letter-spacing: .01em;
}
.btn-primary:hover { background: #1a44c2; text-decoration: none; color: #fff; }
.btn-secondary {
  background: var(--surface); color: var(--navy);
  padding: .65rem 1.5rem; border-radius: 8px;
  border: 1.5px solid var(--border2); font-weight: 600; font-size: .9rem;
  cursor: pointer; transition: border-color .18s, color .18s, box-shadow .18s;
  letter-spacing: .01em;
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); box-shadow: var(--shadow); }

/* ── Tech Panel (Hero Visual) ── */
.hero-visual { position: relative; z-index: 1; flex-shrink: 0; }

.tech-panel {
  width: 340px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  font-family: 'Inter', monospace;
}

.panel-header {
  display: flex; align-items: center; gap: .45rem;
  padding: .7rem 1rem;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.panel-dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.panel-dot.green { background: #30d158; }
.panel-dot.amber { background: #ffd60a; }
.panel-dot.red   { background: #ff453a; }
.panel-title {
  font-size: .72rem; color: rgba(255,255,255,.5);
  margin-left: .4rem; font-family: 'JetBrains Mono', monospace;
  letter-spacing: .06em;
}

.panel-metrics {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.metric {
  padding: 1rem 1.1rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.metric:nth-child(even) { border-right: none; }
.metric:nth-child(3), .metric:nth-child(4) { border-bottom: none; }
.metric-val {
  display: block; font-size: 1.55rem; font-weight: 800;
  color: var(--navy); line-height: 1.1; margin-bottom: .2rem;
  letter-spacing: -.03em;
}
.metric-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

.panel-tags {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(29,78,216,.03);
}
.ptag {
  background: rgba(29,78,216,.09); border: 1px solid rgba(29,78,216,.2);
  color: var(--blue); padding: .18rem .55rem; border-radius: 4px;
  font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  font-family: 'JetBrains Mono', monospace;
}

.panel-bar-section { padding: .9rem 1rem 1rem; }
.bar-label { font-size: .7rem; color: var(--muted); margin-bottom: .3rem; font-weight: 500; }
.bar-track {
  height: 6px; background: var(--bg-alt); border-radius: 3px;
  margin-bottom: .65rem; overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  animation: grow 1.4s cubic-bezier(.4,0,.2,1) both;
}
.fill2 { background: linear-gradient(90deg, var(--blue2), #a78bfa); animation-delay: .15s; }
.fill3 { background: linear-gradient(90deg, #0369a1, #38bdf8); animation-delay: .3s; }
@keyframes grow { from { width: 0 !important; } }

/* ── Sections ── */
section:not(#hero) { padding: 5rem 2rem; }
.container { max-width: 1120px; margin: 0 auto; }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--navy);
  margin-bottom: 2.5rem; position: relative; padding-bottom: .75rem;
  letter-spacing: -.02em;
}
.section-title::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 44px; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue2));
  border-radius: 2px;
}

/* ── About / Skills ── */
#about { background: var(--surface); }
.summary-text {
  font-size: 1.02rem; color: var(--muted); max-width: 800px;
  margin-bottom: 2.5rem; line-height: 1.8;
}
.skills-heading { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--navy); }
.skills-grid { display: flex; flex-wrap: wrap; gap: .55rem; }
.skill-chip {
  background: rgba(29,78,216,.07); border: 1px solid rgba(29,78,216,.2);
  color: var(--blue); padding: .32rem .85rem; border-radius: 20px;
  font-size: .8rem; font-weight: 600; transition: background .18s, border-color .18s;
  letter-spacing: .01em;
}
.skill-chip:hover { background: rgba(29,78,216,.14); border-color: rgba(29,78,216,.35); }

/* ── Timeline ── */
#experience { background: var(--bg-alt); }
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--blue) 0%, var(--border) 100%);
}
.timeline-item { position: relative; margin-bottom: 2.25rem; }
.timeline-dot {
  position: absolute; left: -2.1rem; top: 1.4rem;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--blue); border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 3px rgba(29,78,216,.2);
}
.dot-sm { width: 11px; height: 11px; left: -1.9rem; background: var(--border2); box-shadow: none; border-color: var(--bg-alt); }
.timeline-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.7rem 2rem;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 1px 4px rgba(29,78,216,.06);
}
.timeline-card:hover { border-color: rgba(29,78,216,.35); box-shadow: var(--shadow-lg); }
.card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.card-header h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .2rem; color: var(--navy); }
.company { color: var(--blue); font-size: .88rem; font-weight: 600; }
.date-badge {
  background: rgba(29,78,216,.08); border: 1px solid rgba(29,78,216,.18);
  color: var(--blue); padding: .22rem .7rem; border-radius: 20px;
  font-size: .75rem; font-weight: 700; white-space: nowrap; letter-spacing: .04em;
}
.role-summary { color: var(--muted); font-size: .93rem; margin-bottom: 1rem; line-height: 1.7; }
.achievements { padding-left: 1.2rem; display: flex; flex-direction: column; gap: .45rem; }
.achievements li { color: var(--muted); font-size: .88rem; line-height: 1.65; }
.achievements li::marker { color: var(--blue); }

/* Additional experience */
.card-sm { padding: 1.2rem 1.75rem; }
.additional-title { font-size: .95rem; font-weight: 700; margin-bottom: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.additional-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: .65rem; }
.additional-item {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: .65rem 1rem;
  transition: border-color .18s;
}
.additional-item:hover { border-color: rgba(29,78,216,.3); }
.add-company { display: block; font-weight: 700; font-size: .88rem; margin-bottom: .12rem; color: var(--navy); }
.add-role { font-size: .78rem; color: var(--muted); }

/* ── Education ── */
#education { background: var(--surface); }
.edu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1.4rem; }
.edu-card {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.65rem;
  display: flex; gap: 1.2rem; align-items: flex-start;
  transition: border-color .2s, box-shadow .2s;
}
.edu-card:hover { border-color: rgba(29,78,216,.35); box-shadow: var(--shadow); }
.edu-icon { font-size: 1.9rem; }
.edu-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: .28rem; color: var(--navy); }
.edu-field { color: var(--blue); font-size: .88rem; margin-bottom: .22rem; font-weight: 600; }
.edu-school { color: var(--muted); font-size: .82rem; }

/* ── Certifications ── */
#certifications { background: var(--bg-alt); }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 1.1rem; }
.cert-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  text-align: center; transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 1px 4px rgba(29,78,216,.05);
}
.cert-card.active:hover  { border-color: var(--green); box-shadow: 0 4px 20px rgba(5,150,105,.12); }
.cert-card.in-progress:hover { border-color: var(--amber); box-shadow: 0 4px 20px rgba(215,119,6,.12); }
.cert-icon { font-size: 2rem; display: block; margin-bottom: .7rem; }
.cert-card h3 { font-size: .87rem; font-weight: 700; margin-bottom: .7rem; line-height: 1.4; color: var(--navy); }
.cert-status { display: inline-block; padding: .22rem .7rem; border-radius: 12px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.status-active   { background: rgba(5,150,105,.1); color: var(--green); border: 1px solid rgba(5,150,105,.25); }
.status-progress { background: rgba(215,119,6,.1); color: var(--amber); border: 1px solid rgba(215,119,6,.25); }

/* ── Contact ── */
#contact { background: var(--surface); }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 1rem; margin-bottom: 3rem; }
.contact-card {
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.4rem;
  display: flex; align-items: center; gap: .9rem;
  font-size: .88rem; color: var(--text); transition: border-color .2s, box-shadow .2s;
}
.contact-card:hover { border-color: rgba(29,78,216,.35); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.contact-icon { font-size: 1.3rem; }
.chat-cta { text-align: center; }
.chat-cta p { color: var(--muted); margin-bottom: 1rem; font-size: .95rem; }

/* ── Footer ── */
footer {
  text-align: center; padding: 2rem;
  color: var(--muted); font-size: .82rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Chat Widget ── */
.chat-overlay {
  position: fixed; inset: 0; background: rgba(13,31,69,.25); z-index: 1000;
  backdrop-filter: blur(3px);
}
.chat-widget {
  position: fixed; bottom: 1.75rem; right: 1.75rem; z-index: 1001;
  width: min(400px, calc(100vw - 2rem));
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(29,78,216,.18);
  display: flex; flex-direction: column; overflow: hidden;
  max-height: min(580px, calc(100vh - 3.5rem));
}
.hidden { display: none !important; }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .95rem 1.2rem;
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a8a 100%);
}
.chat-header-info { display: flex; align-items: center; gap: .7rem; }
.chat-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.15); display: flex;
  align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem; color: #fff;
  border: 1px solid rgba(255,255,255,.2);
}
.chat-name { font-weight: 700; font-size: .92rem; color: #fff; }
.chat-subtitle { font-size: .72rem; color: rgba(255,255,255,.65); }
.chat-close {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
  color: #fff; width: 28px; height: 28px; border-radius: 7px;
  cursor: pointer; font-size: .8rem; transition: background .18s;
}
.chat-close:hover { background: rgba(255,255,255,.28); }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 1.1rem;
  display: flex; flex-direction: column; gap: .8rem;
  background: var(--bg);
}
.message { max-width: 86%; animation: fadeUp .22s ease; }
@keyframes fadeUp { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: none; } }

.bot-message { align-self: flex-start; }
.bot-message p {
  background: var(--surface); border: 1px solid var(--border);
  padding: .7rem .95rem; border-radius: 12px 12px 12px 2px;
  font-size: .86rem; line-height: 1.6; color: var(--text);
  box-shadow: 0 1px 4px rgba(29,78,216,.07);
}
.user-message { align-self: flex-end; }
.user-message p {
  background: linear-gradient(135deg, var(--blue), #3b82f6);
  padding: .7rem .95rem; border-radius: 12px 12px 2px 12px;
  font-size: .86rem; line-height: 1.6; color: #fff;
}
.typing-indicator p { color: var(--muted); font-style: italic; font-size: .83rem; }

.chat-input-area {
  display: flex; gap: .5rem; padding: .85rem;
  border-top: 1px solid var(--border); background: var(--surface);
}
#chatInput {
  flex: 1; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: .6rem .9rem; color: var(--text);
  font-size: .88rem; font-family: inherit; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
#chatInput:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
#chatInput::placeholder { color: #9faec8; }
.send-btn {
  background: var(--blue); border: none; border-radius: 8px;
  width: 38px; height: 38px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; color: #fff;
  transition: background .18s; flex-shrink: 0;
}
.send-btn:hover { background: #1a44c2; }
.send-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Key setup form inside chat */
.key-setup { width: 100%; display: flex; flex-direction: column; gap: .5rem; }
.key-setup-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.key-setup-row { display: flex; gap: .5rem; }
.key-setup-row input {
  flex: 1; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; padding: .6rem .9rem; color: var(--text);
  font-size: .85rem; font-family: 'JetBrains Mono', monospace; outline: none;
  transition: border-color .18s;
}
.key-setup-row input:focus { border-color: var(--blue); }
.key-setup-hint { font-size: .72rem; color: var(--muted); }

.chat-powered {
  text-align: center; font-size: .7rem; color: var(--muted);
  padding: 0 0 .55rem; background: var(--surface);
}

/* ── Redacted / blur-to-reveal ── */
.redacted {
  filter: blur(5px);
  cursor: pointer;
  transition: filter .3s ease;
  user-select: none;
  border-radius: 3px;
}
.redacted:hover,
.redacted.revealed {
  filter: blur(0);
  user-select: text;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Responsive ── */
@media (max-width: 820px) {
  #hero { flex-direction: column; padding-top: 5.5rem; text-align: center; }
  .hero-meta { justify-content: center; }
  .hero-actions { justify-content: center; }
  .tech-panel { width: 100%; max-width: 340px; }
  .nav-links { display: none; }
  .timeline { padding-left: 1.75rem; }
  .card-header { flex-direction: column; }
}
