/* ============================================================
   REFINED VAPORWAVE — retro-futurist, but credible & clear.
   Deep indigo base, disciplined neon accents, clean type.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f9f8f5;
  --bg-2:      #f0ede7;
  --surface:   rgba(255, 255, 255, 0.68);
  --surface-2: rgba(240, 237, 231, 0.9);
  --border:    rgba(44, 62, 80, 0.12);
  --border-2:  rgba(44, 62, 80, 0.22);
  --text:      #1a1a2e;
  --muted:     #4a4a6a;
  --faint:     #5f5f7d;

  --pink:   #c0392b;
  --magenta:#e74c3c;
  --cyan:   #1a5276;
  --gold:   #d4ac0d;
  --gold-text: #8a6d1d;

  --grad: linear-gradient(120deg, var(--cyan), var(--pink));
  --maxw: 1140px;
  --pad: clamp(20px, 5vw, 64px);

  --font-display: "Inter", system-ui, sans-serif;
  --font-body: "Lora", Georgia, serif;
  --font-mono: "Inter", system-ui, sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

/* ---------------- Particle network canvas ---------------- */
#particleCanvas {
  position: absolute; top: 0; left: 0; width: 100%; z-index: 0;
  pointer-events: none;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(26, 82, 118, 0.07), transparent 60%),
    radial-gradient(900px 600px at 90% 10%, rgba(192, 57, 43, 0.05), transparent 55%),
    var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--cyan); color: #fff; }

html { scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
section { padding: clamp(64px, 11vh, 130px) 0; position: relative; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 14px;
}
.eyebrow::before { content: ""; display: inline-block; width: 24px; height: 2px; margin: 0 10px 0 0; vertical-align: middle; background: var(--cyan); }

.grad-text { color: var(--cyan); }

.section-head { margin-bottom: 28px; max-width: 640px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.1; letter-spacing: -0.5px; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 1.02rem; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 20px; border-radius: 8px; cursor: pointer; border: 1px solid var(--cyan);
  background: transparent; color: var(--cyan);
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--cyan); color: #fff; }
.btn--primary {
  color: #fff; font-weight: 600;
  background: var(--cyan); box-shadow: none;
}
.btn--primary:hover { background: #124260; box-shadow: none; }

/* ---------------- Navbar ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(249, 248, 245, 0.95);
  border-bottom: 1px solid var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav__brand { font-family: var(--font-display); font-weight: 600; font-size: 0.875rem; letter-spacing: 0.05em; text-transform: uppercase; }
.nav__brand b { color: var(--pink); }
.nav__links { display: flex; gap: 30px; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.nav__links a { color: var(--muted); transition: color 0.3s; position: relative; padding: 4px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  height: 2px; width: 100%; background: var(--cyan);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.nav__links a:hover, .nav__links a.active { color: var(--cyan); }
.nav__links a:hover::after, .nav__links a.active::after { transform: scaleX(1); }
.nav__cta { padding: 9px 18px; }

/* ---------------- Hero ---------------- */
.hero { padding-top: clamp(28px, 5vh, 56px); padding-bottom: clamp(28px, 5vh, 56px); overflow: hidden; }
#projects { padding-top: clamp(16px, 3vh, 40px); }
.hero__sun {
  position: absolute; right: 4%; top: 60px; width: min(440px, 42vw); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(26, 82, 118, 0.08), transparent 68%);
  opacity: 1; filter: none; z-index: 0; pointer-events: none;
}
.hero__glow { position: absolute; right: 6%; top: 30px; width: min(480px, 46vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(192, 57, 43, 0.05), transparent 65%); filter: blur(50px); z-index: 0; }
.hero::after {
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -2px; height: 42%;
  background-image:
    linear-gradient(rgba(26, 82, 118, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 57, 43, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: none;
  -webkit-mask: linear-gradient(transparent, #000 75%); mask: linear-gradient(transparent, #000 75%);
  opacity: 1; z-index: 0; pointer-events: none;
}
.hero__inner { position: relative; z-index: 2; max-width: 760px; }
.hero h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.5rem, 6vw, 4.25rem); line-height: 1.02; letter-spacing: -1.5px; margin-bottom: 18px; }
.hero__tag { font-size: clamp(1.05rem, 2vw, 1.3rem); line-height: 1.5; color: var(--muted); max-width: 60ch; }
.hero__tag b { color: var(--text); font-weight: 600; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }
.hero__socials { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.hero__socials a { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; overflow: hidden; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); background: rgba(255, 255, 255, 0.34); transition: color .2s ease, border-color .2s ease, transform .2s ease, background .2s ease; }
.hero__socials svg { display: block; flex: 0 0 19px; width: 19px !important; height: 19px !important; max-width: 19px; max-height: 19px; overflow: hidden; fill: currentColor; }
.hero__socials a:hover, .hero__socials a:focus-visible { color: var(--cyan); border-color: var(--cyan); background: rgba(26, 82, 118, 0.08); transform: translateY(-2px); }

/* Stats */
.stats { display: flex; flex-wrap: wrap; gap: 0; margin-top: 18px; padding: 8px 0; position: relative; z-index: 2; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat { position: relative; flex: 1 1 0; min-width: 130px; padding: 4px 22px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; }
.stat__label { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-top: 2px; }

/* ---------------- Skills ---------------- */
.skills-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.skill-cat {
  position: relative;
  display: flex; align-items: baseline; gap: 18px;
  padding: 0; border: none; background: none; box-shadow: none; overflow: visible;
}
.skill-cat h3 { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); flex: 0 0 150px; margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 0.8rem; padding: 5px 11px; border-radius: 3px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); }
.chip:hover { border-color: var(--cyan); color: var(--cyan); }

/* ---------------- Projects ---------------- */
.proj-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: -16px 0 20px; }
.filter-pill {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 8px 16px; border-radius: 3px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer;
  transition: color 0.3s, border-color 0.3s, transform 0.3s, background 0.3s;
}
.filter-pill:hover { color: var(--cyan); border-color: var(--cyan); transform: translateY(-2px); }
.filter-pill.active { background: var(--cyan); color: #fff; border-color: var(--cyan); font-weight: 600; }

.projects { display: grid; grid-template-columns: 1fr; gap: 18px; }
.project {
  position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 26px 28px;
  background: var(--surface); overflow: hidden; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--grad); opacity: 0; transition: opacity 0.3s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px; pointer-events: none;
}
.projects .project:hover, .projects .project.open { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1); }
.project:hover::before, .project.open::before { opacity: 1; }
.project__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.project__tag { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 10px; border-radius: 3px; background: rgba(26, 82, 118, 0.08); color: var(--cyan); border: 1px solid rgba(26, 82, 118, 0.18); }
.project__year { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--faint); padding: 4px 8px; border: 1px solid var(--border); border-radius: 3px; }
.project__metric { font-family: var(--font-mono); font-size: 0.78rem; color: var(--gold-text); white-space: nowrap; margin-left: auto; }
.project__title { margin-bottom: 2px; }
.project__toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%;
  background: none; border: none; padding: 0; cursor: pointer; color: inherit; text-align: left;
  font: inherit;
}
.project__toggle:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 4px; }
.project h3 { font-family: var(--font-display); font-size: clamp(1.35rem, 2.4vw, 1.65rem); letter-spacing: -0.3px; }
.project__chev { flex: 0 0 16px; width: 16px; height: 16px; color: var(--faint); transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.2s ease; }
.project:hover .project__chev { color: var(--cyan); }
.project.open .project__chev { transform: rotate(180deg); color: var(--cyan); }
.project__sub { color: var(--cyan); font-size: 0.88rem; font-family: var(--font-mono); margin: 2px 0 12px; }
.project__desc { color: var(--muted); font-size: 0.95rem; max-width: 75ch; }
.project__feats { list-style: none; margin: 16px 0 18px; display: grid; gap: 10px 26px; }
.project__feats li { position: relative; padding-left: 20px; font-size: 0.9rem; color: var(--muted); }
.project__feats li::before { content: "\25B8"; position: absolute; left: 0; color: var(--pink); }
.project__tech { display: flex; flex-wrap: wrap; gap: 7px; }
.project__tech span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }

.project__detail {
  display: grid; grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0s 0.45s;
}
.project.open .project__detail { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.project__detail-clip { overflow: hidden; min-height: 0; }
.project__detail-grid {
  display: grid; grid-template-columns: 1fr; gap: 26px;
  margin-top: 20px; padding-top: 22px; border-top: 1px solid var(--border);
}
.project__img { width: 100%; max-height: 240px; object-fit: cover; display: block; border-radius: 10px; margin-bottom: 18px; border: 1px solid var(--border); background: var(--bg-2); }
.project__img--ph { display: flex; align-items: center; justify-content: center; min-height: 160px; background: var(--cyan); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; text-align: center; padding: 20px; }
.project__detail h4 { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }
.project__detail-desc { color: var(--muted); font-size: 0.97rem; max-width: 70ch; }
.project__meta { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 16px; }
.project__meta div { font-size: 0.92rem; }
.project__meta dt { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.project__meta dd { color: var(--text); margin-top: 2px; }
.project__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.project__actions .btn { padding: 10px 16px; }
.project__block { margin-bottom: 18px; }
.project__block:last-child { margin-bottom: 0; }
.project__block ul { list-style: none; display: grid; gap: 8px; }
.project__block li { position: relative; padding-left: 20px; color: var(--muted); font-size: 0.95rem; }
.project__block li::before { content: "\25B8"; position: absolute; left: 0; color: var(--pink); }

.view-all-wrap { text-align: center; margin-top: 44px; }
.projects-empty { color: var(--muted); font-family: var(--font-mono); font-size: 0.9rem; padding: 30px 0; }
.projects-noscript {
  grid-column: 1 / -1;
  border: 1px dashed var(--border-2); border-radius: 8px; padding: 20px;
  background: var(--surface); color: var(--muted); font-size: 0.95rem;
}
.projects-noscript ul { list-style: none; margin-top: 12px; display: grid; gap: 10px; }
.projects-noscript a { color: var(--cyan); border-bottom: 1px solid transparent; }
.projects-noscript a:hover { border-color: var(--cyan); }

/* ---------------- Experience / Awards timeline ---------------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--pink), var(--magenta), var(--cyan)); opacity: 0.5; }
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 5px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--pink);
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.10);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.tl-item:hover::before {
  background: var(--pink); border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(192, 57, 43, 0.15), 0 0 12px rgba(192, 57, 43, 0.12);
}
.tl-item__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.tl-item__role { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.tl-item__co { color: var(--cyan); font-size: 0.95rem; }
.tl-item__date { font-family: var(--font-mono); font-size: 0.76rem; color: var(--faint); margin-left: auto; }
.tl-item__desc { color: var(--muted); margin-top: 8px; font-size: 0.94rem; }
.tl-item__place {
  display: inline-block; margin-top: 9px; font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-text);
  border: 1px solid rgba(255,210,125,0.32); background: rgba(255,210,125,0.08);
  padding: 3px 10px; border-radius: 999px;
}
.tl-item__place--gold {
  color: #190a1a; font-weight: 700; border-color: transparent;
  background: linear-gradient(120deg, var(--gold), #ffb86b);
}
.timeline--compact .tl-item:not(.tl-item--featured) { padding-bottom: 20px; }
.timeline--compact .tl-item:not(.tl-item--featured) .tl-item__desc { font-size: 0.9rem; }

/* ---------------- Contact ---------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 34px; align-items: start; }
.contact-info h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; letter-spacing: -0.5px; }
.contact-info p { color: var(--muted); margin: 14px 0 24px; }
.contact-info a.mail { font-family: var(--font-mono); color: var(--cyan); font-size: 1.05rem; }
.socials { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.socials a {
  font-family: var(--font-mono); font-size: 0.84rem; padding: 9px 14px;
  border: 1px solid var(--border); border-radius: 9px; color: var(--muted);
  position: relative; overflow: hidden; transition: all 0.25s;
}
.socials a::before {
  content: ""; position: absolute; inset: 0; background: var(--grad);
  opacity: 0; transition: opacity 0.25s; z-index: -1; border-radius: inherit;
}
.socials a:hover { color: #fff; border-color: transparent; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(26, 82, 118, 0.2); }
.socials a:hover::before { opacity: 1; }

.form { position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; padding: 26px; background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); transition: box-shadow 0.3s ease; }
.form::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--grad); opacity: 0; transition: opacity 0.3s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1px; pointer-events: none;
}
.form:hover { transform: none; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); }
.form:hover::before { opacity: 1; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; background: #fff; border: 1px solid var(--border-2); border-radius: 3px;
  padding: 12px 14px; color: var(--text); font-family: var(--font-body); font-size: 0.95rem; transition: border-color 0.3s, box-shadow 0.3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.12); }
.field textarea { resize: vertical; min-height: 120px; }
.form__btn { width: 100%; justify-content: center; }
.form__ok { display: none; margin-top: 14px; font-family: var(--font-mono); font-size: 0.88rem; color: var(--cyan); }
.form__ok.show { display: block; }
.form__ok.error { color: var(--pink); }

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--faint); }

/* ---------------- Typewriter effect ---------------- */
.typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--cyan);
}

.typewriter--blink {
  animation: blink 0.75s step-end infinite;
}

@keyframes blink {
  from, to { border-color: transparent; }
  50% { border-color: var(--cyan); }
}

/* ---------------- Scroll reveal ---------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------- Responsive ---------------- */
@media (min-width: 900px) {
  .project__feats { grid-template-columns: repeat(3, 1fr); }
  .project__detail-grid { grid-template-columns: 1.25fr 1fr; }
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
  .stat { min-width: 120px; }
}
@media (max-width: 600px) {
  .nav__links { display: none; }
  .skill-cat { flex-direction: column; align-items: flex-start; gap: 6px; }
  .skill-cat h3 { flex: none; }
  .stat { flex: 1 1 45%; }
  .stat:nth-child(3) { border-left: none; }
  .tl-item__date { margin-left: 0; width: 100%; }
  .project { padding: 22px 20px; }
  .project__metric { margin-left: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .project__detail { transition: none; }
  .project__chev { transition: none; }
  html { scroll-behavior: auto; }
}
