/* ===== AI Light Theme — Dr. Lau Cher Han ===== */
/* Light + Glassmorphism + Vibrant gradient accents */

/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #f8faff;
  --color-bg-alt: #f0f4ff;
  --color-surface: #ffffff;
  --color-glass: rgba(255, 255, 255, 0.7);
  --color-glass-border: rgba(0, 0, 0, 0.06);
  --color-primary: #4f46e5;
  --color-primary-light: #eef2ff;
  --color-primary-dim: rgba(79, 70, 229, 0.08);
  --color-secondary: #7c3aed;
  --color-accent: #06b6d4;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-border: #e2e8f0;
  --gradient-main: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #06b6d4 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 4px 24px rgba(79, 70, 229, 0.15);
  --font-heading: 'Exo', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Roboto Mono', 'Fira Code', monospace;
  --max-width: 1100px;
  --nav-height: 64px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ===== Subtle Dot Grid Background ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(79, 70, 229, 0.045) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Ambient gradient orb */
body::after {
  content: '';
  position: fixed;
  top: -25%;
  right: -15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.06) 0%, rgba(6, 182, 212, 0.03) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 20s ease-in-out infinite alternate;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-50px, 35px) scale(1.08); }
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.25s ease-out;
}

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-bottom: 0.5rem; }

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(79, 70, 229, 0.3); }
  50% { box-shadow: 0 0 16px rgba(79, 70, 229, 0.5); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fade-up {
  animation: fadeInUp 0.7s ease-out both;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out both;
}

.animate-slide-left {
  animation: slideInLeft 0.7s ease-out both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Navigation ===== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(248, 250, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-light);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.25s ease-out;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-main);
  transition: width 0.3s ease-out;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  margin: 5px 0;
  transition: 0.3s ease-out;
}

/* ===== Layout ===== */
.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.page-content {
  padding-top: var(--nav-height);
}

section {
  padding: 5rem 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

/* ===== Hero ===== */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -15%;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.08) 0%, rgba(6, 182, 212, 0.04) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: orbFloat 15s ease-in-out infinite alternate;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.06) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  animation: orbFloat 18s ease-in-out infinite alternate-reverse;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 680px;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image img {
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(79, 70, 229, 0.06);
}

.hero-greeting {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: 3.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: var(--gradient-main);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease-in-out infinite;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--color-text-light);
  max-width: 540px;
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.75rem;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out, background 0.25s ease-out;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient-main);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
  animation: gradientShift 4s ease-in-out infinite;
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 6px 28px rgba(79, 70, 229, 0.35);
}

.btn-outline {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px solid var(--color-border);
}

.btn-outline:hover {
  background: var(--color-primary-light);
  border-color: rgba(79, 70, 229, 0.2);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

/* ===== Glass Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--color-glass);
  border: 1px solid var(--color-glass-border);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, border-color 0.3s ease-out;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 70, 229, 0.15);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(79, 70, 229, 0.05);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--gradient-subtle);
  border: 1px solid var(--color-glass-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.card h3 {
  color: var(--color-text);
}

.card p {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* ===== About ===== */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

.about-text strong {
  color: var(--color-primary);
}

.role-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.role-list li {
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease-out, border-color 0.25s ease-out, box-shadow 0.25s ease-out;
  cursor: pointer;
}

.role-list li:hover {
  transform: translateX(6px);
  border-color: rgba(79, 70, 229, 0.2);
  box-shadow: var(--shadow-md);
}

.role-title {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
}

.role-org {
  color: var(--color-text-light);
  font-size: 0.88rem;
}

/* ===== Media ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.media-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 1.75rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out;
  cursor: pointer;
}

.media-item:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 58, 237, 0.2);
  box-shadow: 0 6px 30px rgba(124, 58, 237, 0.08);
}

.media-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  color: var(--color-text);
}

.media-desc {
  font-size: 0.88rem;
  color: var(--color-text-light);
}

.media-item--featured {
  grid-column: 1 / -1;
}

.media-clippings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.media-clipping {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
  cursor: pointer;
}

.media-clipping:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.media-clipping img {
  width: 100%;
  display: block;
}

.clipping-title {
  display: block;
  padding: 0.75rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.media-videos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
}

/* ===== Speaking / Timeline ===== */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent), var(--color-border));
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.45rem;
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
  transform: translateX(-5px);
  animation: glowPulse 3s ease-in-out infinite;
}

.timeline-item:nth-child(even)::before {
  background: var(--color-accent);
  animation: none;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.35);
}

.timeline-item h3 {
  margin-bottom: 0.25rem;
}

.timeline-meta {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.timeline-desc {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

/* ===== Blog ===== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease-out, border-color 0.3s ease-out, box-shadow 0.3s ease-out;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 70, 229, 0.15);
  box-shadow: var(--shadow-lg);
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-text-light);
  margin-bottom: 0.35rem;
}

.post-card h3 a {
  color: var(--color-text);
  transition: color 0.25s ease-out;
}

.post-card h3 a:hover {
  color: var(--color-primary);
}

.post-excerpt {
  color: var(--color-text-light);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* ===== Post Layout ===== */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.post-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.post-body {
  max-width: 720px;
}

.post-body p {
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.post-body h2 {
  margin-top: 2.5rem;
}

.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.post-body li {
  margin-bottom: 0.35rem;
}

.post-body strong {
  color: var(--color-text);
  font-weight: 700;
}

.post-body code {
  background: var(--color-primary-light);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--color-primary);
}

.post-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ===== Article Page ===== */
.article-content {
  max-width: 720px;
}

.article-image {
  margin-bottom: 2.5rem;
}

.article-image img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.article-body p {
  margin-bottom: 1.25rem;
  color: var(--color-text);
  line-height: 1.9;
}

.article-body ul {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.article-body li {
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

.article-body strong {
  color: var(--color-primary);
}

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.25s ease-out, box-shadow 0.25s ease-out;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #94a3b8;
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.contact-info h3 {
  margin-bottom: 1rem;
}

.contact-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-light);
  font-size: 0.95rem;
  transition: color 0.25s ease-out;
}

.contact-links a:hover {
  color: var(--color-primary);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.88rem;
  position: relative;
  z-index: 1;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--color-text-light);
  font-size: 0.88rem;
  transition: color 0.25s ease-out;
}

.footer-links a:hover {
  color: var(--color-primary);
}

/* ===== Clients ===== */
.client-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.client-tag {
  padding: 0.4rem 1rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border: 1px solid rgba(79, 70, 229, 0.1);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.25s ease-out, box-shadow 0.25s ease-out, transform 0.25s ease-out;
  cursor: pointer;
}

.client-tag:hover {
  background: rgba(79, 70, 229, 0.12);
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.1);
  transform: translateY(-1px);
}

/* ===== Scroll Reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Alt section background ===== */
section[style*="background"] {
  background: var(--color-bg-alt) !important;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(248, 250, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    pointer-events: none;
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hero h1 {
    font-size: 2.35rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    max-width: 280px;
  }

  .hero-buttons {
    justify-content: center;
  }

  .about-content,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .media-grid {
    grid-template-columns: 1fr 1fr;
  }

  .media-videos,
  .video-grid,
  .media-clippings {
    grid-template-columns: 1fr;
  }

  section {
    padding: 3rem 0;
  }
}

@media (max-width: 480px) {
  .media-grid {
    grid-template-columns: 1fr;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}
