/* ================================================================
   HAZEL CHEN — PORTFOLIO
   ================================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #fff;
  color: #111;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.8;
  opacity: 0;
  transition: opacity 0.4s ease;
  cursor: none;
  overflow-x: hidden;
}

body.loaded { opacity: 1; }

/* Hide cursor on touch */
@media (hover: none) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
  * { cursor: auto !important; }
}

/* ——— Tokens ——— */
:root {
  --bg:        #fff;
  --text:      #111;
  --text-2:    #666;
  --text-3:    #999;
  --border:    #eee;
  --green:     #4A9B72;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* kept for case study / about pages */
  --bg-2:      #f5f5f5;
  --bg-card:   #f5f5f5;
  --r-sm:  8px;
  --r-md:  16px;
  --r-lg:  24px;
  --r-xl:  32px;
  --space-sm:  20px;
  --space-md:  32px;
  --space-lg:  64px;
  --space-xl:  96px;
  --space-2xl: 140px;
  --space-3xl: 180px;
}

/* ——— Base links ——— */
a {
  color: #111;
  text-decoration: underline;
  text-decoration-color: #ccc;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
a:hover { text-decoration-color: #111; }

/* ——— Custom Cursor ——— */
.cursor-dot,
.cursor-ring {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.cursor-dot {
  width: 7px; height: 7px;
  background: #fff;
  mix-blend-mode: difference;
  display: none;
}

.cursor-ring {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1a6b8a, #2ab5b5, #7dd4d4, #b8eef0);
  background-size: 200% 200%;
  opacity: 0.2;
  transition: transform 0.3s var(--ease-expo);
  animation: cursor-gradient-shift 4s ease infinite;
}

body.hovering .cursor-ring {
  transform: translate(-50%, -50%) scale(1.45);
}

@keyframes cursor-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ——— Page transition ——— */
.page-transition {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.page-transition.active { opacity: 1; }

/* ——— Entry animations (homepage) ——— */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.home-name {
  opacity: 0;
  animation: fade-up 0.4s ease forwards 0.1s;
}

.home-bio p {
  opacity: 0;
  animation: fade-up 0.4s ease forwards;
}
.home-bio p:nth-child(1) { animation-delay: 0.18s; }
.home-bio p:nth-child(2) { animation-delay: 0.26s; }
.home-bio p:nth-child(3) { animation-delay: 0.34s; }

.home-work-label {
  opacity: 0;
  animation: fade-up 0.4s ease forwards 0.46s;
}

.work-rows { border-top: 1px solid #eee; }

.work-row {
  opacity: 0;
  animation: fade-up 0.4s ease forwards;
}
.work-row:nth-child(1) { animation-delay: 0.54s; }
.work-row:nth-child(2) { animation-delay: 0.62s; }

/* ——— Navigation ——— */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 32px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.3s ease;
}

nav.scrolled {
  border-bottom: 1px solid #eee;
}

.nav-logo {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: normal;
  color: #111;
  text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }

.nav-links { display: flex; gap: 28px; list-style: none; }

.nav-links a {
  font-family: Georgia, serif;
  font-size: 14px;
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: #111; }

/* ——— Homepage layout ——— */
.home-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 120px 24px 80px;
}

/* ——— Name ——— */
.home-name {
  font-size: 22px;
  font-weight: normal;
  font-family: Georgia, serif;
  line-height: 1.3;
  letter-spacing: 0;
  margin-bottom: 24px;
  color: #111;
}

/* ——— Bio ——— */
.home-bio {
  margin-bottom: 64px;
}

.home-bio p {
  font-size: 16px;
  line-height: 1.8;
  color: #666;
  margin-bottom: 16px;
}
.home-bio p:last-child { margin-bottom: 0; }

/* ——— Work list ——— */
.home-work { margin-bottom: 0; }

.home-work-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
  font-family: Georgia, serif;
}

.work-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 10px;
  margin: 0 -10px;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: #111;
  transition: background 0.15s ease;
}
.work-row:hover {
  background: #f9f9f9;
  text-decoration: none;
  color: #111;
}

.work-row-name {
  font-size: 15px;
  color: #111;
  flex-shrink: 0;
}

.work-row-desc {
  font-size: 14px;
  color: #999;
  text-align: right;
  flex-shrink: 1;
  white-space: nowrap;
}

/* ——— Homepage footer ——— */
.home-footer {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  gap: 20px;
  border-top: 1px solid #eee;
}

.home-footer a {
  font-size: 14px;
  color: #666;
  text-decoration: underline;
  text-decoration-color: #d0d0d0;
  transition: text-decoration-color 0.2s ease, color 0.2s ease;
}
.home-footer a:hover {
  color: #111;
  text-decoration-color: #111;
}

/* ——— Scroll reveal (other pages) ——— */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.9s var(--ease-expo), transform 0.9s var(--ease-expo);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.12s; }
.reveal-delay-2 { transition-delay: 0.22s; }
.reveal-delay-3 { transition-delay: 0.32s; }

/* ——— Layout container (other pages) ——— */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ——— Labels ——— */
.label {
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
}

h1, h2, h3 {
  font-family: Georgia, serif;
  font-weight: normal;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

em { font-style: italic; }

/* ——— Old footer (about + case study pages) ——— */
footer:not(.home-footer) { border-top: 1px solid #eee; padding: 40px 0; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-name {
  font-family: Georgia, serif;
  font-size: 15px;
  color: #666;
}
.footer-links { display: flex; gap: 28px; }

.footer-links a {
  font-size: 13px;
  color: #666;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: #111; }
.footer-copy { font-size: 12px; color: #999; }

/* ——— About Page ——— */
.about-hero {
  padding-top: 160px;
  padding-bottom: var(--space-2xl);
}
.about-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.03em;
  max-width: 760px;
  margin: 20px 0 32px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 96px;
  padding: var(--space-2xl) 0;
  border-top: 1px solid #eee;
}

.about-section-title {
  font-size: 11px;
  font-weight: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 24px;
}

.about-bio {
  font-size: clamp(15px, 1.4vw, 17px);
  color: #666;
  line-height: 1.85;
}
.about-bio p + p { margin-top: 20px; }

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

.skill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  color: #666;
}
.skill-item:first-child { border-top: 1px solid #eee; }

.skill-category {
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #999;
}

.tools-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.tool-pill {
  font-size: 13px;
  color: #666;
  padding: 7px 14px;
  border: 1px solid #eee;
  border-radius: 100px;
  background: #f5f5f5;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.tool-pill:hover {
  background: #111;
  color: #fff;
  border-color: #111;
  text-decoration: none;
}

/* ——— Case Study Hero ——— */
.cs-hero {
  padding-top: 140px;
  padding-bottom: var(--space-xl);
}

.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #999;
  text-decoration: none;
  margin-bottom: 48px;
  transition: color 0.2s ease, gap 0.3s var(--ease-expo);
}
.cs-back:hover { color: #111; gap: 4px; text-decoration: none; }
.cs-back svg { transition: transform 0.3s var(--ease-expo); }
.cs-back:hover svg { transform: translateX(-3px); }

.cs-eyebrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }

.cs-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.03em;
  max-width: 820px;
  margin-bottom: 28px;
}

.cs-subtitle {
  font-size: clamp(16px, 1.5vw, 19px);
  color: #666;
  max-width: 520px;
  line-height: 1.72;
}

.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #eee;
  border: 1px solid #eee;
  border-radius: var(--r-md);
  overflow: hidden;
  margin: var(--space-xl) 0;
}
.cs-meta-item { background: #fff; padding: 22px 26px; }
.cs-meta-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 6px;
}
.cs-meta-value { font-size: 14px; color: #111; font-weight: normal; }

.cs-feature-visual {
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 16/7;
  margin-bottom: var(--space-3xl);
}

/* ——— Case Study Content ——— */
.cs-content { max-width: 780px; margin: 0 auto; }

.cs-section {
  padding: var(--space-xl) 0;
  border-top: 1px solid #eee;
}
.cs-section-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 28px;
}
.cs-section h2 {
  font-size: clamp(26px, 2.8vw, 38px);
  letter-spacing: -0.025em;
  margin-bottom: 22px;
}
.cs-section h3 {
  font-size: clamp(18px, 1.8vw, 24px);
  letter-spacing: -0.02em;
  margin: 40px 0 14px;
}
.cs-section p {
  font-size: 16px;
  color: #666;
  line-height: 1.85;
  margin-bottom: 18px;
}

.callout {
  background: #f5f5f5;
  border-left: 2px solid #111;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 22px 26px;
  margin: 28px 0;
}
.callout p {
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  color: #111;
  margin: 0;
}

blockquote {
  border-left: 2px solid #eee;
  padding-left: 22px;
  margin: 26px 0;
}
blockquote p {
  font-style: italic;
  font-size: 16px;
  color: #666;
  line-height: 1.75;
  margin: 0;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: #eee;
  border: 1px solid #eee;
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 36px 0;
}
.stat-item { background: #fff; padding: 28px 24px; }
.stat-number {
  font-family: Georgia, serif;
  font-size: clamp(30px, 3.5vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label { font-size: 13px; color: #666; line-height: 1.5; }

.findings-list { list-style: none; margin: 22px 0; }
.finding-item {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid #eee;
}
.finding-item:first-child { border-top: 1px solid #eee; }

.finding-number {
  font-family: Georgia, serif;
  font-size: 20px;
  color: #999;
  min-width: 28px;
  padding-top: 2px;
}
.finding-text { font-size: 15px; color: #666; line-height: 1.72; }
.finding-text strong { color: #111; font-weight: normal; font-style: italic; }

.img-placeholder {
  background: #f5f5f5;
  border-radius: var(--r-md);
  aspect-ratio: 16/9;
  margin: 28px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #eee;
}
.img-placeholder-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

figcaption {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin-top: -16px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.ab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 28px 0;
}
.ab-card {
  border: 1px solid #eee;
  border-radius: var(--r-md);
  overflow: hidden;
}
.ab-card-visual { aspect-ratio: 4/3; }
.ab-card-info { padding: 18px 20px; }
.ab-card-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 8px;
}
.ab-card-result {
  font-family: Georgia, serif;
  font-size: 26px;
  color: #111;
  margin-bottom: 8px;
}
.ab-card-result.success { color: var(--green); }
.ab-card-desc { font-size: 13px; color: #666; line-height: 1.6; }

/* ——— Case study tags (reused across pages) ——— */
.case-tag {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #999;
  padding: 4px 10px;
  border: 1px solid #eee;
  border-radius: 100px;
  text-decoration: none;
}

/* ——— Next Case Study ——— */
.next-case { padding: var(--space-2xl) 0; border-top: 1px solid #eee; }
.next-case-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 20px;
}

.next-case-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: #111;
  padding: 40px;
  border: 1px solid #eee;
  border-radius: var(--r-xl);
  background: #f5f5f5;
  transition: background 0.3s ease, transform 0.35s var(--ease-expo);
  gap: 24px;
}
.next-case-link:hover {
  background: #efefef;
  transform: translateY(-4px);
  text-decoration: none;
}
.next-case-link h3 {
  font-size: clamp(20px, 2.2vw, 30px);
  letter-spacing: -0.02em;
}

.next-case-arrow {
  width: 48px; height: 48px;
  border: 1px solid #eee;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.35s var(--ease-expo);
}
.next-case-link:hover .next-case-arrow {
  background: #111;
  border-color: #111;
  transform: rotate(45deg);
}
.next-case-link:hover .next-case-arrow svg { stroke: #fff; }

/* ——— Section header (case study pages) ——— */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 32px;
  border-bottom: 1px solid #eee;
}

/* ——— Responsive ——— */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 56px; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .work-row {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }
  .work-row-desc { text-align: left; white-space: normal; }
}

@media (max-width: 600px) {
  .home-main { padding-top: 100px; }
}

@media (max-width: 768px) {
  .container { padding: 0 24px; }
  nav { padding: 16px 20px; }
  .nav-links { gap: 20px; }
  .cs-feature-visual { aspect-ratio: 4/3; border-radius: var(--r-lg); }
  footer:not(.home-footer) .footer-inner { flex-direction: column; align-items: flex-start; }
  .next-case-link { padding: 28px; }
}

@media (max-width: 560px) {
  .ab-grid { grid-template-columns: 1fr; }
  .cs-meta { grid-template-columns: 1fr 1fr; }
}

::selection {
  background: rgba(42, 181, 181, 0.3);
  color: #111;
}