:root {
  --paper: #fffefa;
  --ink: #171717;
  --muted: #77716b;
  --red: #c92823;
  --red-dark: #8f1815;
  --thin-red: rgba(201, 40, 35, 0.78);
  --soft-line: rgba(23, 23, 23, 0.18);
  --font-mono: "Space Mono", "IBM Plex Mono", "Fira Code", "Cascadia Mono", Consolas, "Courier New", monospace;
  --font-text: Arial, Helvetica, sans-serif;
}

/*
Quer usar uma fonte propria depois?
Coloque o arquivo em fonts/elpa-mono.woff2 e descomente este bloco.

@font-face {
  font-family: "ElpaMono";
  src: url("../fonts/elpa-mono.woff2") format("woff2");
  font-display: swap;
}

Depois troque --font-mono para:
--font-mono: "ElpaMono", Consolas, "Courier New", monospace;
*/

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.5;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--red);
}

h1,
h2,
.site-logo,
.corner-logo,
.home-list,
.edge-nav,
.experiment-link,
time,
.not-found-code {
  font-family: var(--font-mono);
  font-weight: 500;
}

h1 {
  max-width: 18ch;
  margin: 0 0 4.8rem;
  color: var(--red);
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

p {
  max-width: 55ch;
  margin: 0 0 1rem;
}

ul,
ol {
  margin-top: 0;
}

.home-page {
  min-height: 100vh;
  overflow-x: hidden;
}

.home-header {
  position: relative;
  height: 11.2rem;
}

.site-logo {
  position: absolute;
  left: 50%;
  top: 3.1rem;
  transform: translateX(-50%);
  color: var(--red);
  font-size: clamp(3.1rem, 7vw, 5.7rem);
  line-height: 1;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.small-star {
  position: absolute;
  left: clamp(1.3rem, 4vw, 4.8rem);
  top: 5.15rem;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.8;
}

.home-main {
  padding: 0 0 7rem;
}

.home-rule {
  width: min(63vw, 52rem);
  height: 2px;
  margin-top: 0;
  background: var(--thin-red);
}

.home-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: min(30rem, 72vw);
  margin: 2.45rem 14vw 0 auto;
  gap: 2.1rem;
  color: var(--red);
  font-size: clamp(1.35rem, 2.45vw, 2.4rem);
  line-height: 1.02;
}

.home-list a {
  max-width: 20ch;
  text-decoration: none;
}

.inner-page {
  min-height: 100vh;
}

.corner-logo {
  position: fixed;
  left: 1.25rem;
  top: 1rem;
  z-index: 5;
  color: var(--red);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.edge-nav {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.65rem;
  transform: translateY(-50%);
}

.edge-nav a {
  display: block;
  padding: 0.18rem 0.22rem 0.18rem 0.55rem;
  border-right: 2px solid transparent;
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.edge-nav a:hover,
.edge-nav .is-active {
  border-right-color: var(--red);
  color: var(--red);
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(13rem, 0.9fr) minmax(20rem, 1fr);
  gap: clamp(3rem, 9vw, 8rem);
  width: min(71rem, calc(100% - 9rem));
  min-height: 100vh;
  margin-left: clamp(2rem, 6vw, 6rem);
  padding: 5.5rem 0 7rem;
}

.page-layout-simple {
  grid-template-columns: minmax(10rem, 0.6fr) minmax(20rem, 1fr);
}

.art-column {
  min-height: 22rem;
}

.art-slot {
  position: sticky;
  top: 5.5rem;
  width: 100%;
  min-height: 24rem;
}

.art-slot-small,
.art-slot-red {
  min-height: 13rem;
}

.art-image {
  position: sticky;
  top: 5.5rem;
  display: block;
  width: 100%;
  max-width: 27rem;
  height: auto;
}

.page-content {
  max-width: 40rem;
  padding-top: 1.4rem;
}

.text-section,
.link-section,
.split-section,
.experiment-grid,
.idea-list {
  margin-top: 4.3rem;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.7rem;
}

.loose-list,
.link-list,
.idea-list {
  padding: 0;
  list-style: none;
}

.loose-list {
  margin: 0;
}

.loose-list li {
  margin-bottom: 0.42rem;
}

.loose-list li::before {
  content: "- ";
  color: var(--red);
}

.link-list {
  margin: 0;
  border-top: 1px solid var(--thin-red);
}

.link-list li {
  display: grid;
  grid-template-columns: minmax(8rem, 0.72fr) 1fr;
  gap: 1.4rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--soft-line);
}

.link-list a {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  text-decoration: none;
}

.link-list span {
  color: var(--muted);
}

.diary-entry {
  padding: 1.15rem 0 1.3rem;
  border-top: 1px solid var(--soft-line);
}

.diary-entry time {
  display: block;
  margin-bottom: 0.48rem;
  color: var(--red);
  font-size: 0.9rem;
}

.diary-entry p {
  margin-bottom: 0;
}

.diary-door {
  display: inline-grid;
  gap: 0.35rem;
  max-width: 22rem;
  color: var(--red);
  font-family: var(--font-mono);
  text-decoration: none;
}

.diary-door span {
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diary-door small {
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.diary-door:hover small {
  color: var(--red-dark);
}

.diary-index {
  margin-top: 4.3rem;
  border-top: 1px solid var(--thin-red);
}

.diary-entry-link {
  display: grid;
  grid-template-columns: minmax(7rem, 0.4fr) 1fr;
  gap: 1.4rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--soft-line);
  text-decoration: none;
}

.diary-entry-link time {
  color: var(--red);
  font-size: 0.85rem;
}

.diary-entry-link span {
  color: var(--ink);
}

.diary-entry-link:hover span {
  color: var(--red);
}

.back-link {
  display: inline-block;
  margin-bottom: 2.4rem;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
}

.back-link::before {
  content: "< ";
}

.diary-page-text {
  margin-top: 0;
}

.idea-list {
  counter-reset: ideas;
}

.idea-list li {
  counter-increment: ideas;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--soft-line);
}

.idea-list li::before {
  content: counter(ideas, decimal-leading-zero);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.experiment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.experiment-link {
  min-height: 8rem;
  padding: 0.9rem;
  border: 1px solid var(--thin-red);
  color: var(--red);
  font-size: 0.95rem;
  text-decoration: none;
}

.experiment-link:hover {
  background: #fff4f2;
  color: var(--red-dark);
}

.not-found-page {
  min-height: 100vh;
}

.not-found-main {
  display: grid;
  grid-template-columns: minmax(9rem, 0.8fr) minmax(18rem, 1fr);
  gap: clamp(3rem, 10vw, 9rem);
  width: min(62rem, calc(100% - 8rem));
  min-height: 100vh;
  margin-left: clamp(2rem, 7vw, 7rem);
  padding: 5.2rem 0;
}

.not-found-code {
  margin: 0;
  color: var(--red);
  font-size: clamp(5rem, 18vw, 15rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
}

.not-found-text {
  align-self: center;
  max-width: 32rem;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: clamp(1.05rem, 2vw, 1.65rem);
  line-height: 1.25;
}

.not-found-text p {
  margin-bottom: 1.4rem;
}

@media (max-width: 860px) {
  .home-header {
    height: 9rem;
  }

  .site-logo {
    top: 2.6rem;
  }

  .small-star {
    top: 4.3rem;
  }

  .home-rule {
    width: 74vw;
  }

  .home-list {
    width: min(25rem, 86vw);
    margin: 2.2rem 6vw 0 auto;
  }

  .edge-nav {
    top: 0;
    right: 0;
    left: 0;
    flex-direction: row;
    justify-content: flex-end;
    gap: 0.2rem;
    padding: 0.75rem 0.75rem 0.55rem 5rem;
    background: rgba(255, 254, 250, 0.96);
    transform: none;
  }

  .edge-nav a {
    padding: 0.2rem 0.32rem;
    border-right: 0;
    border-bottom: 1px solid transparent;
    font-size: 0.66rem;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .edge-nav a:hover,
  .edge-nav .is-active {
    border-right-color: transparent;
    border-bottom-color: var(--red);
  }

  .page-layout,
  .page-layout-simple,
  .not-found-main {
    display: block;
    width: min(100% - 2rem, 42rem);
    margin: 0 auto;
    padding: 5.3rem 0 4rem;
  }

  .art-column {
    min-height: 5rem;
  }

  .art-slot {
    position: relative;
    top: auto;
    min-height: 5rem;
  }

  .art-image {
    position: relative;
    top: auto;
    max-width: 18rem;
    margin-bottom: 1.5rem;
  }

  .split-section,
  .experiment-grid {
    grid-template-columns: 1fr;
  }

  .link-list li {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .diary-entry-link {
    grid-template-columns: 1fr;
    gap: 0.28rem;
  }

  .not-found-text {
    margin-top: 3rem;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .corner-logo {
    left: 0.75rem;
    top: 0.78rem;
  }

  .edge-nav {
    overflow-x: auto;
    justify-content: flex-start;
    padding-left: 4.2rem;
  }

  .home-rule {
    width: 92vw;
  }

  .home-list {
    gap: 1.55rem;
    margin-right: 1rem;
  }

  .idea-list li {
    grid-template-columns: 2.35rem 1fr;
  }
}
