/* ============ Theme & Base ============ */
:root {
  --bg: #0a0c0d;          /* deep charcoal */
  --bg-elev: #0f1115;      /* elevated panels */
  --text: #e6f1ef;         /* off-white */
  --muted: #95a3ad;        /* slate */
  --card: #0f1115cc;       /* glass subtle */
  --border: #1a2430;       /* crisp border */
  --primary: #2ee37a;      /* soft neon green */
  --accent: #14b86e;       /* emerald */
  --danger: #ff6b6b;
  --shadow: 0 18px 40px rgba(0,0,0,.45);
  /* Aurora (dark) */
  --aurora-red: rgba(255, 77, 109, .18);
  --aurora-blue: rgba(46, 123, 255, .22);
  --aurora-green: rgba(34, 255, 136, .22);
  --aurora-cyan: rgba(0, 229, 255, .22);
  --g: clamp(16px, 4vw, 28px);
  --mx: 0px; /* aurora mouse X offset */
  --my: 0px; /* aurora mouse Y offset */
}

/* Light theme */
.light {
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --text: #0e1320;
  --muted: #4a5161;
  --card: #ffffffcc;
  --border: #e7eaf2;
  --primary: #00c26e;
  --accent: #00e7a0;
  --shadow: 0 10px 20px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  padding-top: 64px; /* account for fixed header */
  position: relative;
}

/* Remove aurora/matrix overlays for a clean, future-minimal look */
/* Global aurora background */
body::before {
  content: "";
  position: fixed;
  top: -40%;
  bottom: -20%;
  left: 50%;
  width: 140vw;
  z-index: 0;
  pointer-events: none;
  filter: blur(80px) saturate(130%);
  background:
    radial-gradient(40% 60% at 20% 15%, var(--aurora-cyan), transparent 60%),
    radial-gradient(35% 55% at 80% 10%, var(--aurora-blue), transparent 60%),
    radial-gradient(30% 50% at 65% 80%, var(--aurora-green), transparent 60%),
    radial-gradient(28% 45% at 30% 85%, var(--aurora-red), transparent 60%);
  transform: translateX(calc(-50% + var(--mx))) translateY(var(--my)) scale(1.03);
  animation: auroraMove 6s ease-in-out infinite alternate, auroraHue 9s linear infinite;
}
.light::before {
  background:
    radial-gradient(40% 60% at 20% 15%, rgba(255, 200, 124, .34), transparent 60%),
    radial-gradient(35% 55% at 80% 10%, rgba(160, 207, 255, .38), transparent 60%),
    radial-gradient(30% 50% at 65% 80%, rgba(156, 255, 208, .36), transparent 60%),
    radial-gradient(28% 45% at 30% 85%, rgba(255, 153, 204, .32), transparent 60%);
}
/* Mobile: make aurora stronger and larger */
@media (max-width: 720px){
  /* Stronger mobile aurora (dark) */
  body::before {
    opacity: .75;
    width: 200vw;
    top: -70%;
    bottom: -40%;
    filter: blur(120px) saturate(180%);
    background:
      radial-gradient(48% 66% at 18% 12%, rgba(0, 229, 255, .45), transparent 60%),
      radial-gradient(46% 60% at 82% 8%, rgba(46, 123, 255, .45), transparent 60%),
      radial-gradient(40% 58% at 66% 82%, rgba(34, 255, 136, .45), transparent 60%),
      radial-gradient(36% 54% at 28% 88%, rgba(255, 77, 109, .40), transparent 60%);
    background-blend-mode: screen, screen, screen, screen;
  }
  /* Stronger for light mode */
  .light::before {
    filter: blur(130px) saturate(200%);
    opacity: .85;
    background:
      radial-gradient(48% 66% at 18% 12%, rgba(160, 207, 255, .50), transparent 60%),
      radial-gradient(46% 60% at 82% 8%, rgba(255, 200, 124, .46), transparent 60%),
      radial-gradient(40% 58% at 66% 82%, rgba(156, 255, 208, .46), transparent 60%),
      radial-gradient(36% 54% at 28% 88%, rgba(255, 153, 204, .42), transparent 60%);
    background-blend-mode: screen, screen, screen, screen;
  }
}

.container { width: min(1200px, calc(100% - var(--g) * 2)); margin-inline: auto; }
.container { padding-inline: calc(env(safe-area-inset-left) + 0px) calc(env(safe-area-inset-right) + 0px); }
.section { padding: 80px 0; position: relative; }
.divider { height: 1px; background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--primary) 40%, transparent), color-mix(in oklab, var(--accent) 40%, transparent), transparent); opacity: .6; width: 100%; }
.section-head { margin-bottom: 18px; }
.section-head h3 { margin: 0 0 6px; font-size: 28px; letter-spacing: .3px; }
.section-head h3 { font-family: 'Space Grotesk', Inter, ui-sans-serif; font-weight: 700; }
.section-head h3::before { content: "> "; color: var(--accent); font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; font-weight: 700; }
.section-tag { margin: 0; color: var(--muted); font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  transition: transform .35s ease, box-shadow .45s ease, border-color .35s ease, background .35s ease;
}
.card:hover { 
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45), 0 0 24px color-mix(in oklab, var(--primary) 30%, transparent);
  border-color: color-mix(in oklab, var(--primary) 45%, var(--border));
}
.center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.list { margin: 8px 0 0; padding: 0 0 0 20px; }
.list li { margin: 6px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding:0; margin:8px 0 0; }
.tags li { padding: 6px 10px; border: 1px dashed var(--border); border-radius: 999px; color: var(--muted); font-size: 13px; }
.tags li:hover { transform: translateY(-2px) scale(1.02); border-style: solid; color: var(--text); }
.badge { background: linear-gradient(90deg, var(--primary), var(--accent)); color:#fff; padding:6px 10px; border-radius: 999px; font-size: 12px; }

/* ============ Header / Nav ============ */
.header { position: fixed; top: 0; inset-inline: 0; z-index: 80; background: color-mix(in oklab, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; gap: 16px; height: 64px; direction: ltr; }
.nav { padding-inline: max(var(--g), calc(env(safe-area-inset-left) + 0px)) max(var(--g), calc(env(safe-area-inset-right) + 0px)); }
.brand { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: 0.5px; background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 14px; list-style: none; margin-inline-start: auto; padding: 0; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.nav-links a:hover { color: var(--primary); background: rgba(46,227,122,.08); }
.nav-links a.active { color: #fff; background: linear-gradient(90deg, color-mix(in oklab, var(--primary) 35%, transparent), color-mix(in oklab, var(--accent) 35%, transparent)); }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 12px; height: 38px; width: 38px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--text); }
.only-mobile { display: none; }
.hide-mobile { display: block; }

/* Scroll progress */
.progress { position: fixed; inset-inline: 0; top: 0; height: 3px; z-index: 100; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--accent)); box-shadow: 0 0 12px color-mix(in oklab, var(--primary) 60%, transparent); }

/* Icons */
.icon-moon::before { content: "☾"; font-size: 16px; }
.icon-sun::before { content: "☼"; font-size: 16px; }
.icon-menu::before { content: "☰"; font-size: 16px; }

/* ============ Hero ============ */
.hero { position: relative; overflow: hidden; min-height: 80dvh; }
.hero .hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 26px; align-items: center; }
.hero::before { content: none; }
@keyframes auroraMove { 0% { transform: translateX(calc(-50% - 28px)) translateY(-22px) scale(1.02); } 50% { transform: translateX(calc(-50% + 24px)) translateY(20px) scale(1.08); } 100% { transform: translateX(calc(-50% - 26px)) translateY(26px) scale(1.02); } }
@keyframes auroraHue { 0% { filter: blur(80px) saturate(130%) hue-rotate(0deg); } 100% { filter: blur(80px) saturate(130%) hue-rotate(360deg); } }
.hero .hero-inner { position: relative; z-index: 1; }
.lead { color: var(--muted); margin-top: 8px; }
.cta-row { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 10px 14px; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: transparent; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 18px color-mix(in oklab, var(--primary) 35%, transparent), 0 12px 24px rgba(0,0,0,.18); border-color: color-mix(in oklab, var(--primary) 45%, var(--border)); }
.btn.primary { background: linear-gradient(90deg, var(--primary), var(--accent)); color: #0a0c0d; border: none; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.btn.ghost:hover { background: rgba(255,255,255,.06); }
/* Light mode keeps the gradient button */
.light .btn.primary { background: linear-gradient(90deg, var(--primary), var(--accent)); color: #0a0c0d; border: none; }

.hero-text h1 { font-size: clamp(26px, 8vw, 60px); margin: 0; line-height: 1.08; letter-spacing: .4px; word-break: break-word; }
.hero-text h2 { font-size: clamp(18px, 3.2vw, 28px); margin: 6px 0 0; font-weight: 600; color: var(--muted); }
.typed-inline { font-size: .45em; color: var(--accent); margin-inline-start: 10px; white-space: nowrap; }
.typed-line { border-inline-end: 2px solid color-mix(in oklab, var(--text) 70%, transparent); padding-inline-end: 6px; white-space: nowrap; }
.typed-line { animation: caret 1s steps(1, end) infinite; }
.hero .typed-line,
.hero .typed-inline,
.hero .sub,
.hero .lead { direction: ltr; text-align: start; }
@keyframes caret { 0%,60% { border-color: transparent } 61%,100% { border-color: color-mix(in oklab, var(--text) 70%, transparent) } }

.hero-visual { display: grid; place-items: center; }
.photo-wrap { position: relative; width: clamp(220px, 28vw, 320px); aspect-ratio: 1; border-radius: 999px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; box-shadow: 0 24px 48px rgba(0,0,0,.5); }
.photo { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.02) contrast(1.01); position: relative; z-index: 1; border-radius: inherit; }
/* Dual-ring neon: outer subtle glow + inner crisp stroke */
.photo-wrap::before {
  content: "";
  position: absolute;
  inset: 0; /* align with edge so it isn't clipped */
  border-radius: 999px;
  border: 3px solid color-mix(in oklab, var(--primary) 70%, #ffffff 15%);
  box-shadow:
    0 0 22px color-mix(in oklab, var(--primary) 38%, transparent),
    0 0 50px color-mix(in oklab, var(--primary) 26%, transparent);
  pointer-events: none;
  z-index: 2;
  animation: ringPulse 2.8s ease-in-out infinite alternate;
}
.photo-wrap::after {
  content: "";
  position: absolute;
  inset: 8px; /* inner fine stroke */
  border-radius: 999px;
  border: 2px solid color-mix(in oklab, var(--primary) 88%, #ffffff 8%);
  box-shadow: inset 0 0 2px color-mix(in oklab, var(--primary) 30%, transparent);
  pointer-events: none;
  z-index: 2;
}
.light .photo-wrap::before { border-color: color-mix(in oklab, var(--primary) 75%, #ffffff 25%); }
.light .photo-wrap::after  { border-color: color-mix(in oklab, var(--primary) 90%, #000000 10%); }

@keyframes ringPulse { from { box-shadow: 0 0 16px color-mix(in oklab, var(--primary) 32%, transparent), 0 0 36px color-mix(in oklab, var(--primary) 20%, transparent); }
  to { box-shadow: 0 0 26px color-mix(in oklab, var(--primary) 45%, transparent), 0 0 64px color-mix(in oklab, var(--primary) 30%, transparent); } }
.photo-wrap::after { content: none; }
.photo-wrap:hover { transform: translateY(-4px); box-shadow: 0 30px 60px rgba(0,0,0,.45); }
@keyframes spin { from { transform: rotate(0) } to { transform: rotate(360deg) } }

/* ============ Timeline / Skills Layout ============ */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.timeline { display: grid; gap: 18px; position: relative; }
.edu-grid { display: grid; grid-template-columns: minmax(160px, 220px) 1fr auto; gap: 22px; align-items: center; }
.logo-box { width: 180px; height: 180px; border-radius: 18px; display: grid; place-items: center; background: #ffffff; border: 0; overflow: hidden; box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.logo-box img { max-width: 90%; max-height: 90%; object-fit: contain; }
.logo-box .logo-fallback { display: none; width: 100%; height: 100%; place-items: center; font-weight: 700; font-size: 32px; color: var(--text); background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 30%, transparent), color-mix(in oklab, var(--accent) 30%, transparent)); }
.logo-box.small { width: 180px; height: 180px; border-radius: 18px; }
.job { display: grid; grid-template-columns: minmax(160px, 220px) 1fr auto; gap: 22px; align-items: center; }
.job-body h4 { margin-top: 0; }
.job .meta { justify-self: end; align-self: center; display: flex; gap: 8px; }

/* ============ Footer ============ */
.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0; background: color-mix(in oklab, var(--bg) 92%, transparent); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.social { display: flex; gap: 10px; }
.icon-link { color: var(--muted); display: inline-flex; padding: 8px; border-radius: 10px; border: 1px solid var(--border); }
.icon-link:hover { color: var(--primary); background: rgba(46,227,122,.08); border-color: color-mix(in oklab, var(--primary) 45%, var(--border)); box-shadow: 0 0 12px color-mix(in oklab, var(--primary) 30%, transparent); }
.copyright { color: var(--muted); font-size: 14px; }

/* ============ Forms ============ */
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, textarea { background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font-size: 15px; }
input:focus, textarea:focus { outline: 2px solid color-mix(in oklab, var(--primary) 50%, transparent); border-color: transparent; }
.form-status { margin-top: 12px; font-size: 14px; min-height: 20px; }
.form-status.success { color: var(--accent); }
.form-status.error { color: var(--danger); }

/* Ornaments removed */

/* ============ Accessibility & Utils ============ */
.skip-link { position: absolute; inset-inline-start: 10px; top: -40px; background: var(--bg-elev); color: var(--text); padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); transition: top .2s; z-index: 60; }
.skip-link:focus { top: 10px; }
.hint { color: var(--muted); font-size: 13px; }
.at { color: var(--muted); font-weight: 500; }

/* Reveal removed to avoid delays in anchor navigation */
[data-reveal], [data-reveal="left"], [data-reveal="right"] { opacity: 1; transform: none; filter: none; }

html { scroll-behavior: smooth; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .hero .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .grid-2 { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr; }
  .logo-box { margin-inline: auto; }
  .job { grid-template-columns: 1fr; }
  .job .logo-box.small { margin-inline: auto; }
  .job .meta { justify-self: start; margin-top: 8px; }
  .photo-wrap { width: clamp(180px, 60vw, 280px); }
}

@media (max-width: 540px) {
  .typed .typed-line { white-space: normal; }
}

@media (max-width: 720px) {
  .skills-grid { grid-template-columns: 1fr; }
  .nav-links { position: fixed; inset-inline: 0; top: 64px; background: var(--bg); border-top: 1px solid var(--border); padding: 14px var(--g); display: none; flex-direction: column; gap: 6px; }
  .nav-links.show { display: flex; }
  .only-mobile { display: inline-grid; margin-inline-start: auto; }
  .hide-mobile { display: none; }
}
