@font-face {
  font-family: "Geist Mono";
  src: url("./assets/geist-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.4);
  --icon-muted: rgba(255, 255, 255, 0.4);
  --grid: #333333;
  --purple: #8232ff;
  --row: 40px;
  --edge: 40px;
  --wide: 80px;
  --pad: 20px;
  --font-size: 12px;
  --shell-width: 100vw;
  --bottom-nav-height: 83px;
  --hatch-size: 18px;
  --hatch-duration: 2.4s;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  font-size: var(--font-size);
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  text-rendering: geometricPrecision;
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(100%, var(--shell-width));
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  background: var(--bg);
  overflow: hidden;
}

.section {
  scroll-margin-top: 0;
}

.row {
  display: grid;
  width: 100%;
  min-height: var(--row);
  border-bottom: 1px solid var(--grid);
}

.shell > .section:first-child > .row:first-child {
  border-top: 1px solid var(--grid);
}

.row--top {
  grid-template-columns: var(--edge) var(--wide) minmax(0, 1fr) var(--edge);
  height: var(--row);
}

.row--title {
  grid-template-columns: var(--edge) minmax(0, 1fr) var(--edge);
  height: var(--row);
}

.row--day {
  grid-template-columns: var(--wide) minmax(0, 1fr) var(--edge);
  height: calc(var(--row) * 2);
}

.row--agenda {
  grid-template-columns: var(--wide) minmax(0, 1fr);
  min-height: calc(var(--row) * 2);
  background:
    linear-gradient(var(--grid), var(--grid)) left top / 1px 100% no-repeat,
    linear-gradient(var(--grid), var(--grid)) var(--wide) top / 1px 100% no-repeat,
    linear-gradient(var(--grid), var(--grid)) right top / 1px 100% no-repeat;
}

.row--full {
  grid-template-columns: 1fr;
  height: var(--row);
}

.row--message,
.row--framed {
  grid-template-columns: var(--edge) minmax(0, 1fr) var(--edge);
}

.row--framed {
  height: var(--row);
}

.row--map-list {
  grid-template-columns: var(--edge) minmax(0, 1fr) var(--edge);
  height: var(--row);
}

.cell {
  min-width: 0;
  border-right: 1px solid var(--grid);
}

.row > .cell:first-child {
  border-left: 1px solid var(--grid);
}

.row--agenda > .cell {
  border-right: 0;
}

.row--agenda > .cell:first-child {
  border-left: 0;
}

.cell--mark {
  display: grid;
  place-items: center;
}

.cell--mark img {
  width: var(--edge);
  height: var(--edge);
}

.cell--empty,
.cell--hatch {
  min-height: 0;
}

.cell--hatch {
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
}

.cell--hatch::before {
  content: "";
  position: absolute;
  inset: calc(-1 * var(--hatch-size));
  background-image: linear-gradient(
    135deg,
    transparent calc(50% - 0.5px),
    rgba(255, 255, 255, 0.13) calc(50% - 0.5px),
    rgba(255, 255, 255, 0.13) calc(50% + 0.5px),
    transparent calc(50% + 0.5px)
  );
  background-position:
    calc(var(--hatch-x, 0px) + var(--hatch-size))
    calc(var(--hatch-y, 0px) + var(--hatch-size));
  background-size: var(--hatch-size) var(--hatch-size);
  animation: hatch-slide var(--hatch-duration) linear infinite;
  pointer-events: none;
  will-change: transform;
}

.cell--meta,
.cell--day,
.cell--contact,
.cell--message,
.cell--memory {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pad);
  padding: 0 var(--pad);
  white-space: nowrap;
  overflow: hidden;
}

.cell--title {
  display: flex;
  align-items: center;
  padding: 0 var(--pad);
}

.cell--time {
  display: flex;
  align-items: flex-start;
  padding: var(--pad);
  color: var(--text);
  white-space: nowrap;
}

.cell--agenda {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: var(--pad);
}

.cell--message {
  min-height: calc(var(--row) * 2.6);
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  white-space: normal;
}

.cell--memory {
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: calc(var(--row) * 2);
  padding: var(--row) var(--pad);
}

.cell--art {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.time-stack,
.copy-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.text-primary {
  color: var(--text);
}

.text-muted {
  color: var(--muted);
}

.label-main,
.label-sub,
.title-label,
.time-stack,
.contact-name,
.contact-phone {
  overflow-wrap: anywhere;
}

.label-main {
  color: var(--text);
}

.label-sub {
  color: var(--muted);
}

.agenda-title,
.agenda-place,
.title-label,
.contact-name,
.contact-phone,
.message-line {
  letter-spacing: 0;
}

.agenda-title,
.title-label,
.contact-name {
  color: var(--text);
}

.agenda-place,
.contact-phone,
.message-sub {
  color: var(--muted);
}

.contact-phone {
  transition: color 160ms ease;
}

.contact-phone:focus-visible,
.contact-phone:hover {
  color: var(--text);
}

.spacer {
  height: var(--row);
}

.map-panel {
  position: relative;
  width: 100%;
  aspect-ratio: 780 / 440;
  overflow: hidden;
  border-left: 1px solid var(--grid);
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
}

.map-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-list-label {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 var(--pad);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-index,
.map-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.icon-mask {
  display: block;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

.map-icon .icon-mask {
  width: 20px;
  height: 20px;
  color: var(--text);
}

.contact-art .cell--art {
  aspect-ratio: 1 / 1;
}

.contact-art img {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  opacity: 0.42;
}

.footer-logo {
  min-height: calc(var(--row) * 1.35);
}

.footer-logo img {
  width: 100%;
  height: auto;
  aspect-ratio: 311 / 63;
  object-fit: contain;
  opacity: 0.42;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  background: var(--bg);
}

.bottom-nav__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, var(--shell-width));
  height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--grid);
  background: var(--bg);
}

.nav-link {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 2px solid transparent;
  color: var(--muted);
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease;
}

.nav-link__icon {
  width: 20px;
  height: 20px;
  background-color: var(--icon-muted);
  transition: background-color 160ms ease;
}

.nav-link__label {
  white-space: nowrap;
}

.nav-link.is-active {
  border-top-color: var(--purple);
  color: var(--text);
}

.nav-link.is-active .nav-link__icon {
  background-color: var(--purple);
}

.nav-link.is-active .nav-link__label {
  color: var(--text);
}

.nav-link:focus-visible {
  outline: 1px solid var(--purple);
  outline-offset: -4px;
}

.noscript {
  position: fixed;
  right: 12px;
  bottom: calc(var(--bottom-nav-height) + 12px);
  left: 12px;
  z-index: 30;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--grid);
  background: var(--bg);
  color: var(--text);
}

@keyframes hatch-slide {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(var(--hatch-size), 0, 0);
  }
}

@media (min-width: 640px) {
  :root {
    --row: 60px;
    --edge: 60px;
    --wide: 120px;
    --pad: 30px;
    --font-size: 14px;
    --shell-width: 640px;
    --bottom-nav-height: 100px;
  }

  .cell--agenda {
    gap: 12px;
  }

  .map-icon .icon-mask,
  .nav-link__icon {
    width: 24px;
    height: 24px;
  }
}

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

  .cell--hatch::before {
    animation: none;
  }

  .nav-link,
  .contact-phone {
    transition: none;
  }
}
