/* ============================================================
   Kelly Zhang — Portfolio
   Typeface: Instrument Sans
   ============================================================ */

:root {
  --ink: #111111;
  --body: #3f3f3f;
  --muted: #6f6f6f;
  --faint: #9a9a9a;
  --hairline: #e4e4e4;
  --paper: #ffffff;
  --wash: #fafafa;
  --accent-purple: #8a5a83;
  --accent-blue: #33719f;
  --accent-olive: #8f8426;
  --fedex-purple: #4d148c;
  --fedex-orange: #e07b1f;
  --max: 1120px;
  --col: 700px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: #111; color: #fff; }

img, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.nav.scrolled {
  border-bottom-color: var(--hairline);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav-logo span { color: var(--faint); font-weight: 400; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}
.nav-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding: 6px 0;
  transition: color 0.25s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--ink); }

/* Dropdown */
.nav-item { position: relative; }
.nav-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translate(-50%, 8px);
  min-width: 320px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.10);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.nav-dropdown a {
  display: block;
  padding: 12px 14px;
  border-radius: 9px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.2s var(--ease);
}
.nav-dropdown a small {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.45;
}
.nav-dropdown a:hover { background: var(--wash); }
.nav-dropdown a::after { display: none; }
.nav-caret { font-size: 16px; margin-left: 6px; vertical-align: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 40px; height: 40px;
  position: relative;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  margin: 5px auto;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--hairline);
    padding: 18px 32px 26px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-links a { font-size: 14px; padding: 10px 0; }
  .nav-item { width: 100%; }
  .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 14px;
    min-width: 0;
  }
}

/* ---------- Layout primitives ---------- */

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

.page { padding-top: 68px; }

section { margin-bottom: 120px; }

.label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.label .emoji { letter-spacing: 0; }

h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
}
h1 .thin, h2 .thin { font-weight: 400; color: #2b2b2b; }

h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin-bottom: 26px;
}

h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 16px; }

p { color: var(--body); margin-bottom: 18px; max-width: var(--col); }
p:last-child { margin-bottom: 0; }

.statement {
  font-size: clamp(23px, 2.9vw, 30px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: #232323;
  max-width: 760px;
  margin: 34px 0;
}

.lead-bold { font-weight: 700; color: var(--ink); }

ul.tight { list-style: none; }
ul.tight li {
  position: relative;
  padding-left: 22px;
  color: var(--body);
  margin-bottom: 8px;
}
ul.tight li::before {
  content: "";
  position: absolute;
  left: 2px; top: 12px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.hr { border: 0; border-top: 1px solid var(--hairline); margin: 0; }

/* ---------- Hero ---------- */

.hero { padding: 130px 0 40px; margin-bottom: 48px; position: relative; overflow: hidden; }
.hero .label { margin-bottom: 22px; }

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: -1;
}
.glow-a { width: 560px; height: 560px; top: -220px; right: -120px; background: radial-gradient(circle, rgba(186, 214, 245, 0.55), transparent 65%); }
.glow-b { width: 480px; height: 480px; top: 240px; left: -200px; background: radial-gradient(circle, rgba(247, 225, 170, 0.4), transparent 65%); }

/* Per-page hero glow themes */
.theme-purple .glow-a { background: radial-gradient(circle, rgba(211, 186, 245, 0.6), transparent 65%); }
.theme-purple .glow-b { background: radial-gradient(circle, rgba(233, 215, 252, 0.5), transparent 65%); }
.theme-mint .glow-a { background: radial-gradient(circle, rgba(171, 230, 201, 0.55), transparent 65%); }
.theme-mint .glow-b { background: radial-gradient(circle, rgba(206, 242, 224, 0.45), transparent 65%); }

/* Problem / Approach / Solution rows */
.pas { margin: 64px 0 30px; }
.pas-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 560px);
  gap: 24px;
  padding: 30px 0;
  border-top: 1px solid var(--hairline);
}
.pas-row:last-child { border-bottom: 1px solid var(--hairline); }
.pas-row dt { font-weight: 700; font-size: 16px; }
.pas-row dd { color: var(--body); }

/* ---------- Figures ---------- */

figure { margin: 44px 0; }
figure.flush { margin-left: 0; margin-right: 0; }
figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--faint);
}
.figure-card img,
.figure-band img { width: 100%; }

.browser {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(17, 24, 39, 0.10);
  background: #fff;
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  background: #f6f6f6;
  border-bottom: 1px solid var(--hairline);
}
.browser-bar i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #d8d8d8;
  display: block;
}
.browser video, .browser img { width: 100%; border-radius: 0; }

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}
.duo-wide { grid-template-columns: 1.9fr 1fr; align-items: start; }

/* User ID page pair: right asset matches left asset's rendered height */
@media (min-width: 901px) {
  .userid { align-items: stretch; }
  .userid figure { display: flex; flex-direction: column; }
  .userid figure img { width: 100%; }
  .userid figure:last-child img {
    flex: 1 1 0;
    min-height: 0;
    object-fit: contain;
    object-position: left top;
  }
}

/* ---------- Tables ---------- */

table.spec {
  width: 100%;
  border-collapse: collapse;
  margin: 40px 0 10px;
  font-size: 15px;
}
table.spec th {
  text-align: left;
  font-weight: 700;
  color: var(--ink);
  padding: 14px 18px 14px 0;
  vertical-align: top;
}
table.spec td {
  padding: 18px 18px 18px 0;
  border-top: 1px solid var(--hairline);
  color: var(--body);
  vertical-align: top;
  line-height: 1.55;
}
table.spec td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
table.spec th { white-space: nowrap; }
table.spec td:nth-child(2), table.spec td:nth-child(3) { white-space: nowrap; }
table.spec ul { list-style: none; }
table.spec ul li { position: relative; padding-left: 18px; margin-bottom: 6px; }
table.spec ul li::before {
  content: "";
  position: absolute; left: 2px; top: 10px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--muted);
}

/* ---------- HMW blocks ---------- */

.hmw { margin: 54px 0; }
.hmw .for {
  font-size: 14.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.hmw blockquote {
  font-size: clamp(21px, 2.6vw, 28px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.38;
  max-width: 780px;
}
.hmw.grey blockquote { color: #8b8b8b; font-weight: 400; }

/* ---------- Stats ---------- */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px 64px;
  max-width: 860px;
  margin: 34px 0 54px;
}
.stat .num {
  font-size: clamp(44px, 5.5vw, 60px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat .name { font-weight: 700; font-size: 16px; margin: 12px 0 8px; }
.stat p { font-size: 15px; color: var(--muted); }
.stats-label {
  font-size: 12.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 40px 0 6px;
}

/* ---------- Persona / principle cards ---------- */

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 48px 0;
}
.persona {
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 26px 24px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(17, 24, 39, 0.05);
}
.persona header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.persona header img { width: 52px; height: 52px; border-radius: 50%; }
.persona header .who { font-weight: 700; font-size: 16.5px; line-height: 1.25; }
.persona header .role { font-size: 13px; color: var(--muted); margin-top: 3px; }
.persona blockquote {
  font-size: 14.5px;
  font-style: italic;
  color: var(--body);
  margin-bottom: 18px;
  line-height: 1.5;
}
.persona .ptitle { font-weight: 700; font-size: 13.5px; margin: 14px 0 6px; }
.persona ul { list-style: none; }
.persona ul li {
  position: relative;
  font-size: 13.5px;
  color: var(--body);
  padding-left: 16px;
  margin-bottom: 6px;
  line-height: 1.5;
}
.persona ul li::before {
  content: "";
  position: absolute; left: 1px; top: 8px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--muted);
}

.principles {
  background: linear-gradient(150deg, #f3faf1 0%, #f0f8f3 55%, #f4f9f6 100%);
  border-radius: 18px;
  padding: clamp(24px, 5vw, 56px);
  margin: 44px 0;
}
.principle-hero { max-width: 560px; margin-bottom: 44px; }
.principle-hero img { width: 34px; height: 34px; margin-bottom: 16px; }
.principle-hero h3 { font-size: 19px; }
.principle-hero p { font-size: 15px; }
.principle-hero .callout { font-weight: 600; color: var(--ink); margin-top: 12px; }
.principles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 56px;
}
.principles-grid img { width: 30px; height: 30px; margin-bottom: 14px; }
.principles-grid h4 { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; }
.principles-grid p { font-size: 14px; color: var(--body); }

/* UX law cards */
.law-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin: 44px 0;
  padding-bottom: 44px;
  border-bottom: 1px solid var(--hairline);
}
.law-cards img { width: 76px; height: 76px; border-radius: 10px; margin-bottom: 20px; }
.law-cards h3 { font-size: 18px; margin-bottom: 10px; }
.law-cards p { font-size: 14.5px; color: var(--muted); }

/* Checklist */
.checks { margin: 30px 0; }
.checks .check { margin-bottom: 34px; max-width: var(--col); }
.checks .check h3 { font-size: 19px; display: flex; gap: 10px; align-items: baseline; }
.checks .check h3 .tick { color: #34a853; }
.checks .check p { font-size: 15.5px; color: var(--muted); }

/* Friction list with avatars */
.friction { margin: 26px 0; }
.friction .f-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.friction .f-row img { width: 30px; height: 30px; border-radius: 50%; margin-top: 3px; flex: none; }
.friction p { margin-bottom: 0; }

/* Hypotheses */
.hypo {
  counter-reset: hypo;
  margin: 40px 0;
}
.hypo p {
  counter-increment: hypo;
  position: relative;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--body);
  padding-left: 34px;
  margin-bottom: 24px;
  max-width: 820px;
}
.hypo p::before {
  content: counter(hypo) ".";
  position: absolute;
  left: 0; top: 2px;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- Split text/image ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  margin: 44px 0;
}
.split.reverse > .split-media { order: -1; }
.split-media img { border-radius: 10px; }
.split-media .frameless { box-shadow: none; }

/* ---------- Case study footer ---------- */

.cs-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 60px 0 90px;
  margin-top: 40px;
}
.cs-footer a {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  position: relative;
  padding-bottom: 5px;
}
.cs-footer a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.cs-footer a:hover::after { transform: scaleX(1); transform-origin: left; }
.cs-footer a:hover { color: var(--muted); }

/* ---------- Home ---------- */

.home-hero { padding: 150px 0 70px; margin-bottom: 0; }
.home-hero .tldr { font-size: 15px; color: var(--ink); margin-bottom: 26px; }
.home-hero h1 { font-size: clamp(36px, 5vw, 56px); }
.home-hero .subtitle {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #2b2b2b;
  margin-top: 6px;
}
.client-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 26px;
  font-size: clamp(11px, 1.15vw, 13.5px);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin: 110px 0 0;
}
.client-row span { white-space: nowrap; }

.cs-list { border-bottom: 1px solid var(--hairline); margin-bottom: 110px; }
.cs-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 40px;
  gap: 28px;
  align-items: start;
  padding: 44px 8px;
  border-top: 1px solid var(--hairline);
  text-decoration: none;
  transition: background 0.3s var(--ease);
}
.cs-row:hover { background: var(--wash); }
.cs-row .cs-num { font-size: 16px; color: var(--ink); padding-top: 4px; }
.cs-row .cs-title {
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: #232323;
  max-width: 620px;
}
.cs-row .cs-title strong { font-weight: 700; color: var(--ink); }
.cs-row .arrow {
  font-size: 22px;
  color: var(--faint);
  transform: translateX(-6px);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease), color 0.35s;
  padding-top: 4px;
}
.cs-row:hover .arrow { transform: translateX(0); opacity: 1; color: var(--ink); }

.home-footer {
  padding: 0 0 70px;
  color: var(--faint);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 32px;
}

/* ---------- Animations ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-img {
  opacity: 0;
  transform: translateY(34px) scale(0.985);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
.reveal-img.in { opacity: 1; transform: translateY(0) scale(1); }

@keyframes heroUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero [data-hero], .home-hero [data-hero] {
  opacity: 0;
  animation: heroUp 0.9s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-img, .hero [data-hero], .home-hero [data-hero] { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .client-row { overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .client-row::-webkit-scrollbar { display: none; }
  .cards-3, .law-cards { grid-template-columns: 1fr; gap: 18px; }
  .principles-grid, .stats, .duo, .duo-wide, .split { grid-template-columns: 1fr; }
  .split.reverse > .split-media { order: 0; }
  section { margin-bottom: 84px; }
  .pas-row { grid-template-columns: 1fr; gap: 8px; padding: 22px 0; }
  .cs-row { grid-template-columns: 1fr 32px; }
  .cs-row .cs-num { grid-column: 1 / -1; padding: 0; }
  .home-footer { flex-direction: column; gap: 8px; }
  .wrap { padding-left: 22px; padding-right: 22px; }
  table.spec { font-size: 14px; }
  table.spec td:first-child { white-space: normal; }
}
