:root {
  --bg: #0c0b0a;
  --text: #f2ece1;
  --muted: #847b70;
  --rule: rgba(242, 236, 225, 0.13);
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --gutter: 28px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Newsreader", Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s, color 0.2s;
}

a:hover { text-decoration-color: currentColor; color: var(--text); }

/* Header */

.site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.site .brand { color: var(--text); text-decoration: none; }

.site nav a {
  margin-left: 1.6rem;
  text-decoration: none;
}

.site nav a[aria-current] { color: var(--text); }

/* Home intro */

.intro {
  max-width: 620px;
  margin-top: 13vh;
}

h1 {
  margin: 0;
  font-weight: 500;
  font-size: 2.6rem;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.tagline {
  margin: 0.6rem 0 2.6rem;
  font-style: italic;
  color: var(--muted);
}

.intro p:not(.tagline) {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  line-height: 1.65;
}

.page-title { margin: 11vh 0 2.4rem; }

.empty-note {
  font-style: italic;
  color: var(--muted);
}

.label {
  margin: 5.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title + .label,
.page-title + table { margin-top: 0; }

/* Tables (sessions, essays) */

table {
  width: 100%;
  margin-top: 0.9rem;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.95rem 0;
  border-top: 1px solid var(--rule);
  vertical-align: baseline;
}

tr:last-child td { border-bottom: 1px solid var(--rule); }

th {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 0;
  padding-bottom: 0.6rem;
}

td.n {
  width: 4.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

td .date {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

table.sessions {
  table-layout: fixed;
}

table.sessions th:nth-child(1),
table.sessions td.n {
  width: 3.25rem;
  padding-right: 1rem;
}

table.sessions td.topic {
  padding-right: 1.5rem;
}

table.sessions th:nth-child(3),
table.sessions th:nth-child(4),
table.sessions th:nth-child(5),
table.sessions td.link {
  width: 6.25rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

td.link .soon { opacity: 0.6; }

td.meta { color: var(--muted); font-size: 0.95rem; }

td.empty {
  font-style: italic;
  color: var(--muted);
}

/* Gallery */

.sheet {
  columns: 2;
  column-gap: 14px;
}

.sheet a {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: 14px;
  text-decoration: none;
  color: var(--text);
}

.sheet a:focus-visible {
  outline: 1px solid var(--text);
  outline-offset: 3px;
}

.sheet img {
  display: block;
  width: 100%;
  height: auto;
  background: #1a1816;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.35s;
}

.sheet a:hover img,
.sheet a:focus-visible img { filter: none; }

.sheet span {
  position: absolute;
  top: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  padding: 0.28rem 0.42rem 0.2rem;
  background: rgba(12, 11, 10, 0.72);
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: max(52px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  background: var(--bg);
  cursor: zoom-out;
  touch-action: pan-y;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 8rem);
  max-height: calc(100svh - 8rem);
  cursor: e-resize;
}

.lightbox .cap {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

.lightbox button {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.lightbox button:hover { opacity: 1; }

/* Footer */

footer {
  margin-top: auto;
  padding-top: 7rem;
}

footer .bar {
  display: flex;
  justify-content: flex-end;
  padding: 1.4rem 0 max(2.4rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
}

footer .copy {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Phones */

@media (max-width: 640px) {
  :root { --gutter: 22px; }

  body { font-size: 17px; }

  .site {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 22px 0 10px;
  }

  .site nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
  }

  .site nav a {
    margin: 0;
    padding: 8px 0;
  }

  .intro { margin-top: 7vh; }
  h1 { font-size: 2.15rem; }
  .tagline { margin-bottom: 2rem; }
  .intro p:not(.tagline) { font-size: 1.02rem; }
  .page-title { margin: 6vh 0 1.8rem; }
  .label { margin-top: 3.8rem; }

  thead { display: none; }

  table, tbody { display: block; }

  tr {
    display: grid;
    grid-template-columns: 2.4rem 1fr 1fr 1fr;
    column-gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid var(--rule);
  }

  tr:last-child { border-bottom: 1px solid var(--rule); }

  td,
  td.n,
  td.link,
  tr:last-child td {
    width: auto;
    padding: 0;
    border: 0;
  }

  td.n { grid-row: 1 / span 2; padding-top: 0.2rem; }
  td:nth-child(2) { grid-column: 2 / -1; }
  td:nth-child(3) { grid-column: 2; grid-row: 2; padding-top: 0.55rem; text-align: center; }
  td:nth-child(4) { grid-column: 3; grid-row: 2; padding-top: 0.55rem; text-align: center; }
  td:nth-child(5) { grid-column: 4; grid-row: 2; padding-top: 0.55rem; text-align: center; }
  td.empty { grid-column: 2 / -1; }

  td.link a { display: inline-block; padding: 4px 0; }
  td.link .soon::before { content: attr(data-label) " "; }

  .sheet {
    column-gap: 10px;
  }

  .sheet a { margin-bottom: 10px; }

  .sheet span {
    font-size: 0.52rem;
    letter-spacing: 0.04em;
  }

  footer { padding-top: 4.5rem; }

  .lightbox img { max-width: 100vw; }
}
