:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --text: #1f2933;
  --muted: #5f6b7a;
  --line: #e3e8ef;
  --accent: #0f5fa8;
  --accent-dark: #0b4a84;
  --accent-soft: #e8f1fa;
  --ok: #1f9d55;
  --radius: 10px;
  --max: 1080px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { line-height: 1.25; margin: 0; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.nav-cta {
  color: #fff; background: var(--accent); padding: 8px 16px; border-radius: 8px;
}
.nav a.nav-cta:hover { background: var(--accent-dark); color: #fff; }
.nav-toggle {
  display: none; background: none; border: 0; font-size: 26px; color: var(--text); cursor: pointer; padding: 4px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 8px; font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-ghost { border-color: var(--line); color: var(--text); background: #fff; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */
.hero {
  padding: 88px 0 80px;
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--bg) 100%);
}
.hero-grid { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 48px; }
.eyebrow { color: var(--muted); font-weight: 500; margin: 0 0 12px; font-size: 15px; }
.hero h1 { font-size: clamp(36px, 6vw, 54px); font-weight: 700; letter-spacing: -0.02em; }
.hero-role { font-size: clamp(20px, 3vw, 26px); font-weight: 600; color: var(--accent); margin: 8px 0 12px; }
.hero-sub { color: var(--muted); font-size: 17px; max-width: 560px; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.availability { display: flex; align-items: center; gap: 10px; margin: 28px 0 0; color: var(--muted); font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(31, 157, 85, 0.15); }
.hero-photo img {
  display: block; width: 240px; height: 240px; border-radius: 50%; object-fit: cover;
  border: 6px solid #fff; box-shadow: 0 12px 32px rgba(15, 40, 80, 0.15);
}

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 28px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 28px; position: relative; padding-bottom: 12px;
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 40px; height: 3px; background: var(--accent); border-radius: 2px;
}
.section-title.center { text-align: center; }
.section-title.center::after { left: 50%; transform: translateX(-50%); }
.lead { font-size: 18px; color: var(--text); }
p { margin: 0 0 16px; }

/* About */
.highlights {
  list-style: none; padding: 0; margin: 36px 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.highlights li {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: #fff;
}
.highlights strong { display: block; font-size: 17px; color: var(--accent); }
.highlights span { font-size: 14px; color: var(--muted); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 36px 28px; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 2px solid var(--accent);
}
.tl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tl-head h3 { font-size: 18px; font-weight: 600; }
.tl-date { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-org { color: var(--accent); font-weight: 500; font-size: 15px; margin: 2px 0 10px; }
.timeline ul { margin: 0; padding-left: 18px; color: var(--muted); }
.timeline ul li { margin-bottom: 6px; }

/* Skills */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: #c9d6e6; box-shadow: 0 8px 24px rgba(15, 40, 80, 0.06); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 21px;
  margin-bottom: 14px;
}
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }

/* Credentials */
.cred-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.cred-list { list-style: none; margin: 0; padding: 0; }
.cred-list li { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.cred-list li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.cred-list h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.cred-list p { color: var(--muted); font-size: 15px; margin: 0; }
.cred-list span { font-size: 14px; color: var(--muted); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; }
.contact-list li { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--muted); }
.contact-list i { color: var(--accent); font-size: 18px; width: 20px; }
.contact-form {
  display: grid; gap: 16px; background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text); }
.contact-form input,
.contact-form textarea {
  font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); width: 100%;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.contact-form textarea { resize: vertical; }
.contact-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-size: 14px; min-height: 1.4em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: #c0392b; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; }
.footer-wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.site-footer p { margin: 0; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; gap: 18px; font-size: 18px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 900px) {
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .cred-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px 20px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a.nav-cta { margin-top: 12px; text-align: center; border-bottom: 0; }

  .hero { padding: 56px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero-photo { order: -1; }
  .hero-photo img { width: 140px; height: 140px; border-width: 4px; }

  .section { padding: 60px 0; }
  .highlights { grid-template-columns: 1fr; }
  .skill-grid,
  .cred-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-wrap { flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Animations */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in-scale {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: none; }
}

.hero-text > * { animation: fade-up 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-text > :nth-child(2) { animation-delay: 0.08s; }
.hero-text > :nth-child(3) { animation-delay: 0.16s; }
.hero-text > :nth-child(4) { animation-delay: 0.24s; }
.hero-text > :nth-child(5) { animation-delay: 0.32s; }
.hero-text > :nth-child(6) { animation-delay: 0.4s; }
.hero-photo img { animation: fade-in-scale 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s both; }

.dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(31, 157, 85, 0.15); }
  50% { box-shadow: 0 0 0 7px rgba(31, 157, 85, 0.05); }
}

/* Scroll reveal (only when JS is running) */
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--delay, 0s);
}
.js .reveal.in { opacity: 1; transform: none; }

/* Hover polish */
.btn { transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(15, 95, 168, 0.25); }
.js .card.reveal.in { transition: opacity 0.6s, transform 0.25s ease, border-color 0.15s, box-shadow 0.25s; transition-delay: 0s; }
.card:hover { transform: translateY(-4px); }
.card-icon { transition: background 0.2s, color 0.2s; }
.card:hover .card-icon { background: var(--accent); color: #fff; }
.highlights li { transition: transform 0.2s, border-color 0.2s; }
.highlights li:hover { transform: translateY(-2px); border-color: #c9d6e6; }
.footer-links a { transition: color 0.15s, transform 0.15s; display: inline-block; }
.footer-links a:hover { transform: translateY(-2px); }

/* Header on scroll + active link */
.site-header { transition: box-shadow 0.25s; }
.site-header.scrolled { box-shadow: 0 4px 20px rgba(15, 40, 80, 0.08); }
.nav a:not(.nav-cta) { position: relative; }
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--accent); border-radius: 2px; transform: scaleX(0); transition: transform 0.25s;
}
.nav a:not(.nav-cta):hover::after,
.nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--text); }
@media (max-width: 720px) {
  .nav a:not(.nav-cta)::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .btn:hover, .card:hover, .highlights li:hover, .footer-links a:hover { transform: none; }
}

/* Hero particle background */
.hero { position: relative; overflow: hidden; }
.hero-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero > .container { position: relative; z-index: 1; }

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 60;
  background: linear-gradient(90deg, var(--accent), #3a8fd9);
  transform: scaleX(0); transform-origin: 0 50%;
}
