/* ============================================================
   Taaffy Xu — Portfolio
   French romantic editorial — cream · dusty rose · Cormorant
   inspired by the warmth of mylittleparis.com
   ============================================================ */

:root {
  --paper: #faf5ef;       /* warm ivory */
  --paper-2: #f1e8dc;     /* deeper cream for image plates */
  --ink: #3a322c;         /* warm charcoal, never pure black */
  --ink-soft: #6b5f54;
  --muted: #9c8d7e;
  --line: #e7dccd;        /* warm hairline */
  --accent: #b06a66;      /* dusty rose — the signature */
  --accent-soft: #d9a7a3;
  --gold: #bd9b6a;        /* delicate detail tone */
  --max: 1320px;
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --script: "Parisienne", "Cormorant Garamond", cursive;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

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

/* small editorial label */
.label {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(250, 245, 239, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: 0.03em;
  font-weight: 600;
}
.brand em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}
.nav-links {
  display: flex;
  gap: 34px;
  align-items: center;
}
.nav-links a {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  padding: 92px 0 60px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 48px;
  align-items: end;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.6rem, 13vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  margin: 16px 0 0;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero-script {
  font-family: var(--script);
  font-size: clamp(2rem, 5vw, 3.6rem);
  color: var(--accent);
  margin-top: 10px;
  line-height: 1;
}
.hero-side {
  padding-bottom: 14px;
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.hero-side p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 14px 0 0;
  max-width: 30ch;
}
.hero-side .avail {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.hero-side .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.hero-rule {
  margin-top: 56px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Section heads ---------- */
.section { padding: 96px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 8px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0;
  line-height: 1;
}
.section-head .count {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Editorial index list ---------- */
.index-list { position: relative; }
.index-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 26px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
  color: var(--ink);
  transition: padding-left 0.4s cubic-bezier(0.2,0.8,0.2,1);
}
.index-row:last-child { border-bottom: 1px solid var(--line); }
.index-row .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--accent);
  transition: color 0.3s;
}
.index-row .title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 4.4vw, 3.1rem);
  line-height: 1;
  transition: transform 0.45s cubic-bezier(0.2,0.8,0.2,1), color 0.3s;
}
.index-row .meta {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.index-row:hover {
  padding-left: 14px;
}
.index-row:hover .title {
  font-style: italic;
  transform: translateX(10px);
  color: var(--accent);
}
.index-row:hover .num { color: var(--ink); }

/* floating hover preview */
.float-img {
  position: fixed;
  width: 260px; height: 330px;
  object-fit: cover;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.94);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 80;
  box-shadow: 0 24px 70px rgba(58, 50, 44, 0.22);
}
.float-img.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- Catalogue groups (home) ---------- */
.cat-group { margin-top: 60px; }
.cat-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 6px;
}
.cat-head .cat-num {
  font-family: var(--script);
  font-size: 1.7rem;
  color: var(--accent);
  line-height: 1;
}
.cat-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  margin: 0;
  line-height: 1;
}

/* ---------- Filter bar ---------- */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 30px 0 8px;
}
.filter button {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 0 0 4px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}
.filter button::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.filter button:hover { color: var(--ink); }
.filter button.active { color: var(--accent); }
.filter button.active::after { transform: scaleX(1); }

/* ---------- About teaser ---------- */
.about-teaser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.about-teaser p {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  line-height: 1.5;
  font-weight: 400;
  margin: 0;
}
.about-teaser .small {
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
  margin-top: 26px;
}

/* ---------- Project detail ---------- */
.detail-hero-img {
  width: 100%;
  height: 82vh;
  min-height: 480px;
  object-fit: cover;
  background: var(--paper-2);
}
.detail-head {
  padding: 46px 0 0;
}
.detail-head .kicker {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.detail-head .kicker .idx {
  font-family: var(--script);
  font-size: 1.9rem;
  color: var(--accent);
  line-height: 1;
}
.detail-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 16ch;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 56px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 38px;
}
.detail-meta div span {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.detail-meta div strong {
  font-weight: 500;
  font-size: 1.05rem;
}
.detail-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 72px 0 40px;
}
.detail-body p {
  font-size: 1.05rem;
  margin: 0 0 22px;
  color: var(--ink-soft);
}
.detail-body p:first-child {
  font-family: var(--serif);
  font-size: 1.65rem;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 34px;
}
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding-bottom: 90px;
}
.gallery figure {
  margin: 0;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 12px;
}
.gallery figure img { width: 100%; height: 100%; object-fit: cover; }
.gallery .g-full { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gallery figure:not(.g-full) { aspect-ratio: 4 / 5; }

/* ---------- Sectioned gallery (masonry, no cropping) ---------- */
.gal-sec {
  padding: 54px 0 10px;
  border-top: 1px solid var(--line);
}
.gal-sec:first-of-type { border-top: none; padding-top: 24px; }
.gal-sec-head {
  max-width: 760px;
  margin: 0 0 30px;
}
.gal-sec-num {
  display: inline-block;
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.gal-sec-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 2.1rem;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
  color: var(--ink);
}
.gal-sec-head p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--muted);
}

/* CSS columns: each plate keeps its own natural proportion. */
.masonry {
  column-count: 3;
  column-gap: 22px;
  padding-bottom: 40px;
}
.plate {
  margin: 0 0 22px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}
.plate a {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--paper-2);
  line-height: 0;
}
.plate img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.plate a:hover img { transform: scale(1.035); }
.plate .zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(250, 245, 239, 0.86);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 30px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.plate a:hover .zoom { opacity: 1; }
.plate figcaption {
  padding: 9px 2px 0;
  font-size: 0.76rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 34, 29, 0.94);
  padding: 40px 60px;
}
.lightbox[hidden] { display: none; }
.lb-figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lb-figure img {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}
.lb-figure figcaption {
  color: #e8ded2;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-align: center;
  max-width: 620px;
}
.lb-close,
.lb-nav {
  position: absolute;
  background: transparent;
  border: none;
  color: #e8ded2;
  font-family: var(--serif);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.25s ease;
}
.lb-close:hover,
.lb-nav:hover { opacity: 1; }
.lb-close {
  top: 18px;
  right: 24px;
  font-size: 2.4rem;
  line-height: 1;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  line-height: 1;
  padding: 0 14px;
}
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.back-link {
  display: inline-block;
  margin: 0 0 8px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.back-link:hover { color: var(--accent); }

/* ---------- About page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 64px;
  align-items: start;
}
.about-portrait {
  aspect-ratio: 3 / 4;
  background: var(--paper-2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 0.1em;
}
.about-bio .kicker { margin-bottom: 22px; }
.about-bio h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1;
  margin: 0 0 28px;
}
.about-bio > p {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 22px;
  max-width: 60ch;
}
.timeline { margin-top: 60px; }
.timeline h3, .skills h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.9rem;
  margin: 0 0 4px;
}
.tl-item {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.tl-item .yr {
  font-family: var(--script);
  font-size: 1.7rem;
  color: var(--accent);
  line-height: 1;
}
.tl-item .role { font-weight: 500; font-size: 1.02rem; }
.tl-item .co { color: var(--muted); font-size: 0.92rem; margin-top: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tags span {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 7px 15px;
}

/* ---------- Contact ---------- */
.contact { padding: 120px 0 140px; }
.contact .kicker { margin-bottom: 26px; }
.contact h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 7rem);
  line-height: 0.96;
  margin: 0 0 60px;
  letter-spacing: -0.01em;
}
.contact h1 em { font-style: italic; color: var(--accent); }
.contact-rows { display: grid; gap: 0; max-width: 760px; }
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  gap: 24px;
}
.contact-row:last-child { border-bottom: 1px solid var(--line); }
.contact-row .lbl {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-row a, .contact-row .val {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  transition: color 0.25s;
}
.contact-row a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 44px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.footer-inner a { color: var(--muted); transition: color 0.25s; }
.footer-inner a:hover { color: var(--ink); }
.footer-social { display: flex; gap: 24px; }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2,0.8,0.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .wrap { padding: 0 24px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 22px; }
  .index-row { grid-template-columns: 44px 1fr; }
  .index-row .meta { display: none; }
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .about-portrait { max-width: 320px; }
  .detail-meta { grid-template-columns: 1fr; gap: 18px; }
  .gallery { grid-template-columns: 1fr; }
  .gallery .g-full { aspect-ratio: 4 / 3; }
  .contact { padding: 80px 0 100px; }
  .float-img { display: none; }
  .masonry { column-count: 2; column-gap: 16px; }
  .plate { margin-bottom: 16px; }
  .gal-sec-head h3 { font-size: 1.7rem; }
  .lightbox { padding: 24px 18px; }
  .lb-nav { font-size: 2.2rem; padding: 0 6px; }
  .lb-prev { left: 2px; }
  .lb-next { right: 2px; }

  /* Nav must not push the page wider than the viewport on small screens. */
  .nav-inner { height: 66px; gap: 14px; }
  .brand { font-size: 1.35rem; white-space: nowrap; }
  .nav-links { gap: 16px; min-width: 0; }
  .nav-links a { font-size: 0.62rem; letter-spacing: 0.12em; }
}

@media (max-width: 560px) {
  .masonry { column-count: 1; }
  .nav-links { gap: 11px; }
  .nav-links a { font-size: 0.58rem; letter-spacing: 0.08em; }
  .brand { font-size: 1.15rem; }
}
