*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── LIGHT MODE DEFAULT ── */
:root {
  --bg:       #fafaf7;
  --bg-alt:   #f2f1ed;
  --surface:  #ffffff;
  --border:   #dddbd5;
  --navy:     #0f1f4a;
  --navy-mid: #1e3470;
  --gold:     #b8892a;
  --gold-l:   #d4a74a;
  --text:     #111111;
  --text-2:   #2e2e2e;
  --muted:    #666666;
  --light:    #999999;
  --ff-d: 'Playfair Display', Georgia, serif;
  --ff-s: 'Outfit', system-ui, sans-serif;
  --ff-m: 'DM Mono', 'Courier New', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── DARK MODE — only when [data-theme="dark"] or system+auto ── */
[data-theme="dark"],
[data-theme="auto"] {
  --bg:      #080808;
  --bg-alt:  #111111;
  --surface: #181818;
  --border:  #2a2a2a;
  --navy:    #6a9fd4;
  --navy-mid:#8abfe4;
  --gold:    #c8973a;
  --gold-l:  #e0b85a;
  --text:    #f0eeea;
  --text-2:  #c0bdb8;
  --muted:   #808080;
  --light:   #505050;
}

/* System preference only when auto mode selected */
[data-theme="auto"] {
  color-scheme: light dark;
}

@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg:       #fafaf7;
    --bg-alt:   #f2f1ed;
    --surface:  #ffffff;
    --border:   #dddbd5;
    --navy:     #0f1f4a;
    --navy-mid: #1e3470;
    --gold:     #b8892a;
    --gold-l:   #d4a74a;
    --text:     #111111;
    --text-2:   #2e2e2e;
    --muted:    #666666;
    --light:    #999999;
  }
}

body {
  font-family: var(--ff-s);
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 72px;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  transition: background 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}

nav.scrolled {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-color: var(--border);
}

.nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 72px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--ff-d);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 14px;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  margin-left: 8px;
  font-weight: 500 !important;
  transition: all 0.2s !important;
}

.nav-cta:hover {
  background: var(--text) !important;
  color: var(--bg) !important;
  border-color: var(--text) !important;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px;
}

.theme-btn {
  font-size: 12px;
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 2px;
  font-family: var(--ff-m);
  letter-spacing: 0.05em;
  transition: all 0.15s;
}

.theme-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.theme-btn:hover:not(.active) { color: var(--text); }

/* ── HERO — full width, two rows ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 64px;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--text);
}

.hero-glow {
  position: absolute;
  width: 1000px; height: 1000px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15,31,74,0.05) 0%, transparent 65%);
  top: -300px; right: -200px;
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184,137,42,0.05) 0%, transparent 65%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}

.hero-body {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 80px 72px 72px;
  width: 100%;
}

/* Row 1 — eyebrow */
.hero-eyebrow {
  font-family: var(--ff-m);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeUp 1s var(--ease) both;
}

.hero-eyebrow::before {
  content: '';
  width: 48px; height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

.hero-eyebrow::after {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: blink 2.5s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Row 2 — name, full width */
h1 {
  font-family: var(--ff-d);
  font-size: clamp(5rem, 13vw, 13rem);
  font-weight: 700;
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 56px;
  animation: fadeUp 1s var(--ease) 0.1s both;
}

h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 400;
}

/* Row 3 — summary + contact + CTAs */
.hero-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  animation: fadeUp 1s var(--ease) 0.2s both;
}

.hero-summary {
  font-size: 19px;
  color: var(--text-2);
  line-height: 1.85;
  font-weight: 300;
}

.hero-right-block {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
}

.hero-contact a,
.hero-contact span {
  font-family: var(--ff-m);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.hero-contact a:hover { color: var(--gold); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  font-family: var(--ff-s);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s var(--ease);
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--navy); border-color: var(--navy); transform: translateY(-2px); }

.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text); transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--gold); border-color: var(--gold); transform: translateY(-2px); }

.hero-scroll {
  position: absolute;
  bottom: 40px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--light);
  font-size: 10px;
  font-family: var(--ff-m);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  animation: fadeIn 2s var(--ease) 1.5s both;
}

.scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollAnim 2.5s ease infinite;
}

@keyframes scrollAnim {
  0%   { transform: scaleY(0); transform-origin: top; }
  50%  { transform: scaleY(1); transform-origin: top; }
  51%  { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ── IMPACT ── */
.impact-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border-bottom: 1px solid var(--border);
}

.impact-cell {
  padding: 40px 28px;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background 0.2s;
}

.impact-cell::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.impact-cell:hover { background: var(--bg-alt); }
.impact-cell:hover::after { transform: scaleX(1); }
.impact-cell:last-child { border-right: none; }

.impact-number {
  font-family: var(--ff-d);
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}

.impact-label {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  font-family: var(--ff-m);
}

/* ── SECTIONS ── */
main { padding: 0; }

.section { padding: 96px 0; border-bottom: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section:last-child { border-bottom: none; }

.section-header {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 64px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--text);
}

.section-num {
  font-family: var(--ff-d);
  font-size: 64px;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  letter-spacing: -0.04em;
  user-select: none;
  flex-shrink: 0;
}

.section-label {
  font-family: var(--ff-m);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── ROLES ── */
.role {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0 80px;
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
}

.role:last-child { border-bottom: none; padding-bottom: 0; }
.role:first-of-type { padding-top: 0; }

.role-title {
  font-family: var(--ff-d);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.2;
}

.role-company {
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 6px;
}

.role-dates {
  font-family: var(--ff-m);
  font-size: 12px;
  color: var(--light);
  letter-spacing: 0.04em;
}

.role-context {
  font-family: var(--ff-d);
  font-size: 18px;
  font-style: italic;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 24px;
  padding: 20px 28px;
  background: var(--surface);
  border-left: 3px solid var(--gold);
}

.bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bullets li {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.75;
  padding-left: 22px;
  position: relative;
  font-weight: 300;
}

.bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 14px;
  line-height: 1.75;
}

/* ── IP ── */
.ip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.ip-item {
  padding: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease);
}

.ip-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.ip-item:hover { border-color: var(--gold); transform: translateY(-4px); }
.ip-item:hover::before { transform: scaleX(1); }

.ip-name {
  font-family: var(--ff-d);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.ip-meta {
  font-family: var(--ff-m);
  font-size: 12px;
  color: var(--gold);
  margin-bottom: 16px;
}

.ip-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  font-weight: 300;
}

/* ── GITHUB ── */
.github-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.github-sub-label {
  font-family: var(--ff-m);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.contrib-graph {
  width: 100%;
  border-radius: 4px;
  display: block;
}

.pinned-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.pinned-card {
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.2s var(--ease);
  position: relative;
}

.pinned-card::after {
  content: '→';
  position: absolute;
  top: 28px; right: 28px;
  color: var(--border);
  font-size: 18px;
  transition: color 0.2s, transform 0.2s;
}

.pinned-card:hover { border-color: var(--navy); transform: translateY(-2px); }
.pinned-card:hover::after { color: var(--navy); transform: translateX(3px); }

.pinned-icon { font-size: 20px; margin-bottom: 12px; display: block; }

.pinned-name {
  font-family: var(--ff-d);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.pinned-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 16px;
}

.pinned-meta {
  font-family: var(--ff-m);
  font-size: 12px;
  color: var(--light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.lang-dot.go   { background: #00add8; }
.lang-dot.rust { background: #dea584; }
.lang-dot.md   { background: #083fa1; }
.lang-dot.html { background: #e34c26; }

/* ── SKILLS ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-item {
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.skill-item:hover { border-color: var(--gold); }

.skill-cat {
  font-family: var(--ff-m);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 10px;
}

.skill-items {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
}

/* ── CERTS ── */
.cert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cert-tag {
  font-size: 14px;
  color: var(--text-2);
  padding: 12px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 300;
  transition: border-color 0.2s, color 0.2s;
}

.cert-tag:hover { border-color: var(--gold); color: var(--text); }

/* ── EDU + LANG ── */
.edu-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.edu-degree {
  font-family: var(--ff-d);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.edu-inst { font-size: 16px; color: var(--muted); margin-bottom: 6px; font-weight: 300; }
.edu-year { font-family: var(--ff-m); font-size: 13px; color: var(--light); }

.lang-text {
  font-family: var(--ff-d);
  font-size: 26px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-2);
}

/* ── FOOTER ── */
footer { background: #060606; padding: 56px 0; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand {
  font-family: var(--ff-d);
  font-size: 24px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
}

.footer-links { display: flex; gap: 32px; flex-wrap: wrap; }

.footer-links a {
  font-size: 14px;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--gold-l); }

.footer-copy {
  font-family: var(--ff-m);
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 0.08em;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(32px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .container { padding: 0 48px; }
  .nav-inner { padding: 0 48px; }
  .hero-body { padding: 80px 48px 64px; }
}

@media (max-width: 900px) {
  .container { padding: 0 28px; }
  .nav-inner { padding: 0 28px; }
  .hero-body { padding: 64px 28px 56px; }
  .nav-links a:not(.nav-cta) { display: none; }
  h1 { font-size: clamp(3.5rem, 14vw, 7rem); margin-bottom: 40px; }
  .hero-bottom { grid-template-columns: 1fr; gap: 32px; }
  .role { grid-template-columns: 1fr; gap: 20px; }
  .ip-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .impact-bar { grid-template-columns: repeat(3, 1fr); }
  .impact-cell:nth-child(3) { border-right: none; }
  .edu-lang-grid { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 64px 0; }
  .section-num { font-size: 48px; }
  .pinned-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .theme-toggle { display: none; }
}

@media (max-width: 480px) {
  h1 { font-size: 3rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .impact-bar { grid-template-columns: repeat(2, 1fr); }
  .impact-cell:nth-child(2) { border-right: none; }
  .impact-cell:nth-child(4) { border-right: none; }
  .hero-actions { flex-direction: column; }
  .btn { justify-content: center; }
}

@media print {
  nav, footer, .hero-scroll, .hero-actions,
  .hero-glow, .hero-glow-2 { display: none; }
  .hero { min-height: auto; }
  .reveal { opacity: 1; transform: none; }
  .section-alt { background: white; }
}
