/* ==================================================================
   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: #F2F2F0;
}
.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: #8A8A86; 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" matches the approved lockup (Logo Files/AI + INDD, 2026-11-12):
   Inter Light, "b" starts at the right edge of the T stem, "y" ends on the right foot of the A,
   top of the "b" 10.3 logo-units below the A baseline (logo = 292 units wide) */
.u3 .ub-hero__mark { container-type: inline-size; }
.u3 .ub-hero__beauty { font-size: 8.049cqw; letter-spacing: 0.23em; font-weight: 300; margin: -1.994cqw -0.399cqw 0 0; }

/* UB-023 ID board: one stage + picks, after the logo page's Nine Moves board (Nov 12) */
.u3-mono { font-family: "DM Mono", ui-monospace, Menlo, monospace; font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; }
.u3-one { margin-top: var(--pj-gap); }
.u3-one__stage {
  margin: 0; position: relative; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  aspect-ratio: 1400 / 973; max-height: 86vh; padding: clamp(10px, 1.6vw, 22px); background: #fff; cursor: zoom-in; overflow: hidden;
}
.u3-final .u3-one__stage img { display: block; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.3s ease; }
.u3-final .u3-one__stage.is-swap img { opacity: 0; }
.u3-one__cap { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: start; margin-top: 10px; }
.u3-final .u3-one__cap b { color: var(--color-text); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.u3-final .u3-one__cap b span:first-child { color: var(--color-accent); margin-right: 6px; }
.u3-one__cap p { grid-column: 1; margin: 0; font-size: 0.8125rem; font-weight: var(--fw-light); color: var(--color-muted); line-height: 1.5; }
.u3-one__size { grid-column: 2; grid-row: 1 / 3; color: var(--color-muted); padding-top: 2px; }
.u3-one__lists { margin-top: 18px; }
.u3-one__group { margin: 14px 0 6px; color: var(--color-muted); }
.u3-one__lists .u3-one__group:first-child { margin-top: 0; }
.u3-one__list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.u3-one__pick {
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.28); color: var(--color-text);
  padding: 9px 12px; min-height: 38px; cursor: pointer;
  transition: background var(--dur, 0.3s) ease, border-color var(--dur, 0.3s) ease, color var(--dur, 0.3s) ease;
}
.u3-one__pick span { color: var(--color-accent); margin-right: 4px; }
.u3-one__pick:hover { border-color: var(--color-accent); }
.u3-one__pick[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: #000; }
.u3-one__pick[aria-pressed="true"] span { color: #000; }

/* UB-023 posters stage: porcelain panel, fixed height, posters keep their shape */
.u3-one--posters .u3-one__stage { aspect-ratio: auto; height: min(80vh, 820px); max-height: none; min-height: 420px; padding: clamp(18px, 3vw, 40px); background: #F5F0EA; }
.u3-final .u3-one--posters .u3-one__stage img { filter: drop-shadow(0 16px 26px rgba(17, 17, 17, 0.2)); }
.u3-one--posters + .u3-one { margin-top: clamp(40px, 6vw, 72px); }
@media (max-width: 700px) { .u3-one--posters .u3-one__stage { height: 72vh; min-height: 0; } }

/* Campaign film (Week 10 ad), step 11 */
.u3-film{margin:0 0 clamp(28px,4vw,56px)}
.u3-film video{display:block;width:100%;height:auto;aspect-ratio:16/9;background:#111}
.u3-film__meta{display:flex;flex-wrap:wrap;gap:6px 24px;justify-content:space-between;align-items:baseline;margin-top:12px}
.u3-film__meta span:last-child{max-width:60ch;opacity:.8}

/* UB-001 hero: campaign film first, live logo animation second */
.u3 .ub-hero__film{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;background:#111;opacity:0;visibility:hidden;transition:opacity .5s var(--ease),visibility 0s .5s}
.u3 .ub-hero[data-mode="film"] .ub-hero__film{opacity:1;visibility:visible;transition:opacity .5s var(--ease)}
.u3 .ub-hero[data-mode="film"] .ub-hero__bar{color:#F5F0EA;background:linear-gradient(transparent,rgba(17,17,17,.75));padding-top:clamp(22px,3vw,34px)}
.u3 .ub-hero[data-mode="film"] .ub-hero__ways{display:none}
.u3 .ub-hero[data-mode="logo"] .ub-hero__filmctl{display:none}
.u3 .ub-hero__bar{z-index:2}
.u3 .ub-hero__modes{display:flex;gap:18px;flex-wrap:wrap}
.u3 .ub-hero__modes button,.u3 .ub-hero__sound{font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer;opacity:.55;border-bottom:1px solid transparent}
.u3 .ub-hero__modes button[aria-pressed="true"]{opacity:1;border-bottom-color:currentColor}
.u3 .ub-hero__modes button:hover,.u3 .ub-hero__sound:hover{opacity:1}
.u3 .ub-hero__sound[aria-pressed="true"]{opacity:1}
@media (max-width:700px){.u3 .ub-hero__film{object-fit:contain}}
.u3 .ub-hero[data-mode="film"] .ub-hero__mark{visibility:hidden}

/* UB-001 hero + Ulta film: phone and tablet (Nov 13) */
@media (max-width: 700px) {
  /* in film mode the frame takes the film's own 16:9 shape — no empty band above it */
  .u3 .ub-hero[data-mode="film"] { aspect-ratio: 16 / 9; max-height: none; }
  .u3 .ub-hero__film { object-fit: cover; }
  /* the bar stays one line: the two modes side by side, sound on the right */
  .u3 .ub-hero__bar { flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 10px; font-size: 0.5rem; padding: 10px 12px; }
  .u3 .ub-hero__modes { gap: 10px; }
  .u3 .ub-hero__sub { display: none; }          /* "· 0:15" / "· 4 s" only where there is room */
  .u3 .ub-hero__filmctl, .u3 .ub-hero__ways { margin-left: auto; flex: none; }
  /* logo mode: the two labels on their own line, the colour ways under them */
  .u3 .ub-hero[data-mode="logo"] .ub-hero__bar { flex-wrap: wrap; }
  .u3 .ub-hero[data-mode="logo"] .ub-hero__modes { flex: 1 0 100%; }
  .u3 .ub-hero[data-mode="logo"] .ub-hero__ways { gap: 6px; }
}
@media (min-width: 701px) and (max-width: 1024px) {
  .u3 .ub-hero__bar { gap: 10px 16px; }
  .u3 .ub-hero__modes { gap: 14px; }
}

/* Nov 17 2026 (Shuvo): "the poster cut off… use those keys at the poster native space"
   Desktop: the picker keys sit INSIDE the panel, in the empty space beside the poster / board, and the panel
   is sized to the screen under the sticky menus, so the whole picture and its keys are always seen together. */
@media (min-width: 901px) {
  .u3-one { display: grid; grid-template-columns: minmax(0, 1fr) clamp(250px, 24vw, 330px); grid-template-rows: auto 1fr; background: #fff; }
  .u3-one--posters { background: #F5F0EA; }
  .u3-one__stage { grid-column: 1; grid-row: 1 / span 2; background: transparent; }
  .u3-one:not(.u3-one--posters) .u3-one__stage { aspect-ratio: auto; height: min(calc(100vh - 200px), 700px); max-height: none; min-height: 380px; }
  .u3-one--posters .u3-one__stage { height: min(calc(100vh - 200px), 820px); min-height: 420px; background: transparent; }
  .u3-one__cap { grid-column: 2; grid-row: 1; grid-template-columns: 1fr; margin: 0; padding: clamp(20px, 2.6vw, 36px) clamp(18px, 2.2vw, 30px) 0 0; }
  .u3-one__size { grid-column: 1; grid-row: auto; padding-top: 6px; }
  .u3-one__lists { grid-column: 2; grid-row: 2; align-self: start; margin: 0; padding: 22px clamp(18px, 2.2vw, 30px) clamp(20px, 2.6vw, 36px) 0; }
  /* dark type on the light panel */
  .u3-final .u3-one .u3-one__cap b { color: #111; }
  .u3-final .u3-one .u3-one__cap p, .u3-one .u3-one__size, .u3-one .u3-one__group { color: #6B6B67; }
  .u3-one .u3-one__pick { border-color: rgba(17, 17, 17, 0.22); color: #111; padding: 7px 10px; min-height: 34px; }
  .u3-one .u3-one__pick:hover { border-color: var(--color-accent); }
  .u3-one .u3-one__pick[aria-pressed="true"] { background: var(--color-accent); border-color: var(--color-accent); color: #000; }
}

/* Nov 17 2026 (Shuvo): "04 06 could be smaller", then 03, 05, 07 the same — every chapter 03–07 shows its pictures
   in the heading text column, under its heading, so the chapters keep one rhythm */
@media (min-width: 901px) {
  #form > :not(.ub-step__head), #logo > :not(.ub-step__head), #system > :not(.ub-step__head),
  #type > :not(.ub-step__head), #digital > :not(.ub-step__head) {
    margin-left: calc((100% - clamp(20px, 6vw, 96px)) * 5 / 12 + clamp(20px, 6vw, 96px));
  }
  #form .pj-row, #system .pj-row, #type .pj-row, #digital .pj-row { width: auto; }
  /* 07: the "Get hooked on ___" panel scaled to the column */
  #type .ub-hooked { width: calc(100% - ((100% - clamp(20px, 6vw, 96px)) * 5 / 12 + clamp(20px, 6vw, 96px))); min-height: clamp(220px, 20vw, 300px); padding: clamp(22px, 2.6vw, 40px); }
  #type .ub-hooked__line { font-size: clamp(2rem, 0.8rem + 2.8vw, 3.9rem); }
  #type .ub-hooked__u { width: clamp(90px, 11vw, 170px); }
  #type .ub-hooked__tip { left: clamp(22px, 2.6vw, 40px); }
}


/* Nov 17 2026 (Shuvo): "do not cut the image on 6, try a different layout to make it work together"
   06 on desktop: my original pattern study (whole, its own shape) sits in the left column under "06 Patterns",
   the live pattern beside it in the text column, both the same height — the study and the live version side by side */
@media (min-width: 901px) {
  #pattern { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(20px, 6vw, 96px); align-items: stretch; }
  #pattern > .ub-step__head { grid-column: 1 / -1; }
  #pattern > .ub-one { grid-column: 1; grid-row: 2; margin: 0 0 var(--pj-gap); display: block; }
  #pattern > .ub-one figure { margin: 0; }
  #pattern .pj-row.ub-white img { aspect-ratio: auto; height: auto; width: 100%; object-fit: contain; display: block; }
  #pattern > .ub-pat { grid-column: 2; grid-row: 2; margin: 0 0 var(--pj-gap); display: flex; flex-direction: column; }
  #pattern .ub-pat__field { aspect-ratio: auto; flex: 1 1 auto; min-height: 260px; }
}
/* every screen size: the pattern study is never squeezed or cut — always its own shape */
#pattern .pj-row.ub-white img { aspect-ratio: auto; height: auto; object-fit: contain; }
