@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: light;
  --paper: #eeece4;
  --ink: #11110f;
  --soft-ink: rgba(17, 17, 15, 0.56);
  --line: rgba(17, 17, 15, 0.2);
  --signal: #d86642;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", sans-serif;
}

a {
  color: inherit;
}

.home-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 42px;
  min-height: 100svh;
  overflow: hidden;
  border: 1px solid var(--ink);
}

.mac-reference {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: grayscale(1) contrast(1.4) brightness(1.28);
  mix-blend-mode: multiply;
  opacity: 0.12;
}

.home-shell::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: rgba(238, 236, 228, 0.68);
  pointer-events: none;
}

.system-bar,
.home-footer {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
}

.system-bar {
  grid-template-columns: 1fr auto 1fr;
  min-width: 0;
  padding: 0 74px 0 18px;
  border-bottom: 1px solid var(--ink);
}

.system-bar p,
.home-footer span {
  margin: 0;
}

.system-name {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  text-decoration: none;
}

.system-name > span {
  width: 8px;
  height: 8px;
  background: var(--signal);
  border-radius: 50%;
}

.system-index {
  justify-self: end;
}

.home-hero {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 0;
  padding: clamp(74px, 9vw, 130px) clamp(20px, 5vw, 76px) 42px;
}

.home-hero::before,
.home-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.home-hero::before {
  top: 0;
  bottom: 0;
  left: clamp(20px, 5vw, 76px);
  border-left: 1px solid var(--line);
}

.home-hero::after {
  top: 0;
  bottom: 0;
  right: clamp(20px, 5vw, 76px);
  border-right: 1px solid var(--line);
}

.edition {
  margin: 0 0 14px;
  padding-left: clamp(12px, 2.3vw, 34px);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 650;
}

h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(5.3rem, 20.2vw, 20rem);
  font-weight: 400;
  line-height: 0.72;
  letter-spacing: 0;
}

h1 a {
  display: inline-block;
  text-decoration: none;
  transform: translateY(0);
  transition: transform 240ms var(--ease-out), opacity 180ms ease;
}

h1 a:active {
  transform: translateY(0) scale(0.985);
}

h1 a:focus-visible,
.latest-entry a:focus-visible,
.home-footer a:focus-visible,
.system-name:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 5px;
}

.hero-meta {
  position: absolute;
  top: 50%;
  display: flex;
  gap: 18px;
  color: var(--soft-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
  transform: rotate(-90deg) translateX(-50%);
  transform-origin: left top;
}

.hero-meta--left {
  left: 11px;
}

.timeline {
  position: relative;
  width: 100%;
  height: clamp(88px, 14vw, 154px);
  margin-top: clamp(18px, 4vw, 44px);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

#timelineCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.timeline-number {
  position: absolute;
  bottom: 8px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
}

.timeline-number::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 19px;
  width: 7px;
  height: 7px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 50%;
  transform: translateX(-50%);
}

.timeline-number--first {
  left: 12%;
}

.timeline-number--latest {
  right: 12%;
}

.timeline-number--latest::before {
  background: var(--signal);
}

.latest-entry {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 2px 0;
}

.latest-entry p {
  margin: 0;
  color: var(--soft-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.latest-entry p span {
  color: var(--ink);
  font-size: 32px;
  line-height: 0.8;
}

.latest-entry a {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
  border-bottom: 1px solid var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms var(--ease-out), opacity 180ms ease;
}

.latest-entry a span:last-child {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 20px;
}

.latest-entry a:active {
  transform: scale(0.97);
}

.hero-note {
  justify-self: end;
  margin: clamp(24px, 4vw, 48px) 0 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
}

.home-footer {
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 0 18px;
  border-top: 1px solid var(--ink);
}

.home-footer a {
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  h1 a:hover {
    transform: translateY(-5px);
  }

  .latest-entry a:hover,
  .home-footer a:hover {
    opacity: 0.55;
  }
}

@media (max-width: 680px) {
  .home-shell {
    grid-template-rows: 46px minmax(0, 1fr) auto;
  }

  .system-bar {
    grid-template-columns: 1fr auto;
    padding: 0 62px 0 12px;
  }

  .system-bar > p:not(.system-index) {
    display: none;
  }

  .home-hero {
    align-content: center;
    padding: 78px 16px 34px;
  }

  .home-hero::before {
    left: 16px;
  }

  .home-hero::after {
    right: 16px;
  }

  .edition {
    padding-left: 8px;
  }

  h1 {
    font-size: clamp(4.25rem, 23.5vw, 7.2rem);
    line-height: 0.78;
  }

  .timeline {
    height: 104px;
    margin-top: 32px;
  }

  .latest-entry {
    align-items: center;
    padding: 16px 3px 0;
  }

  .latest-entry p span {
    display: block;
    font-size: 26px;
  }

  .hero-note {
    justify-self: start;
    max-width: 28ch;
    line-height: 1.5;
  }

  .hero-meta {
    display: none;
  }

  .home-footer {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 12px;
    line-height: 1.4;
  }

  .mac-reference {
    object-position: 57% center;
    opacity: 0.1;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: clamp(3.95rem, 22.6vw, 5.3rem);
  }

  .latest-entry a {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  h1 a,
  .latest-entry a {
    transition-duration: 0.01ms;
  }
}

@media (prefers-contrast: more) {
  .mac-reference,
  .home-shell::before {
    display: none;
  }
}
