:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6472;
  --border: #e3e6eb;
  --accent: #ff9900;          /* AWS orange */
  --accent-soft: #fff3e0;
  --highlight: #fff1d6;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .04);
}

[data-theme="dark"] {
  --bg: #0f1218;
  --surface: #171b23;
  --text: #e8eaef;
  --muted: #9aa3b2;
  --border: #272d38;
  --accent: #ffad33;
  --accent-soft: #2a2114;
  --highlight: #33280f;
  --shadow: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background .25s, color .25s;
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.muted { color: var(--muted); }
a { color: inherit; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 900px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 24px;
}
.logo { font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.logo span { color: var(--accent); }
.nav nav { display: flex; gap: 20px; margin-left: auto; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: .92rem; font-weight: 500; }
.nav nav a:hover, .nav nav a.active { color: var(--text); }
.icon-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem;
}

/* ---------- Layout ---------- */
main { max-width: 900px; margin: 0 auto; padding: 0 20px; }
section { padding: 64px 0 24px; }
h2 { font-size: 1.5rem; margin-bottom: 20px; letter-spacing: -.01em; }
h2::after {
  content: ""; display: block; width: 40px; height: 3px;
  background: var(--accent); margin-top: 8px; border-radius: 2px;
}
h3 { font-size: 1.05rem; }

/* ---------- Hero ---------- */
.hero { padding-top: 88px; }
.kicker { color: var(--accent); font-size: .95rem; margin-bottom: 8px; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; letter-spacing: -.02em; }
.role { font-size: 1.25rem; color: var(--muted); margin: 10px 0 18px; min-height: 1.6em; }
.cursor { animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }
.summary { max-width: 640px; font-size: 1.05rem; }

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  text-decoration: none; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  font-weight: 500; font-size: .92rem; transition: transform .15s, border-color .15s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 40px;
}
.stats div {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; box-shadow: var(--shadow);
}
.stats strong { font-size: 1.8rem; display: block; color: var(--accent); }
.stats span { color: var(--muted); font-size: .88rem; }

/* ---------- Skills ---------- */
.hint { color: var(--muted); font-size: .9rem; margin: -8px 0 18px; }
.skill-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.skill-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; box-shadow: var(--shadow);
}
.skill-group h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: .85rem; cursor: pointer;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  transition: all .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #111; }

/* ---------- Experience ---------- */
.timeline { position: relative; padding-left: 24px; border-left: 2px solid var(--border); }
.job {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.job::before {
  content: ""; position: absolute; left: -32px; top: 26px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
}
.job-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.company { color: var(--muted); font-size: .95rem; }
.dates { font-size: .82rem; color: var(--muted); white-space: nowrap; padding-top: 3px; }
.job ul { padding-left: 18px; }
.job li { margin: 6px 0; padding: 2px 6px; border-radius: 6px; transition: background .2s, opacity .2s; }
.job li::marker { color: var(--accent); }

/* skill-filter states */
.filtering .job li { opacity: .35; }
.filtering .job li.match { opacity: 1; background: var(--highlight); }
.filtering .job:not(.has-match) { opacity: .5; }

.skill-group.wide { grid-column: 1 / -1; }

/* ---------- AI ---------- */
.intro { max-width: 680px; margin-bottom: 20px; }
.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; box-shadow: var(--shadow);
  transition: opacity .2s, border-color .2s;
}
.ai-card h3 { margin-bottom: 6px; }
.ai-card p { color: var(--muted); font-size: .95rem; }
.tag {
  font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle;
}
.filtering .ai-card { opacity: .35; }
.filtering .ai-card.match { opacity: 1; border-color: var(--accent); }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.project-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s, opacity .2s;
}
.project-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.project-card p { color: var(--muted); font-size: .95rem; }
.project-card .stack { font-size: .78rem; color: var(--accent); margin-top: auto; }
.project-link { font-weight: 600; font-size: .9rem; text-decoration: none; color: var(--text); }
.project-link:hover { color: var(--accent); }
.more-projects { margin-top: 16px; font-size: .92rem; color: var(--muted); }
.more-projects a { font-weight: 600; text-decoration: none; color: var(--text); }
.more-projects a:hover { color: var(--accent); }
.filtering .project-card { opacity: .35; }
.filtering .project-card.match { opacity: 1; border-color: var(--accent); }

/* ---------- Education ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; box-shadow: var(--shadow);
}
.card p { margin-top: 4px; }
.card .cert-gap { margin-top: 16px; }

/* ---------- Chatbot ---------- */
.chat-toggle {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #111; border: none;
  padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
  transition: transform .15s;
}
.chat-toggle:hover { transform: translateY(-2px); }
.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 21;
  width: 400px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden;
}
.chat-panel[hidden], .chat-toggle[hidden] { display: none; }
.chat-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.chat-head span { display: block; font-size: .75rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: .92rem; white-space: pre-wrap; }
.msg.bot { background: var(--bg); border: 1px solid var(--border); align-self: flex-start; }
.msg.user { background: var(--accent); color: #111; align-self: flex-end; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-samples { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.chat-samples .chip { text-align: left; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-form input {
  flex: 1; min-width: 0; font: inherit; font-size: .92rem;
  padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.chat-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.chat-form .btn { cursor: pointer; }

/* ---------- Footer ---------- */
footer { text-align: center; padding: 48px 20px; font-size: .82rem; color: var(--muted); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .nav nav { display: none; }
  .icon-btn { margin-left: auto; }
  .stats, .skill-groups, .two-col, .ai-grid, .project-grid { grid-template-columns: 1fr; }
  .timeline { padding-left: 16px; }
  .job::before { left: -24px; }
}

/* ---------- Print: clean paper resume ---------- */
@media print {
  .nav, .links, .hint, .stats, footer, .cursor, .chat-toggle, .chat-panel { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .reveal { opacity: 1; transform: none; }
  section { padding: 12px 0; }
  .job, .card, .skill-group { box-shadow: none; break-inside: avoid; }
}
