/* ===================================================================
   TOKENS
=================================================================== */
:root{
  /* dark mode is the default palette */
  --bg: #0B0F17;
  --bg-elevated: #131A28;
  --bg-elevated-2: #1B2333;
  --text: #F3F5F8;
  --text-soft: #ADB4C2;
  --text-faint: #757D8E;
  --line: #232B3C;

  --accent: #6E93FF;
  --accent-strong: #9AB6FF;
  --amber: #F2A93B;
  --green: #34D399;

  --header-bg: rgba(11,15,23,0.82);
  --tag-bg: rgba(110,147,255,0.16);
  --tag-text: #9AB6FF;
  --pill-bg: rgba(52,211,153,0.14);
  --pill-border: rgba(52,211,153,0.4);
  --pill-text: #4FE3AA;
  --shadow-color: rgba(0,0,0,0.55);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1120px;

  color-scheme: dark;
}

html[data-theme="light"]{
  --bg: #FAF9F6;
  --bg-elevated: #FFFFFF;
  --bg-elevated-2: #F1EFE9;
  --text: #14181F;
  --text-soft: #545B66;
  --text-faint: #8A8F98;
  --line: #E1DED4;

  --accent: #2451E0;
  --accent-strong: #16309C;
  --amber: #E8952F;
  --green: #1F9D6C;

  --header-bg: rgba(250,249,246,0.86);
  --tag-bg: #E9EFFD;
  --tag-text: #16309C;
  --pill-bg: #EAF6EF;
  --pill-border: #BEE3CC;
  --pill-text: #16724D;
  --shadow-color: rgba(20,24,31,0.35);

  color-scheme: light;
}

html, body{ transition: background 0.25s ease, color 0.25s ease; }

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

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

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

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
ul{ margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4{ font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }

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

:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* subtle graph-paper texture used behind key sections */
.grid-bg{
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
}

.eyebrow{
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--accent-strong);
  margin: 0 0 14px;
  font-weight: 500;
}
.eyebrow-invert{ color: rgba(255,255,255,0.75); }

.section-title{
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  margin-bottom: 40px;
  max-width: 640px;
}

.section{ padding: 96px 0; }

/* ===================================================================
   BUTTONS
=================================================================== */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  border: 1.5px solid transparent;
  cursor: pointer;
}
.btn-primary{
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(20,24,31,0.45); }

.btn-ghost{
  background: transparent;
  border-color: var(--text);
  color: var(--text);
}
.btn-ghost:hover{ background: var(--text); color: var(--bg); }

.btn-ghost-light{
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}
.btn-ghost-light:hover{ background: #fff; color: var(--accent-strong); }

.btn-small{
  padding: 9px 18px;
  font-size: 13px;
  background: var(--text);
  color: var(--bg);
}

/* ===================================================================
   NAV
=================================================================== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}
.logo .dot{ color: var(--accent); }

.nav-right{
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-links{
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a[data-nav]{
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
  padding: 4px 0;
}
.nav-links a[data-nav]:hover{ color: var(--text); }
.nav-links a[data-nav].active{ color: var(--text); }
.nav-links a[data-nav].active::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---- theme toggle ---- */
.theme-toggle{
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  cursor: pointer;
  padding: 3px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.theme-toggle .knob{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(0);
  transition: transform 0.25s ease, background 0.25s ease;
}
html[data-theme="light"] .theme-toggle .knob{ transform: translateX(18px); }
.theme-toggle svg{ width: 11px; height: 11px; color: var(--bg); }
.theme-toggle .icon-sun{ display: none; }
.theme-toggle .icon-moon{ display: block; }
html[data-theme="light"] .theme-toggle .icon-sun{ display: block; }
html[data-theme="light"] .theme-toggle .icon-moon{ display: none; }

.nav-toggle{
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span{
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ===================================================================
   HERO
=================================================================== */
.hero{
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding: 88px 0 96px;
}

.hero-copy h1{
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1.12;
  margin-bottom: 22px;
}
.highlight{ color: var(--accent); }

.hero-lede{
  font-size: 17px;
  color: var(--text-soft);
  max-width: 520px;
  margin-bottom: 26px;
}
.role-typed{ color: var(--text); font-weight: 600; }
.cursor{ color: var(--accent); animation: blink 1s step-end infinite; }
@keyframes blink{ 50%{ opacity: 0; } }

.open-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 14px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--pill-text);
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 28px;
}
.pulse-dot{
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
  flex-shrink: 0;
}
.pulse-dot::after{
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--green);
  animation: pulse 1.8s ease-out infinite;
}
.pulse-dot-light{ background: #fff; }
.pulse-dot-light::after{ border-color: #fff; }
@keyframes pulse{
  0%{ transform: scale(0.7); opacity: 0.9; }
  100%{ transform: scale(1.9); opacity: 0; }
}

.hero-actions{
  display: flex;
  gap: 14px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.hero-meta{
  display: flex;
  gap: 36px;
}
.meta-item{ display: flex; flex-direction: column; }
.meta-num{
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
}
.meta-label{
  font-size: 12.5px;
  color: var(--text-faint);
  margin-top: 2px;
  line-height: 1.35;
}

/* ---- hero right: console + KPIs ---- */
.hero-panel{ display: flex; flex-direction: column; gap: 18px; }

.console{
  background: #14181F;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -24px rgba(20,24,31,0.5);
}
.console-bar{
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #1D2230;
  border-bottom: 1px solid #2A3040;
}
.console-bar .dot{ width: 10px; height: 10px; border-radius: 50%; }
.console-bar .red{ background: #FF5F57; }
.console-bar .amber{ background: #FEBC2E; }
.console-bar .green{ background: #28C840; }
.console-title{
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #7C8497;
}
.console-body{
  margin: 0;
  padding: 22px 20px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: #C7CCD6;
  overflow-x: auto;
}
.c-kw{ color: #7AA2F7; }
.c-fn{ color: #E0B341; }
.c-str{ color: #9ECE6A; }
.c-comment{ color: #5A6377; font-style: italic; }

.kpi-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.kpi-card{
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.kpi-value{
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-strong);
}
.kpi-suffix{
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-strong);
}
.kpi-label{
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 4px;
  line-height: 1.4;
}
.kpi-wide{ grid-column: span 2; }
.kpi-label-only{ font-size: 13px; color: var(--text-soft); margin-top: 0; }

.grid-divider{
  height: 64px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  mask-image: linear-gradient(to bottom, transparent, black 40%, black 60%, transparent);
}

/* ===================================================================
   ABOUT
=================================================================== */
.about-grid{
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 56px;
  align-items: start;
}
.about-photo img{
  border-radius: var(--radius);
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--line);
}
.about-copy h2{
  font-size: 1.6rem;
  margin-bottom: 18px;
  max-width: 560px;
}
.about-copy p{
  color: var(--text-soft);
  max-width: 620px;
  margin: 0 0 16px;
}
.about-facts{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.fact{ display: flex; flex-direction: column; gap: 6px; }
.fact-label{
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.fact-value{ font-size: 14.5px; color: var(--text); }

/* ===================================================================
   EXPERIENCE / TIMELINE
=================================================================== */
.timeline{
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.timeline-item{ position: relative; }
.timeline-marker{
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line);
}
.timeline-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.timeline-head h3{ font-size: 1.15rem; }
.timeline-date{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}
.timeline-org{
  color: var(--accent-strong);
  font-weight: 600;
  font-size: 14.5px;
  margin: 4px 0 14px;
}
.timeline-list li{
  position: relative;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 14.5px;
  margin-bottom: 9px;
  max-width: 680px;
}
.timeline-list li::before{
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--amber);
}

.achievements{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 56px;
}
.achievement-card{
  display: flex;
  gap: 16px;
  padding: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.achievement-icon{
  font-size: 20px;
  color: var(--amber);
  flex-shrink: 0;
}
.achievement-card h4{ font-size: 15px; margin-bottom: 6px; }
.achievement-card p{ font-size: 13.5px; color: var(--text-soft); margin: 0; }

/* ===================================================================
   SKILLS
=================================================================== */
.skills-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.skill-group h3{
  font-size: 15px;
  margin-bottom: 14px;
  color: var(--text);
}
.chip-row{ display: flex; flex-wrap: wrap; gap: 8px; }
.chip{
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 7px 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-soft);
}

/* ===================================================================
   PROJECTS
=================================================================== */
.project-list{
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.project-card{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
}
.project-card:not(:has(.project-image)){ grid-template-columns: 1fr; }
.project-flagship{
  grid-template-columns: 1fr;
  border-color: var(--accent);
  box-shadow: 0 20px 44px -28px rgba(36,81,224,0.35);
}
.project-image{ overflow: hidden; background: #0F1420; }
.project-image img{ width: 100%; height: 100%; object-fit: cover; }
.project-image-banner{ max-height: 340px; }
.project-image-banner img{ height: auto; }
.project-info{ padding: 28px 30px; }
.project-flagship .project-info{ padding: 36px 40px; }

.project-tag{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.project-info h3{ font-size: 1.3rem; margin-bottom: 6px; }
.project-sub{ color: var(--text-faint); font-size: 13.5px; margin: 0 0 12px; }
.project-info p{ color: var(--text-soft); font-size: 14.5px; margin: 0 0 14px; max-width: 700px; }

.project-features{ margin: 0 0 16px; }
.project-features li{
  position: relative;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 8px;
  max-width: 680px;
}
.project-features li::before{
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.project-stack{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 20px;
}

.cta{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-strong);
  border-bottom: 1.5px solid var(--accent);
  padding-bottom: 1px;
}
.cta:hover{ color: var(--accent); }

/* ===================================================================
   OPEN TO WORK
=================================================================== */
.open-to-work{
  background: linear-gradient(150deg, #16309C 0%, #2451E0 55%, #3A6BF0 100%);
  color: #fff;
}
.otw-grid{
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.status-badge{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}
.otw-copy h2{
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 18px;
  max-width: 520px;
}
.otw-copy p{
  color: rgba(255,255,255,0.86);
  max-width: 500px;
  margin-bottom: 30px;
  font-size: 15.5px;
}
.otw-actions{ display: flex; gap: 14px; flex-wrap: wrap; }
.otw-actions .btn-primary{ background: #fff; color: var(--accent-strong); }
.otw-actions .btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(0,0,0,0.35); }

.otw-details{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.otw-row{ display: flex; flex-direction: column; gap: 5px; }
.otw-row + .otw-row{ padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.16); }
.otw-label{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
}
.otw-value{ font-size: 14.5px; color: #fff; line-height: 1.5; }

/* ===================================================================
   CONTACT
=================================================================== */
.contact-lede{ color: var(--text-soft); max-width: 560px; margin-bottom: 40px; }
.contact-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.contact-card{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.contact-card:hover{ transform: translateY(-3px); border-color: var(--accent); }
.contact-icon{
  color: var(--accent);
  width: 26px; height: 26px;
  margin-bottom: 10px;
}
.contact-icon svg{ width: 100%; height: 100%; }
.contact-label{
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact-value{ font-size: 14.5px; font-weight: 600; word-break: break-word; }
.contact-card-static{ cursor: default; }
.contact-card-static:hover{ transform: none; border-color: var(--line); }

/* ===================================================================
   FOOTER
=================================================================== */
.site-footer{
  background: #0B0F17;
  color: rgba(255,255,255,0.7);
  padding: 56px 0 32px;
}
.footer-inner{ text-align: center; }
.brand{
  font-family: var(--font-display);
  font-size: 22px;
  color: #fff;
  letter-spacing: 0.02em;
}
.brand span{ color: rgba(255,255,255,0.55); font-weight: 400; }
.footer-tag{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: rgba(255,255,255,0.5);
  margin: 10px 0 22px;
}
.social-row{ display: flex; justify-content: center; gap: 14px; margin-bottom: 26px; }
.social-row a{
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.24);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.social-row a:hover{ background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.5); }
.copyright{ font-size: 12.5px; color: rgba(255,255,255,0.4); }

/* ===================================================================
   SCROLL REVEAL
=================================================================== */
[data-reveal]{
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].is-visible{
  opacity: 1;
  transform: translateY(0);
}

/* ===================================================================
   RESPONSIVE
=================================================================== */
@media (max-width: 980px){
  .hero{ grid-template-columns: 1fr; padding-top: 48px; }
  .about-grid{ grid-template-columns: 1fr; }
  .about-photo{ max-width: 240px; }
  .achievements{ grid-template-columns: 1fr; }
  .skills-grid{ grid-template-columns: repeat(2, 1fr); }
  .otw-grid{ grid-template-columns: 1fr; }
  .contact-grid{ grid-template-columns: 1fr 1fr; }
  .project-card{ grid-template-columns: 1fr; }
  .project-image{ max-height: 240px; }
}

@media (max-width: 680px){
  .section{ padding: 64px 0; }
  .nav-toggle{ display: flex; }
  .nav-links{
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 28px 28px;
    gap: 18px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav-links.open{
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .hero-meta{ gap: 22px; flex-wrap: wrap; }
  .about-facts{ grid-template-columns: 1fr; }
  .skills-grid{ grid-template-columns: 1fr; }
  .contact-grid{ grid-template-columns: 1fr; }
  .kpi-grid{ grid-template-columns: 1fr 1fr; }
}
