/* =========================================================
   Token system
========================================================= */
:root {
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --maxw: 1120px;

  --transition-theme: background-color .3s ease, color .3s ease, border-color .3s ease;
}

[data-theme="dark"] {
  --bg: #0e1420;
  --bg-raised: #161e2d;
  --bg-inset: #1e2837;
  --border: #2a3547;
  --text: #e7ecf3;
  --text-dim: #a7b2c2;
  --text-faint: #6d7889;

  --primary: #4fa3ff;
  --primary-contrast: #06101f;
  --accent: #34d399;

  --shadow-1: 0 1px 2px rgba(0,0,0,0.2), 0 20px 40px rgba(0,0,0,0.28);
}

[data-theme="light"] {
  --bg: #f6f8fb;
  --bg-raised: #ffffff;
  --bg-inset: #eef2f7;
  --border: #dbe2ea;
  --text: #101828;
  --text-dim: #4b5768;
  --text-faint: #8892a0;

  --primary: #1c6fe0;
  --primary-contrast: #ffffff;
  --accent: #0e9f6e;

  --shadow-1: 0 1px 2px rgba(16,24,40,0.06), 0 16px 32px rgba(16,24,40,0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: var(--transition-theme);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; display: block; }

/* =========================================================
   Header / nav
========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 32px;
  background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition-theme);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
  flex: 0 0 auto;
}

.nav {
  display: flex;
  gap: 30px;
  flex: 1 1 auto;
}
.nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  transition: color .2s ease;
}
.nav a:hover { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }

.theme-toggle {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition-theme), transform .2s ease;
}
.theme-toggle:hover { transform: rotate(-8deg); }
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.nav-burger span { width: 16px; height: 2px; background: var(--text); display: block; }

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 73px;
  z-index: 49;
}
.mobile-menu a {
  font-size: 15px;
  font-weight: 500;
  padding: 16px 28px;
  text-decoration: none;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.mobile-menu.is-open { display: flex; }

/* =========================================================
   Layout helpers
========================================================= */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 100px 32px;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 44px;
}

/* =========================================================
   Hero
========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero__pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-radial-gradient(circle at 78% 30%, transparent 0, transparent 34px, color-mix(in srgb, var(--primary) 14%, transparent) 35px, transparent 36px),
    repeating-radial-gradient(circle at 78% 30%, transparent 0, transparent 70px, color-mix(in srgb, var(--primary) 10%, transparent) 71px, transparent 72px),
    repeating-radial-gradient(circle at 78% 30%, transparent 0, transparent 106px, color-mix(in srgb, var(--primary) 7%, transparent) 107px, transparent 108px);
  mask-image: radial-gradient(circle at 78% 30%, black 0%, transparent 62%);
}
[data-theme="light"] .hero__pattern { opacity: 0.7; }

.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 100px 32px 110px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 56px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 24px;
}
.badge__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 58px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 12px;
}

.hero__role {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 500;
  color: var(--primary);
  margin: 0 0 22px;
}

.hero__bio {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text-dim);
  max-width: 52ch;
  margin: 0 0 34px;
}

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }

.btn {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 32%, transparent);
}
.btn--primary:hover { box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 42%, transparent); }
.btn--ghost { background: var(--bg-raised); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg-inset); }
.btn--block { width: 100%; border-radius: var(--radius-sm); }
.btn--sm { padding: 9px 18px; font-size: 13.5px; }

.hero__socials { font-size: 14px; color: var(--text-faint); }
.hero__socials a { text-decoration: none; color: var(--text-dim); }
.hero__socials a:hover { color: var(--primary); }
.hero__socials .sep { margin: 0 9px; }

.hero__portrait { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.portrait-frame {
  width: 240px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-inset);
  box-shadow: var(--shadow-1);
}
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.portrait-caption {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  margin: 0;
}

/* =========================================================
   Cards (projects)
========================================================= */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
  transition: var(--transition-theme), transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card--project:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-1); }

.card__top { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.card__status {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 4px 11px;
  border-radius: 999px;
}

.card__title { font-family: var(--font-display); font-size: 19px; font-weight: 600; margin: 0 0 12px; line-height: 1.4; }
.card__desc { font-size: 14.5px; color: var(--text-dim); line-height: 1.7; margin: 0 0 20px; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.tags li {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  padding: 5px 12px;
  border-radius: 999px;
}

.card--empty { border-style: dashed; display: flex; flex-direction: column; justify-content: center; }
.card--empty .card__title { color: var(--text-dim); }

/* =========================================================
   Skills
========================================================= */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }

.skill-block {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
}
.skill-block__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 18px;
  color: var(--text);
}

.pill-list { list-style: none; display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 0; }
.pill-list li {
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--bg-inset);
}

/* =========================================================
   Certifications / empty state
========================================================= */
.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 44px;
  text-align: center;
}
.empty-state__text {
  font-size: 14.5px;
  color: var(--text-faint);
  margin: 0;
}

/* =========================================================
   Contact
========================================================= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
  align-items: start;
}

.contact-info {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
}
.contact-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 15px;
  margin: 0 0 20px;
  line-height: 1.5;
  word-break: break-word;
}
.contact-line:last-child { margin-bottom: 0; }
.contact-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.contact-line a { text-decoration: none; color: var(--primary); font-weight: 500; }
.contact-line a:hover { text-decoration: underline; }

.contact-form {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px;
}

.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 7px;
}
.field input, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--text);
  resize: vertical;
  transition: border-color .2s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); outline: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

.form-status {
  font-size: 13.5px;
  color: var(--accent);
  margin: 14px 0 0;
  min-height: 1.2em;
}

/* =========================================================
   Footer
========================================================= */
.site-footer {
  text-align: center;
  padding: 36px 24px 52px;
  font-size: 13.5px;
  color: var(--text-faint);
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 860px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__actions, .hero__socials { justify-content: center; }
  .hero__portrait { order: -1; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .nav-burger { display: flex; }
  .section { padding: 72px 20px; }
  .hero__inner { padding: 72px 20px 80px; }
  .header-actions .btn--sm { display: none; }
}
