/* Untangle: one rope, tied in a five-crossing knot, carries the whole page. */
@font-face { font-family: Anton; src: url("/generator/fonts/anton.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/generator/fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/generator/fonts/instrument-sans-bold.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

:root {
  --bg: #f3efe7;
  --paper: #fbf8f2;
  --ink: #26231f;
  --soft: #6b655c;
  --line: #d3ccbf;
  --ox: #6e1423;
  --ox-dark: #4f0e19;
  --ox-light: #a33a4a;
  --display: Anton, Impact, "Arial Narrow", sans-serif;
  --body: "Instrument Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(20px, 4vw, 64px);
  --rope-w: clamp(10px, 1.25vw, 18px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ox); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: 0.005em; }
.wrap { padding-inline: var(--gutter); max-width: 1600px; margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; }
.skip:focus { top: 1rem; }
.kicker { margin: 0; font: 700 11px/1.5 var(--body); letter-spacing: 0.08em; text-transform: uppercase; }

/* Rope, in CSS, for the stretches that don't need physics. */
.cord, .loose-end {
  background:
    linear-gradient(to bottom, rgb(255 255 255 / 0.16), transparent 45%, rgb(0 0 0 / 0.18)),
    repeating-linear-gradient(-58deg, var(--ox) 0 calc(var(--rope-w) * 0.42), var(--ox-dark) calc(var(--rope-w) * 0.42) calc(var(--rope-w) * 0.6));
  border-radius: 999px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 28px;
  min-height: 50px; padding: 15px 20px;
  background: var(--ox); color: var(--bg); border: 1px solid var(--ox);
  font: 700 13px/1 var(--body); letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.btn:hover { background: var(--ink); border-color: var(--ink); }

/* ---------- Header ---------- */
.top {
  position: absolute; inset: 0 0 auto; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px var(--gutter);
}
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.05em; }
.top nav { display: flex; gap: 24px; }
.top nav a { font-size: 13px; font-weight: 700; text-decoration: none; }
.top nav a:hover { color: var(--ox); }

/* ---------- 1. The knot ---------- */
.untie { position: relative; height: 470vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
.beats { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.beat {
  position: absolute; left: var(--gutter); top: 50%; translate: 0 -46%;
  width: min(44vw, 640px);
  opacity: 0; visibility: hidden;
  transition: opacity 500ms ease, translate 700ms cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 500ms;
}
.stage[data-beat="a"] .beat-a,
.stage[data-beat="b"] .beat-b,
.stage[data-beat="c"] .beat-c {
  opacity: 1; visibility: visible; translate: 0 -50%; pointer-events: auto;
  transition: opacity 500ms ease 120ms, translate 700ms cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s;
}
.beat-a h1 { font-size: clamp(60px, min(8.6vw, 15vh), 150px); line-height: 1.02; margin: 18px 0 26px; }
.beat-a h1 span { color: var(--ox); }
.beat .lede { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.4; margin: 0 0 12px; max-width: 30ch; }
.beat-a .breadth { color: var(--soft); font-size: 15px; margin: 0 0 26px; max-width: 34ch; }
.beat h2 { font-size: clamp(40px, min(4.8vw, 9vh), 80px); line-height: 1.02; margin-bottom: 20px; }
.beat-b .lede { max-width: 34ch; }
.beat-c .lede { max-width: 36ch; }
.knots { list-style: none; margin: 22px 0 0; padding: 0; }
.knots li {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--line);
  font-size: clamp(15px, 1.2vw, 18px); line-height: 1.35;
  transition: color 400ms ease;
}
.knots b, .crossings li {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font: 700 11px/1 var(--mono);
  background: var(--bg); color: var(--ox); border: 1.5px solid var(--ox);
  transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease;
}
.knots li.is-undone { color: var(--soft); }
.knots li.is-undone b { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.knots li.is-undone span::after { content: "  Untied."; font: 700 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.crossings { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; pointer-events: none; }
.crossings li {
  position: absolute; left: 0; top: 0; margin: -12px 0 0 -12px;
  opacity: 0; transition: opacity 350ms ease, scale 350ms ease; scale: 0.6;
}
.crossings li.is-on { opacity: 1; scale: 1; }

.hint, .tally {
  position: absolute; bottom: calc(var(--rope-w) + 26px); margin: 0;
  font: 600 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  transition: opacity 400ms ease;
}
.hint { left: var(--gutter); display: flex; gap: 10px; }
.hint i { font-style: normal; color: var(--ox); animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { translate: 0 5px; } }
.tally { right: var(--gutter); opacity: 0; }
.tally b { color: var(--ox); }
.stage:not([data-beat="a"]) .hint { opacity: 0; }
.stage[data-beat="b"] .tally { opacity: 1; }

/* ---------- 2. The line ---------- */
.line { position: relative; }
.line-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.cord { position: absolute; left: -2vw; right: -2vw; top: 0; height: var(--rope-w); z-index: 2; box-shadow: 0 6px 12px rgb(38 35 31 / 0.14); }
.track {
  list-style: none; margin: 0; padding: 0 var(--gutter);
  position: absolute; top: calc(var(--rope-w) * 0.5); left: 0;
  display: flex; gap: clamp(22px, 3vw, 48px); width: max-content;
  will-change: transform;
}
/* Cards share one image height; each takes its width from its key art. */
.track { align-items: flex-start; }
.card {
  --img-h: clamp(190px, min(40vh, 28vw), 400px);
  width: min(calc(var(--img-h) * var(--r, 0.8) + 24px), 86vw);
  transform-origin: 50% 0; padding-top: 10px;
}
.card a {
  position: relative; display: block; text-decoration: none;
  background: var(--paper); padding: 12px 12px 18px;
  box-shadow: 0 1px 0 rgb(38 35 31 / 0.06), 0 16px 30px -18px rgb(38 35 31 / 0.45);
  transition: translate 300ms ease;
}
.card a:hover { translate: 0 6px; }
.card img { width: 100%; height: var(--img-h); object-fit: cover; margin-bottom: 14px; background: var(--bg); }
.card .proof { max-width: 46ch; }
.card .no { display: block; font: 600 10px/1.4 var(--mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--soft); }
.card strong { display: block; font: 400 clamp(26px, 2.3vw, 36px)/1.05 var(--display); margin: 6px 0 8px; }
.card .proof { display: block; font-size: 14px; line-height: 1.45; color: var(--soft); }
.card a:hover strong { color: var(--ox); }
.peg {
  position: absolute; top: -18px; width: 12px; height: 34px; z-index: 3;
  background: linear-gradient(90deg, #b99a6d, #d8bf94 45%, #a98a5e);
  border-radius: 2px; box-shadow: 0 2px 3px rgb(38 35 31 / 0.25);
}
.peg::after { content: ""; position: absolute; left: 50%; top: 12px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: #7d6a52; }
.peg:first-of-type { left: 16%; }
.peg:nth-of-type(2) { right: 16%; }
.line-label {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(20px, 4vh, 44px);
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
}
.line-label h2 { font-size: clamp(36px, 5vw, 84px); line-height: 1; }
.count { margin: 0; white-space: nowrap; font: 600 12px/1 var(--mono); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.count b { color: var(--ox); }

/* ---------- 3. Range ---------- */
.range { padding-block: clamp(90px, 14vh, 160px) clamp(60px, 10vh, 120px); display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 100px); align-items: end; border-top: 1px solid var(--ink); }
.range h2 { font-size: clamp(40px, 5vw, 86px); line-height: 1.02; }
.range h2 span { color: var(--ox); }
.range-copy p { margin: 0 0 18px; font-size: clamp(17px, 1.35vw, 20px); max-width: 44ch; }

/* ---------- 4. Ways ---------- */
.ways { padding-block: 0 clamp(80px, 12vh, 140px); }
.ways-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 44px); margin-top: 22px; }
.ways article { border-top: 1px solid var(--ink); padding-top: 18px; }
.letter { display: block; font: 400 64px/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--ox); margin-bottom: 14px; }
.ways h3 { font-size: clamp(26px, 2.3vw, 36px); line-height: 1.05; margin-bottom: 10px; }
.ways p { margin: 0; color: var(--soft); max-width: 38ch; }
.ways .ways-foot { margin: 40px 0 0; font-size: 18px; color: var(--ink); }

/* ---------- 5. Loose end ---------- */
.contact { position: relative; background: var(--ink); color: var(--bg); padding-top: clamp(100px, 16vh, 180px); overflow: hidden; }
.loose-end { position: absolute; top: 0; left: calc(50% - var(--rope-w) / 2); width: var(--rope-w); height: clamp(60px, 11vh, 130px); background-size: auto, auto; transform-origin: 50% 0; animation: sway 6s ease-in-out infinite; }
.loose-end { background:
    linear-gradient(to right, rgb(255 255 255 / 0.22), transparent 45%, rgb(0 0 0 / 0.25)),
    repeating-linear-gradient(32deg, #9a2a3a 0 calc(var(--rope-w) * 0.42), var(--ox) calc(var(--rope-w) * 0.42) calc(var(--rope-w) * 0.6)); }
.loose-end::after {
  /* Frayed tip. */
  content: ""; position: absolute; left: -55%; right: -55%; top: 100%; height: 46px;
  background: repeating-linear-gradient(84deg, #c25566 0 1.5px, transparent 1.5px 3.5px);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}
@keyframes sway { 50% { rotate: 1.6deg; } }
.contact-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: start; }
.contact-direct { font-size: 15px !important; color: #a9a196 !important; }
.contact-direct a { color: var(--bg); text-underline-offset: 4px; }
.contact-form { display: grid; gap: 18px; padding-top: clamp(0px, 3vw, 46px); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font: 600 11px/1.3 var(--mono); letter-spacing: 0.07em; text-transform: uppercase; color: #d9d2c5; }
.field label span { color: #8f877b; margin-left: 6px; }
.field input, .field textarea {
  width: 100%; padding: 13px 14px; border: 1px solid #5c564d; border-radius: 0;
  background: #1d1b18; color: var(--bg); font: 400 16px/1.45 var(--body);
}
.field textarea { resize: vertical; min-height: 140px; }
.field input::placeholder, .field textarea::placeholder { color: #7d766b; }
.field input:focus, .field textarea:focus { outline: none; border-color: #d47a86; box-shadow: 0 0 0 1px #d47a86; }
.field [aria-invalid="true"] { border-color: #e58f9b; }
.field-error { min-height: 0; font-size: 13px; color: #f0a7b1; }
.field-error:empty { display: none; }
.contact-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-submit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.contact-submit span { font-size: 13px; color: #a9a196; }
.contact-submit .btn:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.contact-submit .btn:disabled { opacity: 0.6; cursor: progress; }
.contact-status { margin: 0; font-size: 15px; }
.contact-status:empty { display: none; }
.contact-status[data-state="error"] { color: #f0a7b1; }
.contact-status[data-state="success"] { color: #b9d8a8; }
.contact h2 { font-size: clamp(60px, 7.4vw, 128px); line-height: 0.98; margin: 18px 0 28px; }
.contact h2 span { color: #d47a86; }
.contact-inner > p { font-size: clamp(18px, 1.5vw, 22px); max-width: 36ch; margin: 0 0 30px; color: #d9d2c5; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-ghost { background: transparent; border-color: var(--bg); color: var(--bg); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.contact .btn:not(.btn-ghost):hover { background: var(--bg); color: var(--ink); border-color: var(--bg); }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(80px, 14vh, 160px); padding-block: 22px; border-top: 1px solid #4a453e; font: 500 11px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: #a9a196; }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .top nav { gap: 16px; }
  .top nav a:nth-child(2) { display: none; }
  .untie { height: 430vh; }
  .beat { top: auto; bottom: calc(var(--rope-w) + 64px); width: auto; right: var(--gutter); translate: 0 4%; background: var(--bg); box-shadow: 0 0 0 14px var(--bg); }
  .stage[data-beat] .beat { translate: 0 4%; }
  .stage[data-beat="a"] .beat-a, .stage[data-beat="b"] .beat-b, .stage[data-beat="c"] .beat-c { translate: 0 0; }
  .beat-a h1 { font-size: 15vw; margin: 10px 0 14px; }
  .beat-a .kicker { display: none; }
  .beat .lede { font-size: 17px; }
  .beat-a .breadth { margin-bottom: 16px; }
  .beat h2 { font-size: 10vw; margin-bottom: 10px; }
  .beat-b .lede { display: none; }
  .knots { margin-top: 8px; }
  .knots li { padding: 7px 0; font-size: 14.5px; grid-template-columns: 22px 1fr; gap: 10px; }
  .knots b { width: 20px; height: 20px; font-size: 10px; }
  .hint { bottom: calc(var(--rope-w) + 20px); }
  .tally { display: none; }
  .card { --img-h: min(34vh, 50vw); }
  .range { grid-template-columns: 1fr; }
  .ways-grid { grid-template-columns: 1fr; }
  .loose-end { left: auto; right: var(--gutter); height: 64px; }
  .contact-inner { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hint i, .loose-end { animation: none; }
  .beat, .stage[data-beat] .beat { transition: opacity 1ms, visibility 0s; }
}

/* A card whose sheet is open leaves an empty spot on the line. */
.card { transition: opacity 260ms ease; }
.card.is-out { opacity: 0; }

/* Booking: a call is the other way in. Calendly loads only when asked for. */
.book { margin-top: 30px; padding-top: 22px; border-top: 1px solid #4a453e; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.book-or { margin: 0 !important; font: 600 11px/1.4 var(--mono) !important; letter-spacing: 0.07em; text-transform: uppercase; color: #a9a196 !important; }
.book-open span { display: inline-block; transition: rotate 250ms ease; }
.book-open[aria-expanded="true"] span { rotate: 180deg; }
.book-panel { position: relative; padding-top: clamp(40px, 6vw, 70px); scroll-margin-top: 20px; }
.book-panel[hidden] { display: none; }
.book-head { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #4a453e; padding-top: 16px; margin-bottom: 16px; }
.book-head .kicker { color: #a9a196; }
.book-close { width: 42px; height: 42px; display: grid; place-items: center; background: transparent; color: var(--bg); border: 1px solid #5c564d; font: 400 24px/1 var(--body); cursor: pointer; }
.book-close:hover { background: var(--bg); color: var(--ink); }
.book-panel iframe { display: block; width: 100%; height: 720px; border: 0; background: #fff; }
.book-fallback { margin: 12px 0 0; font-size: 13px; color: #a9a196; }
.book-fallback a { color: var(--bg); text-underline-offset: 4px; }
@media (max-width: 760px) {
  .book-panel iframe { height: 960px; }
}

/* Header: labels never wrap; narrow phones tighten the spacing instead. */
.mark span, .top nav a { white-space: nowrap; }
@media (max-width: 420px) {
  .top { gap: 12px; }
  .mark { font-size: 16px; gap: 8px; }
  .mark img { width: 22px; height: 22px; }
  .top nav { gap: 12px; }
  .top nav a { font-size: 12px; }
}

/* Short phones: tighten the hero copy so the knot keeps a real share of the screen. */
@media (max-width: 760px) and (max-height: 760px) {
  .beat { bottom: calc(var(--rope-w) + 46px); }
  .beat-a h1 { font-size: min(13vw, 8.6vh); margin: 4px 0 10px; }
  .beat .lede { font-size: 16px; margin-bottom: 8px; }
  .beat-a .breadth { font-size: 14px; margin-bottom: 12px; }
  .beat-a .btn { min-height: 44px; padding-block: 12px; }
  .hint { bottom: calc(var(--rope-w) + 14px); }
}
@media (max-width: 360px) {
  .mark span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
