/* ===== Colors and fonts (dark theme, purple to cyan) ===== */
:root {
  color-scheme: dark;
  --bg: #09090b;
  --bg-alt: #111114;
  --card: #18181b;
  --card-2: #202024;
  --line: #27272a;
  --line-2: #3f3f46;
  --text: #f4f4f5;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --purple: #a855f7;
  --purple-l: #c084fc;
  --pink: #ec4899;
  --cyan: #06b6d4;
  --cyan-l: #22d3ee;
  --blue: #3b82f6;
  --yellow: #facc15;
  --grad: linear-gradient(90deg, var(--purple-l), var(--cyan-l));
  --grad-btn: linear-gradient(90deg, var(--purple), var(--cyan));
  --font-display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --header-h: 4.25rem;
}

/* ===== Base ===== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 0.5rem); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: var(--cyan-l); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--cyan-l); outline-offset: 3px; border-radius: 6px; }

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.i { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--purple); color: #fff; padding: 0.5rem 1rem; border-radius: 8px;
}
.skip:focus { top: 1rem; }

/* ===== Buttons, tags, cards ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: 600 1rem var(--font-body);
  padding: 0.8rem 1.8rem; border-radius: 10px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  color: var(--text);
  transition: box-shadow 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-sm { font-size: 0.9rem; padding: 0.6rem 1.1rem; }
.btn .i { width: 1rem; height: 1rem; }
.btn-primary { background: var(--grad-btn); color: #fff; }
.btn-primary:hover { box-shadow: 0 8px 28px rgba(168, 85, 247, 0.45); transform: translateY(-1px); }
.btn-dark { background: var(--card-2); border-color: var(--line-2); }
.btn-dark:hover { background: #2a2a30; border-color: var(--purple); }

.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags li {
  font-size: 0.8rem; padding: 0.25rem 0.75rem; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--text-2);
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem;
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: rgba(168, 85, 247, 0.5); }

.center { text-align: center; margin-top: 2.5rem; }

/* ===== Header ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s;
}
.header.scrolled { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--header-h); }

.logo {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; text-decoration: none;
  background: var(--grad-btn); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav { display: flex; align-items: center; gap: 2rem; }
.nav > a { color: var(--muted); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.nav > a:hover { color: var(--text); }
.nav > a.active { color: var(--cyan-l); }
.nav-socials { display: flex; align-items: center; gap: 1rem; padding-left: 1.5rem; border-left: 1px solid var(--line); }
.nav-socials a { color: var(--muted); display: flex; transition: color 0.2s; }
.nav-socials a:hover { color: var(--text); }

.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line-2); color: var(--text); cursor: pointer;
}
.menu-btn .i { width: 1.5rem; height: 1.5rem; }
.menu-btn .icon-close { display: none; }
.menu-btn[aria-expanded="true"] .icon-open { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: grid; place-items: center;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-bottom: 4.5rem;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(3px); transform: scale(1.05); }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(9, 9, 11, 0.82), rgba(9, 9, 11, 0.62) 45%, var(--bg));
}
.hero-content { position: relative; z-index: 1; text-align: center; display: grid; justify-items: center; gap: 1rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  background: rgba(24, 24, 27, 0.75); border: 1px solid var(--line-2);
  padding: 0.4rem 0.95rem; border-radius: 999px;
}
.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); }
.hero-name { font-size: clamp(1.05rem, 2.6vw, 1.3rem); font-weight: 500; color: var(--text-2); margin-top: 0.5rem; }
.hero h1 { font-size: clamp(3rem, 10vw, 5.75rem); font-weight: 700; letter-spacing: -0.01em; }
.grad-hero {
  background: linear-gradient(90deg, var(--purple-l), var(--pink), var(--cyan-l));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: clamp(1.15rem, 3vw, 1.5rem); color: var(--text-2); }
.hero-sub span { color: var(--purple-l); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 1rem; }

.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; z-index: 1; transform: translateX(-50%);
  color: var(--muted); display: flex;
}
.scroll-hint .i { width: 2rem; height: 2rem; }

/* Short windows (zoomed in, or a phone held sideways): tighten the hero so the buttons stay on screen */
@media (max-height: 560px) {
  .hero { padding-bottom: 2.5rem; }
  .hero-content { gap: 0.6rem; }
  .hero-name { margin-top: 0; }
  .hero h1 { font-size: clamp(2.4rem, 8vw, 4rem); }
  .hero-actions { margin-top: 0.4rem; }
  .scroll-hint { display: none; }
}

/* ===== Sections ===== */
.section { padding-block: clamp(4rem, 9vw, 6rem); }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: clamp(1.9rem, 4.5vw, 2.6rem); text-align: center; margin-bottom: 0.75rem; }
.section-sub { text-align: center; color: var(--muted); font-size: 1.1rem; margin-bottom: 3rem; }
#specializations .section-title { margin-bottom: 3rem; }
.sub-title { font-size: 1.6rem; margin: 4rem 0 1.5rem; }

/* Specializations */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 1.5rem; }
.spec {
  background: rgba(39, 39, 42, 0.5); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 2rem; display: grid; gap: 0.75rem; align-content: start;
  transition: border-color 0.25s, transform 0.25s;
}
.spec:hover { border-color: rgba(168, 85, 247, 0.5); transform: translateY(-4px); }
.spec:nth-child(2):hover { border-color: rgba(6, 182, 212, 0.5); }
.spec h3 { font-size: 1.3rem; }
.spec p { color: var(--muted); }
.spec-icon {
  width: 3rem; height: 3rem; border-radius: 12px; color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
}
.g-purple-pink { background: linear-gradient(135deg, var(--purple), var(--pink)); }
.g-cyan-blue { background: linear-gradient(135deg, var(--cyan), var(--blue)); }
.g-purple-cyan { background: linear-gradient(135deg, var(--purple), var(--cyan)); }

/* Featured project */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  margin-bottom: 1.5rem; transition: border-color 0.25s;
}
.feature:hover { border-color: rgba(168, 85, 247, 0.5); }
.feature-img { position: relative; overflow: hidden; min-height: 16rem; }
.feature-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.feature:hover .feature-img img { transform: scale(1.06); }
.feature-body { padding: clamp(1.5rem, 4vw, 2.5rem); display: grid; gap: 1rem; align-content: center; }
.feature-body h3 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
.feature-body p { color: var(--muted); }
.badge {
  justify-self: start; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.3rem 0.8rem; border-radius: 999px; color: var(--yellow);
  background: rgba(250, 204, 21, 0.1); border: 1px solid rgba(250, 204, 21, 0.3);
}
.links { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.25rem; }

/* Project cards */
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.project { padding: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.project-img { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.project:hover .project-img img { transform: scale(1.08); }
.project-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(24, 24, 27, 0.6), transparent 60%); }
.project-img.img-top img { object-position: top; }
.project-body { padding: 1.5rem; display: grid; gap: 0.75rem; align-content: start; }
.project-meta { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--cyan-l); }
.project-body h3 { font-size: 1.35rem; }
.project-body p { color: var(--muted); font-size: 0.95rem; }
.text-link { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.text-link .i { width: 1rem; height: 1rem; }
.text-link:hover { color: #67e8f9; text-decoration: underline; }

/* Experience timeline */
.timeline { list-style: none; margin: 0 auto; padding: 0 0 0 1.75rem; max-width: 52rem; border-left: 2px solid var(--line-2); display: grid; gap: 1.25rem; }
.timeline > li {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.5rem; display: grid; gap: 0.35rem;
}
.timeline > li::before {
  content: ""; position: absolute; left: calc(-1.75rem - 8px); top: 1.6rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--purple);
}
.tl-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; }
.tl-top h3 { font-size: 1.25rem; }
.tl-tag { font-size: 0.8rem; font-weight: 600; color: var(--cyan-l); }
.tl-org { color: var(--purple-l); font-weight: 500; }
.timeline p:not(.tl-org) { color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: start; }
.about-text { display: grid; gap: 1rem; color: var(--text-2); }
.about-text h3 { font-size: 1.6rem; color: var(--text); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.facts li {
  display: flex; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem;
}
.facts li > .i { color: var(--cyan-l); width: 1.4rem; height: 1.4rem; }
.facts strong { display: block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts span { color: var(--text); font-weight: 500; }
.facts .achieve { border-color: rgba(250, 204, 21, 0.35); background: rgba(250, 204, 21, 0.06); }
.facts .achieve > .i { color: var(--yellow); }

/* Skills */
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.skill { display: grid; gap: 1rem; align-content: start; }
.skill h4 { font-size: 1.1rem; color: var(--cyan-l); }

/* Currently learning */
.learning { border-color: rgba(168, 85, 247, 0.35); }
.learning h4 { color: var(--purple-l); }
.progress-item { display: grid; gap: 0.4rem; }
.progress-top { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9rem; color: var(--text-2); }
.progress-top span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }
.bar { height: 0.5rem; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad-btn); }
.next-up { font-size: 0.85rem; color: var(--muted); }

/* Education (hidden for now) */
.edu { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 2rem; max-width: 52rem; margin: 0 auto; }
.edu p { color: var(--muted); }
.edu-year { font-weight: 600; color: var(--purple-l); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem; max-width: 64rem; margin: 0 auto; }
.contact-main { display: grid; gap: 1rem; align-content: start; padding: clamp(1.5rem, 4vw, 2.25rem); }
.contact-main h3 { font-size: 1.6rem; }
.contact-main > p { color: var(--muted); }
.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.email {
  font-weight: 600; font-size: clamp(0.95rem, 2.6vw, 1.1rem); word-break: break-all;
  color: var(--cyan-l); text-decoration: none;
  padding: 0.6rem 0.9rem; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line-2);
}
.opps {
  margin-top: 0.75rem; padding: 1.25rem; border-radius: 12px; display: grid; gap: 0.6rem; justify-items: start;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.opps h4 { font-size: 1.1rem; }
.opps p { color: var(--text-2); }
.contact-side { display: grid; gap: 1.25rem; align-content: start; }
.info { display: flex; align-items: center; gap: 1rem; }
.info h4, .contact-side h4 { font-size: 1.1rem; margin-bottom: 0.15rem; }
.info p { color: var(--text-2); }
.socials { list-style: none; margin: 0.9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.socials a {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.9rem; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--line-2); color: var(--text); text-decoration: none; font-weight: 500;
  transition: border-color 0.2s, transform 0.2s;
}
.socials a:hover { border-color: var(--cyan-l); transform: translateY(-2px); }
.socials .i { width: 1.1rem; height: 1.1rem; color: var(--muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding-block: 2rem; color: var(--muted); font-size: 0.9rem; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--cyan-l); }

/* ===== Animations ===== */
@media (prefers-reduced-motion: no-preference) {
  .hero-content > * { animation: rise 0.8s ease-out both; }
  .hero-content > *:nth-child(2) { animation-delay: 0.1s; }
  .hero-content > *:nth-child(3) { animation-delay: 0.2s; }
  .hero-content > *:nth-child(4) { animation-delay: 0.3s; }
  .hero-content > *:nth-child(5) { animation-delay: 0.4s; }
  .scroll-hint { animation: bounce 2s ease-in-out infinite; }

  /* Scroll reveal: only hides things once JS is running to show them again */
  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.25s; }
  .js .reveal.visible { opacity: 1; transform: none; }
  .js .spec.reveal.visible:hover { transform: translateY(-4px); }
}
@keyframes rise { from { opacity: 0.01; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes bounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 10px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .card, .spec, .feature-img img, .project-img img { transition: none; }
}

/* ===== Tablet and phone ===== */
@media (max-width: 900px) {
  .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: minmax(0, 1fr); }
  .feature-img { min-height: 0; aspect-ratio: 16 / 9; }
  .about-grid,
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .menu-btn { display: flex; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(9, 9, 11, 0.97); border-bottom: 1px solid var(--line);
    padding: 0.5rem max(16px, env(safe-area-inset-left, 0px)) 1.25rem;
    display: none;
  }
  .nav.open { display: flex; }
  .nav > a { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
  .nav-socials { border-left: 0; padding: 1rem 0 0; gap: 1.5rem; }
}

@media (max-width: 820px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .skill-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .socials { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { width: 100%; }
}
