/* A Rockey Enterprise. The page is laid out like pleading paper: numbered
   lines down a double red margin, with one thread that refuses to stay straight. */
:root {
  color-scheme: light;
  --paper: #f4efe4;
  --paper-deep: #e9e2d2;
  --ink: #18231f;
  --ink-soft: #4b5650;
  --red: #c23a22;
  --rule: #d9cfba;
  --gutter: 76px;
  --pad: clamp(20px, 5vw, 72px);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  font: 400 clamp(1.06rem, .98rem + .35vw, 1.28rem)/1.6 var(--serif);
  overflow-wrap: break-word;
  /* Line numbers 1-28 restart down the page, as they do on each sheet of pleading paper. */
  background-image:
    linear-gradient(var(--red), var(--red)),
    linear-gradient(var(--red), var(--red)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='1120' font-family='monospace' font-size='12' fill='%23978c74' text-anchor='end'%3E%3Ctext x='46' y='30'%3E1%3C/text%3E%3Ctext x='46' y='70'%3E2%3C/text%3E%3Ctext x='46' y='110'%3E3%3C/text%3E%3Ctext x='46' y='150'%3E4%3C/text%3E%3Ctext x='46' y='190'%3E5%3C/text%3E%3Ctext x='46' y='230'%3E6%3C/text%3E%3Ctext x='46' y='270'%3E7%3C/text%3E%3Ctext x='46' y='310'%3E8%3C/text%3E%3Ctext x='46' y='350'%3E9%3C/text%3E%3Ctext x='46' y='390'%3E10%3C/text%3E%3Ctext x='46' y='430'%3E11%3C/text%3E%3Ctext x='46' y='470'%3E12%3C/text%3E%3Ctext x='46' y='510'%3E13%3C/text%3E%3Ctext x='46' y='550'%3E14%3C/text%3E%3Ctext x='46' y='590'%3E15%3C/text%3E%3Ctext x='46' y='630'%3E16%3C/text%3E%3Ctext x='46' y='670'%3E17%3C/text%3E%3Ctext x='46' y='710'%3E18%3C/text%3E%3Ctext x='46' y='750'%3E19%3C/text%3E%3Ctext x='46' y='790'%3E20%3C/text%3E%3Ctext x='46' y='830'%3E21%3C/text%3E%3Ctext x='46' y='870'%3E22%3C/text%3E%3Ctext x='46' y='910'%3E23%3C/text%3E%3Ctext x='46' y='950'%3E24%3C/text%3E%3Ctext x='46' y='990'%3E25%3C/text%3E%3Ctext x='46' y='1030'%3E26%3C/text%3E%3Ctext x='46' y='1070'%3E27%3C/text%3E%3Ctext x='46' y='1110'%3E28%3C/text%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-size: 1px 100%, 1px 100%, 50px 1120px;
  background-position: calc(var(--gutter) - 12px) 0, calc(var(--gutter) - 8px) 0, 6px 0;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: .5em .9em; z-index: 5; }
.skip:focus { left: 8px; }

.top, .foot, main > section { padding-left: calc(var(--gutter) + var(--pad)); padding-right: var(--pad); }

.top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: .25rem 2rem; padding-top: 1.6rem; padding-bottom: 1rem;
}
.brand { font-size: 1.1em; font-weight: 700; text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: .1rem 1.5rem; font: 400 .74rem/2 var(--mono); letter-spacing: .1em; text-transform: uppercase; }

/* Hero */
.hero { position: relative; padding-top: clamp(2.5rem, 7vw, 6rem); }
.eyebrow, .section-mark, .clause-no, .dial label, .dial output {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
}
.eyebrow { margin: 0 0 1.1rem; color: var(--red); }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(3rem, 10vw, 9rem); line-height: .98; letter-spacing: -.025em; max-width: 11ch; }
.strike { font-style: italic; color: var(--red); }
.dot { color: var(--red); }
.lede { margin: 1.5rem 0 0; font-size: 1.25em; color: var(--ink-soft); }

.seal {
  position: absolute; top: clamp(2rem, 5vw, 4rem); right: var(--pad);
  width: clamp(112px, 15vw, 208px); height: auto; transform: rotate(-11deg);
}
.seal circle { fill: none; stroke: var(--red); stroke-width: 2; }
.seal text { fill: var(--red); font: 700 15px var(--mono); }
.seal .seal-mark { font: 400 62px var(--serif); }

.thread { margin: clamp(1.5rem, 4vw, 3rem) calc(var(--pad) * -1) 0 calc((var(--pad) + 8px) * -1); }
#thread-svg { display: block; width: 100%; height: clamp(190px, 28vw, 340px); }
#thread-path {
  fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke; stroke-dasharray: 1; animation: draw 1.8s ease-out both;
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.dial {
  display: grid; grid-template-columns: auto minmax(120px, 340px) 1fr; align-items: center; gap: .5rem 1.25rem;
  margin: 1rem 0 0; padding: 0 var(--pad) 0 calc(var(--pad) + 8px);
}
.dial[hidden] { display: none; }
.dial label { color: var(--ink-soft); }
.dial output { text-transform: none; letter-spacing: 0; font-size: .86rem; }
.dial input { width: 100%; margin: 0; accent-color: var(--red); height: 28px; cursor: pointer; }

/* Sections */
main > section:not(.hero) { padding-top: clamp(4rem, 9vw, 8rem); }
.section-mark { margin: 0 0 1rem; color: var(--red); }
h2 { font-size: clamp(2.3rem, 6vw, 5rem); line-height: 1.04; letter-spacing: -.02em; }
.section-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .75rem 3rem; align-items: end; }
.section-head .section-mark { grid-column: 1 / -1; margin: 0; }
.section-head p:last-child { margin: 0; color: var(--ink-soft); }

.clauses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(2rem, 5vw, 5rem); margin-top: clamp(2rem, 4vw, 3.5rem); }
.clauses article { border-top: 1px solid var(--ink); padding: 1.25rem 0 2.5rem; }
.clause-no { margin: 0 0 1.5rem; color: var(--ink-soft); }
h3 { font-size: clamp(1.5rem, 2.8vw, 2.25rem); line-height: 1.15; }
.clauses article p:last-child { margin: .8rem 0 0; color: var(--ink-soft); max-width: 34em; }

.principles { padding-bottom: clamp(2rem, 5vw, 4rem); }

main > .background {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem clamp(2rem, 5vw, 5rem); align-items: end;
  background: var(--ink); color: var(--paper);
  padding-top: clamp(3rem, 7vw, 6rem); padding-bottom: clamp(3rem, 7vw, 6rem);
}
.jd { margin: 0; font-size: clamp(6rem, 21vw, 19rem); line-height: .82; font-style: italic; letter-spacing: -.04em; color: var(--paper); }
.background .section-mark { color: #f07f65; }
.background h2 { font-size: clamp(2rem, 4.4vw, 3.8rem); }
.background-copy > p:last-child { margin: 1rem 0 0; color: #cdd0c5; }

.making p:last-child, .contact p:last-child { max-width: 34em; margin: 1.25rem 0 0; color: var(--ink-soft); }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 2rem;
  margin-top: clamp(4rem, 9vw, 8rem); padding-top: 1.25rem; padding-bottom: 2rem;
  font: 400 .74rem/1.7 var(--mono); color: var(--ink-soft);
}
.foot p { margin: 0; }
.foot::before { content: ""; flex: 0 0 100%; border-top: 1px solid var(--ink); margin-bottom: .75rem; }

/* 404 */
.lost { min-height: 60vh; }

/* Phones: thin the margin so the words get the width. */
@media (max-width: 720px) {
  :root { --gutter: 38px; --pad: 16px; }
  body {
    background-size: 1px 100%, 1px 100%, 25px 560px;
    background-position: calc(var(--gutter) - 9px) 0, calc(var(--gutter) - 6px) 0, 2px 0;
  }
  .hero { padding-top: 7.5rem; }
  .seal { top: 1rem; right: 16px; width: 92px; }
  .section-head, .clauses, main > .background { grid-template-columns: minmax(0, 1fr); }
  main > .background { row-gap: 2.25rem; }
  .dial { grid-template-columns: auto minmax(0, 1fr); }
  .dial output { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #thread-path { animation: none; stroke-dasharray: none; }
}
