/* Direct transfer from soffiro-source.zip: materials, process and FAQ.
   Source styles and interactions, with the project's existing font families. */
.materials, .process, .faq {
  /* Palette */
  --plaster: #EDE9E2;      /* page ground: plaster, a touch warmer to sit with the photographs */
  --plaster-hi: #F7F5F1;   /* input fields, raised panels */
  --linen: #E1DACF;        /* secondary ground: unbleached flax */
  --walnut: #2B211C;       /* text: warm walnut ink */
  --walnut-soft: #5E524A;  /* secondary text (6.1:1 on plaster) */
  --moss: #3D4130;         /* brand: deep olive, taken from the headboard and cushions */
  --moss-deep: #2F3225;    /* hover, footer edge */
  --ochre: #B8873F;        /* thread: seams, piping, knots (graphics only) */
  --ochre-ink: #7A551A;    /* ochre for text and focus on light grounds (5.5:1 plaster, 4.7:1 linen) */
  --ochre-light: #E0B76E;  /* ochre for focus and marks on moss (5.6:1) */
  --smoke: #8E9AA0;        /* supporting fabric tone in imagery */
  --line: #C9C1B5;         /* hairlines */
  --control: #857A70;      /* form control borders (3.6:1 on plaster) */
  --error: #9B2C1F;

  --serif: var(--font-display);
  --sans: var(--font-body);

  --gutter: clamp(20px, 4.5vw, 64px);
  --col-gap: clamp(16px, 2vw, 24px);
  --header-h: 76px;
  --section-y: clamp(96px, 11vw, 168px);
  --ease: cubic-bezier(.22, .7, .2, 1);

  color-scheme: light;
  background: var(--plaster);
  color: var(--walnut);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "kern", "liga";
}
@media (min-width: 960px) {
  .materials, .process, .faq { font-size: 1.125rem; }
}
@media (max-width: 959px) {
  .materials, .process, .faq { --header-h: 64px; }
}
:where(.materials, .process, .faq) p { max-width: none; }
:is(.materials, .process, .faq) p,
:is(.materials, .process, .faq) li { overflow-wrap: normal; }
:is(.materials, .process, .faq) ul,
:is(.materials, .process, .faq) ol { padding: 0; list-style: none; }
:is(.materials, .process, .faq) h3 { letter-spacing: normal; text-wrap: wrap; }
:is(.materials, .process, .faq) :focus-visible {
  outline: 2px solid var(--ochre-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

:is(.materials, .process, .faq) .wrap {
  width: min(var(--container), calc(100% - var(--page-padding) * 2));
  margin-inline: auto;
}

:is(.materials, .process, .faq) .section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -.005em;
  max-width: 17ch;
  text-wrap: balance;
}

/* ---------- Original materials & process ---------- */


.materials { padding-block: var(--section-y); background: var(--cream); }
.materials-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 64px;
}
.materials-intro { grid-column: 1 / span 5; }
.materials-intro > p:not(.eyebrow) { margin-top: 24px; max-width: 42ch; }
.source-pair { margin-top: 40px; display: grid; gap: 28px; }
.source-pair h3, .fabric-questions h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
}
.source-pair p { margin-top: 8px; color: var(--walnut-soft); max-width: 44ch; }
.source-pair > div { padding-top: 20px; border-top: 1px solid var(--line); }

.swatch-explorer { grid-column: 7 / span 6; grid-row: 1 / span 2; }
.fabric-questions { grid-column: 1 / span 5; grid-row: 2; align-self: end; }
.fabric-questions ul { margin-top: 16px; }
.fabric-questions li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--line);
}
.fabric-questions li::before {
  content: "";
  position: absolute; left: 2px; top: calc(10px + .8em - 5px);
  width: 10px; height: 10px;
  border: 1.5px solid var(--ochre);
  border-radius: 50%;
}

.swatch-panel {
  position: relative;
  border-radius: clamp(28px, 4vw, 56px);
  overflow: hidden;
  background: var(--linen);
}
.swatch-surface {
  aspect-ratio: 5 / 4;
  width: 100%;
}
.swatch-surface.is-incoming {
  position: absolute; inset: 0;
  aspect-ratio: auto;
  height: 100%;
}
.swatch-panel::after {
  content: "";
  position: absolute; inset: 12px;
  border: 1.5px dashed rgba(247, 245, 241, .7);
  border-radius: clamp(18px, 3vw, 44px);
  pointer-events: none;
  z-index: 2;
}
.swatch-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: clamp(24px, 3vw, 40px);
  padding-top: 72px;
  background: linear-gradient(to top, rgba(43, 33, 28, .78), rgba(43, 33, 28, 0));
  color: var(--plaster);
}
.swatch-name { font-family: var(--serif); font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); line-height: 1.1; }
.swatch-note { margin-top: 8px; max-width: 44ch; font-size: 1rem; color: rgba(247, 245, 241, .92); }

.swatch-row {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-height: 44px;
  padding: 6px 2px;
  border: 0; background: none; color: var(--walnut);
  font: 500 .875rem/1.25 var(--sans);
  text-align: center;
  cursor: pointer;
  border-radius: 10px;
}
.swatch-chip {
  width: 100%; max-width: 76px; aspect-ratio: 1;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(43, 33, 28, .12);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.swatch[aria-pressed="true"] .swatch-chip {
  box-shadow: 0 0 0 2px var(--plaster), 0 0 0 4px var(--ochre-ink);
}
.swatch:hover .swatch-chip { transform: translateY(-3px); }
.swatch[aria-pressed="true"] .swatch-label { text-decoration: underline; text-decoration-color: var(--ochre); text-underline-offset: .3em; }
.swatch-disclaimer { margin-top: 16px; font-size: .875rem; color: var(--walnut-soft); }

/* Fabric textures, drawn in CSS and tiny SVG tiles */
[data-fabric="boucle"].swatch-surface, [data-fabric="boucle"] .swatch-chip {
  background-color: #E3DACB;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23CDBFA8' stroke-width='2.6'%3E%3Ccircle cx='7' cy='8' r='5.5'/%3E%3Ccircle cx='22' cy='5' r='4.5'/%3E%3Ccircle cx='36' cy='11' r='6'/%3E%3Ccircle cx='13' cy='22' r='6'/%3E%3Ccircle cx='30' cy='25' r='5'/%3E%3Ccircle cx='42' cy='30' r='4.5'/%3E%3Ccircle cx='5' cy='35' r='4.8'/%3E%3Ccircle cx='20' cy='38' r='6'/%3E%3Ccircle cx='35' cy='41' r='4.6'/%3E%3C/g%3E%3Cg fill='none' stroke='%23F3EEE5' stroke-width='1.6'%3E%3Ccircle cx='16' cy='12' r='3.4'/%3E%3Ccircle cx='28' cy='16' r='3'/%3E%3Ccircle cx='8' cy='28' r='3.2'/%3E%3Ccircle cx='38' cy='22' r='3'/%3E%3Ccircle cx='27' cy='33' r='3.4'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 44px 44px;
}
[data-fabric="boucle"] .swatch-chip { background-size: 26px 26px; }

[data-fabric="velvet"].swatch-surface, [data-fabric="velvet"] .swatch-chip {
  background-color: var(--moss);
  background-image:
    radial-gradient(120% 80% at 30% 20%, rgba(150, 152, 120, .45), transparent 60%),
    radial-gradient(90% 70% at 80% 85%, rgba(26, 27, 18, .55), transparent 65%),
    linear-gradient(115deg, #303224 0%, #535640 30%, #3A3C2B 52%, #5E614A 74%, #2F3225 100%);
}

[data-fabric="linen"].swatch-surface, [data-fabric="linen"] .swatch-chip {
  background-color: #E4DED3;
  background-image:
    repeating-linear-gradient(0deg, rgba(171, 158, 138, .30) 0 1px, transparent 1px 3px, rgba(171, 158, 138, .18) 3px 4px, transparent 4px 7px),
    repeating-linear-gradient(90deg, rgba(171, 158, 138, .28) 0 1px, transparent 1px 4px, rgba(255, 255, 255, .35) 4px 5px, transparent 5px 6px);
}

[data-fabric="chenille"].swatch-surface, [data-fabric="chenille"] .swatch-chip {
  background-color: #8E9AA0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .16) 0 2px, rgba(0, 0, 0, 0) 2px 5px, rgba(48, 60, 66, .22) 5px 7px, rgba(0, 0, 0, 0) 7px 9px),
    repeating-linear-gradient(0deg, rgba(48, 60, 66, .18) 0 3px, rgba(0, 0, 0, 0) 3px 11px),
    linear-gradient(160deg, #9AA6AB, #7F8B92);
}

[data-fabric="performance"].swatch-surface, [data-fabric="performance"] .swatch-chip {
  background-color: #6E6157;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Crect width='8' height='8' fill='%23796B60'/%3E%3Crect x='8' y='8' width='8' height='8' fill='%23796B60'/%3E%3Cpath d='M0 2h8M0 5h8M8 10h8M8 13h8' stroke='%235E534A' stroke-width='1'/%3E%3Cpath d='M10 0v8M13 0v8M2 8v8M5 8v8' stroke='%235E534A' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 16px 16px;
}

@media (max-width: 959px) {
  .materials-intro, .swatch-explorer, .fabric-questions { grid-column: 1 / -1; grid-row: auto; }
  .materials-grid { row-gap: 48px; }
  .swatch-surface { aspect-ratio: 1; }
  .swatch-row { gap: 6px; }
  .swatch { font-size: .8125rem; }
}

/* ---------- Process (the seam) ---------- */

.process {
  --linen: var(--ivory);
  background: var(--linen);
  padding-block: var(--section-y);
}
.process-head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: end;
}
.process-head .section-title { grid-column: 1 / span 6; }
.process-head p { grid-column: 8 / span 5; max-width: 40ch; color: var(--walnut-soft); }

.process-track { position: relative; margin-top: clamp(56px, 7vw, 104px); }
.seam {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  pointer-events: none;
}
.seam-ghost { stroke: rgba(43, 33, 28, .16); stroke-width: 2; stroke-dasharray: 12 10; }
.seam-thread { stroke: var(--ochre); stroke-width: 3; stroke-dasharray: 12 10; stroke-linecap: round; }
.seam-needle { fill: var(--plaster); stroke: var(--ochre-ink); stroke-width: 2; }

.steps { position: relative; }
.step {
  position: relative;
  width: min(46%, 520px);
  padding-left: 64px;
}
.step:nth-child(odd) { margin-left: 6%; }
.step:nth-child(even) { margin-left: 52%; }
.step + .step { margin-top: clamp(56px, 6vw, 88px); }
.knot {
  position: absolute; left: 0; top: 2px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--linen);
  border: 2px solid rgba(43, 33, 28, .28);
  transition: background-color .4s, border-color .4s;
}
.knot::after {
  content: "";
  position: absolute; inset: 7px;
  border-radius: 50%;
  background: var(--ochre);
  transform: scale(0);
  transition: transform .45s var(--ease);
}
.step.is-passed .knot { border-color: var(--ochre-ink); }
.step.is-passed .knot::after { transform: scale(1); }
.step-num { font-size: .9375rem; font-weight: 600; color: var(--ochre-ink); }
.step h3 {
  margin-top: 4px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.625rem, 1.2rem + 1.2vw, 2.25rem);
  line-height: 1.12;
}
.step p:last-child { margin-top: 10px; color: var(--walnut-soft); max-width: 42ch; }

@media (max-width: 959px) {
  .process-head .section-title, .process-head p { grid-column: 1 / -1; }
  .process-head p { margin-top: 20px; }
  .step, .step:nth-child(odd), .step:nth-child(even) { width: auto; margin-left: 0; padding-left: 52px; }
  .step + .step { margin-top: 44px; }
  .knot { width: 26px; height: 26px; }
  .knot::after { inset: 6px; }
}

/* ---------- Original FAQ ---------- */


.faq { padding-block: var(--section-y); background: var(--cream); }
.faq-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: 40px;
}
.faq-head { grid-column: 1 / span 4; }
.faq-head p:not(.eyebrow) { margin-top: 20px; color: var(--walnut-soft); max-width: 34ch; }
.faq-list { grid-column: 6 / span 7; border-bottom: 1px solid var(--line); }
@media (min-width: 960px) {
  .faq-head { position: sticky; top: calc(var(--header-h) + 40px); align-self: start; }
}

.faq-item { border-top: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 72px;
  padding-block: 16px;
  font-size: 1.125rem; font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex: none;
  width: 22px; height: 22px;
  background:
    linear-gradient(var(--ochre-ink), var(--ochre-ink)) center / 22px 2px no-repeat,
    linear-gradient(var(--ochre-ink), var(--ochre-ink)) center / 2px 22px no-repeat;
  transition: transform .4s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(135deg); }
.faq-item summary:hover { color: var(--ochre-ink); }
.faq-body { padding: 0 48px 28px 0; color: var(--walnut-soft); max-width: 60ch; }

@media (prefers-reduced-motion: no-preference) {
  @supports selector(::details-content) {
    .faq { interpolate-size: allow-keywords; }
    .faq-item::details-content {
      block-size: 0;
      overflow: hidden;
      transition: block-size .45s var(--ease), content-visibility .45s allow-discrete;
    }
    .faq-item[open]::details-content { block-size: auto; }
  }
}

@media (max-width: 959px) {
  .faq-head, .faq-list { grid-column: 1 / -1; }
  .faq-body { padding-right: 0; }
}


@media (prefers-reduced-motion: reduce) {
  .process .seam-needle { display: none; }
}
