/* ============================================================
   Broadcloth — marketing site
   Design: "the tailor's ledger" — cream paper, warm-charcoal
   ink, mustard-gold thread. Tokens mirror the iOS app's
   BroadclothColors (light theme) exactly.
   ============================================================ */

:root {
  /* paper ladder (app: pageBackground → chipBackground) */
  --paper: #fffbf5;
  --paper-warm: #faf6ee;
  --panel: #f0ece4;
  --chip: #e6e2d8;
  --border: #ddd8ce;

  /* ink ladder (app: onPrimary + text tiers) */
  --ink: #3a3020;
  --text-strong: #5a5040;
  --text-medium: #7a7060;
  --text-muted: #8a8070;

  /* thread (app: gold family) */
  --gold: #c49a2a;
  --gold-bright: #ddb84d;
  --gold-muted: #b8a88a;
  --on-gold: #5a4628;

  /* the dark study (results section, footer) */
  --dark: #272117;
  --dark-panel: #322b1e;
  --dark-border: #48402f;
  --dark-text: #f2ecdf;
  --dark-text-muted: #b3a88f;

  --serif: "Crimson Pro", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, sans-serif;

  --w: 1120px;
}

/* ---- reset-lite ---------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-strong);
  background: var(--paper);
  overflow-x: clip;
}

/* faint paper grain over everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.028;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

::selection {
  background: var(--gold-bright);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- type ------------------------------------------------ */
h1,
h2,
h3,
.serif {
  font-family: var(--serif);
  font-weight: 560;
  color: var(--ink);
  letter-spacing: -0.012em;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 14px;
}

.eyebrow .no {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold);
}

/* ---- header ----------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.site-header .bar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 28px;
  max-width: var(--w);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  margin-right: auto;
}

.brand svg {
  width: 30px;
  height: 30px;
  color: var(--ink);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover svg {
  transform: rotate(90deg);
}

.brand .wordmark {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 620;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-nav a:not(.btn) {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-medium);
  padding: 4px 0;
  background: linear-gradient(var(--gold) 0 0) bottom left / 0 2px no-repeat;
  transition: background-size 0.25s ease, color 0.2s ease;
}

.site-nav a:not(.btn):hover {
  color: var(--ink);
  background-size: 100% 2px;
}

/* ---- buttons ---------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.btn--gold {
  background: var(--gold-bright);
  color: var(--on-gold);
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
}

.btn--gold:hover {
  background: var(--gold);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--gold) 65%, transparent);
}

.btn--ghost {
  color: var(--ink);
  border: 1px solid var(--border);
  background: transparent;
}

.btn--ghost:hover {
  border-color: var(--gold-muted);
  background: var(--paper-warm);
}

.btn--lg {
  font-size: 16px;
  padding: 15px 30px;
}

/* ---- hero -------------------------------------------------- */
.hero {
  position: relative;
  padding: 84px 0 96px;
  overflow: clip;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(3rem, 6.6vw, 4.9rem);
  line-height: 1.01;
  margin: 26px 0 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 600;
}

.hero .lede {
  font-size: 19.5px;
  line-height: 1.55;
  color: var(--text-medium);
  max-width: 36ch;
  margin-bottom: 36px;
}

.hero .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero .platform-note {
  margin-top: 22px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* the button, sewn on */
.button-stage {
  position: relative;
  justify-self: end;
  width: min(46vw, 470px);
  aspect-ratio: 1;
  transform: rotate(-9deg);
  will-change: transform;
}

.button-stage::after {
  /* soft cast shadow */
  content: "";
  position: absolute;
  left: 8%;
  right: 4%;
  bottom: -7%;
  height: 14%;
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(58, 48, 32, 0.22),
    transparent 70%
  );
  z-index: -1;
}

.button-stage svg {
  width: 100%;
  height: 100%;
  color: var(--ink);
}

.button-stage .thread {
  stroke: var(--gold);
  stroke-width: 4.6;
  stroke-linecap: round;
  fill: none;
}

/* hero entrance */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: rotate(-16deg) scale(0.92);
  }
  to {
    opacity: 1;
    transform: rotate(-9deg) scale(1);
  }
}

@keyframes sew {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.hero .rise {
  animation: rise 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero .rise:nth-child(2) {
  animation-delay: 0.08s;
}

.hero .rise:nth-child(3) {
  animation-delay: 0.16s;
}

.hero .rise:nth-child(4) {
  animation-delay: 0.26s;
}

.hero .rise:nth-child(5) {
  animation-delay: 0.34s;
}

.button-stage {
  animation: settle 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.button-stage .thread {
  /* Rest state parks the dash mid-gap (offset 2 in a 1-on/3-off
     pattern) so no dash boundary sits on the line while the
     animation delay runs — a boundary + round linecap renders as
     a stray dot in a buttonhole. The sew keyframes take over from
     offset 1 (still hidden) and draw to 0. */
  stroke-dasharray: 1 3;
  stroke-dashoffset: 2;
  animation: sew 0.55s ease-out forwards;
}

.button-stage .thread--a {
  animation-delay: 0.75s;
}

.button-stage .thread--b {
  animation-delay: 1.05s;
}

/* ---- sections --------------------------------------------- */
.section {
  padding: 96px 0;
}

.section-head {
  max-width: 60ch;
  margin-bottom: 56px;
}

.section-head h2 {
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  line-height: 1.08;
  margin: 18px 0 16px;
}

.section-head .sub {
  font-size: 18px;
  color: var(--text-medium);
  max-width: 52ch;
}

/* ---- method: the ledger ------------------------------------ */
.steps {
  list-style: none;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 28px;
  padding: 44px 0;
  border-top: 1px solid var(--border);
}

.steps .num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 46px;
  line-height: 1;
  color: var(--gold);
}

.steps .num::before {
  content: counter(step, decimal-leading-zero);
}

.steps h3 {
  font-size: 27px;
  margin-bottom: 10px;
}

.steps .body {
  color: var(--text-medium);
  max-width: 56ch;
}

/* ---- results: the dark study -------------------------------- */
.results {
  background: var(--dark);
  color: var(--dark-text);
  padding: 110px 0;
}

.results .eyebrow {
  color: var(--dark-text-muted);
}

.results .section-head h2 {
  color: var(--dark-text);
}

.results .section-head .sub {
  color: var(--dark-text-muted);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.result-card {
  background: var(--dark-panel);
  border: 1px solid var(--dark-border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-card .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.result-card h3 {
  color: var(--dark-text);
  font-size: 24px;
  line-height: 1.15;
}

/* ---- teaching: the palette ---------------------------------- */
.teach .wrap {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 64px;
  align-items: start;
}

.teach .prose p {
  color: var(--text-medium);
  margin-bottom: 18px;
  max-width: 54ch;
}

.teach .prose strong {
  color: var(--ink);
  font-weight: 650;
}

/* swatch rail — real palette data, pinked edges */
.swatch-rail {
  background: var(--paper-warm);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px;
}

.swatch-rail .rail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.swatch-rail .rail-head .label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.swatch-rail .rail-head .count {
  font-family: var(--serif);
  font-style: italic;
  color: var(--gold);
  font-size: 15px;
  white-space: nowrap;
}

.swatches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 14px;
}

.swatch {
  text-align: left;
}

.swatch .cloth {
  aspect-ratio: 4 / 4.6;
  border-radius: 0 0 6px 6px;
  /* pinking-shear top edge */
  clip-path: polygon(
    0% 8%, 5% 0%, 10% 8%, 15% 0%, 20% 8%, 25% 0%, 30% 8%, 35% 0%,
    40% 8%, 45% 0%, 50% 8%, 55% 0%, 60% 8%, 65% 0%, 70% 8%, 75% 0%,
    80% 8%, 85% 0%, 90% 8%, 95% 0%, 100% 8%, 100% 100%, 0% 100%
  );
  transition: transform 0.25s ease;
}

.swatch:hover .cloth {
  transform: translateY(-4px);
}

.swatch .name {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
  margin-top: 8px;
  line-height: 1.3;
}

.swatch .note {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.rail-caption {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-medium);
  line-height: 1.5;
}

/* ---- privacy strip: the selvedge ----------------------------- */
.selvedge {
  background: var(--panel);
  border-top: 3px double var(--gold-muted);
  border-bottom: 3px double var(--gold-muted);
  padding: 72px 0;
}

.selvedge .wrap {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 4fr) minmax(0, 4fr);
  gap: 44px;
  align-items: start;
}

.selvedge h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.2rem);
  line-height: 1.12;
}

.selvedge .promise h3 {
  font-size: 21px;
  margin-bottom: 8px;
}

.selvedge .promise p {
  font-size: 15px;
  color: var(--text-medium);
}

.selvedge a {
  color: var(--ink);
  font-weight: 600;
  text-decoration-color: var(--gold-muted);
  text-underline-offset: 3px;
}

/* ---- get --------------------------------------------------- */
.get {
  padding: 120px 0;
  text-align: center;
}

.get h2 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  line-height: 1.05;
  margin: 20px auto 18px;
  max-width: 22ch;
}

.get p {
  color: var(--text-medium);
  max-width: 46ch;
  margin: 0 auto 34px;
}

.get .eyebrow {
  justify-content: center;
}

.get .fine {
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---- footer ------------------------------------------------- */
.site-footer {
  background: var(--dark);
  color: var(--dark-text-muted);
  padding: 64px 0 40px;
}

.site-footer .top {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 36px;
}

.site-footer .brand .wordmark {
  color: var(--dark-text);
}

.site-footer .brand svg {
  color: var(--dark-text);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.site-footer nav a {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-text-muted);
  text-decoration: none;
}

.site-footer nav a:hover {
  color: var(--gold-bright);
}

.site-footer .rule {
  height: 1px;
  background: var(--dark-border);
}

.site-footer .bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  justify-content: space-between;
  padding-top: 28px;
  font-size: 13.5px;
}

.site-footer .bottom a {
  color: var(--dark-text-muted);
  text-decoration-color: var(--dark-border);
  text-underline-offset: 3px;
}

.site-footer .bottom a:hover {
  color: var(--gold-bright);
}

/* ---- legal pages -------------------------------------------- */
.legal-main {
  padding: 72px 0 110px;
}

.legal-main .wrap {
  max-width: 760px;
}

.legal-main h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 1.05;
  margin: 18px 0 10px;
}

.legal-main .updated {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 44px;
}

.legal-main .intro {
  font-size: 18.5px;
  color: var(--text-medium);
  margin-bottom: 40px;
  max-width: 58ch;
}

.legal-main h2 {
  font-size: 25px;
  margin: 48px 0 14px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.legal-main p,
.legal-main li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-strong);
  margin-bottom: 14px;
}

.legal-main ul {
  padding-left: 22px;
  margin-bottom: 16px;
}

.legal-main li {
  margin-bottom: 8px;
}

.legal-main li::marker {
  color: var(--gold);
}

.legal-main strong {
  color: var(--ink);
}

.legal-main a {
  color: var(--ink);
  font-weight: 600;
  text-decoration-color: var(--gold-muted);
  text-underline-offset: 3px;
}

.legal-main .callout {
  background: var(--paper-warm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 26px 0;
}

.legal-main .callout p {
  margin-bottom: 8px;
}

.legal-main .callout p:last-child {
  margin-bottom: 0;
}

/* ---- forms (Netlify) ------------------------------------------ */
.text-input {
  font: inherit;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 13px 20px;
  width: 100%;
}

.text-input::placeholder {
  color: var(--text-muted);
}

.text-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 0;
  border-color: var(--gold-muted);
}

textarea.text-input {
  border-radius: 16px;
  min-height: 150px;
  resize: vertical;
}

.invite-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 520px;
  margin: 0 auto;
}

.invite-form .text-input {
  flex: 1 1 260px;
  width: auto;
}

.contact-form {
  max-width: 560px;
  display: grid;
  gap: 18px;
}

.contact-form label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.contact-form .btn {
  justify-self: start;
}

/* honeypot — visually removed, present for bots */
.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---- centered mini-pages (404, thanks) ------------------------ */
.center-card {
  min-height: 72vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 18px;
  padding: 60px 24px;
}

.center-card svg {
  width: 84px;
  height: 84px;
  margin: 0 auto;
  color: var(--ink);
  transform: rotate(-9deg);
}

.center-card h1 {
  font-size: 42px;
}

.center-card p {
  color: var(--text-medium);
}

/* ---- reveal on scroll ---------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0s);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---- motion & print ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  body::before {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ---- responsive ----------------------------------------------- */
@media (max-width: 960px) {
  .hero .wrap {
    grid-template-columns: 1fr;
  }

  .button-stage {
    order: -1;
    justify-self: center;
    width: min(46vw, 220px);
    margin-bottom: 8px;
  }

  .steps > li {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .teach .wrap {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .selvedge .wrap {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 760px) {
  .result-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 72px 0;
  }

  .results {
    padding: 84px 0;
  }

  .steps > li {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .steps .num {
    font-size: 36px;
  }

  .swatches {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 10px;
  }

  .swatch .note {
    display: none;
  }
}

@media (max-width: 700px) {
  .site-nav a:not(.btn) {
    display: none;
  }
}
