/* ==================================================================
   ULTA BEAUTY — two more layouts with the whole process (Nov 9)
   .u3--c  Chapters: the 13 steps in four parts, one long scroll
   .u3--d  Index: the 13 steps as a list, open one at a time
   Builds on styles.css + project.css + ulta-beauty.css (same type,
   labels, colours and step chapters as projects/ulta-beauty.html).
   ================================================================== */

/* section head, same rule + label rhythm as the steps */
.u3-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  padding-top: 18px; margin-bottom: clamp(20px, 2.6vw, 32px); border-top: 1px solid var(--color-line);
}
.u3-head h2 {
  margin: 0; font-size: clamp(2rem, 1.2rem + 3vw, 3.6rem); font-weight: var(--fw-light);
  letter-spacing: -0.03em; line-height: 0.95;
}
.u3-head p { margin: 0; max-width: 46ch; color: var(--color-muted); font-size: 0.9375rem; font-weight: var(--fw-light); line-height: 1.5; }

/* the finals */
.u3-final { margin-top: var(--pj-space); }
.u3-grid { display: grid; gap: var(--pj-gap); }
.u3-grid + .u3-grid { margin-top: var(--pj-gap); }
.u3-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* logo poster (9:16) beside the series (2:3), all four the same height */
.u3-grid--wall { grid-template-columns: 0.844fr 1fr 1fr 1fr; }
.u3 figure { margin: 0; }
.u3-final figure img, .u3-reel figure img { display: block; width: 100%; height: auto; }
.u3-final figcaption, .u3-reel figcaption {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px 2px;
  font-size: 0.75rem; font-weight: var(--fw-light); color: var(--color-muted);
}
.u3-final figcaption span, .u3-reel figcaption span { white-space: nowrap; }

/* every picture opens large */
.u3 [data-zoom] { cursor: zoom-in; transition: filter var(--dur, 0.3s) ease; }
.u3 [data-zoom]:hover { filter: brightness(1.06); }

/* ---------- C: the four parts ---------- */
.u3-nav ol { gap: 4px 18px; }
.u3-nav .u3-nav__part { color: var(--color-text); text-transform: uppercase; letter-spacing: var(--tracking-heading); font-size: var(--fs-heading); padding-top: 2px; }
.u3-nav li:has(.u3-nav__part):not(:first-child) { margin-left: 14px; padding-left: 18px; border-left: 1px solid var(--color-line); }

.u3-act {
  display: grid; grid-template-columns: auto minmax(0, 5fr) minmax(0, 7fr); gap: clamp(18px, 4vw, 64px); align-items: start;
  margin-top: var(--pj-space); padding-top: clamp(22px, 2.4vw, 32px);
  border-top: 1px solid var(--color-text);
  scroll-margin-top: calc(var(--header-h) + 90px);
}
.u3-act--solo { grid-template-columns: auto minmax(0, 1fr); align-items: end; }
.u3-act__tile {
  width: clamp(56px, 6vw, 92px); aspect-ratio: 1; border-radius: 22%;
  display: grid; place-items: center; background: var(--a-bg); color: var(--a-fg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-text) 14%, transparent);
}
.u3-act__tile svg { width: 56%; height: auto; overflow: visible; }
.u3-act__tile use { fill: currentColor; }
.u3-act .ub-label { margin: 2px 0 10px; }
.u3-act__title {
  margin: 0; font-size: clamp(3.4rem, 1.6rem + 6.4vw, 8rem); font-weight: var(--fw-light);
  letter-spacing: -0.045em; line-height: 0.82; text-transform: uppercase;
}
.u3-act__steps { list-style: none; margin: 0; padding: 0; }
.u3-act__steps a {
  display: grid; grid-template-columns: 2.6ch 1fr; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--color-line); color: inherit; text-decoration: none;
  font-size: 0.9375rem; font-weight: var(--fw-light); transition: color var(--dur, 0.3s) ease;
}
.u3-act__steps li:first-child a { border-top: 1px solid var(--color-line); }
.u3-act__steps a b { font-weight: var(--fw-regular); color: var(--color-muted); }
.u3-act__steps a:hover, .u3-act__steps a:hover b { color: var(--color-accent); }
.u3-act + .ub-step { margin-top: clamp(48px, 6vw, 88px); }

/* ---------- D: the finals reel ---------- */
.u3-reel__track {
  display: flex; gap: var(--pj-gap); overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 4px; outline-offset: 4px;
}
.u3-reel__track::-webkit-scrollbar { display: none; }
.u3-reel__item { flex: 0 0 auto; scroll-snap-align: start; }
.u3-reel__item img { height: clamp(380px, 62vh, 680px) !important; width: auto !important; max-width: none; }
.u3-reel__item figcaption { max-width: 0; min-width: 100%; }
.u3-reel__nav { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.u3-reel__nav .ub-label { margin: 0; min-width: 5ch; text-align: center; }
.u3-arrow {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--color-line);
  background: none; color: inherit; cursor: pointer; font-size: 1rem;
}
.u3-arrow:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ---------- D: the index ---------- */
.u3-index { margin-top: var(--pj-space); }
.u3-index__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 0 12px; border-bottom: 1px solid var(--color-text);
}
.u3-index__bar .ub-label { margin: 0; }
.u3-all {
  font: inherit; font-size: var(--fs-heading); letter-spacing: var(--tracking-heading); text-transform: uppercase;
  padding: 9px 14px; background: none; color: inherit; border: 1px solid var(--color-line); cursor: pointer;
}
.u3-all:hover, .u3-all[aria-pressed="true"] { border-color: var(--color-accent); color: var(--color-accent); }

.u3-item.ub-step { margin-top: 0; border-bottom: 1px solid var(--color-line); scroll-margin-top: calc(var(--header-h) + 16px); }
.u3-item__h { margin: 0; font: inherit; }
.u3-item__btn {
  --num: clamp(72px, 8vw, 128px);
  width: 100%; display: grid; grid-template-columns: var(--num) minmax(0, 1fr) auto 36px; align-items: center;
  gap: clamp(12px, 2vw, 32px); padding: clamp(14px, 1.8vw, 22px) 0;
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.u3-item__n { font-size: clamp(2.2rem, 1.2rem + 3vw, 4rem); font-weight: var(--fw-light); letter-spacing: -0.04em; line-height: 0.85; transition: color var(--dur, 0.3s) ease; }
.u3-item__t { display: grid; gap: 6px; }
.u3-item__t b { font-size: clamp(1.1rem, 0.9rem + 0.8vw, 1.6rem); font-weight: var(--fw-light); line-height: 1.2; transition: color var(--dur, 0.3s) ease; }
.u3-item__t i {
  font-style: normal; font-size: var(--fs-heading); letter-spacing: var(--tracking-heading);
  text-transform: uppercase; color: var(--color-muted);
}
.u3-item__thumbs { display: flex; gap: 6px; transition: opacity 0.3s ease; }
.u3-item__thumbs img { width: clamp(64px, 6.4vw, 104px); height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #141414; }
.u3-item__x {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--color-line);
  display: grid; place-items: center; font-size: 1.1rem; line-height: 1; transition: transform 0.35s ease, background 0.35s ease;
}
.u3-item__btn:hover .u3-item__n, .u3-item__btn:hover .u3-item__t b, .u3-item__btn[aria-expanded="true"] .u3-item__n { color: var(--color-accent); }
.u3-item__btn[aria-expanded="true"] .u3-item__x { transform: rotate(45deg); background: var(--color-accent); border-color: var(--color-accent); color: #000; }
.u3-item__btn[aria-expanded="true"] .u3-item__thumbs { opacity: 0; }

/* closed = no height but still laid out, so the live pieces (pattern, slider) keep their size */
.u3-item__body { height: 0; overflow: hidden; visibility: hidden; }
.u3-item.is-open .u3-item__body { height: auto; overflow: visible; visibility: visible; padding-bottom: clamp(40px, 5vw, 80px); }
.u3-item.is-open .u3-item__body { animation: u3-in 0.45s ease both; }
.u3-item__text { margin: 4px 0 clamp(24px, 3vw, 44px) calc(var(--num, clamp(72px, 8vw, 128px)) + clamp(12px, 2vw, 32px)); }
@keyframes u3-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- lightbox ---------- */
.u3-box {
  position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: 1fr auto; gap: 14px;
  padding: clamp(14px, 3vw, 40px) clamp(14px, 6vw, 96px); background: rgba(10, 10, 10, 0.95); color: #EDEDEA;
}
.u3-box[hidden] { display: none; }
.u3-box__stage { min-height: 0; display: grid; place-items: center; cursor: zoom-out; }
.u3-box__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.u3-box__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 0.8125rem; font-weight: var(--fw-light); }
.u3-box__bar span:last-child { color: #8C8C88; letter-spacing: var(--tracking-heading); font-size: var(--fs-heading); }
.u3-box button {
  position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 10, 10, 0.5); color: #fff; font-size: 1.1rem; cursor: pointer;
}
.u3-box button:hover { border-color: var(--color-accent); color: var(--color-accent); }
.u3-box__x { top: 14px; right: 16px; }
.u3-box__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.u3-box__next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 1100px) {
  .u3-act { grid-template-columns: auto 1fr; }
  .u3-act__steps { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .u3-grid--3 { grid-template-columns: 1fr; }
  .u3-grid--wall { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .u3-item__btn { grid-template-columns: 56px minmax(0, 1fr) 32px; --num: 56px; }
  .u3-item__thumbs { display: none; }
  .u3-item__text { margin-left: 0; }
  .u3-reel__item img { height: 62vh !important; }
  .u3-box__prev, .u3-box__next { top: auto; bottom: 64px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .u3-item.is-open .u3-item__body { animation: none; }
}

/* hero: "beauty" sits exactly as in the official Hero + beauty lockup
   (Logo Files, lib.py lockup: size 0.2 × logo height, tracking 0.045 × height, weight 300, 2 % in from the right) */
.u3 .ub-hero__mark { container-type: inline-size; }
.u3 .ub-hero__beauty { font-size: 8.63cqw; letter-spacing: 0.155em; font-weight: 300; margin: -1.2cqw 2.6% 0 0; }
