/* ============================================================
   Roy Teo — Liquid Glass (Apple-inspired) design system
   ============================================================ */
:root {
  --bg: #050508;
  --text: #f5f5f7;
  --text-dim: #a0a0a8;
  --accent: #64d2ff;
  --grad: linear-gradient(92deg, #5ee7d4 0%, #64a8ff 50%, #c47dff 100%);
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-bg-strong: rgba(255, 255, 255, 0.11);
  --glass-line: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.18);
  --radius: 26px;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, sans-serif;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(100, 168, 255, 0.35); }

a { color: inherit; text-decoration: none; }

[hidden] { display: none !important; }

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

/* ===== Glass recipe ===== */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 8px 32px rgba(0, 0, 0, 0.35);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(22, 24, 32, 0.94); }
}

/* ===== Backdrop: drifting orbs + grain ===== */
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg);
  overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  will-change: transform;
}
.orb-1 {
  width: 48vw; height: 48vw; min-width: 380px; min-height: 380px;
  background: #0a84ff;
  top: -14%; left: -10%;
  animation: drift-1 90s ease-in-out infinite alternate;
}
.orb-2 {
  width: 40vw; height: 40vw; min-width: 320px; min-height: 320px;
  background: #2ac9b7;
  bottom: 4%; right: -12%;
  animation: drift-2 110s ease-in-out infinite alternate;
}
.orb-3 {
  width: 34vw; height: 34vw; min-width: 280px; min-height: 280px;
  background: #7d4cdb;
  top: 42%; left: 52%;
  animation: drift-3 130s ease-in-out infinite alternate;
}
@keyframes drift-1 { to { transform: translate(22vw, 18vh) scale(1.15); } }
@keyframes drift-2 { to { transform: translate(-18vw, -16vh) scale(0.9); } }
@keyframes drift-3 { to { transform: translate(-24vw, 12vh) scale(1.2); } }
.backdrop::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
}

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 200;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: var(--grad);
  border-radius: 0 2px 2px 0;
}

/* ===== Nav — floating glass pill ===== */
.nav {
  position: fixed;
  top: 16px; left: 0; right: 0;
  margin-inline: auto;
  width: min(900px, calc(100% - 32px));
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 10px 14px 10px 24px;
  border-radius: 999px;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.nav.is-scrolled {
  background: var(--glass-bg-strong);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 12px 40px rgba(0, 0, 0, 0.5);
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo {
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
  margin-right: 4px;
}
.nav-pill {
  font-size: 12px; font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  white-space: nowrap;
  transition: color 0.25s, background 0.25s, transform 0.25s var(--ease);
}
.nav-pill:hover {
  color: var(--text);
  background: var(--glass-bg-strong);
  transform: scale(1.05);
}
.nav-links {
  display: flex; align-items: center; gap: 26px;
  font-size: 14px; font-weight: 500;
}
.nav-links a { color: var(--text-dim); transition: color 0.25s; }
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta {
  color: var(--text);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  border-radius: 999px;
  padding: 8px 18px;
  white-space: nowrap;
  transition: background 0.25s, transform 0.25s var(--ease);
}
.nav-links .nav-cta:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.04);
}
.nav-burger {
  display: none;
  position: relative; z-index: 95;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.nav-burger span {
  width: 20px; height: 2px; border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
.nav-burger.is-open span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-burger.is-open span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ===== Mobile menu — glass sidebar ===== */
.mobile-menu {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5, 5, 8, 0.55);
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.mobile-menu-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(300px, 82vw);
  display: flex; flex-direction: column;
  gap: 6px;
  padding: 96px 28px 32px;
  background: rgba(16, 18, 26, 0.88);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  backdrop-filter: blur(30px) saturate(1.5);
  border-left: 1px solid var(--glass-line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 0.35s var(--ease);
}
.mobile-menu.is-open { opacity: 1; pointer-events: auto; }
.mobile-menu.is-open .mobile-menu-panel { transform: translateX(0); }
.mobile-menu-panel a {
  color: var(--text-dim);
  font-size: 19px; font-weight: 600;
  padding: 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.25s;
}
.mobile-menu-panel a:hover { color: var(--text); }
.mobile-menu-actions {
  margin-top: auto;
  display: flex; gap: 10px;
}
.mobile-menu-actions .nav-pill {
  flex: 1; text-align: center;
  font-size: 13px; padding: 11px 12px;
}
body.menu-open { overflow: hidden; }

/* ===== Buttons — glass pills ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
}
.btn:hover { transform: scale(1.04); }
.btn:active { transform: scale(0.98); }
.btn-lg { padding: 18px 34px; font-size: 16px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, rgba(10, 132, 255, 0.85), rgba(100, 210, 255, 0.7));
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 8px 28px rgba(10, 132, 255, 0.35);
}
.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 36px rgba(10, 132, 255, 0.5);
}
.btn-ghost { color: var(--text); }
.btn-ghost:hover { background: var(--glass-bg-strong); }
.btn-arrow { font-size: 14px; }

/* ===== Hero ===== */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  position: relative;
  padding: 140px 24px 80px;
}
.hero-content { max-width: 1080px; margin: 0 auto; width: 100%; }
.hero-eyebrow {
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(42px, 7.5vw, 92px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin-bottom: 32px;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.hero-title .word { display: inline-block; }
.reveal-line { overflow: hidden; }
.reveal-line > span { display: inline-block; }
.hero-sub {
  max-width: 560px;
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 44px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-scroll-hint {
  position: absolute; bottom: 32px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--text-dim);
}
.hint-line {
  width: 1px; height: 44px;
  background: linear-gradient(to bottom, transparent, var(--text-dim));
}

/* ===== Sections ===== */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 110px 24px;
}
.section-head {
  display: flex; align-items: baseline; gap: 20px;
  margin-bottom: 56px;
}
.section-index {
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.section-title {
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow: hidden;
}
.section-title .char { display: inline-block; }

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
}
.about-lead {
  font-size: 24px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.4;
  margin-bottom: 24px;
}
.about-text p:not(.about-lead) {
  color: var(--text-dim);
  margin-bottom: 18px;
}
.about-text strong { color: var(--text); font-weight: 600; }
.about-stats { display: flex; flex-direction: column; gap: 18px; }
.stat { padding: 26px 28px; }
.stat-num, .stat-plus {
  font-size: 40px; font-weight: 700; letter-spacing: -0.03em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  display: block;
  font-size: 14px; color: var(--text-dim);
  margin-top: 4px;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 36px;
  display: flex; flex-direction: column; gap: 32px;
}
.timeline-line {
  position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(100, 168, 255, 0.5);
  transform: scaleY(0);
  transform-origin: top;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 28px;
}
.timeline-dot {
  position: absolute; left: -36px; top: 8px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12), 0 0 16px rgba(100, 168, 255, 0.8);
}
.timeline-date {
  display: block;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.timeline-company {
  display: block;
  font-size: 15px; color: var(--text-dim);
  margin-top: 6px;
}
.timeline-body { padding: 30px 32px; }
.timeline-body h3 {
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.timeline-body p { color: var(--text-dim); font-size: 15px; }
.timeline-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none;
  margin-top: 18px;
}
.timeline-tags li {
  font-size: 12px; font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  color: var(--text-dim);
}

/* ===== Marquee ===== */
.marquee {
  overflow: hidden;
  margin-bottom: 56px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; gap: 28px;
  width: max-content;
  font-size: 15px; font-weight: 500;
  color: var(--text-dim);
  opacity: 0.7;
  white-space: nowrap;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.skill-card {
  position: relative;
  overflow: hidden;
  padding: 34px 32px;
  transition: transform 0.4s var(--ease), background 0.4s;
}
.skill-card:hover {
  transform: translateY(-4px);
  background: var(--glass-bg-strong);
}
.skill-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.09), transparent 42%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.skill-card:hover::before { opacity: 1; }
.skill-icon {
  font-size: 22px;
  margin-bottom: 18px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.skill-card h3 {
  font-size: 19px; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.skill-card p { color: var(--text-dim); font-size: 15px; }

/* ===== Resume card ===== */
.resume-card {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 28px;
  padding: 44px 48px;
}
.resume-card h3 {
  font-size: 24px; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.resume-card p { color: var(--text-dim); }
.resume-card-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ===== Contact ===== */
.contact { text-align: center; }
.contact-eyebrow {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.contact-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 700; letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 44px;
}
.contact-actions {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: center;
}

/* ===== Footer ===== */
.footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--text-dim);
  border-top: 1px solid var(--glass-line);
}
.footer a:hover { color: var(--text); }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .timeline-item { grid-template-columns: 1fr; gap: 12px; }
  .skills-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .resume-card { padding: 34px 28px; flex-direction: column; align-items: flex-start; gap: 22px; }
  .section { padding: 72px 20px; }
  .hero { padding: 120px 20px 64px; }
  .hero-sub { font-size: 16px; }
  .btn-lg { padding: 15px 24px; font-size: 15px; }
  .contact-actions { flex-direction: column; align-items: stretch; }
  .contact-actions .btn { text-align: center; overflow-wrap: anywhere; }
  .timeline-body { padding: 24px 22px; }
}
@media (max-width: 420px) {
  .nav { padding: 8px 10px 8px 16px; gap: 10px; }
  .nav-logo { font-size: 18px; }
  .nav-pill { font-size: 11px; padding: 5px 10px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb { animation: none; }
  .btn, .nav-links .nav-cta, .skill-card { transition: none; }
}
