:root {
  --bg: #0a0c10;
  --surface: #12151b;
  --surface2: #181c24;
  --border: #242a35;
  --text: #f4f5f7;
  --muted: #8f97a3;
  --accent: #c9a24d;
  --accent-soft: rgba(201, 162, 77, 0.12);
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface2: #f1f3f6;
  --border: #e4e7ec;
  --text: #12151b;
  --muted: #5b6472;
  --accent: #9c7a2e;
  --accent-soft: rgba(156, 122, 46, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: background .3s ease, color .3s ease;
}

h1, h2, h3 { font-family: 'Sora', sans-serif; margin: 0; }
.pf-mono, .eyebrow, .hero-badge, .timeline-date, .tags span { font-family: 'JetBrains Mono', monospace; }

::selection { background: var(--accent); color: #fff; }

button { font-family: inherit; cursor: pointer; }
a { text-decoration: none; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,12,16,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .header { background: rgba(247,248,250,0.85); }

.header-inner {
  max-width: 1140px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}

.logo { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: 16px; }

.nav { display: flex; gap: 26px; }
.navlink {
  background: none; border: none; font-size: 14px; font-weight: 500;
  color: var(--muted); transition: color .2s ease;
}
.navlink:hover, .navlink.active { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 50%;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: var(--text); transition: background .2s ease, transform .2s ease;
}
.icon-btn:hover { transform: translateY(-2px); }

.menu-btn { background: none; border: none; color: var(--text); font-size: 22px; }

.mobile-menu {
  border-top: 1px solid var(--border); padding: 14px 24px;
  flex-direction: column; gap: 14px;
}
.navlink-mobile {
  background: none; border: none; text-align: left; color: var(--muted);
  font-size: 15px; padding: 4px 0;
}

.hide-sm { display: flex; }
.show-sm { display: none; }

@media (max-width: 760px) {
  .hide-sm { display: none; }
  .show-sm { display: flex; }
  .mobile-menu.show-sm { display: none; }
  .mobile-menu.show-sm.open { display: flex; }
  .hero { grid-template-columns: 1fr !important; }
  .contact-grid { grid-template-columns: 1fr !important; }
}

/* Hero */
.hero {
  max-width: 1140px; margin: 0 auto; padding: 80px 24px 60px;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center;
}

.eyebrow {
  color: var(--accent); font-size: 13px; letter-spacing: 1px; margin-bottom: 16px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(36px, 5.5vw, 58px); font-weight: 800; line-height: 1.08;
}

.hero-subtitle {
  font-size: clamp(19px, 2.6vw, 26px); font-weight: 600; color: var(--muted); margin-top: 14px;
}

.cursor-blink::after { content: '|'; animation: blink 1s step-end infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  color: var(--muted); font-size: 16.5px; max-width: 560px; margin-top: 20px; line-height: 1.75;
}

.hero-btns { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.btn {
  border: none; padding: 13px 24px; border-radius: 8px; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }

.hero-social { display: flex; gap: 12px; margin-top: 28px; }

.hero-visual { position: relative; }
.hero-box {
  border-radius: 20px; overflow: hidden; border: 1px solid var(--border); background: var(--surface);
  aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
}
.hero-badge {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 12px; padding: 6px 14px;
  border-radius: 20px; white-space: nowrap;
}

/* Fade animation */
.fade-up { animation: fadeUp .6s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .fade-up, .cursor-blink::after { animation: none; } }

/* Sections */
.section { max-width: 1140px; margin: 0 auto; padding: 64px 24px; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; margin-bottom: 10px; }
.divider { width: 56px; height: 3px; background: var(--accent); margin: 0 auto; border-radius: 2px; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); border-color: var(--accent); }

.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 14px; }
.with-icon { display: flex; align-items: center; gap: 10px; }

.principle-row { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.principle-row.no-border { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.principle-title { font-weight: 600; font-size: 15px; margin: 0; }

.icon-box {
  background: var(--accent-soft); border-radius: 10px; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}

.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; }
.skill-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--text); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.skill-card:hover { transform: translateY(-5px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); border-color: var(--accent); }
.skill-card span { font-size: 13.5px; font-weight: 600; }

/* Timeline */
.timeline { border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 34px; padding-left: 30px; }
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute; left: -37px; top: 5px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
}
.timeline-date { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.timeline-item h3 { font-size: 18px; font-weight: 700; }
.timeline-org { color: var(--accent); font-size: 13.5px; font-weight: 600; margin: 3px 0 10px; }
.timeline-item .muted { font-size: 14.5px; line-height: 1.7; max-width: 620px; }

/* Projects */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.project-card:hover { transform: translateY(-5px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); border-color: var(--accent); }
.project-thumb { width: 100%; aspect-ratio: 16/10; overflow: hidden; background: var(--surface2); }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-body { padding: 24px; }
.project-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.project-head h3 { font-size: 20px; font-weight: 700; }
.project-links { display: flex; gap: 10px; }
.project-links a { color: var(--muted); display: flex; }
.project-links a.accent-icon { color: var(--accent); }
.project-role { color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.project-body .muted { font-size: 14px; line-height: 1.65; min-height: 62px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tags span {
  font-size: 11.5px; background: var(--surface2); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 6px; color: var(--muted);
}

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.field { margin-bottom: 18px; }
.field label { font-size: 13.5px; font-weight: 600; margin-bottom: 7px; display: block; }
.field input, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; color: var(--text); font-size: 14px; font-family: 'Inter', sans-serif;
  resize: vertical;
}
.field input.invalid, .field textarea.invalid {
  border-color: #e5484d;
}
.field-error {
  display: block; color: #e5484d; font-size: 12.5px; margin-top: 6px; min-height: 15px;
}
.field input:focus, .field textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.contact-row { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.contact-icon {
  background: var(--accent-soft); border-radius: 10px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-label { font-size: 12.5px; color: var(--muted); margin: 0; }
.contact-value { font-size: 14.5px; font-weight: 600; color: var(--text); margin: 0; }

.connect-block { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 20px; }
.connect-label { font-weight: 600; font-size: 14px; margin-bottom: 12px; }

/* Footer */
.footer { border-top: 1px solid var(--border); }
.footer-inner {
  max-width: 1140px; margin: 0 auto; padding: 28px 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;
}
.footer-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 17px; margin: 0; }
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-actions { display: flex; align-items: center; gap: 10px; }
.footer-actions a.icon-btn { background: none; border: none; color: var(--muted); }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 24px; text-align: center; }