/* Page CSS for the A&I Artisans catalogue: only what sits inside a visual and the kit lacks. */

/* brand mark: the client's own logo beside the name */
.brand-logo { width: 44px; height: 44px; border-radius: 50%; flex: none; display: block; box-shadow: 0 0 0 1px var(--line); }
.nav__logo, .closing__links .nav__logo { display: inline-flex; align-items: center; gap: var(--s-3); }

/* ------------------------------------------------------------ section heights
   A catalogue section is as tall as its photographs: every photograph shows whole, and no section
   carries an empty band to reach a screen count. All of them share one padding, so the gap between
   any two sections is the same. */
main > section.section:is(.coll, #collections, #order, #made), footer#contact.closing {
  height: auto; min-height: 0;
}
footer#contact.closing { padding-top: 112px; }
main > section.section:is(.coll, #collections, #order) { padding: 112px 0 calc(40px + var(--bar)); }
main > section.section:is(.coll, #collections, #order) > .wrap, footer#contact.closing > .wrap { height: auto; }
main#top > section.section:has(+ section.ground-brand) { padding-bottom: 80px; }
main#top > section.section.coll.ground-brand { padding: 80px 0 80px; }
main#top > section.section.coll.ground-brand + section { padding-top: 80px; }
main > section.section#collections { padding-top: 152px; }
@media (max-width: 639px) {
  main > section.section:is(.coll, #collections, #order) { padding: 64px 0 8px; }
  main#top > section.section:has(+ section.ground-brand) { padding-bottom: 36px; }
  main#top > section.section.coll.ground-brand { padding: 36px 0 36px; }
  main#top > section.section.coll.ground-brand + section { padding-top: 36px; }
  main > section.section#collections { padding-top: 56px; }
  main > section.section:is(.coll, #collections, #order, #made), footer#contact.closing { display: block; }
}

/* section head: the h2 on the left line, its one line on the split line */
.coll-head { align-items: start; margin-bottom: var(--s-6); }
.coll-head h2 { margin: 0; }
.coll-head p { margin: 0; padding-top: 0; font-size: var(--t-lead); line-height: 1.5; max-width: 46ch; }
@media (max-width: 1023px) { .coll-head p { margin-top: var(--s-3); } }
@media (max-width: 639px) { .coll-head { row-gap: var(--s-2); margin-bottom: var(--s-5); } .coll-head p { font-size: 16px; } }

/* ------------------------------------------------------------ justified rows
   Each design's width is its share of its row (set by build.mjs per screen size), and its frame keeps
   the photograph's own shape, so every photograph in a row is the same height and nothing is cropped. */
.zgrid { --zg: 24px; display: flex; flex-wrap: wrap; column-gap: var(--zg); row-gap: 28px; }
.zgrid > .dz { --k: var(--kd); --f: var(--fd); flex: 0 0 auto; width: calc((100% - (var(--k) - 1) * var(--zg)) * var(--f) - 0.05px); }
.zgrid .pic { aspect-ratio: var(--a); }
@media (max-width: 1023px) { .zgrid { --zg: 16px; row-gap: 22px; } .zgrid > .dz { --k: var(--kt); --f: var(--ft); } }
@media (max-width: 639px) { .zgrid { --zg: 12px; row-gap: 18px; } .zgrid > .dz { --k: var(--km); --f: var(--fm); } }

/* a design: its photograph in a frame, its code under it */
.dz { display: flex; flex-direction: column; gap: var(--s-3); color: var(--ink); text-decoration: none; min-width: 0; }
.pic { position: relative; display: block; width: 100%; aspect-ratio: var(--ar, 1 / 1); background-color: var(--surface); background-size: cover; background-position: center; border-radius: var(--r-lg); overflow: clip; isolation: isolate; }
.pic__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; }
.dz__code { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); font-size: 14px; line-height: 1.4; font-weight: 500; letter-spacing: 0.02em; min-width: 0; }
.dz__code small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; text-align: right; min-width: 0; }
.ground-brand .dz__code small { color: inherit; opacity: .85; }
.zgrid .dz__code::after { content: "\2197"; margin-left: auto; font-size: 13px; transition: transform var(--m-out, 120ms) var(--ease, ease); }
.zgrid .dz__code:has(small)::after { display: none; }
.dz__code--name { flex-direction: column; align-items: flex-start; gap: 0; }
.dz__code--name small { text-align: left; }
@media (max-width: 639px) {
  .dz { gap: var(--s-2); }
  .dz__code { font-size: 13px; }
  .dz__code small { font-size: 12px; }
  .zgrid .dz__code:not(:has(small))::after { display: none; }
}
@media (max-width: 1023px) {
  .zgrid .dz__code:has(small) { flex-direction: column; align-items: flex-start; gap: 0; }
  .zgrid .dz__code:has(small) small { text-align: left; max-width: 100%; }
}
@media (hover: hover) and (pointer: fine) {
  .dz .pic { transition: transform var(--m-out, 120ms) var(--ease, ease); }
  .dz:hover .pic { transform: translateY(var(--m-lift, -2px)); }
  .dz:hover .dz__code::after { transform: translate(2px, -2px); }
}
.dz:focus-visible { outline-offset: 4px; }

/* the collections index: ten square tiles, five a row (two on a phone) */
.idx-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px 24px; }
.idx-grid .pic { aspect-ratio: 1 / 1; }
@media (max-width: 1023px) { .idx-grid { gap: 22px 16px; } }
@media (max-width: 639px) { .idx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; } }

/* ------------------------------------------------------------ the statement */
main > section#made { min-height: 0; padding: 168px 0 calc(176px + var(--bar)); }
.statement .wrap { justify-content: center; gap: var(--s-5); }
.statement .t-label { margin: 0; }
.statement .mo-wh__text { font-family: var(--font-display); font-size: clamp(30px, 4.2vw, 60px); line-height: 1.16; letter-spacing: -0.02em; max-width: 26ch; margin: 0; }
@media (max-width: 639px) { main > section#made { padding: 96px 0 40px; } }

/* ------------------------------------------------------------ how to order */
.order-grid { align-items: stretch; }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-rows: 1fr; align-content: stretch; }
.steps-list li { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; padding: var(--s-6) 0; border-top: 1px solid var(--line); }
.steps-list li:last-child { border-bottom: 1px solid var(--line); }
.step-n { font-family: var(--font-display); font-size: 28px; line-height: 1.2; color: var(--accent); }
.steps-list h3 { margin: 0 0 var(--s-2); font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.2; letter-spacing: -0.01em; }
.steps-list p { margin: 0; max-width: 44ch; font-size: 18px; line-height: 1.55; }
.order-visual { aspect-ratio: auto; height: 100%; min-height: 360px; }
@media (max-width: 1023px) { .order-visual { aspect-ratio: 3 / 2; height: auto; min-height: 0; margin-top: var(--s-6); } .steps-list { grid-auto-rows: auto; } }
@media (max-width: 639px) {
  .steps-list li { grid-template-columns: 36px minmax(0, 1fr); padding: var(--s-5) 0; }
  .step-n, .steps-list h3 { font-size: 22px; }
  .steps-list p { font-size: 16px; }
}

/* ------------------------------------------------------------ the hero: four designs, four collections
   Built for the phone first: the h1, the line and the WhatsApp button, then a 2 x 2 grid of designs,
   each tagged with its collection and linking to it. From 640px the four sit in one row. Every photo is
   drawn at a quarter (or half) of the width, so none is stretched past its pixels. The hero is as tall
   as what it holds, never a fixed screen. */
main > section.hero.hero--product { height: auto; min-height: 0; padding-bottom: 64px; }
main > section.hero.hero--product + section#collections { padding-top: 88px; }
main > section.hero.hero--product > .wrap { height: auto; }
.hero-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: var(--s-7); }
.hero-pick .pic { aspect-ratio: 4 / 5; }
.hero-pick__tag {
  position: absolute; left: 12px; bottom: 12px; z-index: 1; max-width: calc(100% - 24px);
  padding: 7px 12px; border-radius: 999px; background: color-mix(in oklab, var(--bg) 92%, transparent);
  color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.25;
  box-shadow: 0 6px 16px -10px rgb(0 0 0 / .45);
}
@media (min-width: 1024px) {
  .hero--product:has(.hero-picks) .hero__head { grid-template-rows: auto auto; row-gap: var(--s-5); }
  .hero--product:has(.hero-picks) .hero__head > :first-child { display: contents; }
  .hero--product:has(.hero-picks) .hero__head h1 { grid-column: 1 / span 7; grid-row: 1 / span 2; align-self: end; margin: 0; }
  .hero--product:has(.hero-picks) .hero__head .hero__lead { grid-column: 9 / -1; grid-row: 1; align-self: end; margin: 0; max-width: none; }
  .hero--product:has(.hero-picks) .hero__head > .btn-row { grid-column: 9 / -1; grid-row: 2; justify-content: flex-start; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .hero--product:has(.hero-picks) .hero__head h1 { grid-column: 1 / span 6; }
  .hero--product:has(.hero-picks) .hero__head .hero__lead,
  .hero--product:has(.hero-picks) .hero__head > .btn-row { grid-column: 7 / -1; }
}
@media (max-width: 1023px) { .hero-picks { gap: 12px; margin-top: var(--s-6); } .hero-pick__tag { left: 8px; bottom: 8px; max-width: calc(100% - 16px); font-size: 13px; } }
@media (max-width: 639px) {
  main > section.hero.hero--product { padding-bottom: 16px; }
  main > section.hero.hero--product + section#collections { padding-top: 56px; }
  .hero-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: var(--s-5); }
  .hero-pick__tag { padding: 5px 9px; font-size: 12px; }
}
@media (max-width: 379px) {
  .hero-pick__tag { left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 4px 7px; font-size: 11px; letter-spacing: -0.005em; }
}

/* ------------------------------------------------------------ hero and closing on a phone */
@media (max-width: 639px) {
  .hero .btn--secondary { display: none; }
  .hero .hero__lead { font-size: 16px; line-height: 1.45; }
  footer#contact.closing { padding-top: 64px; }
  footer#contact.closing > .wrap { display: flex; flex-direction: column; gap: var(--s-8); }
  footer#contact .close__media { min-height: 0; aspect-ratio: 16 / 9; flex: none; }
}
footer#contact .closing__links .footer__col a { color: var(--ink); }

/* ------------------------------------------------------------ lightbox: a design seen large */
.lb { padding: 0; border: 0; max-width: none; max-height: none; width: 100%; height: 100%; background: transparent; color: var(--ink); }
.lb::backdrop { background: color-mix(in oklab, #1a1714 88%, transparent); }
.lb[open] { display: grid; place-items: center; }
.lb__inner { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; width: min(100vw - 48px, 1100px); height: min(100dvh - 48px, 960px); background: var(--bg); border-radius: var(--r-lg); overflow: hidden; }
.lb__fig { position: relative; margin: 0; min-height: 0; overflow: hidden; background: var(--surface); }
.lb__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; display: block; }
.lb__bar { position: relative; z-index: 1; background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--s-5); padding: var(--s-5) var(--s-6); border-top: 1px solid var(--line); }
.lb__meta p { margin: 0; }
.lb__coll { font-size: 14px; color: var(--muted); }
.lb__code { font-family: var(--font-display); font-size: 24px; line-height: 1.25; }
.lb__nav { display: flex; align-items: center; gap: var(--s-3); }
.lb__pos { font-size: 14px; color: var(--muted); min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
.lb__nav button, .lb__close { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); color: var(--ink); font-size: 18px; cursor: pointer; transition: background var(--m-out, 120ms) var(--ease, ease); }
.lb__nav button:hover, .lb__close:hover { background: var(--surface); }
.lb__close { position: absolute; top: 16px; right: 16px; z-index: 2; font-size: 26px; line-height: 1; }
html.lb-open { overflow: hidden; }
@media (max-width: 639px) {
  .lb__inner { width: 100vw; height: 100dvh; border-radius: 0; }
  .lb__bar { grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-4); padding: var(--s-4) var(--gut) calc(var(--s-4) + env(safe-area-inset-bottom)); }
  .lb__ask { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .lb__code { font-size: 20px; }
}

/* ------------------------------------------------------------ the header: frosted glass
   The frosted layer sits behind the header on ::before, never on the header itself: a backdrop-filter
   on .nav would trap the phone menu (fixed inside it) in the header's own 64px box. The hairline under
   it shows only once the page has moved under it. */
.nav { background: transparent; border-bottom-color: transparent; transition: border-color 300ms ease; }
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  transition: background-color 300ms ease;
}
.nav.is-scrolled { border-bottom-color: color-mix(in oklab, var(--ink) 9%, transparent); }
.nav.is-open::before { background: var(--bg); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .nav::before { background: var(--bg); } }

/* one WhatsApp button on screen at a time: the header's waits while the hero's own is in view */
.nav .nav__actions .btn--primary { transition: opacity 280ms ease, transform 320ms cubic-bezier(.2, .7, .2, 1), visibility 0s; }
.hero-cta-in .nav:not(.is-open) .nav__actions .btn--primary {
  opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s 200ms;
}

/* ------------------------------------------------------------ motion
   Smooth travel to a section; the hero's four designs rise in turn on load; every block below the
   first screen rises into place as it scrolls in (catalogue.js marks it); photographs fade up from
   their blurred stills. All of it stops for a visitor who asks for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .hero-pick { animation: pick-in 900ms cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(380ms + var(--n, 0) * 110ms); }
  @keyframes pick-in { from { opacity: 0; transform: translateY(36px) scale(.97); } }

  .rv { opacity: 0; transform: translate3d(0, 32px, 0); }
  .rv.is-in {
    opacity: 1; transform: none;
    transition: opacity 800ms cubic-bezier(.2, .65, .25, 1) var(--rv-d, 0ms), transform 950ms cubic-bezier(.2, .65, .25, 1) var(--rv-d, 0ms);
  }

  .pic__img { transition: opacity 600ms ease; }
  .pic__img.is-loading { opacity: 0; }

  /* the large view opens from a soft lift and closes back into it */
  .lb[open] .lb__inner { animation: lb-in 420ms cubic-bezier(.2, .7, .2, 1); }
  .lb[open]::backdrop { animation: lb-fade 320ms ease; }
  .lb.is-closing .lb__inner { animation: lb-out 220ms ease forwards; }
  .lb.is-closing::backdrop { animation: lb-fade 220ms ease reverse forwards; }
  @keyframes lb-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
  @keyframes lb-out { to { opacity: 0; transform: translateY(12px) scale(.98); } }
  @keyframes lb-fade { from { opacity: 0; } }
}

/* ---------------------------------------------------------------- big screens (a 4K monitor, a wide desktop)
   The same scale as the main site's site.css: the column, the spacing and the type grow together by --k. */
@media (min-width: 1920px) { :root { --k: 1.2; } }
@media (min-width: 2560px) { :root { --k: 1.5; } }
@media (min-width: 3200px) { :root { --k: 1.85; } }
@media (min-width: 1920px) {
  :root {
    --container: calc(1280px * var(--k)); --gut: calc(80px * var(--k));
    --padt: calc(120px * var(--k)); --padb: calc(72px * var(--k)); --hgap: calc(48px * var(--k)); --hpadb: calc(64px * var(--k));
    --nav: calc(72px * var(--k)); --head-gap: calc(48px * var(--k));
    --s-1: calc(4px * var(--k)); --s-2: calc(8px * var(--k)); --s-3: calc(12px * var(--k)); --s-4: calc(16px * var(--k)); --s-5: calc(24px * var(--k));
    --s-6: calc(32px * var(--k)); --s-7: calc(48px * var(--k)); --s-8: calc(64px * var(--k)); --s-9: calc(96px * var(--k)); --s-10: calc(128px * var(--k));
    --t-label: calc(13px * var(--k)); --t-small: calc(14px * var(--k)); --t-body: calc(16px * var(--k)); --t-lead: calc(18px * var(--k));
    --t-card: calc(18px * var(--k)); --t-h3: calc(24px * var(--k)); --t-h2: calc(48px * var(--k)); --t-h1: calc(72px * var(--k));
    --ly-scale: calc(.84 * var(--k)); --ly-lead: calc(20px * var(--k));
    --r-sm: calc(8px * var(--k)); --r-md: calc(12px * var(--k)); --r-lg: calc(20px * var(--k)); --r-btn: calc(8px * var(--k));
    --btn-h: calc(44px * var(--k)); --icon: calc(16px * var(--k));
  }
  body { font-size: var(--t-body); }
  .brand-logo { width: calc(44px * var(--k)); height: calc(44px * var(--k)); }
  .nav__link, .btn { font-size: var(--t-body); }
}

/* heights by content, never by the screen (as on the main site): on a tall 4K screen a screen-high section left
   wide empty bands; every section and the footer now take their content's height with the kit's padding */
main > section.section:not(.hero):not([data-moment="pinned-chapters"]) { height: auto; min-height: 0; }
main > section.section:not(.hero):not([data-moment="pinned-chapters"]) > .wrap { height: auto; }
footer.closing { height: auto; min-height: 0; }
footer.closing > .wrap { height: auto; grid-template-rows: auto auto !important; row-gap: calc(var(--padt) + var(--padb)) !important; }
.closing__cta > .close__media { flex: none; height: clamp(200px, 26vw, 420px); min-height: 0; }
