/* ============================================================
   Molly Liu — Portfolio
   One-page scroll · editorial minimalism
   Type: Cormorant Garamond (display) + Inter (UI/body)
   ============================================================ */

:root {
  --bg: #fbfbf9;
  --ink: #1b1b19;
  --ink-soft: #3a3a35;
  --muted: #b3b3ac;
  --line: #e2e2db;
  --line-strong: #cecec7;
  --accent: #d94f38;          /* coral-red active state */
  --serif: "Cormorant Garamond", "Baskerville", "Hoefler Text", Georgia, "Songti SC", serif;
  --sans: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Arial, sans-serif;
  /* --gut = the minimum side margin that ALWAYS stays, so content
     is centered with breathing room on every screen size. */
  --gut: clamp(1.25rem, 6vw, 6rem);
  --w-hero: 1040px;   /* hero band — narrower, inset */
  --w-wide: 1360px;   /* nav / about → skills — opens up wider */
  --nav-h: 92px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.68;
  letter-spacing: -0.006em;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; }
.muted { color: var(--muted); }

/* ============================= NAV (sticky) ============================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  width: min(100% - 2 * var(--gut), var(--w-wide));
  margin: 0 auto;
  padding: 1.7rem 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(9px);
  backdrop-filter: saturate(180%) blur(9px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s ease, padding 0.35s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); padding-top: 1.3rem; padding-bottom: 1.3rem; }

.brand { display: inline-flex; flex-direction: column; line-height: 1.12; }
.brand__name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
/* ---- walking dachshund (replaces the kaomoji) ---- */
.brand__dog { width: 146px; height: 48px; margin-top: 5px; overflow: visible; }
.dog {
  width: 72px; height: auto; display: block;
  transform-origin: center;
  animation: dog-walk 7s ease-in-out infinite;
  will-change: transform;
  /* dachshund palette — tweak here */
  --c-body: #6f4a29;
  --c-far:  #543620;   /* far (shadow-side) legs */
  --c-ear:  #543620;
  --c-tan:  #e9b978;
  --c-line: #241608;
}
.d-body { fill: var(--c-body); }
.d-far  { fill: var(--c-far); }
.d-ear  { fill: var(--c-ear); }
.d-tan  { fill: var(--c-tan); }
.d-nose { fill: #1a1109; }
.d-eye  { fill: #1a1109; }
.d-hi   { fill: #fbf6ea; }
.d-mouth { fill: none; stroke: var(--c-line); stroke-width: 4.5; stroke-linecap: round; }
.dog-strk { stroke: var(--c-line); stroke-width: 6; stroke-linejoin: round; stroke-linecap: round; }
.dog__bob { transform-box: fill-box; transform-origin: center; animation: dog-bob 0.5s ease-in-out infinite; }
.dog__leg { transform-box: fill-box; transform-origin: 50% 8%; }
.dog__leg.leg-a { animation: dog-step-a 0.5s ease-in-out infinite; }
.dog__leg.leg-b { animation: dog-step-b 0.5s ease-in-out infinite; }
.dog__tail { transform-box: fill-box; transform-origin: 100% 100%; animation: dog-wag 0.5s ease-in-out infinite; }

@keyframes dog-walk {
  0%   { transform: translateX(0)    scaleX(1); }
  46%  { transform: translateX(70px) scaleX(1); }
  50%  { transform: translateX(70px) scaleX(-1); }
  96%  { transform: translateX(0)    scaleX(-1); }
  100% { transform: translateX(0)    scaleX(1); }
}
/* independent leg step (diagonal gait) + gentle bob + tail wag */
@keyframes dog-bob    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes dog-step-a { 0%,100% { transform: rotate(11deg); }  50% { transform: rotate(-11deg); } }
@keyframes dog-step-b { 0%,100% { transform: rotate(-11deg); } 50% { transform: rotate(11deg); } }
@keyframes dog-wag    { 0%,100% { transform: rotate(-8deg); }  50% { transform: rotate(10deg); } }

@media (prefers-reduced-motion: reduce) {
  .dog, .dog__bob, .dog__leg, .dog__tail { animation: none; }
}

.menu {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1rem, 2.6vw, 2.7rem);
  padding-top: 6px;
}
.menu__link {
  position: relative;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.17em;
  color: var(--ink-soft);
  padding-bottom: 3px;
  transition: color 0.25s ease;
}
.menu__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0.999);
  transform-origin: left;
  opacity: 0.5;
  transition: opacity 0.25s ease, background 0.25s ease;
}
.menu__link:hover { color: var(--accent); }
.menu__link.is-active { color: var(--accent); }
.menu__link.is-active::after { opacity: 1; }

/* ============================= SECTIONS ============================= */
main { width: 100%; }

.section {
  width: min(100% - 2 * var(--gut), var(--w-wide));
  margin: 0 auto;
  scroll-margin-top: var(--nav-h);
  padding: clamp(3.5rem, 9vw, 7rem) 0;
}
.section--home {
  width: min(100% - 2 * var(--gut), var(--w-hero));
  padding-top: 0;
}

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s ease, transform 0.8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================= HOME / HERO ============================= */
.section--home { min-height: calc(100vh - var(--nav-h)); display: flex; align-items: center; }
.hero { position: relative; width: 100%; padding-top: clamp(1rem, 4vw, 2.5rem); }

.hero__lines {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: clamp(240px, 36vw, 400px);
}
.hero__lines span {
  display: block;
  width: 1px;
  background: var(--ink);
  opacity: 0.3;
}

.hero__phrase {
  margin: -3.1em 0 0;
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  font-size: clamp(1.7rem, 5.4vw, 3.9rem);
  line-height: 1;
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;  /* spread words edge-to-edge */
  gap: 0.4em;
}
.hero__phrase .w { display: inline-flex; }
.hero__phrase .l {
  display: inline-block;
  transform: translateY(var(--y, 0));
  padding: 0 0.11em;   /* airy letter spacing */
}

/* ============================= SECTION HEADS ============================= */
.section-head { margin-bottom: clamp(1.8rem, 4vw, 3rem); }
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 3.1rem);
  margin: 0 0 0.35rem;
  letter-spacing: 0.005em;
}
.section-sub { font-size: 0.9rem; margin: 0; letter-spacing: 0.02em; }

/* ============================= ABOUT ============================= */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about__media img { width: 100%; height: auto; display: block; filter: saturate(0.97); }
.about__tags { margin-top: 1.6rem; }
.about__tags p { margin: 0 0 0.12rem; font-size: 0.85rem; line-height: 1.55; }

.about__hi { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--ink); margin: 0 0 1.5rem; }
.about__text p { margin: 0 0 1.15rem; color: var(--ink-soft); max-width: 68ch; }

.social { display: flex; align-items: center; gap: 1rem; margin-top: 1.2rem; }
.social__link {
  display: inline-flex;
  color: var(--muted);   /* same grey as the hashtags */
  transition: color 0.25s ease, transform 0.25s ease;
}
.social__link:hover { color: var(--accent); transform: translateY(-2px); }
.social .icon { width: 20px; height: 20px; display: block; }

.about__cv { margin-top: 1.7rem; }
.cv-link {
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.cv-link:hover { color: var(--accent); border-color: var(--accent); }

/* ============================= PROJECTS ============================= */
.projects { list-style: none; margin: 0; padding: 0; }
.project {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.6rem;
  padding: 2.1rem 0;
  border-top: 1px solid var(--line);
}
.project:last-child { border-bottom: 1px solid var(--line); }
.project__index {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--muted);
  padding-top: 0.1rem;
}
.project__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.9vw, 1.95rem);
  margin: 0 0 0.5rem;
  line-height: 1.22;
}
.award {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.18em 0.75em;
  margin-left: 0.5rem;
  vertical-align: middle;
  white-space: nowrap;
}
.project__meta { font-size: 0.8rem; letter-spacing: 0.03em; margin: 0 0 0.7rem; text-transform: lowercase; }
.project__desc { margin: 0; color: var(--ink-soft); max-width: 64ch; }

/* ============================= SKILLS ============================= */
.skills { margin: 0; }
.skills__row {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}
.skills__row:last-child { border-bottom: 1px solid var(--line); }
.skills dt { font-family: var(--serif); font-style: italic; font-size: 1.3rem; }
.skills dd { margin: 0; color: var(--ink-soft); line-height: 1.95; }

/* ============================= FOOTER ============================= */
.foot {
  width: min(100% - 2 * var(--gut), var(--w-wide));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) 0 2.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.foot__quote { font-family: var(--serif); font-style: italic; font-size: 0.95rem; color: var(--muted); letter-spacing: 0.01em; }

/* ============================= RESPONSIVE ============================= */
@media (max-width: 720px) {
  :root { --nav-h: 130px; }
  .nav { flex-direction: column; gap: 0.9rem; }
  .menu { gap: 0.9rem 1.4rem; }
  .hero__phrase { flex-wrap: wrap; justify-content: center; gap: 0.4em 0.9em; }
  .about { grid-template-columns: 1fr; }
  .about__text p { max-width: none; }
  .project { grid-template-columns: 2.4rem 1fr; gap: 1rem; }
  .skills__row { grid-template-columns: 1fr; gap: 0.4rem; }
  .award { display: inline-block; margin: 0.4rem 0 0; white-space: normal; }
  .foot { flex-direction: column; }
}
