:root {
  --bg: #fdfdfc;
  --fg: #1a1a1a;
  --muted: #767676;
  --border: #e8e8e6;
  --gap: calc(1.5rem + 20px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2rem 1.5rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.site-header h1 {
  font-family: 'MedievalSharp', cursive;
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.01em;
}

.source-link {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}

.source-link:hover {
  color: var(--fg);
  text-decoration: underline;
}

.grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(224px, 1fr));
  gap: var(--gap);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 90px);
  padding: 1rem 1.5rem 3rem;
  text-align: center;
}

.hero img {
  display: block;
  max-width: 90vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  background: var(--border);
}

.hero .block-title {
  margin-top: 1.25rem;
  font-size: 0.85rem;
}

.status {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 4rem 0;
}

.block {
  break-inside: avoid;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.block.expanded {
  grid-column: span 2;
  grid-row: span 2;
  z-index: 2;
}

.block img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  background: var(--border);
  cursor: zoom-in;
}

.block.expanded img {
  cursor: zoom-out;
}

.block-text {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  background: #fff;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.block-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.block-link {
  display: block;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.25rem;
  background: #fff;
  text-decoration: none;
  color: var(--fg);
  font-size: 0.95rem;
}

.block-link:hover {
  border-color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #eee;
    --muted: #9a9a9a;
    --border: #2a2a2a;
  }
  .block-text,
  .block-link {
    background: #1a1a1a;
  }
}
