* {
  box-sizing: border-box;
}

html {
  font-size: 120%;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: black;
  background: white;
}

body.home {
  --fractal-edge: 48px;
}

.fractal-ribbon {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.site-head-row,
.header-left {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.site-head-row h1,
.header-left h1 {
  margin: 0;
}

.role,
.stack-meta,
.stack-label,
.screenshot-label,
.project-status,
.paper-subtitle {
  font-size: small;
}

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.nav-spacer {
  flex: 1;
}

body.home {
  overflow-x: hidden;
  overflow-y: auto;
}

body.project {
  overflow: hidden;
}

body.project .site-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 10;
  width: 100%;
  max-width: 1152px;
  padding: 1rem;
  background: white;
  transform: translateX(-50%);
}

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 2rem;
  width: 100%;
  max-width: 1152px;
  height: 100vh;
  margin: 0 auto;
  padding: 0 1rem;
}

.core,
.stack {
  padding-top: 8rem;
  padding-bottom: 2rem;
  overflow-y: auto;
}

.core {
  min-width: 0;
  max-width: 768px;
}

body.home .site-layout {
  position: relative;
  display: block;
  width: 100%;
  max-width: 1152px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 1rem;
}

body.home .site-copy {
  position: relative;
  z-index: 2;
  width: min(100%, 800px);
  min-height: 100vh;
  padding: 0 1rem;
  background: transparent;
  text-shadow: 0 1px 0 white, 0 0 0.35rem rgba(255, 255, 255, 0.92);
}

body.home .site-header {
  position: static;
  width: auto;
  max-width: none;
  padding: 1rem 0;
  border-bottom: 1px solid black;
  background: transparent;
  transform: none;
}

body.home .page {
  position: static;
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  margin: 0;
  padding: 0;
}

body.home .core {
  width: 100%;
  max-width: 768px;
  min-height: calc(100vh - 8rem);
  height: auto;
  padding: 2rem 0 4rem;
  overflow: visible;
}

body.home .fractal-column {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
}

body.home .fractal-stack {
  position: relative;
  width: 100%;
  height: 100%;
}

body.home .fractal-stack .fractal-ribbon {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.06) 34%, rgba(0, 0, 0, 0.42) 52%, black 68%);
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.06) 34%, rgba(0, 0, 0, 0.42) 52%, black 68%);
}

body.blog-post .fractal-stack .fractal-ribbon {
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 45%, rgba(0, 0, 0, 0.08) 54%, rgba(0, 0, 0, 0.48) 66%, black 78%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 45%, rgba(0, 0, 0, 0.08) 54%, rgba(0, 0, 0, 0.48) 66%, black 78%);
}

.now {
  margin-top: 2rem;
}

.now .stack-meta {
  text-align: left;
}

section {
  margin-top: 2rem;
}

.feed {
  margin-top: 3rem;
}

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.feed-head h2,
.feed-item-head h3 {
  margin: 0;
  font-size: 1rem;
}

.feed-item {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid black;
}

.feed-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.feed-excerpt {
  display: -webkit-box;
  margin: 0.75rem 0 0.5rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.post-attachment {
  font-size: small;
}

.post {
  max-width: 768px;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  margin: 0;
}

.post-deck {
  font-size: 1.1rem;
}

.post-section {
  margin-top: 3rem;
}

.post-section h2 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.result-table-wrap {
  max-width: 100%;
  margin: 2rem 0;
  overflow-x: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: small;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-table caption {
  padding-bottom: 0.5rem;
  text-align: left;
}

.result-table th,
.result-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid black;
  text-align: right;
}

.result-table thead th {
  border-top: 1px solid black;
  font-weight: normal;
}

.result-table tbody th {
  font-weight: normal;
}

.result-table th:first-child,
.result-table td:first-child {
  padding-left: 0;
  text-align: left;
}

.result-table th:last-child,
.result-table td:last-child {
  padding-right: 0;
}

.post-chart figcaption,
.post-notes {
  font-size: small;
}

.post-equation {
  max-width: 100%;
  margin: 1.5rem 0;
  padding: 1rem;
  overflow-x: auto;
  border-top: 1px solid black;
  border-bottom: 1px solid black;
  text-align: center;
  white-space: nowrap;
}

.post-chart {
  margin: 2rem 0;
}

.post-chart img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid black;
  background: white;
}

.post-chart figcaption {
  margin-top: 0.4rem;
}

body.blog-post.raodreamer-post .post-feature {
  -webkit-mask-image: none;
  mask-image: none;
}

.post-notes {
  margin-top: 3rem;
}

.post-attachment {
  margin-top: 2rem;
}

.post-media {
  margin: 2rem 0;
}

body.blog-post .post-media {
  content-visibility: auto;
  contain-intrinsic-size: auto 2200px;
}

.post-feature {
  margin: 0 0 0.75rem;
}

body.blog-post .post-feature {
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.4) 3.5rem, black 8rem);
  mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, 0.4) 3.5rem, black 8rem);
}

.post-feature img,
.post-figure img {
  display: block;
  width: 100%;
  height: auto;
}

body.blog-post .post-feature img,
body.blog-post .post-figure img {
  border: 1px solid black;
}

.post-gallery {
  display: grid;
  gap: 0.75rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
}

.post-gallery--animated {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}

.post-gallery--stills {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-figure {
  min-width: 0;
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  background: white;
}

.post-figure img {
  height: 100%;
  object-fit: contain;
}

blockquote {
  margin-inline: 2.5rem;
}

.entry {
  margin-bottom: 1rem;
}

.entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.entry-name,
.paper-title {
  font-weight: bold;
}

.entry-links {
  display: flex;
  flex: none;
  gap: 0.5rem;
  white-space: nowrap;
}

.entry-desc {
  margin-top: 0.25rem;
}

.stack-block {
  margin-bottom: 1.5rem;
}

.stack-fractal {
  display: flex;
  height: 336px;
  flex-direction: column;
}

.stack-fractal canvas {
  display: block;
  width: 100%;
  min-height: 0;
  flex: 1;
  border: 1px solid black;
  background: white;
}

.fractal-spacer {
  height: 0.5rem;
}

.stack-meta {
  text-align: center;
}

.now-list {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
  font-size: small;
}

.project-title {
  margin-bottom: 0;
}

.project-status {
  font-weight: normal;
}

.subtitle {
  margin-top: 0.25rem;
}

pre {
  max-width: 100%;
  overflow-x: auto;
}

.screenshot {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 1rem;
}

.screenshot-label {
  display: block;
  margin-bottom: 1rem;
}

body.paper {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.paper .site-header {
  flex: none;
  padding: 1rem 2rem 0;
  background: white;
}

.header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.paper-meta {
  flex: none;
  text-align: right;
}

.pdf-region {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 1rem 2rem 1.5rem;
}

.pdf-wrap {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: hidden;
  border: 1px solid black;
}

.pdf-wrap embed {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.pdf-ctrl {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem;
  background: white;
}

.pdf-ctrl-btn {
  cursor: pointer;
}

@media (max-width: 1032px) {
  body.home,
  body.project {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.home .site-header,
  body.project .site-header {
    position: static;
    max-width: 816px;
    transform: none;
  }

  .page {
    display: block;
    max-width: 816px;
    height: auto;
  }

  .core,
  .stack {
    max-width: none;
    padding-top: 1rem;
    overflow: visible;
  }

  body.home .site-layout {
    display: block;
    max-width: 816px;
    min-height: 100%;
    padding: 0 1rem;
  }

  body.home .site-header,
  body.home .page {
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  body.home .core {
    height: auto;
    min-height: 0;
    padding: 1rem 0 3rem;
  }

  body.home .site-copy {
    width: 100%;
    max-width: none;
  }

  .stack-fractal {
    width: min(100%, 384px);
    height: 384px;
  }
}

@media (max-width: 768px) {
  body.home .site-layout {
    padding-inline: 0;
  }

  .site-head-row,
  .header-left,
  .header-top,
  .entry-head,
  .feed-item-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }

  nav,
  .now-list {
    flex-wrap: wrap;
  }

  body.home .fractal-stack .fractal-ribbon {
    opacity: 0.16;
  }

  .result-table {
    font-size: 0.625rem;
  }

  .result-table caption {
    white-space: normal;
  }

  .result-table th,
  .result-table td {
    padding: 0.45rem 0.25rem;
  }

  blockquote {
    margin-inline: 1rem;
  }

  .header-top {
    display: flex;
  }

  .paper-meta {
    text-align: left;
  }

  .post-gallery,
  .post-gallery--animated,
  .post-gallery--stills {
    grid-template-columns: 1fr;
  }

  body.paper {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  body.paper .site-header {
    padding: 1rem 1rem 0;
  }

  .pdf-region {
    height: 80vh;
    min-height: 30rem;
    flex: none;
    padding: 1rem;
  }
}

@media (max-height: 500px) and (pointer: coarse) {
  body.home .fractal-stack .fractal-ribbon {
    opacity: 0.16;
  }
}
