/* ============================================================
   Ling Sie Yek — portfolio
   deep-space aurora theme · glassmorphism · Space Grotesk/Inter
   ============================================================ */

:root {
  --bg: #07080d;
  --surface: rgba(255, 255, 255, .035);
  --surface-strong: rgba(255, 255, 255, .06);
  --line: rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .06);
  --text: #f2f3f8;
  --text-dim: #9ba1b7;
  --text-faint: #6b7189;
  --violet: #a78bfa;
  --cyan: #67e8f9;
  --pink: #f0abfc;
  --amber: #fcd34d;
  --green: #4ade80;
  --grad: linear-gradient(92deg, #a78bfa 0%, #818cf8 45%, #67e8f9 100%);
  --radius: 20px;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, monospace;
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 450;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(167, 139, 250, .35); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #23263a; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #32364f; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 28px; }

a { color: var(--text); text-decoration: none; }

/* ============ BACKGROUND ============ */
.bg-aurora {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .22;
}
.blob-1 {
  width: 620px; height: 620px; top: -220px; right: -140px;
  background: radial-gradient(circle, #6d28d9, transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate;
}
.blob-2 {
  width: 520px; height: 520px; top: 30%; left: -220px;
  background: radial-gradient(circle, #0e7490, transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate;
}
.blob-3 {
  width: 480px; height: 480px; bottom: -180px; right: 12%;
  background: radial-gradient(circle, #7e22ce, transparent 65%);
  animation: drift1 38s ease-in-out infinite alternate-reverse;
}
@keyframes drift1 { to { transform: translate(-70px, 60px) scale(1.12); } }
@keyframes drift2 { to { transform: translate(80px, -50px) scale(1.08); } }

.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ GLASS + SPOTLIGHT ============ */
.glass {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}
.glass::after {
  content: '';
  position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
              rgba(167, 139, 250, .13), transparent 65%);
  opacity: 0; transition: opacity .35s;
  pointer-events: none;
}
.glass:hover::after { opacity: 1; }

/* ============ NAV ============ */
.nav-wrap {
  position: fixed; top: 18px; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: center;
  padding: 0 20px;
}
.nav {
  display: flex; align-items: center; gap: 8px;
  background: rgba(13, 15, 24, .72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 8px 10px 8px 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .35);
}
.nav-logo {
  font-family: var(--font-display); font-weight: 700;
  letter-spacing: .06em; font-size: 1rem; margin-right: 16px;
}
.nav-logo em { font-style: normal; color: var(--violet); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  font-size: .88rem; font-weight: 500; color: var(--text-dim);
  padding: 8px 14px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-strong); }
.nav-links .nav-cta {
  color: #0a0b12; background: var(--text); font-weight: 600;
  margin-left: 6px;
}
.nav-links .nav-cta:hover { background: #fff; color: #0a0b12; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.nav-toggle span {
  display: block; width: 20px; height: 2px; margin: 4px 0;
  background: var(--text); border-radius: 2px;
}

/* ============ HERO ============ */
.hero { padding: 168px 0 0; }
.hero-inner {
  display: grid; grid-template-columns: 1.35fr 1fr;
  gap: 56px; align-items: center;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: .8rem; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; margin-bottom: 28px;
  background: var(--surface);
}
.hero-kicker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 10px var(--green);
  animation: pulse 2.2s infinite;
}
@keyframes pulse { 50% { opacity: .35; } }

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7.5vw, 4.9rem);
  font-weight: 700; letter-spacing: -.035em; line-height: 1.02;
}
.hero-role {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 500; letter-spacing: -.015em;
  color: var(--text-dim); margin-top: 14px;
}
.rotator-mask { display: inline-block; }
.rotator {
  display: inline-block;
  transition: opacity .35s, transform .35s;
}
.rotator.fade { opacity: 0; transform: translateY(14px); }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-desc {
  color: var(--text-dim); margin-top: 22px; max-width: 520px;
  font-size: 1.02rem;
}
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-social { display: flex; gap: 6px; margin-top: 30px; }
.hero-social a {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  color: var(--text-dim); border: 1px solid transparent;
  transition: .2s;
}
.hero-social a:hover {
  color: var(--text); border-color: var(--line);
  background: var(--surface-strong); transform: translateY(-2px);
}

/* --- hero visual --- */
.hero-visual { display: flex; justify-content: center; }
.avatar-scene { position: relative; width: 300px; height: 300px; }
.avatar-glow {
  position: absolute; inset: -12%;
  background: conic-gradient(from 140deg, #a78bfa, #67e8f9, #f0abfc, #a78bfa);
  border-radius: 50%; filter: blur(46px); opacity: .4;
  animation: spinGlow 14s linear infinite;
}
@keyframes spinGlow { to { transform: rotate(360deg); } }
.avatar-frame {
  position: absolute; inset: 0;
  border-radius: 38% 62% 55% 45% / 45% 48% 52% 55%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  animation: morph 12s ease-in-out infinite alternate;
}
@keyframes morph {
  to { border-radius: 55% 45% 40% 60% / 52% 60% 40% 48%; }
}
.avatar-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }

.float-chip {
  position: absolute;
  font-family: var(--mono); font-size: .74rem; white-space: nowrap;
  color: var(--text);
  background: rgba(16, 18, 30, .82);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .4);
  animation: floaty 5.5s ease-in-out infinite;
}
.chip-a { top: -6px; left: -34px; animation-delay: 0s; }
.chip-b { top: 24%; right: -52px; animation-delay: -1.6s; }
.chip-c { bottom: 8%; left: -46px; animation-delay: -3.1s; }
.chip-d {
  bottom: -14px; right: 6%; animation-delay: -4.4s;
  color: #0a0b12; background: var(--grad); border: 0; font-weight: 500;
}
@keyframes floaty { 50% { transform: translateY(-9px); } }

/* --- hero stats --- */
.hero-stats {
  margin-top: 84px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.stat {
  padding: 26px 12px; text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.stat + .stat { border-left: 1px solid var(--line-soft); }
.stat strong {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.02em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat span { font-size: .8rem; color: var(--text-faint); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: 999px;
  font-weight: 600; font-size: .93rem;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn-arrow { transition: transform .2s; }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-primary {
  background: var(--text); color: #0a0b12;
}
.btn-primary:hover {
  background: #fff; transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(167, 139, 250, .28);
}
.btn-outline {
  border: 1px solid var(--line); color: var(--text);
  background: var(--surface);
}
.btn-outline:hover {
  border-color: rgba(167, 139, 250, .6); transform: translateY(-2px);
  background: var(--surface-strong);
}

/* ============ SECTIONS ============ */
.section { padding: 108px 0 0; }
.section-head { margin-bottom: 48px; }
.section-eyebrow {
  display: inline-block;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--violet);
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 2.7rem);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.12;
}
.sync-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: .72rem; color: var(--text-faint);
  border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 4px 12px; margin-left: 14px; vertical-align: 3px;
}
.sync-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: pulse 2.2s infinite;
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px;
  align-items: start;
}
.about-lede {
  font-size: clamp(1.05rem, 1.8vw, 1.25rem); line-height: 1.75;
  color: var(--text-dim);
}
.about-lede strong, .about-side strong { color: var(--text); font-weight: 600; }
.about-side {
  color: var(--text-faint); font-size: .95rem;
  border-left: 2px solid rgba(167, 139, 250, .4);
  padding-left: 22px; margin-top: 8px;
}

/* ============ SKILLS ============ */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-card { padding: 30px 28px; transition: transform .25s, border-color .25s; }
.skill-card:hover { transform: translateY(-4px); border-color: var(--line); }
.skill-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 18px;
}
.icon-ai    { color: var(--pink);   background: rgba(240, 171, 252, .1); }
.icon-lang  { color: var(--cyan);   background: rgba(103, 232, 249, .1); }
.icon-tools { color: var(--violet); background: rgba(167, 139, 250, .1); }
.skill-card h3 {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 600;
  margin-bottom: 16px; letter-spacing: -.01em;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span {
  font-size: .78rem; font-weight: 500; color: var(--text-dim);
  background: var(--surface-strong);
  border: 1px solid var(--line-soft);
  padding: 5px 12px; border-radius: 999px;
  transition: color .2s, border-color .2s;
}
.chips span:hover { color: var(--text); border-color: var(--line); }

/* ============ PROJECTS ============ */
.filter-bar {
  display: inline-flex; gap: 4px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 5px;
  margin-bottom: 36px;
}
.filter-btn {
  font-family: var(--font-body); font-size: .86rem; font-weight: 500;
  color: var(--text-dim); background: none; border: 0; cursor: pointer;
  padding: 9px 18px; border-radius: 999px; transition: .2s;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { color: #0a0b12; background: var(--text); font-weight: 600; }

.projects-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.project-card {
  padding: 28px;
  display: flex; flex-direction: column;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(167, 139, 250, .35);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .35);
}
.project-card.hidden { display: none; }
.project-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(167, 139, 250, .09), rgba(103, 232, 249, .05) 60%, var(--surface));
  border-color: rgba(167, 139, 250, .28);
}
.project-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px; gap: 12px;
}
.cat-pill {
  font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .04em;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid;
}
.pill-ai      { color: var(--pink);   border-color: rgba(240, 171, 252, .3); background: rgba(240, 171, 252, .07); }
.pill-mobile  { color: var(--cyan);   border-color: rgba(103, 232, 249, .3); background: rgba(103, 232, 249, .07); }
.pill-web     { color: var(--amber);  border-color: rgba(252, 211, 77, .3);  background: rgba(252, 211, 77, .07); }
.pill-desktop { color: var(--violet); border-color: rgba(167, 139, 250, .35); background: rgba(167, 139, 250, .07); }
.project-metric {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  letter-spacing: -.02em; line-height: 1; text-align: right;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.project-metric em {
  display: block; font-style: normal; font-family: var(--mono);
  font-size: .66rem; color: var(--text-faint);
  -webkit-text-fill-color: var(--text-faint); margin-top: 5px;
}
.project-card h3 {
  font-family: var(--font-display); font-size: 1.14rem; font-weight: 600;
  letter-spacing: -.015em; line-height: 1.35; margin-bottom: 10px;
}
.project-card.featured h3 { font-size: 1.45rem; max-width: 26ch; }
.project-card > p { color: var(--text-dim); font-size: .91rem; flex: 1; }
.tech { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 18px 0 16px; }
.tech span {
  font-family: var(--mono); font-size: .74rem; color: var(--text-faint);
}
.project-links { display: flex; gap: 20px; }
.project-links a {
  font-size: .88rem; font-weight: 600; color: var(--text);
  transition: color .2s;
}
.project-links a:hover { color: var(--violet); }
.project-links .link-demo { color: var(--cyan); }
.project-links .link-demo:hover { color: #a5f3fc; }
.projects-more { margin-top: 36px; }
.projects-more a {
  font-family: var(--mono); font-size: .88rem; color: var(--text-dim);
  transition: color .2s;
}
.projects-more a:hover { color: var(--text); }
.projects-more a span { color: var(--violet); }

/* ============ EDUCATION ============ */
.edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.edu-card { padding: 32px; transition: transform .25s, border-color .25s; }
.edu-card:hover { transform: translateY(-4px); border-color: var(--line); }
.edu-date {
  font-family: var(--mono); font-size: .78rem; color: var(--cyan);
  letter-spacing: .06em;
}
.edu-card h3 {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 600;
  letter-spacing: -.015em; margin: 12px 0 4px;
}
.edu-school { color: var(--text-dim); font-size: .93rem; }
.edu-note {
  color: var(--text-faint); font-size: .87rem; margin-top: 14px;
  padding-top: 14px; border-top: 1px solid var(--line-soft);
}

/* ============ CONTACT ============ */
#contact { padding-bottom: 40px; }
.contact-panel {
  text-align: center; padding: 84px 40px;
  border-radius: 28px;
  background:
    radial-gradient(500px 240px at 50% 0%, rgba(167, 139, 250, .12), transparent 70%),
    var(--surface);
}
.contact-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  margin-bottom: 18px;
}
.contact-lead { color: var(--text-dim); max-width: 460px; margin: 0 auto 36px; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ============ FOOTER ============ */
.footer { padding: 36px 0; margin-top: 40px; border-top: 1px solid var(--line-soft); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
  color: var(--text-faint); font-size: .84rem;
}
.footer-mono { font-family: var(--mono); font-size: .76rem; }

/* ============ REVEAL ============ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ============ MOTION PREFERENCES ============ */
@media (prefers-reduced-motion: reduce) {
  .blob, .avatar-glow, .avatar-frame, .float-chip, .hero-kicker .dot { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .project-card.featured { grid-column: span 2; }
  .skills-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .hero { padding-top: 132px; }
  .hero-inner { grid-template-columns: 1fr; gap: 64px; text-align: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-actions, .hero-social { justify-content: center; }
  .hero-visual { order: -1; }
  .avatar-scene { width: 230px; height: 230px; }
  .chip-a { left: -50px; } .chip-b { right: -58px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line-soft); }

  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card.featured { grid-column: auto; }
  .edu-grid { grid-template-columns: 1fr; }
  .footer-inner { justify-content: center; }

  .nav { width: 100%; justify-content: space-between; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(13, 15, 24, .96);
    backdrop-filter: blur(18px);
    border: 1px solid var(--line-soft); border-radius: 20px;
    flex-direction: column; padding: 18px; gap: 6px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; text-align: center; padding: 12px; }
  .nav-links .nav-cta { margin-left: 0; }
}
