/* dialogic.tools
   The same paper, ink and type as dialogic.studio. Paper in light, ink in dark,
   following the system. This one file styles the home page and every small page;
   Marrow's page has its own look in marrow/style.css. */

@font-face {
  font-family: "Newsreader Variable";
  src: url("/fonts/Newsreader-latin-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader Variable";
  src: url("/fonts/Newsreader-latin-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "iA Writer Duo";
  src: url("/fonts/iAWriterDuoS-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4e6c6;
  --ink: #221d15;
  --muted: #5a5246;
  --lead: #8a7f6e;
  --rule: rgba(34, 29, 21, 0.16);
  --grain: 0.86;
  --serif: "Newsreader Variable", "Newsreader", Georgia, "Times New Roman", serif;
  --duo: "iA Writer Duo", "Courier New", ui-monospace, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #221d15;
    --ink: #f4e6c6;
    --muted: #b5a684;
    --lead: #8a7f6e;
    --rule: rgba(244, 230, 198, 0.16);
    --grain: 0.35;
  }
}

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

body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* The paper's grain, over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: var(--grain);
  background: url("/paper.png") 0 0 / 256px 256px;
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.small {
  font-family: var(--duo);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lead);
}

/* ---------- The home page ---------- */

.home {
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 7rem) 1.5rem 3rem;
  flex: 1;
}

.mast {
  display: flex;
  justify-content: center;
  /* Both words are 724 units tall in their own pictures, so one height lines them up. */
  --h: min(calc(88vw * 724 / (2172 + 1465)), 128px);
  height: var(--h);
  margin-bottom: clamp(3.5rem, 10vh, 6rem);
}

/* Each word is cut out of the ink colour, so it turns with light and dark */
.wordmark, .mast .tools {
  display: block;
  height: 100%;
  background: var(--ink);
}

.wordmark {
  aspect-ratio: 2172 / 724;
  -webkit-mask: url("/wordmark.png") center / contain no-repeat;
  mask: url("/wordmark.png") center / contain no-repeat;
}

.mast .tools {
  aspect-ratio: 1465 / 724;
  -webkit-mask: url("/tools.svg") center / contain no-repeat;
  mask: url("/tools.svg") center / contain no-repeat;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

section + section { margin-top: clamp(3rem, 8vh, 5rem); }

section h2 {
  font-family: var(--duo);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lead);
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.2rem;
}

.shelf {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 2.6rem 2.4rem;
}

.shelf a { display: block; }

.shelf img {
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 0 0.9rem -6px;
  transition: transform 0.25s ease;
}

.shelf a:hover img { transform: translateY(-3px); }

.shelf h3 {
  font-weight: 400;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.shelf p {
  color: var(--muted);
  font-size: 1.02rem;
  text-wrap: pretty;
}

.shelf a:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--lead);
}

/* ---------- A small page: an icon, a name, a line ---------- */

.one {
  flex: 1;
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.one img {
  width: 128px;
  height: 128px;
  margin-bottom: 1.4rem;
}

.one h1 {
  font-weight: 400;
  font-size: 3.1rem;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 0.7rem;
}

.one p {
  font-size: 1.3rem;
  color: var(--muted);
  text-wrap: balance;
}

.one nav {
  margin-top: 1.8rem;
  display: flex;
  gap: 1.6rem;
}

/* ---------- The bottom of every page ---------- */

footer {
  padding: 2rem 1.5rem 2.4rem;
  text-align: center;
}

footer .small a:hover, .one nav a:hover { color: var(--ink); }

.back {
  position: absolute;
  top: 1.4rem;
  left: 1.5rem;
}

.back:hover { color: var(--ink); }
