/* ============================================
   Jackie Pan · Portfolio
   Apple-inspired design system
   ============================================ */

:root {
  /* Apple system palette */
  --bg:         #ffffff;   /* page background */
  --bg-alt:     #f5f5f7;   /* signature light gray section */
  --bg-dark:    #000000;   /* dramatic dark sections */
  --card:       #ffffff;   /* raised surfaces */
  --card-alt:   #fbfbfd;   /* faint off-white */

  --ink:        #1d1d1f;   /* near-black text */
  --ink-soft:   #6e6e73;   /* secondary text */
  --ink-faint:  #86868b;   /* tertiary / labels */
  --on-dark:    #f5f5f7;   /* text on dark */
  --on-dark-soft:#a1a1a6;

  --line:       #d2d2d7;   /* hairline */
  --line-soft:  #e8e8ed;

  --accent:     #0071e3;   /* Apple blue */
  --accent-hi:  #0077ed;   /* hover */
  --link:       #06c;      /* link blue */
  --accent-tint:#f0f6ff;   /* faint blue wash */

  --radius:     22px;
  --radius-lg:  28px;
  --radius-sm:  14px;
  --max:        1024px;
  --max-text:   720px;

  /* San Francisco on Apple devices, Inter elsewhere */
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans:    "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;

  font-size: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }

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

/* Shared eyebrow / kicker */
.kicker {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--accent);
  display: inline-block;
}

/* ============================================
   Header / nav: translucent, Apple chrome
   ============================================ */
header.site {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px;
}
.logo {
  font-family: var(--display);
  font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--ink);
}
.logo span { color: var(--accent); }

nav.main {
  display: flex; gap: 4px; align-items: center;
}
nav.main a {
  font-size: 0.82rem; color: var(--ink-soft); font-weight: 400;
  padding: 7px 14px; border-radius: 980px; transition: color 0.2s ease, background 0.2s ease;
}
nav.main a:hover { color: var(--ink); }
nav.main a.active { color: var(--ink); font-weight: 500; }

/* ============================================
   Buttons / pills: Apple style
   ============================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 24px; border-radius: 980px;
  font-size: 0.98rem; font-weight: 400; line-height: 1;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hi); transform: scale(1.02); }
.btn.ghost {
  background: transparent; color: var(--link);
  padding: 12px 8px; border-radius: 8px;
}
.btn.ghost:hover { color: var(--accent-hi); }
.btn.ghost .arrow { transition: transform 0.22s ease; }
.btn.ghost:hover .arrow { transform: translateX(3px); }
.btn.primary .arrow { transition: transform 0.22s ease; }
.btn.primary:hover .arrow { transform: translateX(3px); }

/* Inline chevron link */
.chev::after { content: " ›"; }

/* ============================================
   Hero: centered, monumental type
   ============================================ */
.hero { padding: 96px 0 72px; text-align: center; }
.hero .kicker { margin-bottom: 18px; }
.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1.04; letter-spacing: -0.025em; font-weight: 600;
  max-width: 18ch; margin: 0 auto;
}
.hero h1 em {
  font-style: normal; color: var(--ink-faint); font-weight: 600;
}
.hero p.lede {
  margin: 26px auto 0; font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--ink-soft); max-width: 60ch; line-height: 1.45; font-weight: 400;
}
.hero .cta-row {
  margin-top: 34px; display: flex; gap: 22px; flex-wrap: wrap;
  justify-content: center; align-items: center;
}

/* ============================================
   Section scaffolding
   ============================================ */
section { padding: 96px 0; }
#work { background: var(--bg-alt); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; flex-wrap: wrap;
  margin-bottom: 48px;
}
.section-head .lead { max-width: 44ch; }
.section-head .kicker { margin-bottom: 12px; }
.section-head h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4.4vw, 3.2rem); letter-spacing: -0.025em;
  font-weight: 600; line-height: 1.06;
}
.section-head p { color: var(--ink-soft); margin-top: 12px; max-width: 50ch; font-size: 1.05rem; }

/* Decorative tab pills (filter row) */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs .tab {
  font-size: 0.82rem; font-weight: 500; color: var(--ink-soft);
  padding: 8px 16px; border-radius: 980px;
  background: #fff; border: 1px solid var(--line);
}
.tabs .tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ============================================
   Work: large soft tiles
   ============================================ */
.work-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.work-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 4px 24px -12px rgba(0,0,0,0.12);
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94), box-shadow 0.4s ease;
}
.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -28px rgba(0,0,0,0.32);
}
.work-card .thumb {
  position: relative;
  aspect-ratio: 16 / 10; overflow: hidden;
  background: linear-gradient(160deg, #fbfbfd 0%, #eef0f4 100%);
}
.work-card .thumb img, .work-card .thumb svg {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.work-card:hover .thumb img, .work-card:hover .thumb svg { transform: scale(1.04); }
.work-card .index {
  position: absolute; top: 16px; left: 18px; z-index: 2;
  font-family: var(--display); font-size: 0.85rem; font-weight: 600;
  color: var(--ink);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  width: 36px; height: 36px; border-radius: 980px;
  display: grid; place-items: center;
}
.work-card .meta { padding: 28px 30px 32px; display: flex; flex-direction: column; flex: 1; }
.work-card .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tag {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent); background: var(--accent-tint);
  padding: 5px 11px; border-radius: 980px;
}
.tag.alt { color: var(--ink-soft); background: var(--bg-alt); }
.work-card h3 {
  font-family: var(--display);
  font-size: 1.5rem; letter-spacing: -0.02em; line-height: 1.14; font-weight: 600;
}
.work-card p { font-size: 0.98rem; color: var(--ink-soft); margin-top: 10px; line-height: 1.5; }
.work-card .result {
  margin-top: auto; padding-top: 20px;
  font-size: 0.9rem; font-weight: 500; color: var(--link);
  display: flex; align-items: center; gap: 6px;
}
.work-card .result::after { content: "›"; font-weight: 600; transition: transform 0.22s ease; }
.work-card:hover .result::after { transform: translateX(4px); }

/* ============================================
   About
   ============================================ */
.about-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 72px; align-items: start;
}
.about-grid .kicker { margin-bottom: 14px; }
.about-grid h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 2.8rem); margin-bottom: 24px;
  letter-spacing: -0.025em; font-weight: 600; line-height: 1.1;
}
.about-grid p { color: var(--ink-soft); margin-bottom: 16px; font-size: 1.08rem; line-height: 1.55; }
.about-grid p strong { color: var(--ink); font-weight: 600; }

.facts {
  background: var(--bg-alt);
  border-radius: var(--radius); padding: 34px;
}
.facts h3 {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-faint); margin-bottom: 18px; font-weight: 600;
}
.facts ul { list-style: none; }
.facts li {
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 0.93rem; display: flex; justify-content: space-between; gap: 14px;
}
.facts li:last-child { border-bottom: none; }
.facts li span { color: var(--ink-faint); white-space: nowrap; }

/* ============================================
   Footer
   ============================================ */
footer.site {
  background: var(--bg-alt);
  padding: 56px 0 64px;
  border-top: 1px solid var(--line-soft);
}
footer.site .wrap {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 28px;
}
footer.site .logo { font-size: 1.3rem; margin-bottom: 8px; }
footer.site small { color: var(--ink-faint); font-size: 0.82rem; }
footer.site .links { display: flex; gap: 28px; font-size: 0.88rem; color: var(--ink-soft); }
footer.site .links a { transition: color 0.2s ease; }
footer.site .links a:hover { color: var(--accent); }

/* ============================================
   Case study pages
   ============================================ */
.case-hero { padding: 88px 0 56px; text-align: center; }
.case-hero .crumb { font-size: 0.88rem; color: var(--link); margin-bottom: 30px; }
.case-hero .crumb a:hover { color: var(--accent-hi); }
.case-hero h1 {
  font-family: var(--display);
  font-size: clamp(2.3rem, 5.4vw, 4rem); line-height: 1.06;
  letter-spacing: -0.025em; font-weight: 600; max-width: 20ch; margin: 0 auto;
}
.case-hero p.sub {
  margin: 26px auto 0; font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--ink-soft); max-width: 60ch; line-height: 1.45;
}

.case-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
  margin: 56px auto 0; max-width: 920px;
  padding-top: 36px; border-top: 1px solid var(--line);
  text-align: left;
}
.case-meta h4 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-faint); margin-bottom: 8px; font-weight: 600;
}
.case-meta p { font-size: 0.98rem; font-weight: 500; }

.case-body { padding: 64px 0 24px; }
.case-body .prose { max-width: var(--max-text); margin: 0 auto; }
.case-body h2 {
  font-family: var(--display);
  font-size: 1.9rem; letter-spacing: -0.02em; margin: 64px 0 20px;
  font-weight: 600; line-height: 1.12;
}
.case-body h2:first-child { margin-top: 0; }
.case-body p { color: var(--ink-soft); margin-bottom: 18px; font-size: 1.08rem; line-height: 1.6; }
.case-body ul { color: var(--ink-soft); margin: 0 0 18px 22px; }
.case-body li { margin-bottom: 12px; font-size: 1.08rem; line-height: 1.55; }
.case-body strong { color: var(--ink); font-weight: 600; }

.figure { margin: 56px auto; max-width: 920px; }
.figure .frame {
  background: var(--bg-alt);
  border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 48px);
  overflow: hidden;
}
.figure.flush .frame { padding: 0; }
.figure img, .figure svg { width: 100%; height: auto; border-radius: 12px; }
.figure.flush img, .figure.flush svg { border-radius: var(--radius-lg); }
.figure figcaption {
  margin-top: 18px; font-size: 0.88rem; color: var(--ink-faint); text-align: center;
  max-width: 60ch; margin-left: auto; margin-right: auto;
}

.callout {
  background: var(--accent-tint);
  border-radius: 18px; padding: 26px 30px; margin: 36px auto;
  font-size: 1.05rem; color: var(--ink); max-width: var(--max-text);
  line-height: 1.5;
}
.callout strong { color: var(--ink); }

.impact-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin: 40px auto 8px; max-width: 920px;
}
.impact-grid .impact {
  background: var(--bg-alt); padding: 34px 30px; border-radius: var(--radius);
  text-align: center;
}
.impact strong {
  display: block; font-family: var(--display);
  font-size: 2.6rem; line-height: 1; letter-spacing: -0.03em;
  color: var(--ink); font-weight: 600;
}
.impact span { display: block; margin-top: 12px; font-size: 0.92rem; color: var(--ink-soft); line-height: 1.4; }

.note-confidential {
  font-size: 0.85rem; color: var(--ink-faint);
  margin: 44px auto 0; max-width: var(--max-text); line-height: 1.5;
}

/* Prev / next pager */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  padding: 56px 0 16px; margin: 64px auto 0; max-width: 920px;
  border-top: 1px solid var(--line);
}
.pager a {
  background: var(--bg-alt); border-radius: var(--radius);
  padding: 26px 30px; transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pager a:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -24px rgba(0,0,0,0.3); }
.pager a.next { text-align: right; }
.pager .dir { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
.pager .title { font-family: var(--display); font-weight: 600; margin-top: 8px; font-size: 1.1rem; letter-spacing: -0.01em; }

/* ============================================
   Scroll reveal
   ============================================ */
.js-reveal .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.25,0.46,0.45,0.94), transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94); }
.js-reveal .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .work-grid { grid-template-columns: 1fr; gap: 20px; }
  .pager { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 44px; }
  .case-meta { grid-template-columns: repeat(2, 1fr); }
  .impact-grid { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 22px; }
  header.site .wrap { height: 48px; }
  nav.main a { padding: 6px 10px; font-size: 0.78rem; }
  .hero { padding: 64px 0 52px; }
  section { padding: 64px 0; }
  footer.site .wrap { flex-direction: column; align-items: flex-start; }
}
