@font-face {
  font-family: "Yomogi";
  src: url(/fonts/yomogi-latin.woff2) format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Klee One";
  src: url(/fonts/klee-one-latin.woff2) format("woff2");
  font-display: swap;
}

/* white space. three colours, nothing else */
:root {
  --paper: #ffffff;
  --ink: #0b0b0b;
  --red: #d81e2c;
  color-scheme: light dark;
}

/* black space. the drawings are black line art, so inverting them is enough */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0b0b;
    --ink: #ffffff;
  }

  img {
    filter: invert(1);
  }
}

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

html {
  background: var(--paper);
  color: var(--ink);
}

/* the column sits left of centre and the rest of the room stays empty */
body {
  max-width: 36rem;
  margin-left: clamp(0rem, 14vw - 3rem, 16rem);
  padding: 0 1.25rem 7rem;
  font: 1.125rem/1.75 "Klee One", cursive;
}

h1,
h2,
label,
button,
summary,
time,
.quiet,
.said {
  font-family: "Yomogi", cursive;
  font-weight: 400;
}

h1 {
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

a {
  color: inherit;
  text-decoration: underline var(--red);
  text-underline-offset: 0.2em;
}

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

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

img {
  display: block;
}

.quiet {
  font-size: 1.5rem;
}

.said {
  text-decoration: underline wavy var(--red);
  text-underline-offset: 0.3em;
}

/* the diary */

.lamp {
  display: flex;
  align-items: flex-end;
  gap: 1.1rem;
  margin-bottom: 3.25rem;
}

.lamp h1 {
  padding-bottom: 0.55rem;
}

.day {
  padding-bottom: 2.5rem;
}

/* the pencil line is a mask so it follows the ink colour in both rooms */
.day + .day::before,
.written li + li::before {
  content: "";
  display: block;
  height: 6px;
  margin-bottom: 2.25rem;
  background: var(--ink);
  mask: url(/line.svg) center / 100% 100% no-repeat;
}

h2 {
  font-size: 1.5rem;
  line-height: 1.3;
}

.note {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  column-gap: 0.6rem;
  margin-top: 1rem;
}

.note time,
.when time {
  text-decoration: underline var(--red);
  text-underline-offset: 0.25em;
}

.note p,
.written p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lost {
  padding-top: 5rem;
}

.lost a {
  display: inline-block;
  margin-top: 1rem;
}

/* the door and the desk */

input,
textarea,
button {
  font-size: inherit;
  color: inherit;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 0.45rem 0.85rem;
}

/* uneven corners so the boxes look drawn, not rendered */
input,
textarea {
  width: 100%;
  font-family: "Klee One", cursive;
  line-height: 1.6;
  border-radius: 14px 4px 12px 5px / 5px 12px 4px 14px;
}

textarea {
  display: block;
  resize: vertical;
}

button {
  justify-self: start;
  cursor: pointer;
  border-radius: 12px 5px 14px 4px / 4px 14px 5px 12px;
}

button:hover {
  background: var(--ink);
  color: var(--paper);
}

form {
  display: grid;
  gap: 0.5rem;
}

.threshold main {
  padding-top: 4.5rem;
}

.threshold form {
  max-width: 17rem;
  margin: 1.75rem 0 1.25rem;
}

.desk header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2.5rem 0 2rem;
}

.desk .said {
  margin-bottom: 1.5rem;
}

.written {
  list-style: none;
  padding: 0;
  margin-top: 3.5rem;
}

.written li {
  padding-bottom: 2.25rem;
}

.written a,
.written details {
  display: inline-block;
  margin: 0.75rem 1.25rem 0 0;
  vertical-align: top;
}

summary {
  cursor: pointer;
}

details form {
  margin-top: 0.5rem;
}
