/* Concept A · The Thread
   One continuous gold thread sews the page together as you scroll. Ivory and wine, Fraunces at scale,
   craft revealed through a loupe. Restraint everywhere except the stitch. */
body { --gut: clamp(12px, 1.6vw, 26px); --menu-bg: var(--wine); --menu-fg: var(--ivory); }
main { position: relative; }
.z { position: relative; z-index: 3; } /* the thread passes behind these */
em { font-style: italic; }

/* ---------- preloader ---------- */
.pre { position: fixed; inset: 0; z-index: 1400; background: var(--ivory); display: grid; place-items: center; }
.pre__inner { width: min(62vw, 440px); display: flex; flex-direction: column; align-items: center; gap: 26px; }
.pre__stitch { width: 100%; height: 12px; overflow: visible; }
.pre__stitch path { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 9 7; vector-effect: non-scaling-stroke; }
.pre__mark { width: min(54vw, 300px); }
.pre__note { color: var(--muted); }

/* ---------- header ---------- */
.hdr {
  position: fixed; inset: 0 0 auto; z-index: 1000; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 20px var(--pad); transition: transform .9s var(--ease-io), background-color .6s, box-shadow .6s;
}
.hdr.is-scrolled { background: rgba(251, 247, 241, .86); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.hdr.is-hidden { transform: translateY(-105%); }
.hdr__logo img { width: clamp(96px, 8.6vw, 128px); height: auto; }
.hdr__btn { justify-self: start; padding: 12px 0; }
.hdr__btn--end { justify-self: end; }
.menu-open .hdr { background: transparent; box-shadow: none; }
.menu-open .hdr__logo img { filter: brightness(0) invert(1); }
.menu-open .hdr__btn { color: var(--ivory); position: relative; z-index: 1300; }

/* ---------- the thread ---------- */
.thread { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: hidden; }
.thread__path { fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.thread__knot { fill: var(--wine); transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform 1s var(--ease-out); }
.thread__knot.is-on { transform: scale(1); }
.needle line { stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; }
.needle ellipse { fill: none; stroke: var(--ink); stroke-width: 1; }
.needle { transition: opacity .4s; }
.needle.is-off { opacity: 0; }

/* ---------- type ---------- */
.h2 {
  font: 300 clamp(48px, 6.4vw, 118px)/.94 var(--serif); letter-spacing: -.032em;
  font-variation-settings: 'opsz' 144, 'SOFT' 40;
}
.h2 em { color: var(--wine); }
.chap { color: var(--gold-text); margin-bottom: 26px; }
.lede { font-size: clamp(17px, 1.25vw, 20px); line-height: 1.65; color: var(--muted); max-width: 34ch; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 16px; height: 60px; padding: 0 32px; border-radius: 99px;
  background: var(--wine); color: var(--ivory); font: 500 12px/1 var(--label); letter-spacing: .2em; text-transform: uppercase;
  transition: background-color .5s, color .5s;
}
.btn i { font-style: normal; display: inline-block; transition: transform .6s var(--ease-out); }
.btn:hover i { transform: translateX(6px); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut);
  grid-template-rows: 1fr auto auto; padding: 17vh var(--pad) 4.5vh;
}
.hero__title {
  grid-column: 1 / 9; grid-row: 1; align-self: end; margin: 0;
  font: 300 clamp(70px, 12.6vw, 240px)/.84 var(--serif); letter-spacing: -.045em;
  --wg: 300; --soft: 30;
  font-variation-settings: 'wght' var(--wg), 'SOFT' var(--soft), 'opsz' 144;
}
.hero__ln { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.hero__ln .w { display: inline-block; }
.hero__ln--it { padding-left: 1.04em; font-style: italic; color: var(--wine); }
.hero__arch { grid-column: 9 / 13; grid-row: 1 / 3; align-self: end; display: flex; flex-direction: column; gap: 14px; }
.hero__arch-in { aspect-ratio: 3 / 4.1; overflow: hidden; border-radius: 999px 999px 0 0; background: var(--blush); }
.hero__arch-in img { width: 100%; height: 112%; object-fit: cover; object-position: 50% 18%; }
.hero__arch figcaption { color: var(--muted); }
.hero__intro { grid-column: 1 / 5; grid-row: 2; margin-top: 5vh; max-width: 32ch; color: var(--muted); }
.hero__meta {
  grid-column: 1 / -1; grid-row: 3; display: flex; justify-content: space-between; gap: 20px;
  margin-top: 5vh; padding-top: 18px; border-top: 1px solid var(--line);
}
.hero__cue i { font-style: normal; display: inline-block; animation: cue 2.4s var(--ease-io) infinite; }
@keyframes cue { 0%, 100% { transform: translateY(-2px); opacity: .5; } 50% { transform: translateY(4px); opacity: 1; } }

/* ---------- manifesto ---------- */
.manifesto { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); padding: 28vh var(--pad) 26vh; }
.manifesto__label { grid-column: 1 / 3; color: var(--gold-text); padding-top: 1.3em; }
.manifesto__text {
  grid-column: 3 / 12; font: 300 clamp(30px, 4.35vw, 80px)/1.1 var(--serif); letter-spacing: -.022em;
  font-variation-settings: 'opsz' 144, 'SOFT' 40;
}
.manifesto__text em { color: var(--wine); }

/* ---------- chapter I: look closer ---------- */
.hand { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); align-items: center; padding: 8vh var(--pad) 22vh; }
.hand__fig { grid-column: 2 / 7; aspect-ratio: 1067 / 1600; overflow: hidden; background: var(--blush); touch-action: pan-y; }
.hand__fig > img { width: 100%; height: 100%; object-fit: cover; }
.loupe { position: absolute; left: 0; top: 0; width: clamp(150px, 15vw, 240px); aspect-ratio: 1; pointer-events: none; will-change: transform; }
.loupe__in {
  width: 100%; height: 100%; border-radius: 50%; background-repeat: no-repeat; background-color: var(--blush);
  box-shadow: 0 0 0 1px rgba(251, 247, 241, .95), 0 0 0 7px rgba(251, 247, 241, .18), 0 22px 60px -12px rgba(31, 27, 29, .6);
  transform: scale(.2); opacity: 0;
}
.loupe__label { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); color: var(--ivory); text-shadow: 0 1px 10px rgba(0, 0, 0, .55); white-space: nowrap; opacity: 0; transition: opacity .4s; }
.loupe.is-on .loupe__label { opacity: 1; }
.hand__hint {
  position: absolute; left: 18px; bottom: 18px; color: var(--ivory); padding: 10px 14px; border-radius: 99px;
  background: rgba(31, 27, 29, .38); backdrop-filter: blur(8px); transition: opacity .5s;
}
.hand__hint.is-off { opacity: 0; }
.hand__copy { grid-column: 8 / 12; }
.prod { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; margin: 38px 0 34px; padding: 20px 0; border-top: 1px solid var(--gold); border-bottom: 1px solid var(--line); }
.prod__name { font: 300 26px/1.2 var(--serif); }
.prod__price { font: 500 15px/1.6 var(--label); letter-spacing: .1em; }
.prod__note { grid-column: 1 / -1; font: 500 12px/1.4 var(--label); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-text); }

/* ---------- chapter II: the index ---------- */
.idx { padding: 14vh var(--pad) 20vh; }
.idx__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); align-items: end; margin-bottom: 7vh; }
.idx__head .chap { grid-column: 1 / -1; }
.idx__head .h2 { grid-column: 1 / 9; }
.idx__sub { grid-column: 10 / 13; color: var(--muted); padding-bottom: .6em; }
.idx__list { border-top: 1px solid var(--ink); }
.idx__row a {
  position: relative; display: grid; grid-template-columns: 5ch minmax(0, 1fr) 20ch 9ch; align-items: baseline; gap: 2vw;
  padding: 2.2vh 0 2vh; border-bottom: 1px solid var(--line); transition: opacity .55s var(--ease-out), color .55s;
}
.idx__n { font: 500 12px var(--label); letter-spacing: .2em; color: var(--gold-text); }
.idx__name {
  font: 300 clamp(30px, 4.4vw, 82px)/1 var(--serif); letter-spacing: -.028em; --wg: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 30, 'wght' var(--wg);
  transition: transform .9s var(--ease-out), font-variation-settings .9s var(--ease-out), color .5s;
}
.idx__meta { color: var(--muted); }
.idx__price { justify-self: end; font: 500 15px var(--label); letter-spacing: .1em; }
.idx__thumb { display: none; }
@media (hover: hover) {
  .idx__list:hover .idx__row a { opacity: .3; }
  .idx__list .idx__row a:hover { opacity: 1; }
  .idx__row a:hover .idx__name { transform: translateX(2.4vw); font-variation-settings: 'opsz' 144, 'SOFT' 100, 'wght' 420; color: var(--wine); }
}
.idx__all { display: inline-flex; gap: 12px; margin-top: 5vh; padding-bottom: 8px; border-bottom: 1px solid var(--gold); color: var(--wine); }
.prev {
  position: fixed; left: 0; top: 0; z-index: 40; width: clamp(200px, 18vw, 300px); aspect-ratio: 2 / 3; pointer-events: none;
  opacity: 0; visibility: hidden; overflow: hidden; background: var(--blush); will-change: transform;
}
.prev img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; opacity: 0; }

/* ---------- chapter III: made to order ---------- */
.mto { background: var(--blush); padding: 16vh var(--pad) 18vh; position: relative; }
.mto__head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); align-items: end; }
.mto__head .chap { grid-column: 1 / -1; }
.mto__head .h2 { grid-column: 1 / 9; }
.mto__head .lede { grid-column: 9 / 13; margin-top: 0; }
.stitch { position: relative; margin: 14vh 2vw 0; padding-bottom: 150px; }
.stitch svg { width: 100%; height: 20px; overflow: visible; }
.stitch path { fill: none; stroke-width: 2.2; stroke-dasharray: 12 9; vector-effect: non-scaling-stroke; }
.stitch__ghost path { stroke: rgba(126, 98, 36, .22); }
.stitch__live { position: absolute; left: 0; top: 0; width: 100%; }
.stitch__live path { stroke: var(--gold); }
.stitch__steps { position: absolute; left: 0; right: 0; top: 0; height: 100%; }
.stitch__step { position: absolute; top: 0; left: calc(var(--at) * 100%); width: min(22vw, 270px); display: flex; flex-direction: column; gap: 6px; padding-top: 34px; }
.stitch__step[data-at='1'] { transform: translateX(-100%); text-align: right; align-items: flex-end; }
.stitch__step[data-at='.6'] { transform: translateX(-50%); text-align: center; align-items: center; }
.stitch__step i { position: absolute; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--wine); transform: scale(0); transition: transform .9s var(--ease-out); }
.stitch__step[data-at='0'] i { left: -8px; } .stitch__step[data-at='.6'] i { left: calc(50% - 8px); } .stitch__step[data-at='1'] i { right: -8px; }
.stitch__step.is-on i { transform: scale(1); }
.stitch__step .label { color: var(--gold-text); }
.stitch__step b { font: 300 clamp(24px, 2.2vw, 34px)/1.1 var(--serif); }
.stitch__txt { font-size: 15px; color: var(--muted); line-height: 1.5; }
.when { margin-top: 10vh; padding-top: 6vh; border-top: 1px solid rgba(110, 20, 35, .18); display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; align-items: end; }
.when__q { display: flex; flex-direction: column; gap: 18px; }
.when__h { font: 300 clamp(34px, 3.6vw, 60px)/1 var(--serif); letter-spacing: -.02em; }
.when__field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font: 500 12px var(--label); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.when__field input {
  font: 300 clamp(22px, 1.9vw, 30px) var(--serif); color: var(--wine); background: transparent; border: 0; border-bottom: 1px solid var(--wine);
  padding: 6px 2px; min-height: 48px; letter-spacing: 0; text-transform: none;
}
.when__a { font: 300 clamp(22px, 2.1vw, 36px)/1.3 var(--serif); letter-spacing: -.01em; }
.when__a em { color: var(--wine); }
.when__a a { color: var(--wine); border-bottom: 1px solid var(--gold); }

/* ---------- chapter IV: occasions ---------- */
.occ { padding: 18vh var(--pad) 12vh; overflow: clip; }
.occ__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5vh; }
.occ__head .chap { margin: 0; }
.occ__sub { color: var(--muted); }
.occ__list { border-top: 1px solid var(--ink); }
.occ__list a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 2vw; padding: 1vh 0 1.4vh; border-bottom: 1px solid var(--line); }
.occ__word, .occ__fill {
  font: 300 clamp(44px, 8.4vw, 160px)/1.04 var(--serif); letter-spacing: -.04em;
  font-variation-settings: 'opsz' 144, 'SOFT' 30; white-space: nowrap;
}
.occ__fill {
  position: absolute; left: 0; top: 1vh; color: transparent; -webkit-background-clip: text; background-clip: text;
  background-size: cover; background-position: 50% 42%; opacity: 0;
  transition: opacity .9s var(--ease-out), background-position 2.6s var(--ease-out);
}
.occ__word { transition: color .7s var(--ease-out); }
.occ__count { flex: none; color: var(--muted); transition: color .5s; }
@media (hover: hover) {
  .occ__list a:hover .occ__fill { opacity: 1; background-position: 50% 26%; }
  .occ__list a:hover .occ__word { color: transparent; }
  .occ__list a:hover .occ__count { color: var(--wine); }
}

/* ---------- finale ---------- */
.fin { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gut); align-items: end; padding: 20vh var(--pad) 16vh; }
.fin__title {
  grid-column: 1 / 9; grid-row: 1; font: 300 clamp(64px, 11.6vw, 220px)/.86 var(--serif); letter-spacing: -.045em;
  font-variation-settings: 'opsz' 144, 'SOFT' 40;
}
.fin__title em { color: var(--wine); }
.fin__fig { grid-column: 10 / 13; grid-row: 1 / 3; aspect-ratio: 3 / 4.2; overflow: hidden; border-radius: 999px 999px 0 0; background: var(--blush); }
.fin__fig img { width: 100%; height: 118%; object-fit: cover; object-position: 50% 12%; }
.fin__act { grid-column: 1 / 9; grid-row: 2; position: relative; display: flex; align-items: flex-end; gap: 4vw; flex-wrap: wrap; margin-top: 7vh; }
.fin__knot { position: absolute; left: -12px; top: 30px; width: 1px; height: 1px; }
.join { flex: 1 1 320px; max-width: 460px; }
.join__label { display: block; font: 300 22px/1.3 var(--serif); margin-bottom: 14px; }
.join__row { display: flex; border-bottom: 1px solid var(--ink); }
.join__row input { flex: 1; min-width: 0; border: 0; background: transparent; font: 400 17px var(--body); padding: 14px 0; color: var(--ink); }
.join__row input::placeholder { color: #7b7275; }
.join__row button { padding: 0 6px 0 18px; color: var(--wine); }
.join__msg { margin-top: 12px; font-size: 14px; color: var(--muted); }

/* ---------- footer ---------- */
.ft { position: relative; overflow: hidden; padding: 0 var(--pad); border-top: 1px solid var(--line); }
.ft__row { display: flex; flex-wrap: wrap; gap: 14px 34px; padding: 26px 0 0; color: var(--muted); }
.ft__row span { margin-left: auto; }
.ft__mark { width: 100%; height: auto; margin: 6vh 0 -4.5vw; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; padding-top: 15vh; row-gap: 4vh; }
  .hero__title { grid-column: 1; grid-row: 1; font-size: clamp(64px, 19vw, 150px); }
  .hero__arch { grid-column: 1; grid-row: 2; width: 66%; justify-self: end; }
  .hero__intro { grid-column: 1; grid-row: 3; margin-top: 0; }
  .hero__meta { grid-row: 4; flex-direction: column; gap: 8px; margin-top: 0; }
  .manifesto { padding: 16vh var(--pad); }
  .manifesto__label { grid-column: 1 / -1; padding: 0 0 18px; }
  .manifesto__text { grid-column: 1 / -1; font-size: clamp(28px, 7.4vw, 46px); }
  .hand { grid-template-columns: 1fr; row-gap: 6vh; padding-bottom: 14vh; }
  .hand__fig, .hand__copy { grid-column: 1; }
  .idx__head .h2, .idx__sub { grid-column: 1 / -1; }
  .idx__sub { margin-top: 16px; }
  .idx__row a { grid-template-columns: 56px 1fr auto; grid-template-areas: 'thumb name price' 'thumb meta price'; gap: 4px 14px; align-items: center; padding: 14px 0; }
  .idx__n { display: none; }
  .idx__thumb { display: block; grid-area: thumb; width: 56px; height: 76px; object-fit: cover; object-position: 50% 12%; }
  .idx__name { grid-area: name; font-size: clamp(22px, 6vw, 34px); }
  .idx__meta { grid-area: meta; }
  .idx__price { grid-area: price; }
  .prev { display: none; }
  .mto__head .h2, .mto__head .lede { grid-column: 1 / -1; }
  .mto__head .lede { margin-top: 24px; }
  .stitch { margin: 9vh 0 0; padding-bottom: 0; }
  .stitch svg { display: none; }
  .stitch__live { display: none; }
  .stitch__steps { position: static; display: flex; flex-direction: column; gap: 28px; border-left: 2px dashed var(--gold); padding-left: 22px; }
  .stitch__step, .stitch__step[data-at='1'], .stitch__step[data-at='.6'] { position: relative; left: auto; width: auto; transform: none; text-align: left; align-items: flex-start; padding-top: 0; }
  .stitch__step i, .stitch__step[data-at='0'] i, .stitch__step[data-at='.6'] i, .stitch__step[data-at='1'] i { left: -31px; right: auto; top: 4px; transform: scale(1); }
  .when { grid-template-columns: 1fr; }
  .occ__word, .occ__fill { font-size: clamp(34px, 10vw, 64px); white-space: normal; }
  .occ__head { flex-direction: column; gap: 10px; }
  .fin { grid-template-columns: 1fr; row-gap: 5vh; }
  .fin__title { grid-column: 1; font-size: clamp(60px, 18vw, 130px); }
  .fin__fig { grid-column: 1; grid-row: 2; width: 58%; justify-self: end; }
  .fin__act { grid-column: 1; grid-row: 3; margin-top: 0; }
  .ft__row span { margin-left: 0; }
}
