/* Layerr's own page: paper, ink, fabric and stitching, from the Layerr brand kit.
   The current fabric (--main, --deep, --stitch and data-weave on <html>) is set
   in the page head and changed by layerr.js. */

@property --main { syntax: "<color>"; inherits: true; initial-value: #33508F; }
@property --deep { syntax: "<color>"; inherits: true; initial-value: #22386A; }
@property --stitch { syntax: "<color>"; inherits: true; initial-value: #CF7A26; }

:root {
  --paper: #F7F5F2;
  --cream: #FFFDF8;
  --ink: #3C3A36;
  --muted: #726C64;
  --night: #0C0C0E;
  --graphite: #1A1A1D;

  --bg: var(--paper);
  --surface: var(--cream);
  --text: var(--ink);
  --dim: var(--muted);
  --line: rgba(60, 58, 54, 0.12);
  --accent: var(--main);
  --shadow: rgba(12, 12, 14, 0.4);

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --pad: clamp(20px, 5vw, 64px);
  --max: 1240px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  transition: --main 0.7s var(--ease), --deep 0.7s var(--ease), --stitch 0.7s var(--ease);
}

:root[data-theme="dark"] {
  --bg: var(--night);
  --surface: var(--graphite);
  --text: #F3EFE8;
  --dim: #9C968D;
  --line: rgba(255, 253, 248, 0.1);
  --accent: color-mix(in oklab, var(--main) 55%, #FFFDF8);
  --shadow: rgba(0, 0, 0, 0.7);
}

/* Weaves, layered over the fabric's main-to-deep tone */
[data-weave="twill"] { --weave: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 5px); }
[data-weave="plain"] { --weave: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 4px), repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 4px); }
[data-weave="satin"] { --weave: linear-gradient(115deg, transparent 15%, rgba(255, 255, 255, 0.2) 42%, transparent 68%); }
[data-weave="wale"] { --weave: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0 2px, rgba(255, 255, 255, 0.05) 2px 3px, transparent 3px 7px); }

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--main); color: var(--cream); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

h1, h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.03em;
}
h1 em, h2 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.mono {
  margin: 0;
  font: 600 11px/1.4 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--main);
  color: var(--cream);
  font: 500 15px/1 var(--sans);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 14px 30px -14px var(--deep);
  transition: background-color 0.3s, transform 0.3s var(--ease);
}
.btn:hover { background: var(--deep); transform: translateY(-1px); }
.btn--sm { height: 38px; padding: 0 16px; font-size: 13px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16); }

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}
.toggle:hover { border-color: var(--dim); }
.toggle__icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.toggle__icon--sun,
:root[data-theme="dark"] .toggle__icon--moon { display: none; }
:root[data-theme="dark"] .toggle__icon--sun { display: block; }

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background-color 0.3s;
}
.top.is-scrolled { border-bottom-color: var(--line); }

.top__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.top__id { display: flex; align-items: baseline; gap: 14px; min-width: 0; }

.brand {
  font: 600 26px/1 var(--serif);
  letter-spacing: -0.02em;
  color: var(--accent);
}

.top__by {
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.top__by:hover { color: var(--text); }

.top__nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
.top__link {
  padding-bottom: 3px;
  font-size: 14px;
  font-weight: 500;
  color: var(--dim);
  /* A hairline that draws in from the left on hover */
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color 0.2s, background-size 0.45s var(--ease);
}
.top__link:hover { color: var(--text); background-size: 100% 1px; }

/* ---------- fabric surfaces ---------- */

.fabric {
  --r: 36px;
  --inset: 14px;
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  color: var(--cream);
  background-color: var(--main);
  background-image: var(--weave, none), linear-gradient(140deg, var(--main) 0%, var(--deep) 100%);
}

/* The stitched seam inside every fabric card */
.fabric::after {
  content: "";
  position: absolute;
  inset: var(--inset);
  border: 2px dashed var(--stitch);
  border-radius: calc(var(--r) - var(--inset));
  z-index: 2;
  pointer-events: none;
}

.fabric__name {
  position: absolute;
  left: calc(var(--inset) + 0.9em);
  bottom: calc(var(--inset) + 0.6em);
  font: 600 clamp(20px, 2.4vw, 30px)/1 var(--serif);
  letter-spacing: -0.01em;
}
.fabric__weave {
  position: absolute;
  right: calc(var(--inset) + 1.4em);
  bottom: calc(var(--inset) + 1.3em);
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* ---------- hang tag ---------- */

.tag {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 1.55;
}
.tag__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9cqw;
  padding-top: 8cqw;
  border-radius: 6cqw;
  color: var(--ink);
  background: linear-gradient(90deg, #FDFBF6, #F1ECE4 50%, #FBF8F2);
  box-shadow: 0 30px 50px -24px var(--shadow), 0 1px 2px rgba(0, 0, 0, 0.08);
}
.tag__face::before {
  content: "";
  position: absolute;
  top: 12cqw;
  left: 13cqw;
  right: 13cqw;
  height: max(2px, 0.9cqw);
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--stitch) 0 4cqw, transparent 4cqw 6.6cqw);
}
.tag__name {
  font: 600 10cqw/1 var(--serif);
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  text-transform: uppercase;
}
.tag__care {
  width: 22cqw;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  padding-top: clamp(40px, 7vw, 100px);
  padding-bottom: clamp(72px, 10vw, 140px);
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(50px, 8vw, 118px);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.hero__lede {
  max-width: 31em;
  margin: 28px 0 0;
  font-size: clamp(16px, 1.35vw, 18px);
  color: var(--dim);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px 36px;
  margin-top: 40px;
}

.specs { display: flex; margin: 0; }
.specs div { padding: 0 18px; border-left: 1px solid var(--line); }
.specs div:first-child { padding-left: 0; border-left: 0; }
.specs dt { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.specs dd { margin: 7px 0 0; font: 600 13px/1 var(--mono); letter-spacing: 0.06em; }

.art {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 9 / 10;
  justify-self: end;
}

.art__cloth {
  position: absolute;
  inset: 0 0 10% 10%;
  display: grid;
  place-items: center;
  box-shadow: 0 50px 90px -50px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.art__cloth .fabric__name { top: calc(var(--inset) + 0.8em); bottom: auto; font-size: clamp(22px, 2.6vw, 34px); }
.art__cloth .fabric__weave { top: calc(var(--inset) + 1.5em); bottom: auto; }

.art__icon {
  width: 46%;
  height: auto;
  margin-bottom: 8%;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.3));
}

.art__tag {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44%;
  transform: rotate(-7deg);
}

/* ---------- screenshot band ---------- */

.band {
  --r: 0px;
  overflow: clip; /* not hidden: the pinned rail has to stick */
  border-radius: 0;
}
.band__pin { position: relative; padding: clamp(80px, 10vw, 128px) 0; overflow: clip; }
.band__head, .band .shots { position: relative; z-index: 1; }
.band::after { display: none; }

.seam {
  position: absolute;
  left: 0;
  right: 0;
  height: 16px;
  background:
    repeating-linear-gradient(90deg, var(--stitch) 0 18px, transparent 18px 30px) 0 0 / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--stitch) 0 18px, transparent 18px 30px) 0 100% / 100% 2px no-repeat,
    linear-gradient(transparent 35%, rgba(0, 0, 0, 0.22) 50%, rgba(255, 255, 255, 0.08) 56%, transparent 70%);
}
.seam--top { top: 26px; }
.seam--bottom { bottom: 26px; }

.band__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.band .mono { color: rgba(255, 253, 248, 0.68); }
.band h2 { margin-top: 14px; font-size: clamp(34px, 4.6vw, 60px); line-height: 1; }
.band h2 em { color: inherit; }

.shots__track {
  display: flex;
  gap: clamp(12px, 1.4vw, 18px);
  list-style: none;
  margin: 0;
  padding: 10px max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad))) 40px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: max(var(--pad), calc((100vw - var(--max)) / 2 + var(--pad)));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.shots__track::-webkit-scrollbar { display: none; }
.shots__track li {
  position: relative;
  flex: none;
  width: clamp(220px, 23vw, 290px);
  padding-top: 58px;
  scroll-snap-align: start;
  transform-origin: 50% 6px;
}
/* A brass hanger for each piece */
.shots__track li::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 50%;
  width: 130px;
  height: 74px;
  margin-left: -65px;
  background: linear-gradient(115deg, #F8E9C2, #C9A566 40%, #F3DFAE 62%, #9C7A3E);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 74'%3E%3Cpath d='M56 12a9 9 0 1 1 15 7c-4 3-6 5-6 11M65 30 8 66c-3 2-2 5 1 5h112c3 0 4-3 1-5L65 30' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 130 74'%3E%3Cpath d='M56 12a9 9 0 1 1 15 7c-4 3-6 5-6 11M65 30 8 66c-3 2-2 5 1 5h112c3 0 4-3 1-5L65 30' fill='none' stroke='%23000' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* ...on a brass rail */
.band .shots::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 18px;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(#FBF0D2, #C9A566 45%, #7E5F30);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}
.shots__track img {
  width: 100%;
  height: auto;
  border-radius: clamp(22px, 2.4vw, 30px);
  box-shadow: 0 30px 50px -30px rgba(0, 0, 0, 0.6);
  user-select: none;
  -webkit-user-drag: none;
}

.band__hint { display: none; }
@media (hover: hover) and (pointer: fine) {
  .band__hint { display: block; }
  .shots__track { cursor: grab; scroll-snap-type: none; }
  .shots__track.is-dragging { cursor: grabbing; }
}

/* ---------- chapters ---------- */

.chapter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(40px, 7vw, 120px);
  padding-top: clamp(96px, 12vw, 176px);
}
.chapter--flip .chapter__text { order: 2; }

.chapter h2,
.fabrics h2,
.private h2 {
  margin-top: 18px;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 0.98;
}

.chapter__text > p:not(.mono),
.fabrics__intro > p:not(.mono),
.private__text > p:not(.mono) {
  max-width: 30em;
  margin: 24px 0 0;
  font-size: clamp(16px, 1.3vw, 18px);
  color: var(--dim);
}

.points { list-style: none; max-width: 30em; margin: 36px 0 0; padding: 0; }
.points li {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
/* A single stitch for a bullet */
.points li::before {
  content: "";
  flex: none;
  width: 12px;
  height: 2px;
  margin-top: 0.75em;
  border-radius: 1px;
  background: var(--stitch);
}

.chapter__art { display: flex; justify-content: center; }

.card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: clamp(26px, 3.4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 50px 80px -56px var(--shadow);
}

.card__title {
  margin: 12px 0 0;
  font: 600 clamp(24px, 2.4vw, 30px)/1.1 var(--serif);
  letter-spacing: -0.02em;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font: 500 12px/1 var(--sans);
  color: var(--accent);
  background: color-mix(in srgb, var(--main) 13%, transparent);
  white-space: nowrap;
}

/* Item card, styled like a garment label */
.item__stitch {
  display: block;
  height: 2px;
  margin-bottom: 26px;
  background: repeating-linear-gradient(90deg, var(--stitch) 0 10px, transparent 10px 17px);
}
.item__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 16px;
  margin: 30px 0 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.item__grid dt,
.care dt { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.item__grid dd,
.care dd { margin: 8px 0 0; font: 600 15px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; }

/* Store artwork: the app on real cloth */
.shot { margin: 0; }
.shot img {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  border-radius: 28px;
  box-shadow: 0 50px 80px -56px var(--shadow);
}

/* Streak */
.streak__count { display: flex; align-items: baseline; gap: 14px; }
.streak__num { font: 600 clamp(64px, 7vw, 92px)/0.9 var(--serif); letter-spacing: -0.04em; color: var(--accent); }
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  text-align: center;
  font: 600 10px/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--dim);
}
.week span {
  display: block;
  aspect-ratio: 1;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--c);
  background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 4px);
}
.week .is-today { color: var(--text); }
.week .is-today span { background: none; border: 2px dashed var(--stitch); }
.streak__basket {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--dim);
}
.streak__basket p { margin: 0; }
.streak__basket strong { color: var(--text); font-weight: 500; }

/* ---------- fabrics ---------- */

.fabrics {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: start;
  gap: clamp(40px, 6vw, 96px);
  padding-top: clamp(112px, 14vw, 200px);
}

.preview { display: flex; align-items: center; gap: 22px; margin: 40px 0 0; }
.preview img {
  width: clamp(96px, 10vw, 128px);
  height: auto;
  filter: drop-shadow(0 18px 24px var(--shadow));
}

.swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 1.6vw, 20px);
}

.swatch {
  --r: 24px;
  --inset: 9px;
  aspect-ratio: 5 / 4;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: 0 24px 40px -30px var(--shadow);
  outline: 2px solid transparent;
  outline-offset: 5px;
  transition: transform 0.4s var(--ease), outline-color 0.3s;
}
.swatch:hover { transform: translateY(-3px); }
.swatch[aria-pressed="true"] { outline-color: var(--text); }
.swatch .fabric__name { font-size: clamp(16px, 1.6vw, 21px); left: calc(var(--inset) + 12px); bottom: calc(var(--inset) + 12px); }
.swatch .fabric__weave { right: calc(var(--inset) + 12px); top: calc(var(--inset) + 14px); bottom: auto; font-size: 9px; }

/* ---------- privacy ---------- */

#private { padding-top: clamp(112px, 14vw, 200px); }

.private {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: clamp(40px, 6vw, 96px);
  padding: clamp(40px, 7vw, 96px);
  border-radius: 36px;
  background: var(--night);
  color: var(--cream);
}
:root[data-theme="dark"] .private { background: var(--graphite); }
.private .mono,
.private__text > p:not(.mono) { color: rgba(255, 253, 248, 0.64); }
.private h2 em { color: color-mix(in oklab, var(--main) 50%, var(--cream)); }

.care {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 28px;
  margin: 0;
  padding: clamp(26px, 3vw, 36px);
  border-radius: 20px;
  color: var(--ink);
  background: linear-gradient(90deg, #FDFBF6, #F1ECE4 50%, #FBF8F2);
  transform: rotate(1.5deg);
}
.care dt { color: #8A847B; }

/* ---------- closing ---------- */

.closer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(120px, 15vw, 220px);
  padding-bottom: clamp(100px, 13vw, 180px);
}
.closer__art {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 60px 100px -70px var(--shadow);
  transform: translateZ(0); /* keeps Safari clipping the zooming image to the corners */
}
.closer__art img { display: block; width: 100%; height: auto; }
.closer h2 { margin-top: clamp(56px, 7vw, 96px); font-size: clamp(44px, 6.4vw, 92px); line-height: 0.96; }
.closer p { margin: 20px 0 36px; font-size: 18px; color: var(--dim); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 40px;
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.foot__id p { margin: 10px 0 0; font-size: 14px; color: var(--dim); }
.foot__id p a { color: var(--text); }
.foot__id p a:hover,
.foot__links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 14px; color: var(--dim); }
.foot__links a:hover { color: var(--text); }

/* ---------- reveal on scroll ---------- */

.reveal [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.reveal [data-reveal].is-in { opacity: 1; transform: none; }
.reveal .art[data-reveal] { transform: translateY(28px) scale(0.98); transition-duration: 1.4s; }
.reveal .art[data-reveal].is-in { transform: none; }

/* ---------- motion ----------
   The reveal pieces below only run with .reveal on <html>, which the page head
   sets when motion is welcome; the reduced-motion rule at the end stops the rest. */

/* Hero headline rises line by line from behind its own baseline */
.lines > span {
  display: block;
  overflow: hidden;
  padding: 0.08em 0.14em 0.14em 0;
  margin: -0.08em -0.14em -0.14em 0;
}
.lines > span > span { display: block; }
.reveal h1.lines[data-reveal] { opacity: 1; transform: none; }
.reveal .lines > span > span { transform: translateY(112%); transition: transform 1.4s var(--ease); }
.reveal .lines > span:nth-child(2) > span { transition-delay: 0.14s; }
.reveal .lines.is-in > span > span { transform: none; }

/* The hang tag drops onto its corner, settles, then barely moves; its stitch sews itself */
.art__tag { transform-origin: 50% 6%; }
.reveal .art.is-in .art__tag {
  animation: tag-hang 1.9s ease-in-out 0.45s both, tag-sway 9s ease-in-out 2.35s infinite alternate;
}
@keyframes tag-hang {
  0% { transform: translateY(-14px) rotate(-24deg); }
  38% { transform: rotate(-1deg); }
  62% { transform: rotate(-10.5deg); }
  82% { transform: rotate(-5.5deg); }
  100% { transform: rotate(-7deg); }
}
@keyframes tag-sway { from { transform: rotate(-7deg); } to { transform: rotate(-5deg); } }

.reveal .art .tag__face::before { clip-path: inset(0 100% 0 0); transition: clip-path 1.4s var(--ease) 1.3s; }
.reveal .art.is-in .tag__face::before { clip-path: inset(0); }

.reveal .art.is-in .art__icon { animation: float 7s ease-in-out 1.6s infinite alternate; }
@keyframes float { to { transform: translateY(-9px); } }

/* Seams run across the band like a machine stitch, then the screenshots slide in */
.reveal [data-sew] .seam {
  background-size: 0% 2px, 0% 2px, 100% 100%;
  transition: background-size 2.4s var(--ease) 0.1s;
}
.reveal [data-sew] .seam--bottom { transition-delay: 0.45s; }
.reveal [data-sew].is-in .seam { background-size: 100% 2px, 100% 2px, 100% 100%; }

.reveal .band .shots__track li {
  opacity: 0;
  transform: translateX(56px);
  transition: opacity 1s var(--ease), transform 1.3s var(--ease);
  transition-delay: calc(0.25s + var(--i, 0) * 80ms);
}
.reveal .band.is-in .shots__track li { opacity: 1; transform: none; }

/* Bullet points follow their heading in, each stitch drawn as it lands */
.reveal .points li {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(0.35s + var(--i, 0) * 110ms);
}
.reveal .points li::before {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease);
  transition-delay: calc(0.6s + var(--i, 0) * 110ms);
}
.reveal .is-in .points li,
.reveal .is-in .points li::before { opacity: 1; transform: none; }

/* The item card's top stitch sews across */
.reveal .item__stitch {
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 1.6s var(--ease) 0.4s;
}
.reveal .is-in .item__stitch { background-size: 100% 100%; }

/* The week fills in a day at a time while the streak counts up (layerr.js) */
.reveal .week li {
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  transition: opacity 0.6s var(--ease), transform 0.9s var(--ease);
  transition-delay: calc(0.3s + var(--i, 0) * 90ms);
}
.reveal .is-in .week li { opacity: 1; transform: none; }

/* The care label is pinned on a beat after its panel */
.reveal .private .care {
  opacity: 0;
  transform: translateY(26px) rotate(6deg);
  transition: opacity 1s var(--ease) 0.35s, transform 1.5s var(--ease) 0.35s;
}
.reveal .private.is-in .care { opacity: 1; transform: rotate(1.5deg); }

/* Tied to scrolling, where the browser supports it: the store artwork drifts a
   little against the page, and the patchwork eases out of a slight zoom */
@supports (animation-timeline: view()) {
  .shot img {
    animation: drift linear both;
    animation-timeline: view();
    animation-range: cover;
  }
  @keyframes drift {
    from { transform: translateY(36px); }
    to { transform: translateY(-36px); }
  }

  .closer__art img {
    animation: settle linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 55%;
  }
  @keyframes settle {
    from { transform: scale(1.12); }
    to { transform: scale(1); }
  }
}

/* ---------- the fancy layer ---------- */

/* The opening: two panels of cloth, a seam sewn down the middle, then they part */
.curtain { display: none; }
.intro .curtain {
  display: block;
  position: fixed;
  z-index: 100;
  inset: 0;
  pointer-events: none;
  animation: curtain-off 0.01s linear 2s forwards;
}
@keyframes curtain-off { to { visibility: hidden; } }
.curtain__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  background-color: var(--main);
  background-image: var(--weave, none), linear-gradient(140deg, var(--main), var(--deep));
  animation: 1.05s cubic-bezier(0.76, 0, 0.18, 1) 0.85s forwards;
}
.curtain__panel--l { left: 0; animation-name: part-l; }
.curtain__panel--r { right: 0; animation-name: part-r; }
@keyframes part-l { to { transform: translateX(-101%); } }
@keyframes part-r { to { transform: translateX(101%); } }
.curtain__seam {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: repeating-linear-gradient(var(--stitch) 0 16px, transparent 16px 28px);
  animation: seam-sew 0.75s cubic-bezier(0.5, 0, 0.2, 1) both, seam-fade 0.3s linear 0.85s forwards;
}
@keyframes seam-sew { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes seam-fade { to { opacity: 0; } }
.curtain__name {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 0.28em 0.7em 0.34em;
  border-radius: 0.2em;
  color: var(--ink);
  background: linear-gradient(90deg, #FDFBF6, #F1ECE4 50%, #FBF8F2);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55);
  font: 600 clamp(26px, 3.6vw, 44px)/1 var(--serif);
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
  animation: name-in 0.6s var(--ease) 0.1s both, name-out 0.4s var(--ease) 0.82s forwards;
}
@keyframes name-in { from { opacity: 0; transform: translate(-50%, -38%) rotate(-5deg); } }
@keyframes name-out { to { opacity: 0; transform: translate(-50%, -66%) rotate(3deg); } }

/* Scroll progress: a thread sewn along the top bar */
.thread {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--stitch) 0 12px, transparent 12px 20px);
  clip-path: inset(0 calc(100% - var(--p, 0) * 100%) 0 0);
}

/* Moving cloth, drawn by layerr.js; the CSS weave underneath stays as the fallback */
.drape { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; display: block; }
.art__cloth > :not(.drape) { z-index: 2; }
.art__icon { position: relative; }

/* Light that follows the pointer across a surface */
[data-sheen]::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.26), transparent 62%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s var(--ease);
}
[data-sheen].is-lit::before { opacity: 1; }
.card[data-sheen]::before { background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--stitch) 16%, transparent), transparent 66%); }
.card > * { position: relative; z-index: 2; }

/* Surfaces that lean toward the pointer */
[data-tilt] { transition: transform 0.9s var(--ease); will-change: transform; }
[data-tilt].is-tilting { transition: transform 0.12s linear; }

/* The stitch inside every fabric sews itself around once it's in view */
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 360deg; }
.reveal .swatch::after,
.reveal .art__cloth::after {
  --sweep: 0deg;
  -webkit-mask: conic-gradient(from -45deg, #000 var(--sweep), transparent 0);
  mask: conic-gradient(from -45deg, #000 var(--sweep), transparent 0);
  transition: --sweep 1.8s cubic-bezier(0.5, 0, 0.2, 1) var(--sew-delay, 0.5s);
}
.reveal .is-in .swatch::after,
.reveal .is-in .art__cloth::after,
.reveal .art.is-in .art__cloth::after { --sweep: 360deg; }

/* Swatches are laid out one at a time */
.reveal .swatches .swatch {
  opacity: 0;
  translate: 0 26px;
  scale: 0.94;
  transition: opacity 0.8s var(--ease), translate 1.1s var(--ease), scale 1.1s var(--ease), transform 0.9s var(--ease), outline-color 0.3s;
  transition-delay: calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms), calc(var(--i, 0) * 90ms), 0s, 0s;
  --sew-delay: calc(0.3s + var(--i, 0) * 120ms);
}
.reveal .swatches.is-in .swatch { opacity: 1; translate: 0 0; scale: 1; }

/* Every heading rises a word at a time */
.w { display: inline-block; overflow: hidden; padding: 0.08em 0.1em 0.14em 0; margin: -0.08em -0.1em -0.14em 0; vertical-align: top; }
.wi { display: inline-block; }
.reveal .wi { transform: translateY(115%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.15s var(--ease); transition-delay: calc(0.12s + var(--w, 0) * 75ms); }
.reveal .is-in .wi { transform: none; }

/* The hero's italic catches the light once, in the stitch color */
.hero h1 em {
  background: linear-gradient(100deg, var(--accent) 40%, var(--stitch) 50%, var(--accent) 60%) 100% 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.reveal .lines.is-in em { animation: catch-light 2.6s var(--ease) 1.2s; }
@keyframes catch-light { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* Store artwork unrolls upward */
.reveal .shot[data-reveal] { opacity: 1; transform: none; }
.reveal .shot img { clip-path: inset(100% 0 0 0 round 28px); transition: clip-path 1.5s cubic-bezier(0.7, 0, 0.15, 1); }
.reveal .shot.is-in img { clip-path: inset(-20% -20% -20% -20% round 0px); }

/* A line from the hang tag, drifting opposite ways with the scroll */
.ribbon {
  margin-top: clamp(96px, 12vw, 176px);
  overflow: clip;
  font: 600 clamp(44px, 8.4vw, 124px)/1.12 var(--serif);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.ribbon__line { margin: 0; translate: calc(var(--drift, 0) * -18vw) 0; color: var(--accent); }
.ribbon__line i { color: var(--stitch); font-weight: 400; }
.ribbon__line--back {
  translate: calc(-40vw + var(--drift, 0) * 18vw) 0;
  color: transparent;
  font-style: italic;
  font-weight: 500;
  -webkit-text-stroke: 1px var(--dim);
}
.ribbon__line--back i { color: transparent; }
@supports (animation-timeline: view()) {
  .ribbon__line { animation: drift-l linear both; animation-timeline: view(); }
  .ribbon__line--back { animation-name: drift-r; }
  @keyframes drift-l { from { translate: 6vw 0; } to { translate: -46vw 0; } }
  @keyframes drift-r { from { translate: -56vw 0; } to { translate: -6vw 0; } }
}

/* Buttons: a stitch appears inside on hover, and light passes across */
.btn { position: relative; overflow: hidden; }
.btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px dashed color-mix(in srgb, var(--stitch) 80%, #fff);
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-110%);
}
.btn:hover::before { opacity: 1; }
.btn:hover::after { transform: translateX(110%); transition: transform 0.9s var(--ease); }

/* The fabric change sweeps out from where you tapped (layerr.js) */
:root.is-dyeing { transition: none; }
::view-transition-old(root),
::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }

/* On a big screen the rail holds still while the pieces pass by */
.band.is-pinned .band__pin {
  position: sticky;
  top: 68px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: calc(100vh - 68px);
  padding: 0;
}
.band.is-pinned .band__head { width: 100%; }
.band.is-pinned .shots__track { overflow: hidden; }
.band.is-pinned .shots__track li { width: clamp(150px, calc((100vh - 440px) * 0.46), 290px); }

/* ---------- small screens ---------- */

@media (max-width: 900px) {
  .hero,
  .chapter,
  .fabrics,
  .private { grid-template-columns: 1fr; }
  .art { justify-self: center; max-width: 440px; }
  .chapter--flip .chapter__text { order: 0; }
  .top__link { display: none; }
  .ribbon { font-size: 44px; }
}

@media (max-width: 560px) {
  .top__by { display: none; }
  .swatches { grid-template-columns: 1fr 1fr; }
  .hero__cta .btn { width: 100%; }
  .band__head { display: block; }
  .item__grid { grid-template-columns: 1fr 1fr; }
  .private { border-radius: 28px; }
  .care { transform: none; }
  /* Keep the hang tag big enough to read: crop the patchwork's sides instead */
  .closer__art { border-radius: 22px; }
  .closer__art img { aspect-ratio: 4 / 3; object-fit: cover; }
  .reveal .private.is-in .care { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .curtain { display: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
