/* ==========================================================
   Wendy Yu — portfolio styles
   Change the look here: colors, fonts, and timing live in :root
   ========================================================== */

:root {
  /* Palette: mostly white, with two accents.
     To try a different second accent, change the --blush values. */
  --matcha: #3F5A2E;        /* accent 1: dark matcha green */
  --matcha-soft: #E8EFDF;   /* light matcha, for tiles and cards */
  --blush: #E39AA6;         /* accent 2: blush pink (doodles, details) */
  --blush-soft: #FBE9EB;    /* light blush, for tiles and cards */

  --bg: #FFFFFF;
  --landing: #FFF8F8;       /* barely-there blush so the work sheet still slides over it */
  --sheet: #FFFFFF;
  --card-a: var(--blush-soft);
  --card-b: var(--matcha-soft);
  --ink: #1F231C;           /* near-black with a hint of green */
  --ink-soft: #474C42;
  --ink-muted: #6A6F64;
  --line: #ECE7E4;

  /* Type */
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-hand: 'Caveat', cursive;

  /* Layout */
  --nav-h: 72px;
  --max: 1080px;
  --cards-max: 1360px;   /* how wide the project grid can get */
  --radius-sheet: 40px;
  --radius-card: 28px;

  /* Reel line height — keep in sync with script.js (it reads this) */
  --reel-h: 84px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
a:hover { color: var(--matcha); }
img { max-width: 100%; display: block; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: var(--nav-h);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.nav__name { font-weight: 700; font-size: 18px; text-decoration: none; }
.nav__links { display: flex; gap: 32px; font-size: 15px; }
.nav__links a { padding: 12px 0; text-decoration: none; }
.nav__links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--matcha); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---------- Landing ---------- */
.landing {
  position: sticky; top: var(--nav-h); z-index: 1;
  min-height: calc(100vh - var(--nav-h));
  background: var(--landing);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 24px 120px;
}
.landing__inner {
  width: 100%; max-width: 900px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.landing__lead {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15; font-weight: 700; letter-spacing: -0.01em;
}

/* Reel (slot machine) */
.reel-wrap {
  position: relative; width: 100%; max-width: 820px;
  padding: 28px 0;
  color: var(--ink);
}
.reel-window {
  height: var(--reel-h);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 22%, #000 78%, transparent 100%);
}
.reel {
  list-style: none; margin: 0; padding: 0;
  transition: transform 0.7s cubic-bezier(0.34, 1.45, 0.64, 1);
}
.reel li {
  height: var(--reel-h);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hand);
  font-size: clamp(34px, 5vw, 54px);
  white-space: nowrap;
}
.reel li img { max-width: 92%; height: auto; }

/* Doodles */
.doodle { position: absolute; color: var(--matcha); }
.doodle.d2, .doodle.d3, .doodle.d6 { color: var(--blush); }
.d1 { width: 30px; left: 24px; top: 0; }
.d2 { width: 14px; left: 62px; top: 34px; }
.d3 { width: 26px; right: 30px; bottom: 2px; rotate: -12deg; }
.d4 { width: 12px; right: 70px; top: 6px; }
.d5 { width: 18px; right: 8px; top: 22px; }
.d6 { width: 16px; left: 4px; bottom: 10px; }

@keyframes twinkle {
  0%, 100% { opacity: 1; scale: 1; }
  50% { opacity: 0.45; scale: 0.82; }
}
.twinkle { animation: twinkle 2.8s ease-in-out infinite; }
.twinkle.t2 { animation-delay: -0.9s; }
.twinkle.t3 { animation-delay: -1.8s; }

/* ---------- Work sheet ---------- */
.sheet {
  position: relative; z-index: 2;
  background: var(--sheet);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.06);
  padding: 16px clamp(12px, 2.5vw, 40px) 40px;
  margin-top: -64px; /* peeks up over the landing as a "pull up" hint */
}
.sheet__handle {
  width: 48px; height: 5px; border-radius: 3px;
  background: var(--blush); margin: 0 auto 20px;
}
.cards {
  max-width: var(--cards-max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px;
}
.card {
  border-radius: var(--radius-card);
  padding: 24px 24px 28px;
  display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: var(--ink);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card--a { background: var(--matcha-soft); } /* all project cards are light matcha */
.card--b { background: var(--card-b); }
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  color: var(--ink);
}
.card__cover {
  aspect-ratio: 16 / 10; border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  overflow: hidden; margin-bottom: 12px;
}
.card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card__cover img, .card:focus-within .card__cover img { transform: scale(1.03); }
/* Hover arrow: a plain white arrow with a soft shadow, top-right of the cover */
.card { position: relative; }
.card::after {
  content: "";
  position: absolute; top: 32px; right: 34px; z-index: 1;
  width: 22px; height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 18 18 6M8 6h10v10'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  opacity: 0; transform: translate(-6px, 6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.card:hover::after, .card:focus-within::after { opacity: 1; transform: none; }
.card__title { margin: 0; font-size: 24px; font-weight: 700; }
.card__line { margin: 0; font-size: 15px; color: var(--ink-soft); }
.card__main { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); }
.card__main:hover { color: var(--ink); }
.card__main::before { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* makes the whole card clickable */
.card__main:focus-visible { outline: none; }
.card:has(.card__main:focus-visible) { outline: 2px solid var(--ink); outline-offset: 3px; }
.card__line { line-height: 1.55; }
.card__stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.card__stat {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  background: #FFFFFF;
  font-size: 13px; color: var(--ink-soft);
}
.card__stat strong { font-size: 15px; font-weight: 700; color: var(--matcha); }
.card__links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; } /* pinned to the bottom so buttons line up across a row */
.card__links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  background: #FFFFFF; color: var(--ink); text-decoration: none;
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--line);
  transition: background 0.2s ease;
}
.card__links a::after { content: "\2197"; font-size: 12px; font-variant-emoji: text; }
.card__links a:hover { background: var(--matcha); color: #FFFFFF; border-color: var(--matcha); }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 2;
  background: var(--sheet);
  border-top: 1px solid var(--line);
}
.footer__inner {
  max-width: 1200px; margin: 0 auto; padding: 24px 24px 32px;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap; font-size: 15px;
}
.footer__contacts { display: flex; flex-direction: column; gap: 6px; }
.footer__label { margin: 0; font-weight: 700; color: var(--matcha); }
.footer__note { margin: 0; font-size: 14px; color: var(--ink-muted); }

/* ---------- Inner pages (about + case studies) ---------- */
.page {
  max-width: 760px; margin: 0 auto; padding: 72px 24px 96px;
}
.page__eyebrow { margin: 0 0 12px; font-size: 14px; color: var(--ink-muted); }
.page h1 { margin: 0 0 16px; font-size: clamp(36px, 5vw, 52px); line-height: 1.1; }
.page h2 { margin: 56px 0 12px; font-size: 24px; }
.page p, .page li { font-size: 18px; line-height: 1.7; color: var(--ink-soft); }
.page__meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
  margin: 32px 0; padding: 20px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.page__meta dt { font-size: 13px; color: var(--ink-muted); margin-bottom: 4px; }
.page__meta dd { margin: 0; font-size: 16px; }
.figure {
  margin: 32px 0; border-radius: 20px; background: var(--card-a);
  aspect-ratio: 16 / 10; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-muted); font-size: 14px;
}
.figure img { width: 100%; height: 100%; object-fit: cover; }
.back { display: inline-block; margin-bottom: 32px; font-size: 15px; }
.button {
  display: inline-block; padding: 14px 22px; border-radius: 999px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 500;
}
.button:hover { color: #fff; background: #000; }

/* About page: photo beside the intro on desktop, stacked on phones */
.page:has(.about-intro) { max-width: 1000px; }
.about-intro {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 56px; align-items: center;
}
.about-photo {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 32px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.10);
}
.about-text h1 { margin-bottom: 20px; }

/* Hobbies: tilted sticker tiles with hand-drawn icons */
.hobbies { position: relative; margin-top: 72px; }
.hobbies h2 { margin: 0 0 28px; }
.hobbies__doodle { position: absolute; width: 22px; color: var(--matcha); top: -6px; left: 210px; }
.hobbies__doodle--b { width: 14px; color: var(--blush); top: 18px; left: 240px; }
.hobbies__list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px;
}
.hobby {
  background: var(--card-a);
  border-radius: 24px;
  padding: 26px 14px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  text-align: center;
  rotate: var(--tilt, 0deg);
  transition: rotate 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: default;
}
.hobby:nth-child(1) { --tilt: -3deg; }
.hobby:nth-child(2) { --tilt: 2deg; transform: translateY(10px); }
.hobby:nth-child(3) { --tilt: -1.5deg; }
.hobby:nth-child(4) { --tilt: 3deg; transform: translateY(8px); }
.hobby:nth-child(5) { --tilt: -2deg; }
.hobby:nth-child(even) { background: var(--matcha-soft); }
.hobby:hover {
  background: var(--matcha);
  rotate: 0deg; transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}
.hobby__icon { width: 56px; height: 56px; color: var(--matcha); transition: color 0.3s ease; }
.hobby__fill { fill: var(--card-a); transition: fill 0.3s ease; }
.hobby:nth-child(even) .hobby__fill { fill: var(--matcha-soft); }
.hobby:hover .hobby__fill { fill: var(--matcha); }
.hobby:hover .hobby__icon, .hobby:hover .hobby__label { color: #FFFFFF; }
.hobby:hover .hobby__icon { animation: hobby-wiggle 0.6s ease; }
.hobby__label { font-size: 16px; font-weight: 500; line-height: 1.3; color: var(--ink); transition: color 0.3s ease; }
@keyframes hobby-wiggle {
  0%, 100% { rotate: 0deg; }
  25% { rotate: -10deg; }
  50% { rotate: 8deg; }
  75% { rotate: -4deg; }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; gap: 20px; }
  .nav__links { gap: 18px; }
  .reel li { white-space: normal; line-height: 1; }
  .doodle { display: none; }
  .doodle.d1, .doodle.d3 { display: block; }
  .page__meta { grid-template-columns: 1fr; }
  .about-intro { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { max-width: 360px; border-radius: 24px; }
  .hobbies__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .hobby:nth-child(n) { transform: none; }
}

/* Respect people who turn off motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reel { transition: none; }
  .twinkle { animation: none; }
  .card, .card__cover img, .card::after { transition: none; }
  .hobby { transition: none; }
  .hobby:hover .hobby__icon { animation: none; }
}
