/* The public pages, on top of base.css: the first screen a stranger sees, the
   page for businesses, and the long legal texts.

   One thread runs down every page and everything worth pressing hangs on it.
   The thread is the one memorable thing here, so it is drawn as an object, and
   everything around it stays flat and quiet.

   All of it is measured from one edge. A .sheet is a centred box with no padding
   of its own, the cord hangs --cord-x in from its right edge, and tags and beads
   count from that same edge, so they stay on the cord at any width without one
   of them knowing how wide the screen is. */

.front {
  --sheet: 72rem;
  --edge: 1.1rem;
  --cord-x: 1.9rem;
  --emblem: 6rem;
  --emblem-top: 1.9rem;
  --display: clamp(2.3rem, 1.5rem + 4vw, 3.4rem);
  --focus: var(--ink);
}

.front main { width: 100%; max-width: none; margin: 0; padding: 0; }

.sheet {
  position: relative;
  width: min(100% - 2 * var(--edge), var(--sheet));
  margin-inline: auto;
}

/* The cord behind everything on the sheet. Each section draws its own length at
   the same distance from the same edge, so it runs on unbroken from the sea to
   the shore. */
.corded::after {
  content: '';
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  right: calc(var(--cord-x) - var(--cord-w) / 2);
  width: var(--cord-w);
  background: var(--twine);
  filter: var(--cord-shade);
}

/* ---- the bar ---- */

.bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem max(var(--edge), (100% - var(--sheet)) / 2);
  background: var(--surface);
}

.signin {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.signin:hover { color: var(--sea-deep); }

/* ---- the first screen ---- */

.hero {
  --focus: var(--surface);
  position: relative;
  color: var(--surface);
  background: var(--sea);
}

.hero-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "words emblem" "doors doors";
  column-gap: 0.75rem;
  padding-top: var(--emblem-top);
}

/* Starts inside the mark's bead, so the cord hangs from the logo. */
.hero-sheet.corded::after { top: calc(var(--emblem-top) + var(--emblem) * 0.94); }

.hero-words { grid-area: words; position: relative; z-index: 1; }

.hero .doors { grid-area: doors; }

.hero h1 {
  margin: 0;
  font: 700 var(--display)/1.06 var(--title);
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.pitch {
  max-width: 34ch;
  margin: 1.1rem 0 0;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* The mark, centred on the cord so its arrow and bead sit on the line. 0.785 is
   the mark's own width over its height. Both sides are stated: an SVG in an auto
   column with its width left to the engine came out 163px wide in WebKit, which
   took the mark off the cord and the room from the headline on every iPhone. */
.emblem {
  --emblem-w: calc(var(--emblem) * 0.785);
  grid-area: emblem;
  position: relative;
  z-index: 1;
  display: block;
  width: var(--emblem-w);
  height: var(--emblem);
  margin-right: calc(var(--cord-x) - var(--emblem-w) / 2);
}

.emblem .mark {
  display: block;
  width: 100%;
  height: 100%;
  fill: var(--surface);
}

/* ---- the tags ----

   A real tag on a real thread, built from the back to the front:

     the cord         the sheet's own, running behind everything
     .paper           the card, with a hole punched through it, so the cord and
                      the page behind show in the hole, and a brass eyelet round it
     .door-thread     a length of the same cord in front of the card, from above
                      its top edge down into the hole

   So the thread lies on the front of the tag, goes in through the eyelet, and is
   behind the tag until it comes out under the bottom edge. Nothing here knows
   where the page is: the hole is --cord-x from the card's right edge, and the
   card's right edge is the sheet's. */

.doors {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  gap: 1rem;
  margin-top: 1.9rem;
}

.door {
  --eyelet: 15px;
  --hole: 11px;
  --cut: 1.35rem;
  --sway: 0deg;
  position: relative;
  display: block;
  width: min(100%, 27rem);
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px 0 0 8px;
  -webkit-tap-highlight-color: transparent;
}

.door:nth-child(odd) { --sway: -1.5deg; }
.door:nth-child(even) { --sway: -0.8deg; }

.door-work, .price-now { --tag: var(--spark); --tag-hi: #2CE1FB; --tag-lo: #05C9E8; }
.door-staff, .price-later { --tag: var(--ink); --tag-hi: #2C3F58; --tag-lo: #122338; color: var(--surface); }

.door-card {
  position: relative;
  display: block;
  padding: 0.95rem calc(var(--cord-x) + var(--eyelet) + 0.7rem) 1rem 1.15rem;
  transform: rotate(var(--sway));
  transform-origin: calc(100% - var(--cord-x)) 50%;
  transition: transform 520ms cubic-bezier(.3, 1.7, .5, 1);
  animation: tag-settle 1500ms cubic-bezier(.3, .6, .4, 1) backwards;
}

/* The card itself. The mask punches the hole clean through it and the polygon
   takes the two corners off the eyelet's end, which is what makes it a tag. It is
   its own layer so the shadow can follow that shape, hole included, with the text
   outside the filter, where Safari keeps it sharp. */
.door .paper { filter: drop-shadow(0 7px 7px rgba(12, 28, 52, 0.3)); }

.door .paper::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--tag-hi), var(--tag) 34%, var(--tag-lo));
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  -webkit-mask: radial-gradient(circle var(--hole) at calc(100% - var(--cord-x)) 50%, transparent 97%, #000 100%);
  mask: radial-gradient(circle var(--hole) at calc(100% - var(--cord-x)) 50%, transparent 97%, #000 100%);
}

/* The eyelet: a brass ring, lit from the upper left. */
.door .paper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(var(--cord-x) - var(--eyelet));
  width: calc(var(--eyelet) * 2);
  height: calc(var(--eyelet) * 2);
  margin-top: calc(var(--eyelet) * -1);
  border-radius: 50%;
  background: conic-gradient(from 205deg, #FFF3CF, #B98B36 22%, #F6DFA6 42%, #8D6723 66%, #E9C57F 84%, #FFF3CF);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
  mask: radial-gradient(closest-side, transparent calc(100% - 5px), #000 calc(100% - 4.5px));
}

/* The length in front. It starts above the card, where it lies exactly on the
   cord behind, and it does not turn with the card: the cord hangs straight and
   only the tag swings. */
.door-thread {
  position: absolute;
  z-index: 2;
  top: -0.75rem;
  bottom: calc(50% - 7px);
  right: calc(var(--cord-x) - var(--cord-w) / 2);
  width: var(--cord-w);
  background: var(--twine);
  border-radius: 0 0 2px 2px;
  filter: drop-shadow(1px 2px 1.5px rgba(12, 28, 52, 0.5));
  /* It goes in, it does not stop: the last of it fades into the length that
     carries on behind the card, seen through the hole. */
  -webkit-mask: linear-gradient(#000 calc(100% - 9px), transparent);
  mask: linear-gradient(#000 calc(100% - 9px), transparent);
  pointer-events: none;
}

.door strong {
  display: block;
  font: 700 1.42rem/1.15 var(--title);
  letter-spacing: -0.016em;
}

.door-card > span { display: block; margin-top: 0.15rem; font-size: 0.95rem; }

/* It swings on the eyelet, which is the only way a tag on a thread can move. */
a.door:hover .door-card, a.door:focus-visible .door-card { transform: rotate(calc(var(--sway) * 0.2)); }
a.door:active .door-card { transform: rotate(0deg) translateY(1px); }

.door:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  box-shadow: none;
}

/* The one thing on the page that moves by itself: the tags were just let go. */
@keyframes tag-settle {
  0% { transform: rotate(calc(var(--sway) + 7deg)); }
  32% { transform: rotate(calc(var(--sway) - 3.2deg)); }
  62% { transform: rotate(calc(var(--sway) + 1.4deg)); }
  100% { transform: rotate(var(--sway)); }
}

/* The last tag hangs over the bottom edge of the sea. */
.hero .doors { margin-bottom: -2.4rem; }

/* ---- the strand ---- */

.strand { position: relative; overflow-x: clip; }

.strand-sheet { padding: 5rem 0 3.5rem; }

.strand h2 {
  position: relative;
  z-index: 1;
  max-width: 11em;
  margin: 0 calc(var(--cord-x) + 1rem) 1.9rem 0;
  font: 700 clamp(2rem, 1.5rem + 2.4vw, 3rem)/1.1 var(--title);
  letter-spacing: -0.022em;
}

.beads { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; }

.beads li { position: relative; padding: 0 calc(var(--cord-x) + 1.15rem) 2rem 0; }

.beads h3 {
  margin: 0 0 0.35rem;
  font: 600 1.28rem/1.22 var(--title);
  letter-spacing: -0.014em;
}

.beads p { max-width: 38ch; }

/* A bead on the cord, counted from the same edge as the cord. */
.beads li::after {
  content: '';
  position: absolute;
  right: calc(var(--cord-x) - 12px);
  top: 0.1rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bead-ink);
  box-shadow: var(--bead-shade);
}

.beads .yours::after { background: var(--bead-amber); }

/* ---- the knot ----

   The employer's end of the thread comes in from the far side of the page and
   ties on to the reader's. It only reaches the reader's after the step where the
   reader says yes, which is the whole promise, drawn. */

.knot { position: relative; z-index: 1; height: 5.5rem; }

.knot::before {
  content: '';
  position: absolute;
  left: -100vw;
  right: calc(var(--cord-x) + 1.4rem);
  top: 2.5rem;
  height: var(--cord-w);
  background: var(--twine-sea);
  filter: var(--cord-shade);
}

.knot .tie {
  position: absolute;
  right: calc(var(--cord-x) - 2.2rem);
  top: 0.45rem;
  width: 4.4rem;
  height: 4.4rem;
  overflow: visible;
}

.knot-employer, .knot-you {
  position: absolute;
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--quiet);
}

.knot-employer { left: 0; top: 1.15rem; }
.knot-you { right: calc(var(--cord-x) + 2.6rem); top: 0.5rem; }

.made {
  position: relative;
  z-index: 1;
  max-width: 21em;
  margin: 0.75rem calc(var(--cord-x) + 1rem) 0 0;
  font: 600 1.45rem/1.25 var(--title);
  letter-spacing: -0.015em;
}

.free { position: relative; z-index: 1; margin-top: 3rem; padding-right: calc(var(--cord-x) + 1rem); }
.free h2 { margin: 0 0 0.8rem; font-size: clamp(1.8rem, 1.4rem + 2vw, 2.6rem); }
.free p { max-width: 40ch; }

/* The cord's end, under the last tag: a stopper knot, so the tags cannot slide
   off, and the frayed tail past it. */
.strand-sheet::before {
  content: '';
  position: absolute;
  z-index: 1;
  right: calc(var(--cord-x) - 9px);
  bottom: 1.1rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #F4DDA9 0 14%, #CC9A45 46%, #8E6522 92%);
  box-shadow: var(--bead-shade);
}

.strand-sheet.corded::after { bottom: 0.2rem; }

/* ---- the page for businesses ----

   The tag a business pressed was ink, so it lands on ink. There is no mark here:
   the reader is a business with something to get done, and the one big gesture on
   the site belongs to the person looking for work. */

.hero-ink { background: var(--ink); }
.hero-ink .hero-sheet { grid-template-areas: "words words" "doors doors"; }
.hero-ink .hero-sheet.corded::after { top: 0; }

.hero-ink h1 {
  max-width: 11em;
  padding-right: calc(var(--cord-x) + 1rem);
  font-size: calc(var(--display) * 0.86);
  line-height: 1.08;
}

.hero-ink .pitch { padding-right: calc(var(--cord-x) + 1rem); box-sizing: content-box; }

.strand-business .beads li:last-child { padding-bottom: 0; }

.cost-lead { font-size: 1.08rem; font-weight: 600; }

/* The prices are tags on the same cord. These two do nothing when pressed, so
   they are not links, and the figure is the thing to read. */
.door strong.price { font-size: 2.1rem; letter-spacing: -0.02em; }
.price-later .door-card > span, .price-now .door-card > span { line-height: 1.35; }

.closing .doors { margin-top: 1.75rem; }

.notes-sheet { display: grid; gap: 0.25rem; padding: 2.5rem 0 2.5rem; border-top: 1px solid var(--haze); }
.notes-sheet p { max-width: 42ch; }
.reps a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* ---- the long texts ----

   Every public page opens on a field, so nobody lands on one and wonders whether
   they have left the site. Here the field is only a head: the cord comes down
   through it and stops on a bead at its lower edge, and from there the page gets
   out of the way, one column at a reading measure on the shore. */

.sheet-head {
  --focus: var(--surface);
  color: var(--surface);
  background: var(--sea);
}

.sheet-head .sheet { padding: 2.2rem calc(var(--cord-x) + 1.25rem) 2.4rem 0; }

/* The bead the cord stops on. */
.sheet-head .sheet::before {
  content: '';
  position: absolute;
  z-index: 1;
  right: calc(var(--cord-x) - 12px);
  bottom: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bead-amber);
  box-shadow: var(--bead-shade);
}

.sheet-head h1 {
  max-width: 16em;
  margin: 0;
  font: 700 clamp(2.2rem, 1.6rem + 3vw, 3.4rem)/1.1 var(--title);
  letter-spacing: -0.024em;
}

.updated { margin: 0.6rem 0 0; font-size: 0.95rem; }

/* The text keeps a reading measure on the left of the sheet, under its title,
   and is never given the gutter as padding: it would eat the measure. */
.doc {
  width: min(100% - 2 * var(--edge), var(--sheet));
  margin-inline: auto;
  padding: 1.75rem 0 3rem;
  hyphens: auto;
}

.doc > * { max-width: 42rem; }

.doc h2 {
  margin: 2.5rem 0 0.7rem;
  font-size: 1.45rem;
  line-height: 1.22;
  hyphens: manual;
}

.doc h3 { margin: 1.5rem 0 0.4rem; font: 600 1.14rem/1.3 var(--title); }

.doc p, .doc li, .doc dd { font-size: 1.04rem; line-height: 1.62; }
.doc ul { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.doc li { margin-bottom: 0.45rem; }

.doc .short { margin-top: 1.2rem; font-size: 1.16rem; line-height: 1.55; }

/* Honey rather than a warning colour: nothing has gone wrong, this is a page that
   is not finished, and the reader is owed that before anything else. */
.draft {
  margin: 0 0 0.5rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  background: var(--honey-pale);
  border-radius: 10px;
}

/* What the owner has yet to supply. It has to be seen from across the room: a
   bracket a reader could take for the real thing is worse than a blank. */
.fill {
  padding: 0.05em 0.25em;
  color: var(--ink);
  background: rgba(226, 169, 59, 0.42);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.toc { margin: 1.4rem 0 0; padding: 0.9rem 1.1rem; background: var(--surface); border: 1px solid var(--haze); border-radius: var(--radius); }
.toc ol { margin: 0; padding-left: 1.5rem; }
.doc .toc li { margin: 0; font-size: 1rem; line-height: 1.4; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; }

/* A term and its answer one above the other: two columns of long Greek words in
   350px is two columns of hyphens. */
.doc dl { margin: 0 0 1rem; }
.doc dt { margin-top: 1rem; font-weight: 600; line-height: 1.35; }
.doc dd { margin: 0.15rem 0 0; }
.doc dd > a:only-child { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- the notice form ---- */

.report .check { align-items: flex-start; margin-bottom: 1rem; line-height: 1.45; }
.report button { width: 100%; }

/* Off the page rather than gone: see the note on it in the template. */
.hidden-field { position: absolute; left: -9999px; }

@media (min-width: 56em) {
  .front {
    --edge: 2.5rem;
    --cord-x: 3.4rem;
    --emblem: 12.5rem;
    --emblem-top: 2.5rem;
    --display: clamp(3.4rem, 2.2rem + 3.2vw, 5rem);
  }

  /* The words on the left, and on the right the mark with the tags hung under it. */
  .hero-sheet {
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    grid-template-areas: "words emblem" "words doors";
    grid-template-rows: auto 1fr;
    column-gap: 2.5rem;
    padding-bottom: 0;
  }

  .hero-words { align-self: center; padding-bottom: 2.5rem; }

  .emblem { justify-self: end; }

  .pitch { font-size: 1.2rem; }

  .hero .doors { align-self: end; margin-top: 1.4rem; margin-bottom: -2rem; }

  .hero-ink .hero-sheet { grid-template-areas: "words doors"; grid-template-rows: auto; }
  .hero-ink .hero-words { padding-block: 0.5rem 4rem; }
  .hero-ink h1 { padding-right: 0; }
  .hero-ink .pitch { padding-right: 0; }
  .hero-ink .doors { margin-top: 0; }

  .strand-sheet { padding-top: 6rem; }

  .beads li {
    display: grid;
    grid-template-columns: minmax(0, 22rem) minmax(0, 34rem);
    gap: 0 3rem;
    padding-bottom: 2.6rem;
  }

  .beads p { max-width: none; font-size: 1.05rem; }

  .made { font-size: 1.9rem; }

  /* The closing pair sit beside what they close, as they do on the first screen. */
  .closing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
    align-items: end;
    gap: 2.5rem;
    margin-top: 4rem;
  }

  .closing .free { margin-top: 0; padding-right: 0; }
  .closing .doors { margin-top: 0; }

  .notes-sheet { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 3rem; }
  .notes-sheet p { max-width: none; }
  .reps { grid-column: 1 / -1; }

  .toc ol { columns: 2; column-gap: 2.5rem; }
  .doc .toc li { break-inside: avoid; }

  .sheet-head .sheet { padding-block: 3rem 3.2rem; }
}

/* ---- on paper ---- */

@media print {
  .bar, .foot, .draft { display: none; }
  .sheet-head { color: var(--ink); background: none; }
  .corded::after, .sheet-head .sheet::before { display: none; }
}
