/* Heritage Upholstery Co. — styles
   Palette: parchment / charcoal ink / cognac accent. One radius: 3px.
   Signature motif: stitched dashed lines. */

:root {
  --parchment: #f0e8d6;
  --cream: #faf5e8;
  --ink: #2b2118;
  --ink-soft: #57462f;
  --cognac: #a05a28;
  --cognac-deep: #7c4520;
  --line: #d8c9ab;
  --thread: #e9d9b8;
  --radius: 3px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Spectral", Georgia, serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 560;
  letter-spacing: -0.01em;
  line-height: 1.04;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(3.1rem, 10vw, 5.8rem); }
h2 { font-size: clamp(2rem, 5.4vw, 3rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }
a { color: var(--cognac-deep); }
ul, ol { margin: 0 0 1em; padding: 0; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--cream); padding: 10px 16px; z-index: 200;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--parchment);
  border-bottom: 2px solid var(--ink);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; gap: 26px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; color: var(--cognac-deep); flex: none; }
.brand-word { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; }
.brand-word em { font-style: italic; color: var(--cognac-deep); }
.site-nav { display: flex; gap: 24px; margin-left: auto; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.98rem; }
.site-nav a:hover { color: var(--cognac-deep); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 14px 28px; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; border: 2px solid var(--ink);
  transition: background-color 0.18s ease-out, color 0.18s ease-out;
}
.btn-primary { background: var(--cognac); border-color: var(--cognac-deep); color: var(--cream); }
.btn-primary:hover { background: var(--cognac-deep); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(43,33,24,0.07); }
.btn-big { padding: 16px 34px; font-size: 1.05rem; }
.header-cta { padding: 10px 20px; font-size: 0.95rem; white-space: nowrap; }

/* ---------- Pinned scroll-scrubbed hero ---------- */
.hero { height: 235vh; position: relative; }
.hero-pin {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  overflow: hidden; display: flex; align-items: center;
}
.hero-scene { position: absolute; inset: 0; }
.hero-scene svg { width: 100%; height: 100%; display: block; }
.hero-scene .layer { will-change: transform; }
.hero-copy { position: relative; z-index: 2; width: 100%; }
.hero-panel {
  background: var(--parchment);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  max-width: 620px;
  padding: 44px 44px 36px;
  box-shadow: 10px 10px 0 rgba(43,33,24,0.16);
  position: relative;
}
.hero-panel::after {
  content: ""; position: absolute; inset: 8px;
  border: 2px dashed var(--cognac);
  border-radius: 2px; pointer-events: none;
}
.hero-kicker {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--cognac-deep); margin-bottom: 16px;
}
.hero-panel h1 { margin-bottom: 0.35em; }
.hero-sub { font-size: 1.12rem; color: var(--ink-soft); max-width: 32em; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 18px; }
.hero-copy .scroll-hint {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0;
}
.scroll-hint span { display: block; width: 56px; height: 2px; background: var(--cognac); }

/* ---------- Stitched section dividers ---------- */
.stitch-wrap { padding: 6px 0; }
.stitch-divider { display: block; width: 100%; height: 24px; }
.stitch-draw {
  stroke: var(--cognac); stroke-width: 3; stroke-dasharray: 14 10;
  transform: scaleX(0); transform-origin: left center;
}
.stitch-wrap.in .stitch-draw {
  transform: scaleX(1);
  transition: transform 0.9s ease-out;
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-dark { background: var(--ink); color: var(--parchment); }
.section-dark .section-kicker { color: var(--thread); }
.section-dark .section-lede { color: #cbbfa4; }
.section-kicker {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--cognac-deep); margin-bottom: 16px;
}
.section-lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 38em; }

/* Scroll-scrubbed heading: words light up as you read */
.scrub-heading { max-width: 16em; margin-bottom: 0.6em; }
.scrub-heading .w { color: rgba(43,33,24,0.16); transition: color 0.15s linear; }
.scrub-heading .w.lit { color: var(--ink); }

/* ---------- Craft steps ---------- */
.craft-steps { list-style: none; margin: 56px 0 0; }
.craft-steps li {
  display: grid; grid-template-columns: 130px 1fr; gap: 32px;
  padding: 38px 0; border-top: 2px solid var(--line);
  align-items: start;
}
.craft-steps li:last-child { border-bottom: 2px solid var(--line); }
.craft-num {
  font-family: var(--font-display); font-weight: 600; font-size: 3.2rem;
  line-height: 1; color: var(--cognac);
}
.craft-steps h3 { font-size: 1.6rem; margin-bottom: 0.3em; }
.craft-steps p { margin: 0; color: var(--ink-soft); max-width: 44em; font-size: 1.05rem; }

/* ---------- Service rows ---------- */
.service-rows { margin-top: 56px; border-top: 2px solid var(--ink); }
.service-row {
  display: grid; grid-template-columns: 110px 1fr; gap: 32px;
  padding: 40px 0; border-bottom: 2px solid var(--ink);
  align-items: start;
}
.service-num {
  font-family: var(--font-display); font-style: italic;
  font-size: 2.4rem; color: var(--cognac-deep); line-height: 1.1;
}
.service-row h3 { font-size: 1.9rem; margin-bottom: 0.3em; }
.service-row p { color: var(--ink-soft); max-width: 46em; }
.service-meta {
  font-size: 0.92rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cognac-deep); font-weight: 600; margin: 0.8em 0 0;
}

/* ---------- Swatch studio ---------- */
.studio-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 64px;
  margin-top: 56px; align-items: center;
}
.studio-chair {
  background: var(--parchment);
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 32px; display: flex; justify-content: center;
  position: relative;
}
.studio-chair::after {
  content: ""; position: absolute; inset: 10px;
  border: 2px dashed var(--cognac); border-radius: 2px; pointer-events: none;
}
.chair { width: min(100%, 380px); height: auto; display: block; }
/* Recolorable upholstery */
#studio-chair { --fabric: #a05a28; --fabric-deep: #7c4520; }
#studio-chair .fabric { fill: var(--fabric); transition: fill 0.25s ease-out; }
#studio-chair .fabric-deep { fill: var(--fabric-deep); transition: fill 0.25s ease-out; }
.thread {
  stroke: var(--thread); stroke-width: 2; fill: none;
  stroke-dasharray: 7 5; stroke-linecap: round;
}
.swatch-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.swatch {
  width: 62px; height: 62px; border-radius: var(--radius);
  border: 2px solid var(--line); cursor: pointer; padding: 0;
  transition: transform 0.18s ease-out;
}
.swatch:hover { transform: translateY(-3px); }
.swatch[aria-pressed="true"] { outline: 3px solid var(--cognac); outline-offset: 3px; }
.fabric-card {
  border: 2px solid var(--line); border-radius: var(--radius);
  padding: 24px 26px; background: rgba(250,245,232,0.05);
  min-height: 150px;
}
.fabric-card h3 { font-size: 1.7rem; margin-bottom: 0.25em; }
.fabric-card p { margin: 0 0 0.6em; color: #d8cba9; }
.fabric-note {
  font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cognac); font-weight: 600; margin: 0;
}
.studio-note { margin-top: 22px; font-size: 0.98rem; color: #cbbfa4; font-style: italic; }

/* ---------- Before / after slider ---------- */
.ba {
  position: relative; max-width: 620px; margin: 48px auto 0;
  aspect-ratio: 360 / 400; user-select: none; touch-action: pan-y;
  border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--cream); overflow: hidden;
}
.ba-layer { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ba-layer .chair { width: min(78%, 340px); }
.ba-worn-layer { width: 50%; overflow: hidden; border-right: 3px solid var(--cognac); background: #e9e2d0; }
.ba-inner { height: 100%; display: flex; align-items: center; justify-content: center; flex: none; }
.ba-tag {
  position: absolute; top: 14px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  background: var(--ink); color: var(--cream); padding: 6px 14px; border-radius: var(--radius);
}
.ba-tag-before { left: 14px; }
.ba-tag-after { right: 14px; }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 0; z-index: 5;
  cursor: ew-resize; outline: none;
}
.ba-handle:focus-visible .ba-grip { outline: 3px solid var(--cognac-deep); outline-offset: 3px; }
.ba-grip {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--parchment); border: 3px solid var(--cognac);
  display: flex; align-items: center; justify-content: center; color: var(--cognac-deep);
  box-shadow: 0 4px 14px rgba(43,33,24,0.25);
}
.ba-grip svg { width: 26px; height: 26px; }
.ba-caption { text-align: center; color: var(--ink-soft); font-style: italic; margin-top: 20px; font-size: 0.98rem; }

/* ---------- Quote ---------- */
.quote-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: start; }
.quote-phone a { color: var(--ink); }
.hours { font-size: 0.92rem; color: var(--ink-soft); }
.quote-form-wrap {
  background: var(--cream); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 36px; position: relative;
  box-shadow: 8px 8px 0 rgba(160,90,40,0.25);
}
.quote-form-wrap::after {
  content: ""; position: absolute; inset: 9px;
  border: 2px dashed var(--cognac); border-radius: 2px; pointer-events: none;
}
.field { margin-bottom: 18px; position: relative; z-index: 1; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--ink-soft); font-size: 0.88rem; font-style: italic; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fffdf6; border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 11px 14px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid var(--cognac); outline-offset: 1px;
}
.field textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.quote-form .btn { position: relative; z-index: 1; width: 100%; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin: 12px 0 0; text-align: center; font-style: italic; }
.form-done { padding: 24px 4px; position: relative; z-index: 1; }
.done-title { font-family: var(--font-display); font-size: 1.7rem; margin-bottom: 0.4em; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #cbbfa4;
  padding: 60px 0 calc(40px + env(safe-area-inset-bottom));
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding-bottom: 32px; border-bottom: 1px solid rgba(240,232,214,0.18);
  margin-bottom: 24px;
}
.footer-brand .brand-word { color: var(--parchment); }
.footer-brand p { font-size: 0.95rem; margin-top: 10px; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; align-content: flex-start; }
.footer-nav a { color: var(--parchment); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { color: var(--thread); }
.demo-disclaimer {
  font-size: 0.9rem; color: #a8946f; max-width: 62em;
  border-left: 3px solid var(--cognac); padding-left: 16px;
}
.demo-disclaimer strong { color: var(--parchment); }
.copy { font-size: 0.85rem; color: #8a7a5c; margin: 16px 0 0; }

/* ---------- Reveal (opacity + translate only; hidden states need .js) ---------- */
html.js .reveal { opacity: 0; transform: translateY(24px); }
html.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.38s ease-out, transform 0.38s ease-out;
}
html.no-motion .reveal { opacity: 1; transform: none; }
html.no-motion .stitch-draw { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
  .stitch-draw { transform: scaleX(1); }
  .btn, .swatch, #studio-chair .fabric, #studio-chair .fabric-deep { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .site-nav { display: none; }
  .header-inner { gap: 14px; }
  .header-cta { margin-left: auto; }
  .studio-grid { grid-template-columns: 1fr; gap: 40px; }
  .quote-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) {
  .craft-steps li, .service-row { grid-template-columns: 1fr; gap: 10px; }
  .craft-num { font-size: 2.4rem; }
  .hero-panel { padding: 30px 24px 26px; }
  .hero-panel::after { inset: 6px; }
  .section { padding: 72px 0; }
}
@media (max-width: 430px) {
  body { font-size: 17px; }
  .wrap { padding: 0 20px; }
  .brand-word { font-size: 1.15rem; }
  .header-cta { font-size: 0.85rem; padding: 9px 14px; }
  .quote-form-wrap { padding: 26px 20px; }
  .swatch { width: 54px; height: 54px; }
}
