/* Mizohana — a letter on paper: the typographic landscape, a single column of
   prose, a dark close, and one red reserved for the name and the address. */

:root {
  --paper: #f4f0e7;
  --paper-deep: #e8e1d4;
  --ink: #171510;
  --soft-ink: #39352e;
  --muted: #746e63;
  --rule: #cfc7b9;
  --red: #9f0c11;
  --red-bright: #c81920;
  --night: #171411;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --display: Georgia, "Times New Roman", serif;
  --mono: "Courier New", Courier, monospace;
  --gutter: clamp(20px, 4vw, 64px);
  --measure: 1360px;
  --column: 720px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(54, 45, 31, 0.035) 0.55px, transparent 0.55px);
  background-size: 5px 5px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--paper);
  background: var(--red);
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 5px;
}

figcaption,
.colophon,
.epigraph cite {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Ink appears in place, as on a print. */

.js .develop {
  opacity: 0;
  transition: opacity 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.js .develop.developed {
  opacity: 1;
}

.js .d1 {
  transition-delay: 110ms;
}

.js .d2 {
  transition-delay: 220ms;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .develop {
    opacity: 1;
    transition: none;
  }
}

/* Typographic landscape */

.landscape {
  --banner-inset: clamp(16px, 1.5vw, 24px);
  width: min(100%, 1536px);
  margin-inline: auto;
  padding: var(--banner-inset) var(--banner-inset) 0;
}

.banner-frame {
  position: relative;
  container-type: inline-size;
}

#banner {
  width: 100%;
  aspect-ratio: 2.4;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

#banner canvas {
  display: block;
  opacity: 0;
  transition: opacity 600ms ease-out;
}

#banner.loaded canvas {
  opacity: 1;
}

.banner-title {
  position: absolute;
  z-index: 1;
  top: 20%;
  left: 5%;
  color: var(--ink);
  font-family: var(--display);
  font-size: max(20px, 4cqw);
  font-weight: 400;
  line-height: 1;
}

.banner-kanji {
  color: var(--red);
  font-size: 0.85em;
}

.landscape figcaption {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 18px;
  padding-top: 12px;
  color: var(--muted);
}

/* The letter */

.letter {
  width: min(100%, var(--column));
  margin-inline: auto;
  padding: clamp(90px, 12vw, 165px) var(--gutter) clamp(110px, 14vw, 190px);
}

.letter p {
  color: var(--soft-ink);
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.62;
}

.letter p:first-child {
  color: var(--ink);
}

.letter p+p {
  margin-top: 1.5em;
}

.letter p.letter-mail {
  margin-top: 0.75em;
}

.letter-mail a {
  color: var(--red);
  border-bottom: 1px solid color-mix(in srgb, var(--red) 45%, transparent);
  transition: border-color 180ms ease;
}

.letter-mail a:hover {
  border-color: var(--red);
}

.letter-mail span {
  font-style: italic;
}

/* The close */

.contact {
  color: var(--paper);
  background: var(--night);
  padding-top: clamp(70px, 9vw, 110px);
}

.contact-inner {
  width: min(100%, var(--column));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.epigraph {
  max-width: 36em;
  padding-left: 22px;
  border-left: 2px solid var(--red-bright);
}

.epigraph p {
  color: #aaa196;
  font-size: clamp(16px, 1.35vw, 19px);
  font-style: italic;
  line-height: 1.6;
}

.epigraph cite {
  display: block;
  margin-top: 18px;
  color: #777066;
  font-style: normal;
}

.colophon {
  width: min(100%, var(--measure));
  margin: clamp(70px, 9vw, 120px) auto 0;
  padding: 23px var(--gutter) 40px;
  color: #777066;
  border-top: 1px solid #3a3630;
}