/* Weight of Salt — weightofsalt.com
   Colours are taken from the book's cover: its teal ground and shell-cream linework.
   Fonts are self-hosted (no third-party requests). */

@font-face {
  font-family: "IM Fell English";
  src: url("fonts/im-fell-english-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("fonts/im-fell-english-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("fonts/alegreya-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("fonts/alegreya-sans-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("fonts/alegreya-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya Sans";
  src: url("fonts/alegreya-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --cover: #1d3d46;      /* the cover's teal */
  --water: #142d34;      /* deeper water */
  --trench: #0b1c21;     /* the bottom */
  --shell: #efe1d5;      /* the cover's linework cream */
  --paper: #f5ece2;      /* a page of the book */
  --glass: #a9c2be;      /* sea-glass, for quiet text */
  --ochre: #d9ab62;      /* parchment gold from the interior scrolls */
  --ochre-deep: #8a5a17; /* the same gold, dark enough for paper */
  --ink: #12262c;        /* text on paper */
  --rule: rgba(239, 225, 213, 0.22);
  --rule-ink: rgba(18, 38, 44, 0.2);

  --display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: "Alegreya Sans", "Gill Sans", "Trebuchet MS", Verdana, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --wide: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--trench);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--shell);
  font-family: var(--text);
  font-size: 1.1875rem;
  line-height: 1.55;
  /* The page gets darker as you go down, like water. */
  background:
    url("img/grain.png"),
    linear-gradient(180deg, var(--cover) 0, var(--water) 45rem, var(--trench) 100%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--ochre);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--shell);
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}

h2 {
  font-size: clamp(2rem, 4.6vw, 3rem);
  letter-spacing: -0.005em;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1em;
}

.skip {
  position: absolute;
  left: -999rem;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--shell);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
}

.wrap {
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure {
  max-width: var(--measure);
}

.quiet {
  color: var(--glass);
  font-size: 1rem;
}

/* ---------- Header ---------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.4rem;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--shell);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.masthead nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.masthead nav a {
  color: var(--shell);
  font-weight: 500;
  font-size: 1.0625rem;
  text-decoration: none;
  padding-block: 0.35rem;
  display: inline-block;
}
.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  color: var(--ochre);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  font-family: var(--text);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-decoration: none;
  padding: 0.85rem 1.35rem;
  border: 1.5px solid var(--ochre);
  border-radius: 2px;
  background: var(--ochre);
  color: var(--ink);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.button:hover {
  background: var(--shell);
  border-color: var(--shell);
  color: var(--ink);
}
.button.plain {
  background: transparent;
  border-color: var(--shell);
  color: var(--shell);
}
.button.plain:hover {
  background: var(--shell);
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0;
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 5.5rem);
  padding-block: clamp(1.5rem, 5vw, 4rem) clamp(4rem, 9vw, 7.5rem);
}

.series {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--glass);
  margin: 0 0 1rem;
}

.title {
  font-size: clamp(3.1rem, 9.2vw, 7.6rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  margin: 0 0 0.35em;
}
/* The cover sets "of" in lower case between the two capitals; so does the page. */
.title .of {
  text-transform: none;
  letter-spacing: 0.02em;
}
.title .line {
  display: block;
}

.lede {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  line-height: 1.3;
  max-width: 24em;
  margin: 0 0 1.8rem;
}

.hero .quiet {
  margin: 1.4rem 0 0;
}

.book {
  position: relative;
  justify-self: center;
  width: min(100%, 25rem);
  margin: 0;
  box-shadow:
    0 2px 3px rgba(0, 0, 0, 0.3),
    1.6rem 2.4rem 3.5rem rgba(4, 14, 17, 0.55);
  animation: surface 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
/* A soft shadow down the left edge, where the spine folds. */
.book::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28) 0, rgba(255, 255, 255, 0.07) 2.5%, rgba(0, 0, 0, 0) 7%);
  pointer-events: none;
}

@keyframes surface {
  from {
    opacity: 0;
    transform: translateY(1.75rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  border-top: 1px solid var(--rule);
}

.section h2 {
  margin-bottom: 1.4rem;
}

/* Directory sign-up: the button, with a QR code beside it for people reading on a computer. */
.signup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2.25rem;
  margin-top: 1.4rem;
}
.signup .quiet {
  margin: 0.9rem 0 0;
}
.qr {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 17rem;
  color: var(--glass);
  font-size: 1rem;
  line-height: 1.35;
}
.qr img {
  width: 6.75rem;
  flex: none;
  border-radius: 2px;
}

.split > .facts {
  align-self: center;
}
.facts.joining {
  grid-template-columns: 11.5rem minmax(0, 1fr);
}

.art {
  justify-self: center;
  align-self: center;
  width: min(100%, 23rem);
  opacity: 0.9;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.scrolls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
  margin: 0;
}
.scrolls img:last-of-type {
  margin-top: 3.5rem;
}
.scrolls figcaption {
  grid-column: 1 / -1;
  color: var(--glass);
  font-size: 1rem;
  margin-top: 0.4rem;
}

/* The note: a page of the book laid across the water. */
.note {
  background: var(--paper);
  color: var(--ink);
  padding-block: clamp(3.5rem, 8vw, 6rem);
}
.note h2 {
  font-style: italic;
  margin-bottom: 1.5rem;
}
.note p {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.42;
  max-width: 31em;
  margin: 0;
}
.note p + p {
  margin-top: 0.9em;
}
/* Where the words are terms rather than voice, use the plainer face so figures read clearly. */
.note.plain p {
  font-family: var(--text);
  font-size: 1.3rem;
  line-height: 1.5;
  max-width: 36em;
}

/* Ways to get a copy: a price list, not cards. */
.ways {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--rule);
}
.ways > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13.5rem 15.5rem;
  gap: 1rem 3rem;
  align-items: center;
  padding-block: 1.9rem;
  border-top: 1px solid var(--rule);
}
.ways h3 {
  margin-bottom: 0.45rem;
}
.ways p {
  margin: 0;
  max-width: 30em;
  color: var(--glass);
}
.ways .price {
  font-family: var(--display);
  font-size: 2.1rem;
  line-height: 1.05;
  color: var(--shell);
}
.ways .price small {
  display: block;
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.3;
  color: var(--glass);
  margin-top: 0.3rem;
}
.ways .button {
  white-space: nowrap;
  text-align: center;
}
.after-list {
  margin: 1.3rem 0 0;
}

/* Facts about the edition */
.facts {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 0;
  margin: 0;
  max-width: 46rem;
}
.facts dt,
.facts dd {
  padding-block: 0.85rem;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.facts dt {
  color: var(--glass);
}

/* Questions */
.faq {
  max-width: 46rem;
  border-bottom: 1px solid var(--rule);
}
.faq details {
  border-top: 1px solid var(--rule);
}
.faq summary {
  cursor: pointer;
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1.25;
  padding-block: 1rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-family: var(--text);
  color: var(--ochre);
  flex: none;
}
.faq details[open] summary::after {
  content: "\2212";
}
.faq details p {
  max-width: var(--measure);
  color: var(--glass);
  margin-bottom: 1.3rem;
}

/* ---------- Mermaid Friend page ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(3.5rem, 8vw, 6rem);
}
.intro h1 {
  font-size: clamp(2.6rem, 6.4vw, 4.8rem);
  margin-bottom: 0.4em;
}
.intro .lede {
  margin-bottom: 1.5rem;
}
.cost {
  font-family: var(--display);
  font-size: 2.3rem;
  line-height: 1.1;
  margin: 0 0 1.3rem;
}
.cost small {
  font-family: var(--text);
  font-size: 1.0625rem;
  color: var(--glass);
}

/* A sketch of the back cover. */
.backcover {
  justify-self: center;
  width: min(100%, 22rem);
  margin: 0;
}
.backcover .board {
  aspect-ratio: 5.5 / 8.5;
  background: var(--cover) url("img/grain.png");
  border: 1px solid rgba(239, 225, 213, 0.16);
  box-shadow: -1.4rem 2.2rem 3.2rem rgba(4, 14, 17, 0.55);
  padding: 9% 9% 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5%;
}
.backcover .slot {
  width: 54%;
  aspect-ratio: 4 / 5;
  border: 1.5px dashed var(--ochre);
  display: grid;
  place-items: center;
  padding: 0.6rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--ochre);
}
.backcover .credit {
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
}
.backcover .credit span {
  display: block;
  font-style: italic;
  color: var(--glass);
}
.backcover .lines {
  width: 100%;
  margin-top: auto;
  display: grid;
  gap: 0.5rem;
}
.backcover .lines i {
  display: block;
  height: 2px;
  background: rgba(239, 225, 213, 0.28);
}
.backcover .lines i:nth-child(3n) {
  width: 72%;
  justify-self: center;
}
.backcover .mark {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--glass);
  margin: 0;
}
.backcover figcaption {
  color: var(--glass);
  font-size: 1rem;
  margin-top: 1.2rem;
  text-align: center;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  max-width: 46rem;
  border-bottom: 1px solid var(--rule);
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  padding-block: 1.3rem;
  border-top: 1px solid var(--rule);
}
.steps li::before {
  content: counter(step);
  font-family: var(--text);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.15;
  color: var(--ochre);
}
.steps h3 {
  margin-bottom: 0.3rem;
}
.steps p {
  margin: 0;
  color: var(--glass);
}

.plain-list {
  margin: 0;
  padding-left: 1.2rem;
  max-width: var(--measure);
}
.plain-list li {
  margin-bottom: 0.7rem;
  padding-left: 0.3rem;
}
.plain-list li::marker {
  color: var(--ochre);
}

.closing {
  text-align: left;
}
.closing h2 {
  margin-bottom: 1rem;
}

/* ---------- Paper pages (terms, privacy, policy) ---------- */

.paper {
  background: var(--paper);
  color: var(--ink);
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 8vw, 6rem);
}
.paper .doc {
  max-width: 43rem;
}
.paper h1 {
  font-size: clamp(2.4rem, 5.6vw, 3.8rem);
  margin-bottom: 0.5rem;
}
.paper .updated {
  color: #47595e;
  font-size: 1rem;
  margin-bottom: 2rem;
}
.paper h2 {
  font-family: var(--text);
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 2.6rem 0 0.7rem;
}
.paper h3 {
  font-family: var(--text);
  font-weight: 700;
  font-size: 1.1875rem;
  margin: 1.5rem 0 0.4rem;
}
.paper a {
  color: var(--ochre-deep);
}
.paper a:hover {
  color: var(--ink);
}
.paper ul,
.paper ol {
  padding-left: 1.3rem;
  margin: 0 0 1em;
}
.paper li {
  margin-bottom: 0.45rem;
}
.paper .summary {
  border: 1px solid var(--rule-ink);
  border-left: 4px solid var(--ochre-deep);
  padding: 1.1rem 1.3rem;
  margin: 0 0 1.5rem;
  background: rgba(255, 255, 255, 0.35);
}
.paper .summary p:last-child,
.paper .summary ul:last-child {
  margin-bottom: 0;
}
.paper address {
  font-style: normal;
  margin-bottom: 1em;
}
.paper :focus-visible {
  outline-color: var(--ochre-deep);
}

/* ---------- Footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  padding-block: 3rem 2.5rem;
  font-size: 1rem;
  color: var(--glass);
}
.foot .cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem 3rem;
}
.foot h2 {
  font-size: 1.25rem;
  color: var(--shell);
  margin-bottom: 0.7rem;
}
.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.foot li {
  margin-bottom: 0.35rem;
}
.foot a {
  color: var(--shell);
}
.foot a:hover {
  color: var(--ochre);
}
.foot address {
  font-style: normal;
}
.foot .small {
  margin: 2.5rem 0 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
}

/* ---------- Small screens ---------- */

@media (max-width: 52rem) {
  body {
    font-size: 1.125rem;
  }
  .hero,
  .intro,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero .book {
    order: -1;
    width: min(72%, 19rem);
    justify-self: start;
  }
  .intro .backcover {
    width: min(78%, 19rem);
    justify-self: start;
  }
  .art {
    width: min(70%, 17rem);
    justify-self: start;
  }
  /* On a phone the button is already one tap away. */
  .qr {
    display: none;
  }
  .ways > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
    justify-items: start;
  }
  .facts,
  .facts.joining {
    grid-template-columns: minmax(0, 1fr);
  }
  .facts dt {
    padding-bottom: 0;
  }
  .facts dd {
    border-top: 0;
    padding-top: 0.15rem;
  }
  .foot .cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .masthead {
    padding-block: 1.1rem;
  }
  .masthead nav ul {
    gap: 0 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .book {
    animation: none;
  }
  .button {
    transition: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }
  .masthead nav,
  .foot,
  .actions {
    display: none;
  }
}
