/* ============================================
   CHING AN YU — Portfolio CSS
   style.css
   ============================================ */

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

:root {
  --bg:         #09090f;
  --bg2:        #0e0e18;
  --bg3:        #13131f;
  --accent:     #A9A3FF;
  --accent-dim: rgba(169,163,255,0.35);
  --white:      #ffffff;
  --w60:        rgba(255,255,255,0.72);
  --w30:        rgba(255,255,255,0.42);
  --w12:        rgba(255,255,255,0.22);
  --w05:        rgba(255,255,255,0.12);
}

html, body {
  background: var(--bg);
  color: var(--white);
  font-family: 'IBM Plex Sans', sans-serif;
  overflow-x: hidden;
  cursor: none;
}

/* ── Cursor ── */
#cursor {
  position: fixed;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 14px var(--accent), 0 0 28px rgba(169,163,255,0.3);
  transition: width 0.2s, height 0.2s;
}
#cursor.hovering {
  width: 40px; height: 40px;
  background: transparent;
  border: 1px solid var(--accent);
  box-shadow: none;
}

/* ── Canvas ── */
#bgCanvas, #revealCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
#revealCanvas { z-index: 1; }

/* ── Nav ── */
nav {
  position: fixed; top:0; left:0; right:0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 56px;
  border-bottom: 1px solid var(--w05);
  background: rgba(9,9,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-decoration: none;
}

.nav-links { display:flex; gap:40px; list-style:none; }
.nav-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; color: var(--w30);
  text-decoration: none;
  letter-spacing: 2.5px; text-transform: uppercase;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--accent); }

.nav-cta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bg); background: var(--accent);
  padding: 10px 22px; border-radius: 2px;
  text-decoration: none; transition: opacity 0.2s;
}
.nav-cta:hover { opacity: 0.82; }

/* ── Hero ── */
#hero {
  position: relative; z-index: 10;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 140px 56px 100px;
}

.hero-tag {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 36px;
}
.hero-tag-line { width:28px; height:1px; background:var(--accent); }
.hero-tag-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--accent);
  letter-spacing: 3.5px; text-transform: uppercase;
}

.hero-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(48px, 7vw, 86px);
  line-height: 1.0; letter-spacing: -3px;
  color: var(--white); max-width: 720px;
}
.hero-title .dim    { color: var(--w12); }
.hero-title .accent { color: var(--accent); }

.hero-desc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300; font-size: 15px;
  color: var(--w30); line-height: 1.9;
  max-width: 440px; margin: 36px 0 44px;
}

.hero-values { display:flex; gap:10px; margin-bottom:44px; flex-wrap:wrap; }
.hero-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; color: var(--accent-dim);
  letter-spacing: 2.5px; text-transform: uppercase;
  border: 1px solid rgba(169,163,255,0.2);
  padding: 6px 14px; border-radius: 2px;
}

.hero-cta { display:flex; align-items:center; gap:28px; }

.btn-primary {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bg); background: var(--accent);
  padding: 14px 32px; border-radius: 2px;
  text-decoration: none; transition: opacity 0.2s;
  display: inline-block;
}
.btn-primary:hover { opacity: 0.82; }

.btn-ghost {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--w30); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
  transition: color 0.3s;
}
.btn-ghost:hover { color: var(--accent); }
.btn-ghost-arrow { color: var(--accent); font-size: 15px; }

/* ── Hero Stats ── */
.hero-stats {
  position: fixed; right:56px; top:50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap:32px;
  text-align: right;
  opacity: 0.15;
  transition: opacity 0.15s ease-out;
}
.hero-stats.hidden { opacity: 0; pointer-events: none; visibility: hidden; }

.stat-num {
  font-family: 'Manrope', sans-serif;
  font-weight: 700; font-size: 28px;
  color: var(--white); letter-spacing: -1px; line-height:1;
}
.stat-num span { color: var(--accent); }
.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; color: rgba(255,255,255,0.52);
  letter-spacing: 2px; text-transform: uppercase; margin-top:5px;
}

/* ── Bottom Bar ── */
.hero-bottom {
  position: fixed; bottom:0; left:0; right:0;
  z-index: 100;
  display: flex; justify-content:space-between; align-items:center;
  padding: 18px 56px;
  border-top: 1px solid var(--w05);
  transition: opacity 0.15s ease-out;
}
.hero-bottom.hidden { opacity: 0; pointer-events: none; visibility: hidden; }

.hero-bottom-scroll {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.48);
  letter-spacing: 3px; text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
}
.hero-bottom-coords {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: #A9A3FF;
  letter-spacing: 1.5px;
}

@keyframes pulse {
  0%,100% { opacity:0.35; }
  50%      { opacity:0.7; }
}

/* ── Work Section ── */
#work {
  position: relative; z-index: 10;
  padding: 120px 56px 160px;
  background: var(--bg);
}

#work-bg-overlay {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: 0;
  transition: background 0.5s ease, opacity 0.5s ease;
}

.section-header {
  position: relative; z-index: 2;
  display: flex; align-items:flex-end;
  justify-content: space-between;
  margin-bottom: 64px;
}

.section-tag {
  display: flex; align-items:center; gap:14px;
  margin-bottom: 14px;
}
.section-tag-line { width:28px; height:1px; background:var(--accent); }
.section-tag-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: var(--accent);
  letter-spacing: 3.5px; text-transform: uppercase;
}

.section-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(36px,4vw,52px);
  color: var(--white); letter-spacing: -2px; line-height:1;
}
.section-title .dim { color: var(--w12); }

.section-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.32);
  letter-spacing: 2px; text-transform: uppercase;
  padding-bottom: 8px;
}

/* ── Project Grid ── */
.projects-grid {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 2px;
}

.project-card {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--w05);
  padding: 44px;
  cursor: none;
  overflow: hidden;
  transition: border-color 0.35s, background 0.35s;
  min-height: 300px;
  text-decoration: none;
}
.project-card:hover {
  background: var(--bg3);
  border-color: rgba(169,163,255,0.22);
}

.project-card.featured {
  grid-column: 1 / -1;
  min-height: 360px;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.project-card.featured .project-info { max-width: 560px; }

.project-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.28);
  letter-spacing: 3px; margin-bottom: 18px;
  transition: color 0.3s;
}
.project-card:hover .project-num { color: var(--accent); }

.collab-badge-inline {
  display: inline-flex;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; color: var(--accent);
  letter-spacing: 2px; text-transform: uppercase;
  background: rgba(169,163,255,0.08);
  border: 1px solid rgba(169,163,255,0.2);
  padding: 5px 12px; border-radius: 2px;
  margin-bottom: 16px;
}

.project-type {
  display: inline-flex;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; color: var(--accent);
  letter-spacing: 2.5px; text-transform: uppercase;
  border: 1px solid rgba(169,163,255,0.25);
  padding: 5px 12px; border-radius: 2px;
  margin-bottom: 18px;
}

.project-name {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(22px,2.5vw,32px);
  color: var(--white); letter-spacing: -1px; line-height:1.1;
  margin-bottom: 14px;
}

.project-desc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300; font-size: 13px;
  color: rgba(255,255,255,0.50);
  line-height: 1.75; max-width: 380px;
}

.project-arrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; color: var(--accent);
  letter-spacing: 2px;
  opacity: 0;
  transform: translate(-10px,10px);
  transition: opacity 0.3s, transform 0.3s;
  white-space: nowrap;
  flex-shrink: 0; align-self: flex-end;
  margin-top: auto;
  padding-top: 24px;
  padding-bottom: 4px;
}
.project-card:hover .project-arrow {
  opacity: 1; transform: translate(0,0);
}

.project-corner-tag {
  position: absolute; top:36px; right:36px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; color: rgba(255,255,255,0.48);
  letter-spacing: 2px; text-transform: uppercase;
  text-align: right; line-height: 2;
}


.project-line {
  position: absolute; bottom:0; left:0;
  height: 1px; width: 0;
  background: var(--accent);
  transition: width 0.45s ease, background 0.35s ease;
}
.project-card:hover .project-line {
  width: 100%;
  background: var(--project-line-hover, var(--accent));
}

/* ── About Section ── */
#about {
  position: relative; z-index: 10;
  padding: 120px 56px 140px;
  border-top: 1px solid var(--w05);
}

.about-inner {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 80px;
  align-items: start;
}

.about-left { position: sticky; top: 120px; }

/* ── About Photo ── */
.about-photo-wrap {
  margin: 24px 0 32px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.15);
  max-width: 280px;
}

.about-photo {
  width: 100%;
  display: block;
  filter: grayscale(20%) contrast(1.05);
  transition: filter 0.4s;
}

.about-photo:hover {
  filter: grayscale(0%) contrast(1.05);
}

.about-quote {
  font-family: 'Manrope', sans-serif;
  font-weight: 300;
  font-size: clamp(18px, 2vw, 24px);
  color: rgba(255,255,255,0.85);
  line-height: 1.55; letter-spacing: -0.5px;
  margin-top: 28px;
  padding-left: 20px;
  border-left: 1px solid var(--accent);
}

.about-credit {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; color: rgba(169,163,255,0.5);
  letter-spacing: 2px;
}

.about-right { padding-top: 80px; }

.about-bio {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300; font-size: 15px;
  color: rgba(255,255,255,0.65);
  line-height: 1.9; margin-bottom: 20px;
  max-width: 580px;
}

.about-skills-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--w05);
}

.about-skills-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; color: var(--accent);
  letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 16px;
}

.about-skills-list { list-style: none; }
.about-skills-list li {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px; color: rgba(255,255,255,0.52);
  padding: 10px 0;
  border-bottom: 1px solid var(--w05);
  transition: color 0.2s;
}
.about-skills-list li:hover { color: rgba(255,255,255,0.8); }

/* ── Contact Section ── */
#contact {
  position: relative; z-index: 10;
  border-top: 1px solid var(--w05);
}

.contact-inner { padding: 120px 56px 80px; }

.contact-title {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 6vw, 76px);
  letter-spacing: -3px; line-height: 1.0;
  color: var(--white);
  margin: 28px 0 32px;
}
.contact-title-dim { color: rgba(255,255,255,0.28); }

.contact-desc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 300; font-size: 15px;
  color: var(--w30); line-height: 1.9;
  max-width: 420px; margin-bottom: 44px;
}

.contact-links {
  margin-top: 48px;
  border-top: 1px solid var(--w05);
  max-width: 480px;
}

.about-link {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px; color: rgba(255,255,255,0.48);
  text-decoration: none;
  padding: 18px 0;
  border-bottom: 1px solid var(--w05);
  transition: color 0.3s;
  letter-spacing: 0.5px;
}
.about-link:hover { color: var(--accent); }

.about-link-label {
  font-size: 9px; letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent); opacity: 0.6;
  min-width: 90px;
  flex-shrink: 0;
}

/* ── Footer ── */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 56px;
  border-top: 1px solid var(--w05);
}

.footer-copy {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: rgba(255,255,255,0.85);
  letter-spacing: 1.5px;
}

.footer-coords {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; color: #A9A3FF;
  letter-spacing: 1.5px;
}

/* photo styles handled above */

/* ── Clarity Field v2 — text reveal transition ── */
.hero-title, .hero-tag, .hero-desc, .hero-values, .hero-cta {
  transition: color 0.12s ease, opacity 0.12s ease;
}
.hero-title .accent, .hero-title .dim {
  transition: color 0.12s ease;
}
.hero-value {
  transition: color 0.12s ease, border-color 0.12s ease;
}

/* ── Hero title + stats always visible, everything else mouse-only ── */
.hero-title         { color: rgba(255,255,255,0.88) !important; }
.hero-title .accent { color: var(--accent) !important; }
.hero-title .dim    { color: rgba(255,255,255,0.38) !important; }
.hero-stats         { opacity: 0.85 !important; }

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */

/* ── Hamburger Button ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 300;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: rgba(255,255,255,0.85);
  transition: all 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Mobile Nav Overlay ── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #09090f;
  z-index: 250;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-nav-overlay.open {
  opacity: 1;
}
.mobile-nav-overlay a {
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  letter-spacing: -1px;
  transition: color 0.2s;
}
.mobile-nav-overlay a:hover { color: #A9A3FF; }
.mobile-nav-overlay .nav-cta-mobile {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #09090f;
  background: #A9A3FF;
  padding: 14px 32px;
  border-radius: 2px;
  margin-top: 16px;
}

@media (max-width: 768px) {

  html, body { cursor: auto; }

  /* Hide desktop cursor + canvas effects */
  #cursor { display: none; }
  #bgCanvas, #revealCanvas { display: none; }

  /* ── Nav ── */
  nav { padding: 20px 24px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: flex; }

  /* ── Hero ── */
  #hero {
    padding: 110px 24px 80px;
    min-height: 100svh;
  }

  .hero-title {
    font-size: clamp(42px, 12vw, 64px);
    letter-spacing: -2px;
  }

  .hero-desc {
    font-size: 14px;
    max-width: 100%;
    margin: 24px 0 32px;
  }

  .hero-values { margin-bottom: 32px; gap: 8px; }
  .hero-value { font-size: 8px; padding: 5px 10px; }

  .hero-cta { flex-direction: column; align-items: flex-start; gap: 16px; }
  .btn-primary { padding: 12px 24px; }

  /* Show text fully on mobile — no mouse reveal needed */
  .hero-title,
  .hero-tag,
  .hero-desc,
  .hero-values,
  .hero-cta {
    opacity: 1 !important;
    color: inherit !important;
    transition: none !important;
  }

  .hero-title { color: #ffffff !important; }
  .hero-title .accent { color: #A9A3FF !important; }
  .hero-title .dim { color: rgba(255,255,255,0.22) !important; }
  .hero-desc { color: rgba(255,255,255,0.62) !important; }

  /* Static background for mobile */
  #hero::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(rgba(169,163,255,0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(169,163,255,0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
  }

  /* Hide hero stats on mobile */
  .hero-stats { display: none; }

  .hero-bottom {
    padding: 14px 24px;
  }
  .hero-bottom-scroll { font-size: 8px; letter-spacing: 2px; }
  .hero-bottom-coords { font-size: 8px; }

  /* ── Work Section ── */
  #work { padding: 80px 24px 100px; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 40px; }
  .section-count { display: none; }
  .section-title { font-size: clamp(28px, 8vw, 40px); }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .project-card {
    min-height: 220px;
    padding: 28px;
  }

  .project-card.featured {
    flex-direction: column;
    align-items: flex-start;
    min-height: 260px;
    gap: 20px;
  }

  .project-name { font-size: clamp(20px, 5vw, 26px); }
  .project-desc { font-size: 12px; max-width: 100%; }
  .project-type { font-size: 8px; }
  .project-num { font-size: 10px; margin-bottom: 12px; }

  /* Always show arrow on mobile */
  .project-arrow {
    opacity: 1 !important;
    transform: translate(0,0) !important;
    font-size: 11px;
    margin-top: 16px;
    padding-top: 0;
  }

  .project-corner-tag { font-size: 8px; top: 24px; right: 24px; }
  .collab-badge-inline { font-size: 8px; }

  /* ── About Section ── */
  #about { padding: 80px 24px 100px; }

  .about-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-left { position: static; }

  .about-photo-wrap { max-width: 200px; }

  .about-quote { font-size: 18px; }

  .about-right { padding-top: 0; }

  .about-bio { font-size: 14px; }

  .about-skills-wrap {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 28px;
    padding-top: 28px;
  }

  /* ── Contact Section ── */
  .contact-inner { padding: 80px 24px 60px; }

  .contact-title {
    font-size: clamp(34px, 9vw, 52px);
    letter-spacing: -2px;
    margin-bottom: 20px;
  }

  .contact-desc { font-size: 13px; max-width: 100%; }

  .contact-links { max-width: 100%; }
  .about-link { font-size: 11px; padding: 14px 0; }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 16px 24px;
  }

  /* ── Hide easter eggs on mobile ── */
  .personality-egg { display: none !important; }

}