/*
  How we handle data (data-handling.html), on the site's Main Street look:
  cream paper, bottle green, brick, mustard and ink, Fraunces and Figtree,
  2.5px ink lines, round corners and offset shadows.

  One plain page that answers the common question it is linked from ("What
  happens to our data?"): it depends on your business and the rules your
  industry follows, so it is agreed with you in writing. One memorable
  thing (the agreement, a page from the proposal) and one moment of motion
  (the three steps, which play once); everything else is quiet. The words
  are all in the HTML; js/data-handling.js only plays the steps.
*/

/* The motion curves, the green kicker and the page-title size are the site's own (css/styles.css). */
.dh { display: block; }

/* ---------- Hero: headline left, the agreement right ---------- */
.dh-hero { padding-block: clamp(40px, 6vw, 84px) clamp(64px, 8vw, 112px); overflow-x: clip; }
.dh-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 48px clamp(40px, 6vw, 96px); align-items: center; }
.dh-hero h1 { max-width: 8.6em; }
.dh-hero .lead { margin-top: 24px; max-width: 25em; color: var(--ink-soft); }

/*
  The agreement: a page from the proposal, with a second sheet tucked
  behind it. On hover the top sheet lifts and tilts a touch and the one
  behind fans out, like picking a page up off the desk.
*/
.dh-stack { position: relative; }
.dh-back { position: absolute; inset: 0; border: var(--line) solid var(--ink); border-radius: var(--r-sm); background: var(--paper-2); transform: rotate(2.4deg) translate(6px, 4px); transform-origin: 50% 100%; }
.dh-sheet { position: relative; margin: 0; padding: clamp(20px, 2.6vw, 30px) clamp(24px, 3vw, 40px) clamp(20px, 2.4vw, 28px); border: var(--line) solid var(--ink); border-radius: var(--r-sm); background: var(--white); box-shadow: 10px 10px 0 var(--green); transform-origin: 50% 100%; }
.dh-back, .dh-sheet { transition: transform 420ms var(--ease-out), box-shadow 420ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .dh-stack:hover .dh-sheet { transform: translateY(-8px) rotate(-1.2deg); box-shadow: 14px 18px 0 var(--green); }
  .dh-stack:hover .dh-back { transform: rotate(4.6deg) translate(16px, 6px); }
}

/* Letterhead: the wordmark, as on every proposal. */
.dh-letterhead { margin-bottom: 26px; }
.dh-letterhead img { width: 108px; height: auto; }
.dh-sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; }
.dh-sheet-head h2 { font-size: clamp(1.6rem, 2.4vw, 2rem); }
.dh-sheet-head p { font-size: 0.95rem; color: var(--ink-soft); }

.dh-fields { margin-top: 22px; }
.dh-fields li { display: flex; align-items: center; gap: 14px; padding-block: 11px; }
.dh-fields li::before { content: ""; flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--mustard); border: 2px solid var(--ink); }
.dh-field-l { display: block; font-weight: 700; font-size: 1.08rem; line-height: 1.3; }
.dh-blank { display: block; }

.dh-sign { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 30px; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); }
.dh-sign .dh-blank { height: 34px; margin-bottom: 6px; border-bottom: 2px solid var(--ink); }
.dh-sheet figcaption { margin-top: 18px; font-family: var(--serif); font-variation-settings: "SOFT" 100; font-style: italic; font-size: 1.05rem; color: var(--green-deep); }

/* ---------- How it works: three discs on a line, on the green band ---------- */
.dh-steps-s { --g: clamp(24px, 4vw, 56px); --nd: clamp(56px, 5.4vw, 72px); --fill: 1; padding-block: clamp(56px, 8vw, 104px); background: var(--green); color: var(--white); }
.dh-steps-s h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
.dh-steps-wrap { position: relative; margin-top: clamp(36px, 5vw, 60px); }
.dh-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px var(--g); }
.dh-step { position: relative; z-index: 1; }

/* The line: a faint dashed guide from the first disc to the last, and the mustard fill that draws along it. */
.dh-track { position: absolute; top: calc(var(--nd) / 2 - 1.25px); left: calc(var(--nd) / 2); right: calc((100% - 2 * var(--g)) / 3 - var(--nd) / 2); height: 0; border-top: 2.5px dashed rgba(255, 251, 241, 0.4); }
.dh-track-fill { position: absolute; left: 0; right: 0; top: -3px; height: 3.5px; border-radius: 2px; background: var(--mustard); transform: scaleX(var(--fill)); transform-origin: 0 50%; }

/* A disc: lit, it's a mustard coin with an ink rim; waiting, it's an empty dashed ring. */
.dh-n { position: relative; display: grid; place-items: center; width: var(--nd); height: var(--nd); border-radius: 50%; box-shadow: 0 0 0 7px var(--green); background: var(--mustard); border: var(--line) solid var(--ink); color: var(--ink); font-family: var(--serif); font-size: clamp(1.5rem, 2.1vw, 1.95rem); }
.dh-n-t { position: relative; z-index: 1; }
.dh-ttl { margin-top: 22px; overflow: hidden; padding-block: 0.08em; font-size: clamp(1.45rem, 2.3vw, 2rem); line-height: 1.1; }
.dh-rise { display: block; }
.dh-sub { margin-top: 8px; max-width: 17em; font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.45; color: var(--on-green-soft); }

/*
  The sequence (the script adds .is-armed, then lights each step): the fill
  draws over 800ms, a disc fills in and its number pops up, the title rises out of a mask, the line under it fades in.
*/
.dh-steps-s.is-armed { --fill: 0; }
.dh-steps-s.is-armed .dh-track-fill { transition: transform 800ms var(--ease-in-out); }
.dh-steps-s.is-armed .dh-n { transition: background-color 240ms ease, border-color 240ms ease, transform 420ms var(--ease-out); }
.dh-steps-s.is-armed .dh-step:not(.is-on) .dh-n { background: transparent; border: 2.5px dashed rgba(255, 251, 241, 0.5); transform: scale(0.9); }
.dh-steps-s.is-armed .dh-n-t { transition: opacity 200ms ease 120ms, transform 380ms var(--ease-out) 120ms; }
.dh-steps-s.is-armed .dh-step:not(.is-on) .dh-n-t { opacity: 0; transform: scale(0.6); }
.dh-steps-s.is-armed .dh-rise { transition: transform 640ms var(--ease-out) 140ms; }
.dh-steps-s.is-armed .dh-step:not(.is-on) .dh-rise { transform: translateY(112%); }
.dh-steps-s.is-armed .dh-sub { transition: opacity 520ms ease 360ms, transform 520ms var(--ease-out) 360ms; }
.dh-steps-s.is-armed .dh-step:not(.is-on) .dh-sub { opacity: 0; transform: translateY(8px); }

/* ---------- Every business is different: four shop signs ---------- */
.dh-dep-s { padding-block: clamp(56px, 8vw, 104px); }
.dh-dep-s h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
.dh-bizzes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px clamp(20px, 3vw, 40px); margin-top: clamp(32px, 4.4vw, 52px); }
.dh-sign-plate { display: inline-block; padding: 10px 20px 11px; border: var(--line) solid var(--ink); border-radius: var(--r-sm); font-family: var(--serif); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: clamp(1.3rem, 1.8vw, 1.6rem); line-height: 1.1; box-shadow: 0 4px 0 var(--ink); }
.dh-biz--0 .dh-sign-plate { background: var(--mustard); }
.dh-biz--1 .dh-sign-plate { background: var(--sky); }
.dh-biz--2 .dh-sign-plate { background: var(--blush); }
.dh-biz p { margin-top: 18px; max-width: 16em; font-size: clamp(1.05rem, 1.4vw, 1.2rem); line-height: 1.45; color: var(--ink-soft); }
/* The fourth sign is still blank: yours. */
.dh-biz--you .dh-sign-plate { background: var(--white); border-style: dashed; box-shadow: none; color: var(--green-deep); }
.dh-biz--you p { font-weight: 600; color: var(--green-deep); }

/* ---------- Closing: the one centred section ---------- */
.dh .closing { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.dh .closing h2 { margin-inline: auto; }
.dh .closing p { margin-inline: auto; }
.dh .closing .btn-row { justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .dh-stack:hover .dh-sheet, .dh-stack:hover .dh-back { transform: none !important; }
}
@media (max-width: 900px) {
  .dh-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .dh-stack { max-width: 520px; }
}
@media (max-width: 1000px) {
  .dh-bizzes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  /* Phones: the steps stack and the line runs down through the discs. */
  .dh-steps-s { --nd: 56px; }
  .dh-steps { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .dh-track { top: calc(var(--nd) / 2); bottom: 50px; left: calc(var(--nd) / 2 - 1.25px); right: auto; height: auto; border-top: 0; border-left: 2.5px dashed rgba(255, 251, 241, 0.4); }
  .dh-track-fill { top: 0; bottom: 0; left: -3px; right: auto; width: 3.5px; height: auto; transform: scaleY(var(--fill)); transform-origin: 50% 0; }
  .dh-step { display: grid; grid-template-columns: var(--nd) minmax(0, 1fr); column-gap: 18px; align-items: center; }
  .dh-n { grid-row: span 2; align-self: start; }
  .dh-ttl { margin-top: 0; align-self: end; }
  .dh-sub { margin-top: 4px; align-self: start; }
  .dh-bizzes { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .dh-biz p { margin-top: 12px; }
  .dh-sheet { box-shadow: 8px 8px 0 var(--green); }
  .dh-back { transform: rotate(1.6deg) translate(4px, 3px); }
}
@media (max-width: 420px) {
  .dh-sign { gap: 18px; }
}
