/* ============================================
   SOPHIA GUO PORTFOLIO — STYLES
   Playful & expressive, warm + electric palette
   ============================================ */

:root {
  --bg: #faf8f4;
  --fg: #1a1714;
  --accent: #f4633a;
  --accent2: #7c5cbf;
  --accent3: #3abf9f;
  --warm: #f9e8d0;
  --muted: #7a7470;
  --card-bg: #ffffff;
  --card-border: rgba(26,23,20,0.08);
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  cursor: none;
  animation: bodyFadeIn 0.5s ease both;
}
@keyframes bodyFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Custom Cursor ── */
.cursor {
  position: fixed;
  width: 40px; height: 40px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease-out),
              height 0.25s var(--ease-out),
              border-color 0.2s,
              background 0.2s,
              opacity 0.2s;
  mix-blend-mode: multiply;
}
.cursor-dot {
  position: fixed;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.08s;
}
.cursor.hovered {
  width: 64px; height: 64px;
  background: rgba(244,99,58,0.08);
  border-color: var(--accent);
}
.cursor.view-cursor {
  width: 80px; height: 80px;
  background: var(--accent);
  border-color: var(--accent);
  mix-blend-mode: normal;
}
.cursor.view-cursor::after {
  content: 'view';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.4s;
}
.nav.scrolled {
  background: rgba(250,248,244,0.85);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.nav-logo {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--accent);
  letter-spacing: -0.02em;
  transition: transform 0.3s var(--ease-spring);
}
.nav-logo:hover { transform: scale(1.1) rotate(-3deg); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  position: relative;
  transition: color 0.2s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}
.nav-link:hover { color: var(--fg); }
.nav-link:hover::after { width: 100%; }
.nav-cta {
  background: var(--fg);
  color: var(--bg) !important;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 500;
  transition: background 0.2s, transform 0.2s var(--ease-spring) !important;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--accent); transform: scale(1.04) !important; }

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 48px 80px;
  position: relative;
  overflow: hidden;
}
.hero-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.wave-emoji {
  font-size: 26px;
  display: inline-block;
  transform-origin: 70% 80%;
  animation: wave 2.5s ease-in-out 0.8s both;
  cursor: default;
}
@keyframes wave {
  0%,100% { transform: rotate(0deg); }
  15% { transform: rotate(18deg); }
  30% { transform: rotate(-10deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-6deg); }
  75% { transform: rotate(10deg); }
}
.greeting-text {
  font-size: 21px;
  color: var(--fg);
  font-weight: 400;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(52px, 8.5vw, 112px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
}
.hero-name { color: var(--fg); }
.hero-subtitle { color: var(--fg); }
.hero-title { position: relative; }
.hero-title-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  -webkit-mask: radial-gradient(circle 20px at var(--hero-mx, -9999px) var(--hero-my, -9999px), black 100%, transparent 100%);
  mask: radial-gradient(circle 20px at var(--hero-mx, -9999px) var(--hero-my, -9999px), black 100%, transparent 100%);
}
/* Force all text inside overlay to accent color */
.hero-title-overlay .hero-subtitle,
.hero-title-overlay .hero-subtitle em {
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
}
.hero-subtitle em {
  font-style: italic;
  color: var(--accent);
  position: relative;
  display: inline-block;
}
.hero-subtitle em::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  animation: underline-in 0.6s var(--ease-out) 1.5s forwards;
}
@keyframes underline-in {
  to { transform: scaleX(1); }
}
.hero-descriptor {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.hero-bio {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.7;
  max-width: 560px;
  color: var(--fg);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
}
.highlight {
  background: linear-gradient(120deg, var(--accent) 0%, #f4a23a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 500;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--card-border);
  color: var(--muted);
  background: var(--card-bg);
  transition: all 0.25s var(--ease-spring);
}
.tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}
.hero-scroll-hint {
  position: absolute;
  bottom: 40px; left: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scroll-line {
  width: 48px;
  height: 1px;
  background: var(--muted);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--accent);
  animation: scroll-scan 2s ease-in-out infinite;
}
@keyframes scroll-scan {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Decorative blobs */
.hero-deco { position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.deco-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
}
.blob-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent), transparent);
  top: -200px; right: -100px;
  animation: float1 8s ease-in-out infinite;
}
.blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--accent2), transparent);
  bottom: 0; left: 40%;
  animation: float2 10s ease-in-out infinite;
}
.blob-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--accent3), transparent);
  top: 30%; right: 20%;
  animation: float1 12s ease-in-out infinite reverse;
}
@keyframes float1 {
  0%,100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.08); }
}
@keyframes float2 {
  0%,100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(0.95); }
}

/* ── Section Shared ── */
section { padding: 100px 48px; }
.section-header { margin-bottom: 56px; }
.section-header.left { margin-bottom: 40px; }
.section-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 4.5vw, 58px);
  letter-spacing: -0.01em;
  line-height: 1.08;
}

/* ── Projects Grid ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project-card-wide { grid-column: span 2; }

.project-card {
  background: var(--card-bg);
  border-radius: 24px;
  border: 1.5px solid var(--card-border);
  overflow: hidden;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s;
  position: relative;
}
.project-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 32px 80px rgba(26,23,20,0.12);
}
.project-card-inner { padding: 36px; height: 100%; display: flex; flex-direction: column; gap: 24px; }
.project-meta { display: flex; align-items: center; justify-content: space-between; }
.project-number {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.project-tags-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ptag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--warm);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.project-body { flex: 1; }
.project-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.project-org {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.project-desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
}
.project-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.project-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  padding: 10px 20px;
  border-radius: 100px;
  border: 1.5px solid var(--fg);
  transition: all 0.25s var(--ease-spring);
  white-space: nowrap;
}
.project-cta:hover {
  background: var(--fg);
  color: var(--bg);
  transform: scale(1.04);
}
.cta-arrow {
  display: inline-block;
  transition: transform 0.2s;
}
.project-cta:hover .cta-arrow { transform: translateX(4px); }

/* Project image placeholders */
.project-img-placeholder {
  width: 160px;
  height: 100px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-spring);
}
.project-card:hover .project-img-placeholder { transform: scale(1.04) rotate(1deg); }
.pi-glow {
  position: absolute;
  inset: 0;
  opacity: 0.6;
  border-radius: 12px;
}
.pi-1 { background: linear-gradient(135deg, #fff0eb, #ffd4c2); }
.pi-1 .pi-glow { background: radial-gradient(circle at 30% 50%, var(--accent), transparent); }
.pi-2 { background: linear-gradient(135deg, #f0ecff, #d8ccff); }
.pi-2 .pi-glow { background: radial-gradient(circle at 70% 30%, var(--accent2), transparent); }
.pi-3 { background: linear-gradient(135deg, #e8fff9, #c2f0e4); }
.pi-3 .pi-glow { background: radial-gradient(circle at 50% 70%, var(--accent3), transparent); }

.pi-shapes { position: absolute; inset: 0; padding: 14px; }
.pi-rect {
  width: 60%; height: 20px;
  background: rgba(255,255,255,0.7);
  border-radius: 4px;
  margin-bottom: 8px;
}
.pi-rect.r2 { width: 40%; }
.pi-line {
  position: absolute;
  left: 14px; right: 14px; bottom: 30px;
  height: 1px;
  background: rgba(255,255,255,0.5);
}
.pi-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  bottom: 14px; right: 40px;
}
.pi-dot.d2 { right: 24px; background: var(--accent2); width: 6px; height: 6px; }
.pi-grid-row {
  width: 100%; height: 18px;
  background: rgba(255,255,255,0.6);
  border-radius: 4px;
  margin-bottom: 6px;
}
.pi-grid-row.r2 { width: 80%; opacity: 0.7; }
.pi-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent2);
  border-radius: 100px;
  margin-top: 8px;
  margin-right: 4px;
  width: 40%; height: 14px;
  border-radius: 100px;
  opacity: 0.8;
}
.pi-badge.b2 { width: 28%; background: var(--accent3); }
.pi-phone {
  width: 44px; height: 76px;
  background: rgba(255,255,255,0.8);
  border-radius: 10px;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 8px 6px;
}
.pi-phone-screen { display: flex; flex-direction: column; gap: 5px; }
.pi-bar { height: 7px; background: var(--accent3); border-radius: 3px; width: 100%; }
.pi-bar.b2 { width: 75%; background: rgba(58,191,159,0.5); }
.pi-bar.b3 { width: 50%; background: rgba(58,191,159,0.3); }

/* ── Skills Marquee ── */
.skills-marquee {
  padding: 0;
  background: var(--fg);
  overflow: hidden;
  white-space: nowrap;
  border-top: 1.5px solid var(--fg);
  border-bottom: 1.5px solid var(--fg);
}
.marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  padding: 20px 0;
  animation: marquee 28s linear infinite;
  will-change: transform;
}
.marquee-track span {
  font-size: 13px;
  font-weight: 400;
  color: var(--bg);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.marquee-dot { color: var(--accent) !important; font-size: 12px !important; }
.skills-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Play Section ── */
.play { background: var(--warm); }
.play-intro {
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 48px;
}
.play-grid {
  column-count: 3;
  column-gap: 16px;
  margin-bottom: 32px;
}

.play-card {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  cursor: none;
  transition: transform 0.4s var(--ease-spring);
}
.play-card:hover { transform: scale(1.02); }
.play-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s var(--ease-out);
}
.play-card:hover img { transform: scale(1.06); }
.play-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,23,20,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 20px;
}
.play-card:hover .play-card-overlay { opacity: 1; }
.play-label {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.play-cta-row { text-align: center; padding-top: 8px; }
.play-see-more {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  border-bottom: 1.5px solid var(--fg);
  padding-bottom: 2px;
  transition: all 0.2s;
  display: inline-block;
}
.play-see-more:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateX(4px);
}

/* ── About Section ── */
.about { background: var(--bg); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.about-para {
  font-size: 16px;
  line-height: 1.75;
  color: var(--fg);
  margin-bottom: 18px;
}
.about-para strong { font-weight: 500; }
.about-para em { font-style: italic; color: var(--accent2); }
.about-fun-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.fun-fact {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--warm);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 14px;
  transition: transform 0.25s var(--ease-spring);
}
.fun-fact:hover { transform: scale(1.05) rotate(-1deg); }
.ff-emoji { font-size: 18px; }

/* Timeline */
.about-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 2px solid var(--card-border);
  padding-left: 28px;
  margin-bottom: 40px;
}
.timeline-item {
  position: relative;
  padding-bottom: 32px;
}
.timeline-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -36px; top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  transition: background 0.2s, transform 0.3s var(--ease-spring);
}
.timeline-item:hover .tl-dot {
  background: var(--accent);
  transform: scale(1.4);
}
.tl-content { display: flex; flex-direction: column; gap: 2px; }
.tl-date {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.tl-content strong {
  font-size: 15px;
  font-weight: 500;
  display: block;
}
.tl-content span {
  font-size: 13px;
  color: var(--muted);
}

/* Photo Carousel */
.about-carousel {
  overflow: hidden;
  margin-top: 72px;
  width: 100%;
}
.about-carousel-track {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: about-scroll 60s linear infinite;
  will-change: transform;
  width: max-content;
}
.about-carousel:hover .about-carousel-track {
  animation-play-state: paused;
}
.about-carousel-track img {
  height: 220px;
  width: auto;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
@keyframes about-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Connect links */
.about-connect {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.connect-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s, transform 0.2s;
}
.connect-link:hover {
  color: var(--accent);
  transform: translateX(6px);
}

/* ── Footer ── */
.footer {
  background: var(--fg);
  color: var(--bg);
  padding: 48px 48px 32px;
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
}
.footer-name {
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.footer-tagline {
  font-size: 13px;
  color: rgba(250,248,244,0.4);
  font-style: italic;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.footer-links a {
  font-size: 14px;
  color: rgba(250,248,244,0.6);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }
.footer-bar {
  display: flex;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid rgba(250,248,244,0.1);
  font-size: 12px;
  color: rgba(250,248,244,0.3);
}

/* ── Reveal Animations ── */
.reveal-word {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal-fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.revealed {
  opacity: 1;
  transform: translateY(0);
}
.project-card, .play-card, .timeline-item, .fun-fact {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), box-shadow 0.4s;
}
.project-card.in-view, .play-card.in-view, .timeline-item.in-view, .fun-fact.in-view {
  opacity: 1;
  transform: translateY(0);
}
/* override hover transforms from above */
.project-card.in-view:hover {
  transform: translateY(-8px) scale(1.01);
}
.play-card.in-view:hover { transform: scale(1.02); }
.fun-fact.in-view:hover { transform: scale(1.05) rotate(-1deg); }

/* ── Back to top button ── */
.back-top {
  position: fixed;
  bottom: 36px; right: 36px;
  width: 44px; height: 44px;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  z-index: 90;
  opacity: 0;
  transform: translateY(16px) scale(0.8);
  transition: opacity 0.3s, transform 0.3s var(--ease-spring), background 0.2s;
  pointer-events: none;
}
.back-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.back-top:hover { background: var(--accent); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav { padding: 16px 24px; }
  section { padding: 72px 24px; }
  .hero { padding: 100px 24px 60px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-card-wide { grid-column: span 1; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .play-grid { column-count: 2; }
  .footer-content { flex-direction: column; gap: 24px; }
  .footer-links { align-items: flex-start; }
}
@media (max-width: 600px) {
  .nav-links { gap: 16px; }
  .nav-link:not(.nav-cta) { display: none; }
  .play-grid { column-count: 1; }
  .project-img-placeholder { display: none; }
}
