/* Layout: one white typed letter, nothing else. The studio's K logo sits top left as the letterhead, date left and recipient right on one line, a wide typewriter text block whose highlights use the logo's crimson and its soft glow, ballpoint sign-off. */
:root {
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
body {
  margin: 0;
  padding: 0;
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: #fff;
  color: #000;
}
img {
  max-width: 100%;
}
[hidden]:not([hidden="until-found" i]) {
  display: none !important;
}

:root {
  --paper: #ffffff;
  --ink: #141413;
  --crimson: #dd0033;
  --on-crimson: #ffffff;
  --hair: #dad9d4;
  --f-type: "JetBrains Mono", monospace, cursive;
  --f-pen: "Nothing You Could Do", "Bradley Hand", cursive;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--paper);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-type);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 64px 96px;
}

.letter {
  max-width: 660px;
  margin-inline: auto;
  font-size: 15.5px;
  font-weight: 180;
  line-height: 1.62;
}

/* letterhead: the logo, flat */
.letterhead {
  margin: 0 0 76px;
}
.logo {
  margin: 0;
  line-height: 0;
}
.logo svg {
  display: block;
  width: clamp(84px, 17vw, 112px);
  height: auto;
}

/* date and recipient */
.addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 64px;
  font-weight: 500;
}
.addresses p {
  margin: 0;
}

p {
  margin: 0 0 1.45em;
}

/* highlighter: flat crimson from the logo */
.hl {
  background: var(--crimson);
  color: var(--on-crimson);
  padding: 0.05em 0.2em;
  margin: 0 -0.2em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.signoff {
  margin-top: 2.4em;
  margin-bottom: 0;
}
.pen {
  font-family: var(--f-pen);
  line-height: 1.05;
  transform: rotate(-4deg);
  transform-origin: left center;
  margin: 10px 0 34px 6px;
}
.pen span {
  display: block;
}
.pen .a {
  font-size: 27px;
}
.pen .b {
  font-size: 36px;
  margin-left: 26px;
}
.ps {
  margin: 0;
}

/* film grain over the whole letter; strength is set from the slider */
.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: 0.28;
}

/* grain control */
.grain-control {
  display: none!important;
  position: fixed;
  z-index: 60;
  left: max(16px, env(safe-area-inset-left, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(280px, calc(100% - 32px));
  padding: 9px 12px;
  background: var(--paper);
  border: 1px solid var(--hair);
  font: 400 12.5px/1 var(--f-type);
  color: var(--ink);
}
.grain-control label {
  flex: none;
  display: none;
}
.grain-control output {
  display: none;
  flex: none;
  min-width: 2.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.grain-control input[type="range"] {
  display: none;
  flex: 1;
  min-width: 0;
  height: 18px;
  margin: 0;
  background: transparent;
  accent-color: var(--crimson);
  cursor: pointer;
}
.grain-control input[type="range"]:focus-visible {
  display: none;
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  body {
    padding-block: 40px 64px;
  }
  .letter {
    font-size: 14.5px;
  }
  .letterhead {
    margin-bottom: 52px;
  }
  .addresses {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 44px;
  }
}
