/* Index + 404: drafting sheet (off-white paper, black linework). Project pages use /assets/project.css instead. */

:root {
  --paper: #f4f2ec;
  --sheet: #fbfaf6;
  --grid: rgba(20, 20, 20, 0.07);
  --grid-fine: rgba(20, 20, 20, 0.035);
  --line: rgba(20, 20, 20, 0.22);
  --line-strong: #141414;
  --ink: #141414;
  --ink-soft: rgba(20, 20, 20, 0.72);
  --ink-mute: rgba(20, 20, 20, 0.5);
  --mark: #141414;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shell: min(1180px, calc(100% - 48px));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::selection {
  background: var(--ink);
  color: var(--sheet);
}

a {
  color: inherit;
}

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

h1,
p,
dl,
dd,
ol {
  margin: 0;
}

.sheet {
  position: relative;
  width: var(--shell);
  margin: 40px auto;
  border: 1px solid var(--line-strong);
  background: var(--sheet);
  box-shadow: 0 0 0 6px var(--paper), 0 0 0 7px var(--line);
}

/* corner registration ticks */
.sheet::before,
.sheet::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--mark);
  border-style: solid;
  content: "";
}

.sheet::before {
  top: -10px;
  left: -10px;
  border-width: 1px 0 0 1px;
}

.sheet::after {
  right: -10px;
  bottom: -10px;
  border-width: 0 1px 1px 0;
}

.label,
.register-head,
.title-meta dt,
.row-no,
.row-venue,
.row-authors,
.sheet-foot {
  font-family: var(--mono);
}

.label {
  margin-bottom: 18px;
  color: var(--mark);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Title block */

.title-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  border-bottom: 1px solid var(--line-strong);
}

.title-main {
  padding: 56px 48px 48px;
}

.title-main h1 {
  margin-bottom: 18px;
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.summary {
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.title-meta {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  border-left: 1px solid var(--line-strong);
}

.title-meta div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-strong);
}

.title-meta div:first-child {
  border-top: 0;
}

.title-meta dt {
  color: var(--ink-mute);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.title-meta dd {
  font-size: 1rem;
  font-weight: 500;
}

.title-meta img {
  width: 104px;
}

/* Register of projects */

.register-head,
.row {
  display: grid;
  grid-template-columns: 64px 220px minmax(0, 1fr) 170px 48px;
  align-items: center;
}

.register-head {
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink-mute);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.register-head span,
.row > span {
  padding: 12px 18px;
}

.register-head span + span,
.row > span + span {
  border-left: 1px dashed var(--line-strong);
}

.rows {
  padding: 0;
  list-style: none;
}

.rows li + li {
  border-top: 1px solid var(--line-strong);
}

.row {
  min-height: 150px;
  align-items: stretch;
  text-decoration: none;
  transition: background 200ms ease;
}

.row > span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.row:hover,
.row:focus-visible {
  background: rgba(20, 20, 20, 0.035);
  outline: none;
}

.row-no {
  color: var(--mark);
  font-size: 0.9rem;
}

.row-fig img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  filter: grayscale(1) contrast(1.1);
  mix-blend-mode: multiply;
  opacity: 0.85;
  transition: filter 300ms ease, opacity 300ms ease;
}

.row:hover .row-fig img,
.row:focus-visible .row-fig img {
  filter: none;
  mix-blend-mode: normal;
  opacity: 1;
}

.row-title {
  margin-bottom: 4px;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.row-sub {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.4;
}

.row-authors {
  color: var(--ink-mute);
  font-size: 0.72rem;
}

.row-venue {
  font-size: 0.82rem;
  line-height: 1.6;
}

.row-venue em {
  color: var(--ink-mute);
  font-size: 0.72rem;
  font-style: normal;
}

.row-go {
  align-items: center;
  color: var(--mark);
  font-size: 1.2rem;
  transition: transform 200ms ease;
}

.row:hover .row-go {
  transform: translateX(3px);
}

.sheet-foot {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--line-strong);
  color: var(--ink-mute);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-foot a {
  text-decoration: none;
}

.sheet-foot a:hover {
  color: var(--ink);
}

/* 404 */

.not-found {
  padding: 72px 48px 96px;
}

.not-found h1 {
  margin-bottom: 20px;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.not-found a {
  color: var(--mark);
  font-family: var(--mono);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .title-block {
    grid-template-columns: 1fr;
  }

  .title-meta {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: none;
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .title-meta div {
    border-top: 0;
    border-left: 1px solid var(--line-strong);
  }

  .title-meta div:first-child {
    border-left: 0;
  }

  .register-head,
  .row {
    grid-template-columns: 52px 180px minmax(0, 1fr) 40px;
  }

  .register-head span:nth-child(4),
  .row-venue {
    display: none !important;
  }
}

@media (max-width: 640px) {
  :root {
    --shell: calc(100% - 32px);
  }

  .sheet {
    margin: 16px auto;
  }

  .title-main {
    padding: 36px 20px 30px;
  }

  .title-meta {
    grid-template-columns: 1fr 1fr;
  }

  .title-meta div {
    padding: 12px 16px;
  }

  .title-meta div:nth-child(3) {
    border-left: 0;
  }

  .title-meta div:nth-child(n + 3) {
    border-top: 1px solid var(--line-strong);
  }

  .register-head {
    display: none;
  }

  .row {
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
      "no fig"
      "no body";
    min-height: 0;
  }

  .row > span + span {
    border-left: 0;
  }

  .row-no {
    grid-area: no;
    justify-content: flex-start !important;
    padding: 18px 0 0 14px !important;
  }

  .row-fig {
    grid-area: fig;
    padding: 18px 16px 0 6px !important;
  }

  .row-body {
    grid-area: body;
    padding: 14px 16px 20px 6px !important;
  }

  .row-go {
    display: none !important;
  }

  .not-found {
    padding: 48px 20px 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .row,
  .row-fig img,
  .row-go {
    transition: none;
  }
}
