:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #121212;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.28);
  --text: #ffffff;
  --text-90: rgba(255, 255, 255, 0.90);
  --muted: rgba(255, 255, 255, 0.60);
  --faint: rgba(255, 255, 255, 0.40);
  --radius: 14px;
  --maxw: 1120px;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle grid backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 70%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: 10px 16px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 16px; top: 16px; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); background: rgba(0,0,0,0.82); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-mark { width: 34px; height: 34px; display: grid; place-items: center; background: #fff; color: #000; border-radius: 9px; font-size: 14px; letter-spacing: .5px; transition: transform .35s var(--ease); }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.05); }
.logo-text { font-size: 17px; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { position: relative; color: var(--muted); font-size: 15px; transition: color .2s ease; }
.main-nav a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; bottom: -6px; width: 100%; height: 1px; background: #fff; transform: scaleX(0); transform-origin: right; transition: transform .3s var(--ease); }
.main-nav a:not(.nav-cta):hover { color: var(--text); }
.main-nav a:not(.nav-cta):hover::after { transform: scaleX(1); transform-origin: left; }
.main-nav .nav-cta { color: #000; background: #fff; padding: 8px 18px; border-radius: 8px; font-weight: 600; transition: transform .2s var(--ease), opacity .2s ease; }
.main-nav .nav-cta:hover { transform: translateY(-2px); opacity: .9; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s ease; }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Text reveal ---------------- */
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.word-inner { display: inline-block; transform: translateY(115%); transition: transform .8s var(--ease); will-change: transform; }
.is-revealed .word-inner { transform: translateY(0); }
.accent .word-inner { color: #fff; }

[data-reveal="up"] { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
[data-reveal="up"].is-revealed { opacity: 1; transform: none; }

.stagger > * { opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.stagger.is-revealed > * { opacity: 1; transform: none; }
.stagger.is-revealed > *:nth-child(1) { transition-delay: .05s; }
.stagger.is-revealed > *:nth-child(2) { transition-delay: .13s; }
.stagger.is-revealed > *:nth-child(3) { transition-delay: .21s; }
.stagger.is-revealed > *:nth-child(4) { transition-delay: .29s; }
.stagger.is-revealed > *:nth-child(5) { transition-delay: .37s; }
.stagger.is-revealed > *:nth-child(6) { transition-delay: .45s; }

/* ---------------- Hero ---------------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 84px; }
.hero-glow { position: absolute; top: -220px; left: 50%; transform: translateX(-50%); width: 720px; height: 620px; background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 62%); filter: blur(30px); pointer-events: none; animation: pulse 7s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .55; transform: translateX(-50%) scale(1); } 50% { opacity: .9; transform: translateX(-50%) scale(1.08); } }
.hero-inner { position: relative; display: grid; grid-template-columns: 1.25fr 0.9fr; gap: 56px; align-items: center; }

.eyebrow, .section-eyebrow { text-transform: uppercase; letter-spacing: 3px; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 16px; }

.hero h1 { font-size: clamp(34px, 5.2vw, 58px); line-height: 1.08; margin: 0 0 22px; letter-spacing: -0.5px; color: var(--text-90); font-weight: 800; }
.accent { color: #fff; }
.lede { font-size: 18px; color: var(--muted); max-width: 520px; margin: 0 0 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; border: 1px solid transparent; position: relative; overflow: hidden; transition: transform .18s var(--ease), background .25s ease, color .25s ease, border-color .25s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { transform: translateY(-3px); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: #fff; color: #000; transform: translateY(-3px); }
.btn-block { width: 100%; }

.hero-meta { list-style: none; margin: 0; padding: 0; display: flex; gap: 44px; flex-wrap: wrap; }
.hero-meta li { display: flex; flex-direction: column; font-size: 15px; color: var(--text); }
.hero-meta strong { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-weight: 600; margin-bottom: 5px; }

.hero-visual { display: flex; justify-content: center; }
.avatar-card { position: relative; width: 300px; height: 300px; border-radius: 24px; background: linear-gradient(160deg, #161616, #050505); border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; }
.avatar-monogram { position: relative; z-index: 2; font-size: 100px; font-weight: 800; letter-spacing: 2px; color: #fff; animation: floaty 5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.avatar-caption { position: absolute; bottom: 22px; z-index: 2; margin: 0; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); }
.avatar-rings { position: absolute; inset: 0; display: grid; place-items: center; }
.avatar-rings span { position: absolute; border: 1px solid rgba(255,255,255,0.14); border-radius: 50%; animation: spin 22s linear infinite; }
.avatar-rings span:nth-child(1) { width: 150px; height: 150px; animation-duration: 16s; }
.avatar-rings span:nth-child(2) { width: 220px; height: 220px; animation-duration: 26s; animation-direction: reverse; }
.avatar-rings span:nth-child(3) { width: 290px; height: 290px; animation-duration: 36s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Sections ---------------- */
.section { position: relative; padding: 84px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(26px, 3.6vw, 38px); margin: 0 0 32px; letter-spacing: -0.3px; font-weight: 800; }

.about-grid { display: grid; gap: 20px; max-width: 780px; }
.about-lead { font-size: 20px; color: var(--text); margin: 0; }
.about-grid p { color: var(--muted); margin: 0; }
.about-lead strong { color: #fff; }

.skills-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.skill-chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 11px 20px; border-radius: 999px; font-size: 15px; font-weight: 500; transition: transform .25s var(--ease), background .25s ease, border-color .25s ease, color .25s ease; }
.skill-chip:hover { transform: translateY(-4px); background: #fff; color: #000; border-color: #fff; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 22px; transition: transform .3s var(--ease), border-color .3s ease; overflow: hidden; }
.section-alt .card { background: var(--surface-2); }
.card::after { content: ''; position: absolute; inset: 0; background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,0.10), transparent 60%); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.card:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.card:hover::after { opacity: 1; }
.card h3 { margin: 18px 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

.card-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: #fff; position: relative; transition: transform .3s var(--ease); }
.card:hover .card-icon { transform: scale(1.08) rotate(-4deg); }
.card-icon::before { content: ''; width: 22px; height: 22px; background: #000; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.card-icon[data-icon='code']::before   { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='16 18 22 12 16 6'/%3E%3Cpolyline points='8 6 2 12 8 18'/%3E%3C/svg%3E"); }
.card-icon[data-icon='python']::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7l8 5 8-5'/%3E%3Cpath d='M4 7v10l8 5 8-5V7l-8-5-8 5z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7l8 5 8-5'/%3E%3Cpath d='M4 7v10l8 5 8-5V7l-8-5-8 5z'/%3E%3C/svg%3E"); }
.card-icon[data-icon='shield']::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l8 4v6c0 5-3.5 8-8 10-4.5-2-8-5-8-10V6l8-4z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2l8 4v6c0 5-3.5 8-8 10-4.5-2-8-5-8-10V6l8-4z'/%3E%3C/svg%3E"); }
.card-icon[data-icon='growth']::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 17 9 11 13 15 21 7'/%3E%3Cpolyline points='15 7 21 7 21 13'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 17 9 11 13 15 21 7'/%3E%3Cpolyline points='15 7 21 7 21 13'/%3E%3C/svg%3E"); }

.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-copy p { color: var(--muted); max-width: 420px; }
.contact-mail { display: inline-block; margin-top: 14px; color: #fff; font-weight: 600; font-size: 18px; border-bottom: 1px solid var(--border-strong); padding-bottom: 2px; transition: opacity .2s ease; }
.contact-mail:hover { opacity: .7; }

.contact-form { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; color: var(--muted); font-weight: 500; }
.field input, .field textarea { width: 100%; background: #000; border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; color: var(--text); font-family: inherit; font-size: 15px; resize: vertical; transition: border-color .2s ease, box-shadow .2s ease; }
.field input:focus, .field textarea:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,0.12); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-note { font-size: 13px; color: var(--faint); margin: 0; }
.form-alert { border-radius: 9px; padding: 12px 14px; font-size: 14px; border: 1px solid var(--border); }
.form-alert.ok { background: rgba(255,255,255,0.06); color: #fff; }
.form-alert.err { background: rgba(255,255,255,0.03); color: var(--muted); }

.site-footer { position: relative; border-top: 1px solid var(--border); padding: 30px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; gap: 20px; margin: 0; }
.footer-links a:hover { color: #fff; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-visual { order: -1; }
  .avatar-card { width: 240px; height: 240px; }
  .avatar-monogram { font-size: 80px; }
  .avatar-rings span:nth-child(3) { width: 240px; height: 240px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .contact-inner { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .main-nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #050505; border-bottom: 1px solid var(--border); padding: 8px 24px 20px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: transform .25s var(--ease), opacity .25s ease; }
  .main-nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .main-nav a { padding: 15px 0; border-bottom: 1px solid var(--border); }
  .main-nav a:not(.nav-cta)::after { display: none; }
  .main-nav .nav-cta { border: 0; padding: 15px 0; background: none; color: var(--text); border-radius: 0; }
  .hero { padding: 64px 0 60px; }
  .section { padding: 60px 0; }
  .cards { grid-template-columns: 1fr; }
  .hero-meta { gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
  .word-inner { transform: none !important; }
  [data-reveal], .stagger > * { opacity: 1 !important; transform: none !important; }
}

/* ================= v2 additions ================= */

/* Scroll progress bar */
.scroll-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: #fff; z-index: 60; }

/* Typewriter line */
.type-line { font-size: 18px; color: var(--muted); margin: 0 0 26px; min-height: 1.7em; }
.type-line .tw { color: #fff; font-weight: 700; }
.type-caret { display: inline-block; width: 2px; height: 1.05em; background: #fff; vertical-align: -0.18em; margin-left: 3px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Wave text (letters bob in sequence) */
.wave { display: inline-block; }
.wave .char { display: inline-block; animation: wave 2.6s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-5px); } 50% { transform: translateY(0); } }

/* Contact CTA (replaces the form) */
.contact-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; margin-top: 8px; }
.btn-xl { min-height: 60px; font-size: 17px; padding: 0 40px; border-radius: 14px; }
.btn-xl svg { margin-left: 10px; transition: transform .25s var(--ease); }
.btn-xl:hover svg { transform: translateX(6px); }
.contact-lead { color: var(--muted); max-width: 520px; margin: 0; font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .type-caret { animation: none; }
  .wave .char { animation: none !important; }
}
