/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root{
  --paper: #F5F5F0;
  --surface: #FFFFFF;
  --surface-2: #EEEDE6;
  --ink: #14171C;
  --ink-soft: #4B4F56;
  --line: #E1DFD6;
  --green: #1F6F50;
  --green-soft: #E4EFE9;
  --blue: #3457D5;
  --rust: #B5533C;
  --rust-soft: #F3E5DF;

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

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -12px rgba(20,23,28,0.18);
  --shadow-sm: 0 4px 14px -6px rgba(20,23,28,0.15);

  --nav-h: 72px;
  --maxw: 1140px;

  --ease: cubic-bezier(.2,.7,.3,1);
}

html[data-theme="dark"] {
  /* Main backgrounds */
  --paper: #080B14;
  --surface: #111827;
  --surface-2: #182033;

  /* Text colours */
  --ink: #F8FAFC;
  --ink-soft: #AAB4C5;

  /* Borders */
  --line: #29344A;

  /* Primary accent */
  --green: #38BDF8;
  --green-soft: #102D40;

  /* Secondary accent */
  --blue: #A78BFA;

  /* Highlight colour */
  --rust: #FB7185;
  --rust-soft: #3B1824;

  /* Shadows */
  --shadow: 0 14px 40px -14px rgba(0, 0, 0, 0.75);
  --shadow-sm: 0 6px 20px -8px rgba(0, 0, 0, 0.65);
}
html[data-theme="dark"] .hero {
  background:
    radial-gradient(
      55% 55% at 85% 10%,
      rgba(56, 189, 248, 0.14),
      transparent 70%
    ),
    radial-gradient(
      45% 50% at 10% 85%,
      rgba(167, 139, 250, 0.10),
      transparent 70%
    ),
    var(--paper);
}
.certificate-action{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

html[data-theme="dark"] .project-card:hover,
html[data-theme="dark"] .skill-card:hover,
html[data-theme="dark"] .achievement-card:hover,
html[data-theme="dark"] .cert-card:hover {
  border-color: var(--green);
  box-shadow:
    0 14px 35px -15px rgba(0, 0, 0, 0.8),
    0 0 18px rgba(56, 189, 248, 0.10);
}
html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #38BDF8, #A78BFA);
  color: #07111D;
  border-color: transparent;
}

html[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
}
html[data-theme="dark"] .form-row input,
html[data-theme="dark"] .form-row textarea {
  background: #0D1422;
  border-color: #2B3850;
}


html[data-theme="dark"] .form-row input:focus,
html[data-theme="dark"] .form-row textarea:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.10);
  outline: none;
}

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

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
}
h1,h2,h3{ font-family: var(--font-display); margin:0; letter-spacing: -0.01em; }
p{ margin:0; }
a{ color: inherit; text-decoration: none; }
ul,ol{ list-style: none; margin:0; padding:0; }
img{ max-width:100%; display:block; }
button{ font-family: inherit; cursor:pointer; }

.skip-link{
  position:absolute; left:-999px; top:0; background:var(--ink); color:var(--paper);
  padding:10px 16px; z-index:999; border-radius:0 0 8px 0;
}
.skip-link:focus{ left:0; }

:focus-visible{ outline: 2px solid var(--blue); outline-offset: 3px; }
.stat-chip-1{
    top: -14px;
    left: -22px;
}

.stat-chip-2{
    bottom: 24px;
    right: -28px;
}

.stat-chip-3{
    bottom: -20px;
    left: 40px;
}

.stat-chip-4{
    top: 120px;
    right: -35px;
}

/* =========================================================
   LAYOUT HELPERS
   ========================================================= */
.section{ padding: 96px 24px; }
.section-alt{ background: var(--surface-2); }
.section-inner{ max-width: var(--maxw); margin: 0 auto; }
.section-eyebrow{
  font-family: var(--font-mono); font-size: 13px; color: var(--green);
  letter-spacing: .06em; margin-bottom: 10px;
}
.section-title{ font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.section-sub{ color: var(--ink-soft); max-width: 640px; margin-bottom: 40px; font-size: 16px; }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1.5px solid transparent; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-2px); }
.btn-primary{ background: var(--ink); color: var(--paper); }
.btn-primary:hover{ box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .btn-primary{ background: var(--green); color:#04120C; }
.btn-outline{ border-color: var(--ink); color: var(--ink); }
.btn-ghost{ color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.btn-sm{ padding: 8px 16px; font-size: 13px; }

@media (max-width: 520px){
  .certificate-action{
    flex-direction: column;
    align-items: stretch;
  }

  .certificate-action .btn{
    width: 100%;
  }
}

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar{
  position: fixed; top:0; left:0; right:0; z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.navbar.scrolled{ border-bottom-color: var(--line); }
.nav-inner{
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  display:flex; align-items:center; justify-content: space-between; padding: 0 24px;
}
.logo{ font-family: var(--font-mono); font-weight: 600; font-size: 17px; }
.logo-bracket{ color: var(--ink-soft); }
.logo-accent{ color: var(--rust); }
.nav-links{ display:flex; gap: 30px; }
.nav-links a{ font-size: 14.5px; font-weight:500; color: var(--ink-soft); position:relative; }
.nav-links a:hover{ color: var(--ink); }
.nav-links a::after{
  content:''; position:absolute; left:0; bottom:-6px; height:2px; width:0; background: var(--green);
  transition: width .25s var(--ease);
}
.nav-links a:hover::after{ width:100%; }
.nav-actions{ display:flex; align-items:center; gap: 14px; }
.icon-btn{
  background:none; border: 1px solid var(--line); width:38px; height:38px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; color: var(--ink); transition: background .2s;
}
.icon-btn:hover{ background: var(--surface-2); }
.icon-moon{ display:none; }
html[data-theme="dark"] .icon-sun{ display:none; }
html[data-theme="dark"] .icon-moon{ display:block; }

.hamburger{ display:none; background:none; border:none; width:34px; height:24px; position:relative; }
.hamburger span{
  position:absolute; left:0; right:0; height:2px; background: var(--ink); border-radius:2px;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.hamburger span:nth-child(1){ top:0; }
.hamburger span:nth-child(2){ top:11px; }
.hamburger span:nth-child(3){ top:22px; }
.hamburger.open span:nth-child(1){ transform: translateY(11px) rotate(45deg); }
.hamburger.open span:nth-child(2){ opacity:0; }
.hamburger.open span:nth-child(3){ transform: translateY(-11px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero{
  position: relative; min-height: 100vh; display:flex; flex-direction:column; justify-content:center;
  padding: calc(var(--nav-h) + 40px) 24px 60px;
  background:
    radial-gradient(60% 50% at 85% 8%, color-mix(in srgb, var(--green) 12%, transparent), transparent 70%),
    var(--paper);
}
.hero-inner{
  max-width: var(--maxw); margin:0 auto; width:100%;
  display:grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items:center;
}
.eyebrow{
  font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); margin-bottom: 18px;
  letter-spacing: .04em;
}
.hero h1{
  font-size: clamp(42px, 6vw, 68px); line-height: 1.02; margin-bottom: 14px;
}
.hero-role{
  font-family: var(--font-mono); font-size: clamp(16px,2vw,20px); color: var(--green); margin-bottom: 22px;
  min-height: 26px;
}
.cursor{ animation: blink 1s step-end infinite; color: var(--ink-soft); }
@keyframes blink{ 50%{ opacity:0; } }
.hero-tagline{
  font-size: 17px; color: var(--ink-soft); max-width: 480px; margin-bottom: 34px;
}
.hero-ctas{ display:flex; flex-wrap:wrap; gap:14px; margin-bottom: 34px; }
.hero-socials{ display:flex; gap:18px; color: var(--ink-soft); }
.hero-socials a{ transition: color .2s, transform .2s; }
.hero-socials a:hover{ color: var(--green); transform: translateY(-2px); }

.hero-visual{ position: relative; }
.terminal-card{
  background: #0F1218; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow:hidden; border: 1px solid rgba(255,255,255,0.06);
  transform: rotate(1.2deg);
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty{ 0%,100%{ transform: rotate(1.2deg) translateY(0);} 50%{ transform: rotate(1.2deg) translateY(-8px);} }
.terminal-bar{
  display:flex; align-items:center; gap:8px; padding: 12px 16px; background:#171B22;
}
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; }
.dot-r{ background:#FF5F57; } .dot-y{ background:#FEBC2E; } .dot-g{ background:#28C840; }
.terminal-title{ margin-left: 8px; font-family: var(--font-mono); font-size:12px; color:#8A93A2; }
.terminal-body{
  margin:0; padding: 22px 20px 26px; color:#D6F5E4; font-family: var(--font-mono); font-size: 13.5px;
  min-height: 220px; white-space: pre-wrap; word-break: break-word;
}
.stat-chip{
  position:absolute; background: var(--surface); border:1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 16px; box-shadow: var(--shadow-sm); text-align:center; font-family: var(--font-mono);
}
.stat-chip strong{ display:block; font-size:20px; color: var(--green); }
.stat-chip span{ font-size: 11px; color: var(--ink-soft); }
.stat-chip-1{ top: -14px; left: -22px; }
.stat-chip-2{ bottom: 24px; right: -28px; }
.stat-chip-3{ bottom: -20px; left: 40px; }

.scroll-cue{
  position:absolute; bottom: 26px; left:50%; transform: translateX(-50%); color: var(--ink-soft);
}
.scroll-dot{ animation: scrollDot 1.6s ease-in-out infinite; }
@keyframes scrollDot{ 0%{ transform:translateY(0); opacity:1;} 70%{ transform:translateY(9px); opacity:0;} 100%{opacity:0;} }

/* =========================================================
   ABOUT
   ========================================================= */
.about-grid{ display:grid; grid-template-columns: 1.4fr 1fr; gap: 50px; align-items:start; }
.about-text{ font-size: 17px; color: var(--ink-soft); max-width: 640px; }
.about-facts{ display:grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.about-facts li{ display:flex; flex-direction:column; gap:4px; }
.fact-num{ font-family: var(--font-display); font-size: 30px; font-weight:700; color: var(--green); }
.fact-label{ font-size: 13px; color: var(--ink-soft); }

/* =========================================================
   SKILLS
   ========================================================= */
.skills-grid{ display:grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.skill-card{
  background: var(--surface); border:1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.skill-card:hover{ transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.skill-card h3{ font-size: 15px; margin-bottom: 18px; }
.bar-row{ margin-bottom: 14px; }
.bar-row span{ font-size: 13px; color: var(--ink-soft); display:block; margin-bottom:6px; }
.bar{ height: 7px; background: var(--surface-2); border-radius: 99px; overflow:hidden; }
.bar i{
  display:block; height:100%; width:0; border-radius:99px; background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 1.1s var(--ease);
}
.bar.in-view i{ width: var(--val); }
.chip-cloud{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  font-family: var(--font-mono); font-size: 12px; padding: 6px 12px; border-radius: 99px;
  background: var(--surface-2); border:1px solid var(--line); color: var(--ink-soft);
}
.chip-accent{ background: var(--green-soft); color: var(--green); border-color: transparent; }

/* =========================================================
   PROJECTS
   ========================================================= */
.project-grid{ display:grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.project-card{
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display:flex; flex-direction:column; gap: 14px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.project-card:hover{ transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--green); }
.project-top{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.project-top h3{ font-size: 19px; }
.project-status{
  font-family: var(--font-mono); font-size: 11px; padding: 4px 10px; border-radius: 99px;
  background: var(--rust-soft); color: var(--rust); white-space:nowrap; margin-top:3px;
}
.project-status-done{ background: var(--green-soft); color: var(--green); }
.project-problem, .project-solution{ font-size: 14.5px; color: var(--ink-soft); }
.project-tags{ display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.tag{
  font-family: var(--font-mono); font-size: 11.5px; padding: 4px 10px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.project-links{ margin-top:auto; padding-top: 6px; }
.project-links a{ font-weight:600; font-size: 14px; color: var(--blue); }
.project-links a:hover{ text-decoration: underline; }

/* =========================================================
   EXPERIENCE — commit log
   ========================================================= */
.commit-log{ position:relative; margin-left: 6px; padding-left: 30px; border-left: 2px solid var(--line); }
.commit{ position:relative; padding-bottom: 34px; }
.commit:last-child{ padding-bottom: 6px; }
.commit-dot{
  position:absolute; left:-38px; top:4px; width:14px; height:14px; border-radius:50%;
  background: var(--green); border: 3px solid var(--paper); box-shadow: 0 0 0 2px var(--green);
}
.commit-head{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:8px; }
.commit-hash{
  font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); color: var(--rust);
  padding: 3px 8px; border-radius: 6px;
}
.commit-msg{ font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.commit-desc{ color: var(--ink-soft); font-size: 14.5px; max-width: 680px; margin-bottom: 10px; }
.commit-files{ display:flex; flex-wrap:wrap; gap:8px; }

.subsection-title{ font-size: 20px; margin: 50px 0 18px; }
.responsibility-list li{
  padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 15px;
}
.responsibility-list li strong{ color: var(--ink); }

.achievement-grid{ display:grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.achievement-card{
  background: var(--surface); border:1px solid var(--line); border-radius: var(--radius-sm); padding: 18px;
}
.achievement-tag{
  display:inline-block; font-family: var(--font-mono); font-size: 11px; color: var(--blue);
  margin-bottom: 8px;
}
.achievement-card p{ font-size: 13.5px; color: var(--ink-soft); }

/* =========================================================
   EDUCATION
   ========================================================= */
.edu-list{ display:flex; flex-direction:column; gap: 16px; }
.edu-card{
  display:flex; justify-content:space-between; align-items:center; gap: 20px; flex-wrap:wrap;
  background: var(--surface); border:1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px;
}
.edu-main h3{ font-size: 18px; margin-bottom: 4px; }
.edu-main p{ color: var(--ink-soft); font-size: 14px; }
.edu-meta{ display:flex; align-items:center; gap:16px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); }
.edu-score{ background: var(--green-soft); color: var(--green); padding: 6px 14px; border-radius: 99px; font-weight:600; }

/* =========================================================
   CERTIFICATIONS
   ========================================================= */
.cert-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 40px; }
.cert-card{
  display:flex; align-items:center; gap:14px; background: var(--surface); border:1px solid var(--line);
  border-radius: var(--radius-sm); padding: 18px; font-size: 14px; color: var(--ink-soft);
}
.cert-icon{ font-size: 22px; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-grid{ display:grid; grid-template-columns: .9fr 1.1fr; gap: 50px; }
.contact-info{ display:flex; flex-direction:column; gap: 18px; }
.contact-row{
  display:flex; align-items:center; gap: 12px; font-size: 15px; color: var(--ink);
  padding: 12px 0; border-bottom: 1px solid var(--line); transition: color .2s;
}
.contact-row:hover{ color: var(--green); }
.contact-location{ color: var(--ink-soft); font-size: 14px; margin-top: 6px; }

.contact-form{ display:flex; flex-direction:column; gap: 18px; }
.form-row{ display:flex; flex-direction:column; gap: 6px; }
.form-row label{ font-size: 13px; color: var(--ink-soft); font-weight:600; }
.form-row input, .form-row textarea{
  font-family: var(--font-body); font-size: 15px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical;
  transition: border-color .2s;
}
.form-row input:focus, .form-row textarea:focus{ border-color: var(--green); }
.form-status{ font-size: 13.5px; color: var(--green); min-height: 18px; }

/* =========================================================
   FOOTER + SCROLL TOP
   ========================================================= */
.footer{
  padding: 34px 24px 50px; text-align:center; color: var(--ink-soft); font-size: 13.5px;
  border-top: 1px solid var(--line);
}
.footer-socials{ display:flex; gap: 18px; justify-content:center; margin-top: 12px; }
.footer-socials a:hover{ color: var(--green); }

.scroll-top{
  position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: var(--paper); border:none; display:flex; align-items:center; justify-content:center;
  box-shadow: var(--shadow-sm); opacity:0; visibility:hidden; transform: translateY(10px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s; z-index: 90;
}
html[data-theme="dark"] .scroll-top{ background: var(--green); color:#04120C; }
.scroll-top.visible{ opacity:1; visibility:visible; transform: translateY(0); }

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal{ opacity:0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in-view{ opacity:1; transform:none; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px){
  .hero-inner{ grid-template-columns: 1fr; }
  .hero-visual{ order:-1; max-width: 460px; margin: 0 auto 20px; }
  .about-grid{ grid-template-columns: 1fr; }
  .skills-grid{ grid-template-columns: repeat(2,1fr); }
  .project-grid{ grid-template-columns: 1fr; }
  .achievement-grid{ grid-template-columns: repeat(2,1fr); }
  .cert-grid{ grid-template-columns: repeat(2,1fr); }
  .contact-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .nav-links{
    position: fixed; top: var(--nav-h); left:0; right:0; background: var(--paper);
    flex-direction:column; padding: 20px 24px 30px; gap: 4px; border-bottom: 1px solid var(--line);
    transform: translateY(-130%); opacity:0; transition: transform .3s var(--ease), opacity .3s var(--ease);
  }
  .nav-links.open{ transform: translateY(0); opacity:1; }
  .nav-links a{ display:block; padding: 12px 0; font-size: 16px; }
  .hamburger{ display:block; }
  .nav-resume{ display:none; }
  .stat-chip{ display:none; }
  .skills-grid{ grid-template-columns: 1fr; }
  .achievement-grid{ grid-template-columns: 1fr; }
  .cert-grid{ grid-template-columns: 1fr; }
  .section{ padding: 70px 20px; }
  .about-facts{ grid-template-columns: 1fr 1fr; }
}
