.ref-page {
  --sp-page: #0b0b0b;
  --sp-hatch: rgba(255, 255, 255, 0.05);
  --sp-paper: #121212;
  --sp-raise: #1e1e1e;
  --sp-band: #1d1d1d;
  --sp-ink: #eee;
  --sp-soft: #c9c9c9;
  --sp-muted: #9a9a9a;
  --sp-line: #262626;
  --sp-line-strong: #363636;
  min-height: 100dvh;
  margin: 0;
  color: var(--sp-ink);
  background-color: var(--sp-page);
  background-image: repeating-linear-gradient(135deg, var(--sp-hatch) 0 1px, transparent 1px 10px);
  font-family: Manrope, sans-serif;
  padding: 12px clamp(10px, 2.4vw, 28px) 28px;
}

.ref-page[data-theme="light"] {
  --sp-page: #efefef;
  --sp-hatch: rgba(0, 0, 0, 0.06);
  --sp-paper: #fbfbfb;
  --sp-raise: #ffffff;
  --sp-band: #e9e9e9;
  --sp-ink: #151515;
  --sp-soft: #3d3d3d;
  --sp-muted: #7b7b7b;
  --sp-line: #e2e2e2;
  --sp-line-strong: #cfcfcf;
}

html:has(.ref-page[data-theme="light"]),
html:has(.ref-page[data-theme="light"]) body {
  background: #efefef;
}

.ref-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--sp-paper) 86%, transparent);
  border: 1px solid var(--sp-line);
}

.ref-brand,
.ref-home,
.ref-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sp-ink);
  text-decoration: none;
}

.ref-brand {
  gap: 10px;
  font-weight: 600;
}

.ref-brand img {
  display: block;
}

.ref-page[data-theme="light"] .ref-brand img {
  filter: invert(1);
}

.ref-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-theme,
.ref-home {
  border: 1px solid var(--sp-line-strong);
  background: var(--sp-raise);
}

.ref-theme {
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
}

.ref-theme svg {
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ref-theme[data-dark="true"] svg {
  transform: rotate(180deg);
}

.ref-home {
  min-height: 36px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
}

.ref-theme:hover,
.ref-home:hover,
.ref-shot:hover {
  border-color: var(--sp-ink);
}

.ref-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.ref-intro {
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 460px;
  padding: clamp(22px, 3vw, 36px);
  background: var(--sp-paper);
  border: 1px solid var(--sp-line);
}

.ref-intro.is-solo {
  grid-column: 1 / -1;
  grid-row: auto;
  min-height: 62vh;
}

.ref-kicker {
  margin: 0 0 14px;
  color: var(--sp-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ref-intro h1 {
  margin: 0;
  max-width: 8em;
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(40px, 5vw, 68px);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 0.98;
}

.ref-lead {
  max-width: 34ch;
  margin: 18px 0 0;
  color: var(--sp-soft);
  font-size: 15.5px;
  line-height: 1.55;
}

.ref-count {
  margin-top: 28px;
  color: var(--sp-muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.ref-shot {
  position: relative;
  grid-column: span 2;
  display: block;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--sp-line);
  background: var(--sp-raise);
  color: #fff;
  text-decoration: none;
}

.ref-shot.is-hero {
  grid-column: span 4;
  grid-row: span 2;
  min-height: 460px;
}

.ref-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.ref-shot:hover img {
  transform: scale(1.03);
}

.ref-shot img {
  transition: transform 0.6s ease;
}

.ref-cap {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
}

.ref-cap strong {
  font-size: 15px;
  font-weight: 600;
}

.ref-cap span {
  color: rgba(255, 255, 255, 0.78);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .ref-grid {
    grid-template-columns: 1fr;
  }

  .ref-intro,
  .ref-intro.is-solo,
  .ref-shot,
  .ref-shot.is-hero {
    grid-column: auto;
    grid-row: auto;
    min-height: 280px;
  }

  .ref-intro,
  .ref-intro.is-solo {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ref-shot img,
  .ref-theme svg,
  .ref-page {
    transition: none;
  }

  .ref-shot:hover img {
    transform: none;
  }
}
