/* ============ Tracy L. Union — Portfolio ============ */
:root {
  --pink: #eeb0cd;
  --pink-soft: #f6d3e2;
  --pink-deep: #d97fae;
  --teal: #a2c1c3;
  --teal-soft: #cfe0e1;
  --teal-deep: #6e9598;
  --ink: #1c2526;
  --ink-soft: #47585a;
  --paper: #fdfafb;
  --paper2: #f7f3f4;
  --shadow: 0 12px 32px rgba(28, 37, 38, 0.14);
  --radius: 14px;
  --font-display: "Archivo Black", "Arial Black", "Helvetica Neue", sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--teal-deep); }

.container { width: min(1120px, 92vw); margin: 0 auto; }
.section { padding: clamp(64px, 9vw, 110px) 0; position: relative; }

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: 0.01em;
  margin-bottom: 0.6em;
}
.eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  background: var(--teal-deep);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* ---------- Nav ---------- */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--pink);
  box-shadow: 0 3px 0 rgba(28,37,38,0.55);
}
.nav {
  width: min(1120px, 94vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.nav-brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  list-style: none;
  gap: clamp(8px, 2vw, 26px);
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.nav-links a:hover { background: rgba(255,255,255,0.45); }
.nav-links a.active { color: #fff; background: rgba(28,37,38,0.85); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span {
  display: block; width: 24px; height: 3px; margin: 4px 0;
  background: var(--ink); border-radius: 2px; transition: transform 0.25s, opacity 0.25s;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(92vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url("../img/hero-magnolia.jpg") center / cover no-repeat;
  opacity: 0.9;
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.25) 45%, rgba(255,255,255,0.85) 100%);
}
.hero-inner { position: relative; z-index: 2; padding: 60px 20px; }
.hero-kicker {
  font-family: var(--font-display);
  font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  font-size: clamp(1.4rem, 3.2vw, 2.2rem); color: var(--teal-deep);
  margin-bottom: 28px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 15vw, 9.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}
.t-teal { color: var(--teal); }
.t-pink { color: var(--pink-deep); }
.t-teal-dark { color: var(--teal-deep); letter-spacing: 0.12em; }
.t-pink-dark { color: var(--pink-deep); font-family: Georgia, "Times New Roman", serif; }
.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.4vw, 2.1rem);
  margin-top: 26px;
}
.hero-sub em { font-style: italic; font-weight: 400; }
.hero-lede {
  max-width: 520px; margin: 18px auto 28px;
  color: var(--ink-soft); font-size: 1.05rem;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.btn {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 999px;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-pink { background: var(--pink-deep); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.75); color: var(--ink); border: 2px solid var(--ink); }
.hero-scroll {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 2; color: var(--ink); text-decoration: none; font-size: 1.6rem;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- Profile ---------- */
.profile { background: #fff; }
.profile-grid {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
.photo-arch {
  border-radius: 999px 999px 999px 999px / 60% 60% 40% 40%;
  overflow: hidden;
  border: 6px solid var(--teal-soft);
  box-shadow: var(--shadow);
  background: #eef4f4;
}
.photo-arch img { width: 100%; height: auto; }
.profile-text h2 { color: var(--ink); }
.profile-text p { color: var(--ink-soft); margin-bottom: 1em; max-width: 56ch; }
.profile-stats {
  display: flex; gap: clamp(18px, 4vw, 44px); flex-wrap: wrap; margin-top: 26px;
}
.stat { border-top: 4px solid var(--pink); padding-top: 10px; }
.stat-num {
  display: block; font-family: var(--font-display);
  font-size: 1.6rem; color: var(--teal-deep);
}
.stat-label { font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Projects ---------- */
.projects { background: var(--teal); }
.projects .eyebrow { background: var(--ink); }
.projects h2 { color: var(--ink); }
.section-note { color: rgba(28,37,38,0.75); margin-bottom: 26px; font-weight: 500; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }
.filter {
  font-family: var(--font-body);
  font-weight: 700; font-size: 0.9rem;
  padding: 9px 20px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.filter:hover { transform: translateY(-2px); }
.filter.active { background: var(--ink); color: var(--pink); }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  align-items: start;
  gap: 26px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(28,37,38,0.18);
  transition: transform 0.25s, box-shadow 0.25s, opacity 0.35s, scale 0.35s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: 0 18px 40px rgba(28,37,38,0.28); }
.card.hidden { display: none; }
.card-wide { grid-column: span 2; }
.card-btn {
  border: 0; padding: 0; cursor: zoom-in; background: #f3f0f1;
  display: block; width: 100%;
}
.card-btn img { width: 100%; height: 300px; object-fit: contain; padding: 14px; }
.card-wide .card-btn img { height: 220px; }
.card figcaption { padding: 16px 18px 20px; border-top: 1px solid #f0e7ea; }
.tag {
  display: inline-block;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--pink-soft); color: var(--ink);
  padding: 3px 10px; border-radius: 999px; margin-bottom: 8px;
}
.card h3 { font-size: 1.02rem; line-height: 1.3; margin-bottom: 4px; }
.card figcaption p { font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- Skills & Tools ---------- */
.skills { background: var(--paper2); }
.skills-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(36px, 6vw, 90px);
  align-items: start;
}
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.chips li {
  background: #fff;
  border: 1.5px solid var(--pink);
  color: var(--ink);
  font-weight: 600; font-size: 0.88rem;
  padding: 7px 15px;
  border-radius: 999px;
  transition: background 0.2s, transform 0.15s;
}
.chips li:hover { background: var(--pink-soft); transform: translateY(-2px); }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.tool {
  background: #fff;
  border-radius: 12px;
  padding: 16px 12px 12px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(28,37,38,0.15);
  transition: transform 0.2s;
}
.tool:hover { transform: translateY(-4px) scale(1.03); }
.tool img {
  height: 56px;
  width: auto;
  max-width: 90%;
  object-fit: contain;
  margin: 0 auto;
}
.tool small { display: block; margin-top: 10px; font-weight: 600; color: var(--ink); }

/* ---------- Contact ---------- */
.contact { background: var(--pink-soft); overflow: hidden; padding-bottom: 0; }
.contact .eyebrow { background: var(--pink-deep); }
.contact-inner { text-align: center; padding-bottom: 40px; position: relative; z-index: 2; }
.contact-list {
  list-style: none;
  margin: 10px auto 30px;
  display: flex;
  width: fit-content;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  font-size: 1.08rem;
  font-weight: 600;
}
.contact-list a { color: var(--ink); text-decoration-color: var(--pink-deep); text-underline-offset: 3px; }
.contact-list a:hover { color: var(--pink-deep); }
.c-ico { display: inline-block; width: 1.8em; }
.footer-flowers {
  height: 190px;
  background: url("../img/footer-magnolia.jpg") center top / cover no-repeat;
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: #cfd8d9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px clamp(20px, 4vw, 56px);
  font-size: 0.9rem;
}
.to-top { color: var(--pink); text-decoration: none; font-weight: 700; }
.to-top:hover { text-decoration: underline; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 26, 27, 0.92);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lb-stage { max-width: min(880px, 86vw); text-align: center; }
.lb-stage img {
  max-height: 78vh; max-width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
  background: #fff;
  transform: perspective(1200px) rotateY(0deg);
  animation: flipIn 0.45s ease;
}
@keyframes flipIn {
  from { transform: perspective(1200px) rotateY(-55deg); opacity: 0; }
  to   { transform: perspective(1200px) rotateY(0deg); opacity: 1; }
}
.lb-stage figcaption { color: #f0dbe6; margin-top: 14px; font-weight: 600; }

/* ---------- Book viewer (booklets read like a real book) ---------- */
.lb-book {
  position: relative;
  display: flex;
  justify-content: center;
  perspective: 2600px;
  --page-h: min(72vh, 620px);
  --page-w: calc(var(--page-h) * 0.775);
}
.lb-book[hidden] { display: none; }
#lb-img[hidden] { display: none; }
.book-page {
  width: var(--page-w);
  height: var(--page-h);
  background: transparent;
}
.book-page.book-empty { width: 0; }
.book-page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
}
.book-page img[src=""] { visibility: hidden; box-shadow: none; }
.book-left img { border-radius: 8px 0 0 8px; }
.book-right img { border-radius: 0 8px 8px 0; }
.book-page.book-solo img { border-radius: 8px; }
.book-flip {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--page-w);
  height: var(--page-h);
  transform-style: preserve-3d;
  transform-origin: left center;
  z-index: 3;
}
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.flip-front img { border-radius: 0 8px 8px 0; }
.flip-back { transform: rotateY(180deg); }
.flip-back img { border-radius: 8px 0 0 8px; }
@media (max-width: 760px) {
  /* Derive height from a width budget (44vw) using the same 0.775 ratio as
     --page-w below, so the two never disagree and the image never letterboxes. */
  .lb-book { --page-h: min(60vh, 480px, calc(44vw / 0.775)); }
}
.lb-close, .lb-prev, .lb-next {
  background: none; border: 0; color: #fff; cursor: pointer;
  font-size: 2.6rem; line-height: 1; padding: 12px;
  opacity: 0.8; transition: opacity 0.2s, transform 0.2s;
  user-select: none;
}
.lb-close { position: absolute; top: 14px; right: 22px; font-size: 2.2rem; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; transform: scale(1.12); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .lb-stage img { animation: none; }
  .hero-scroll { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .profile-grid, .skills-grid { grid-template-columns: 1fr; }
  .profile-photo { max-width: 340px; margin: 0 auto; }
  .card-wide { grid-column: auto; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--pink);
    box-shadow: 0 12px 24px rgba(28,37,38,0.2);
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 320px; }
  .nav-links li { text-align: center; }
  .nav-links a { display: block; padding: 14px; border-radius: 0; }
  .nav-wrap.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-wrap.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-wrap.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}
