/* ========================================
   Joy Cai — Personal Site
   Minimal. Bold. Founder-grade.
   ======================================== */

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

:root {
  --bg:      #080810;
  --surface: #0f0f1a;
  --border:  #1a1a2e;
  --text:    #f0ece4;
  --muted:   #8a8499;
  --accent:  #d4a76a;
  --accent2: #8b5cf6;
  --font:    'Inter', system-ui, -apple-system, sans-serif;
  --mono:    'Cinzel', 'Georgia', serif;
  --max-w:   880px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover { opacity: 0.7; }

.mono  { font-family: var(--mono); font-size: 0.85em; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

/* ===== Fade-in animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
.d1 { transition-delay: 0.15s; }
.d2 { transition-delay: 0.3s; }
.d3 { transition-delay: 0.45s; }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 48px;
}

.hero .mono {
  color: var(--accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1.05;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 600;
}

.hero-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-links a {
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s, opacity 0.2s;
}
.hero-links a:hover {
  border-bottom-color: var(--accent);
  opacity: 1;
}

/* ===== Hero Portrait ===== */
.hero-portrait {
  position: relative;
  flex-shrink: 0;
}

.hero-portrait img {
  display: block;
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(212, 167, 106, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(139, 92, 246, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-portrait img:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 0 1px rgba(212, 167, 106, 0.2),
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(139, 92, 246, 0.12);
}

.hero-portrait::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent2), transparent);
  opacity: 0.3;
  z-index: -1;
  transition: opacity 0.4s ease;
}

.hero-portrait:hover::before {
  opacity: 0.5;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}

/* ===== Metrics ===== */
.metrics {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}

.metric-num {
  display: block;
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Building Now ===== */
.now { padding: 80px 0; }

.section-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 40px;
}

.now-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.now-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), transparent);
}

.now-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 167, 106, 0.03), rgba(139, 92, 246, 0.03));
  pointer-events: none;
}

.now-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  background: rgba(212, 167, 106, 0.1);
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.now-card h3 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.now-tagline {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 16px;
  font-style: italic;
}

.now-card > p {
  color: #b5b0a8;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.now-card > p:last-child {
  margin-bottom: 0;
}

.now-card > .now-problem {
  color: var(--text);
  font-weight: 500;
}

.now-card > .now-role {
  color: var(--accent);
  font-weight: 500;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

/* ===== Work / Timeline ===== */
.work {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.timeline { position: relative; }

.timeline::before {
  content: '';
  position: absolute;
  left: 72px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.tl-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 32px;
  padding-bottom: 40px;
  position: relative;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-date {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
  padding-top: 2px;
  white-space: nowrap;
}

.tl-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.tl-org {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.tl-body > p:last-child {
  font-size: 0.9rem;
  color: #9a9590;
  line-height: 1.7;
}

/* ===== About ===== */
.about {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px 48px;
}

.about-col h3 {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 10px;
}

.about-col p,
.about-col li {
  font-size: 0.9rem;
  color: #c2bcb2;
}

.clean-list {
  list-style: none;
}

.clean-list li {
  padding: 3px 0;
  font-size: 0.9rem;
  color: #c2bcb2;
}

.clean-list li::before {
  content: '\2192';
  margin-right: 8px;
  color: var(--accent);
  font-size: 0.75rem;
}

/* ===== Tags ===== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: #b5b0a8;
  transition: border-color 0.2s, color 0.2s;
}

.tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.footer-links a {
  font-family: var(--mono);
  font-size: 0.8rem;
}

footer .mono.small {
  color: var(--muted);
  font-size: 0.7rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-portrait {
    order: -1;
    justify-self: center;
  }

  .hero-portrait img {
    width: 220px;
    height: 220px;
    border-radius: 50%;
  }

  .hero-portrait::before {
    border-radius: 50%;
  }

  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }

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

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

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

  .now-card {
    padding: 28px 20px;
  }

  .timeline::before { left: 0; display: none; }
  .tl-item { grid-template-columns: 1fr; gap: 4px; }
  .tl-date { text-align: left; }
}

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

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

  .hero-portrait img {
    width: 180px;
    height: 180px;
  }
}
