/* ============================================================
   KELVIN ZHU — PORTFOLIO SITE
   ============================================================
   Structure:
   1. Reset & variables
   2. Base & typography
   3. Buttons
   4. Nav
   5. Hero
   6. Services
   7. Experience
   8. About
   9. Contact
   10. Footer
   11. Animations
   12. Responsive
   ============================================================ */


/* ============================================================
   1. RESET & VARIABLES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #FAFAF8;
  --surface:      #FFFFFF;
  --border:       #E8E4DE;
  --border-hover: #C8C3BC;

  --text:         #1A1A1A;
  --text-muted:   #6B6860;
  --text-light:   #9E9A94;

  --accent:       #0D9488;
  --accent-dark:  #0F766E;
  --accent-bg:    #F0FDF9;

  --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow:    0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.08);

  --max-width: 1100px;
  --section-gap: 110px;
}

html {
  scroll-behavior: smooth;
}

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


/* ============================================================
   2. BASE & TYPOGRAPHY
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 36px;
}

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

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

h1 {
  font-size: clamp(38px, 5.5vw, 66px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -2px;
  color: var(--text);
}

h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1.2px;
  color: var(--text);
  margin-bottom: 48px;
}

h3 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

p {
  color: var(--text-muted);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}


/* ============================================================
   3. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 10px 18px;
  font-size: 14px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--text);
  transform: translateY(-1px);
}

.cta-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}


/* ============================================================
   4. NAV
   ============================================================ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 22px 0;
  transition: padding 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

#nav.scrolled {
  padding: 14px 0;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a:not(.btn) {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:not(.btn):hover {
  color: var(--text);
}


/* ============================================================
   5. HERO
   ============================================================ */
#hero {
  padding: 160px 0 var(--section-gap);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 80px;
  align-items: center;
}

.hero-text h1 {
  margin-bottom: 26px;
}

.hero-sub {
  font-size: 19px;
  line-height: 1.75;
  max-width: 500px;
  margin-bottom: 42px;
}

.hero-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  aspect-ratio: 4 / 5;
}


/* ============================================================
   5b. CLIENTS
   ============================================================ */
#clients {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.clients-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.clients-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0 var(--container-pad, 24px);
}

.logos-slider {
  overflow: hidden;
  width: 100%;
}

.logos-track {
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  animation: logo-scroll 28s linear infinite;
}

.logos-track:hover {
  animation-play-state: paused;
}

.logos-track img {
  height: 36px;
  width: auto;
  opacity: 0.45;
  filter: grayscale(100%);
  transition: opacity 0.2s, filter 0.2s;
}

.logos-track img:hover {
  opacity: 0.8;
  filter: grayscale(0%);
}

@keyframes logo-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}


/* ============================================================
   6. SERVICES
   ============================================================ */
#services {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--border);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}


.service-card {
  padding: 30px;
}

.service-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-bg);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 20px;
}

.service-card h3 {
  margin-bottom: 10px;
}

.service-card p {
  font-size: 15px;
  line-height: 1.65;
}

.service-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(13, 148, 136, 0.07);
}


/* ============================================================
   6b. CASE STUDIES
   ============================================================ */
#work {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--border);
}

.case-study-card {
  display: block;
  padding: 40px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.case-study-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 40px rgba(13, 148, 136, 0.08);
  transform: translateY(-2px);
}

.cs-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.cs-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 12px;
  border-radius: 20px;
}

.cs-period {
  font-size: 13px;
  color: var(--text-light);
}

.cs-headline {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 32px;
  max-width: 620px;
  letter-spacing: -0.5px;
}

.cs-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.cs-stat-num {
  display: block;
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -1.5px;
  line-height: 1;
  margin-bottom: 8px;
}

.cs-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.cs-cta {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}

.exp-case-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.exp-case-link:hover {
  opacity: 0.75;
}

@media (max-width: 640px) {
  .cs-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-headline {
    font-size: 20px;
  }
}


/* ============================================================
   7. EXPERIENCE
   ============================================================ */
#experience {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--border);
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.exp-card {
  padding: 36px 40px;
}

.exp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.exp-company {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.exp-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.exp-date {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
  padding-top: 4px;
}

.exp-summary {
  font-size: 16px;
  margin-bottom: 14px;
}

.exp-body {
  font-size: 16px;
  margin-bottom: 16px;
}

.exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.exp-bullets li {
  font-size: 15px;
  color: var(--text-muted);
  padding-left: 22px;
  position: relative;
  line-height: 1.6;
}

.exp-bullets li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.6;
}


/* ============================================================
   8. ABOUT
   ============================================================ */
#about {
  padding: var(--section-gap) 0;
  border-top: 1px solid var(--border);
}

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

.about-image img {
  width: 100%;
  border-radius: var(--radius-lg);
  object-fit: cover;
  aspect-ratio: 3 / 4;
}

.about-text h2 {
  margin-bottom: 28px;
}

.about-text p {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 18px;
}

.about-text p:last-of-type {
  margin-bottom: 32px;
}

.about-links {
  display: flex;
  gap: 12px;
}


/* ============================================================
   9. CONTACT
   ============================================================ */
#contact {
  padding: var(--section-gap) 0;
  background: var(--accent);
}

.contact-inner {
  max-width: 620px;
}

.contact-inner .eyebrow {
  color: rgba(255, 255, 255, 0.65);
}

.contact-inner h2 {
  color: #fff;
  margin-bottom: 18px;
}

.contact-sub {
  font-size: 18px;
  line-height: 1.75;
  margin-bottom: 40px;
  color: rgba(255, 255, 255, 0.8);
}

#contact .btn-primary {
  background: #fff;
  color: var(--accent);
}

#contact .btn-primary:hover {
  background: #f0fdfa;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

#contact .btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

#contact .btn-ghost:hover {
  border-color: #fff;
}


/* ============================================================
   10. FOOTER
   ============================================================ */
footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 14px;
  color: var(--text-light);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-light);
  transition: color 0.2s;
}

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


/* ============================================================
   11. ANIMATIONS
   ============================================================ */
section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

#hero {
  opacity: 1;
  transform: none;
}


/* ============================================================
   12. RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    max-width: 200px;
    aspect-ratio: 1;
    border-radius: 50%;
  }

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

  .about-image img {
    max-width: 200px;
    aspect-ratio: 1;
    border-radius: 50%;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid .service-card:nth-child(4) {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  :root {
    --section-gap: 80px;
  }

  .container {
    padding: 0 20px;
  }

  .nav-links a:not(.btn) {
    display: none;
  }

  .nav-links {
    gap: 16px;
  }

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

  .cta-group {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
    text-align: center;
  }

  .exp-header {
    flex-direction: column;
    gap: 6px;
  }

  .exp-card {
    padding: 24px;
  }

  h2 {
    margin-bottom: 32px;
  }
}
