:root {
  --bg: #0d0d0e;
  --panel: #121213;
  --panel-soft: #1d1d1f;
  --panel-hover: #262629;
  --ink: #f4f4f5;
  --muted: #8e8e93;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent: #ffffff;
  --sidebar-width: 220px;
  --page-header-height: 50px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.is-dialog-open {
  overflow: hidden;
}

button,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--page-header-height);
  padding: 0 18px;
  color: var(--ink);
  background: #111112;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border-radius: 6px;
}

.sidebar-toggle span {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
}

.sidebar-toggle span + span {
  margin-top: 0;
  transform: none;
}

.sidebar-backdrop {
  display: none;
}

.gallery-app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: calc(100svh - var(--page-header-height));
}

.sidebar {
  position: sticky;
  top: var(--page-header-height);
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: calc(100svh - var(--page-header-height));
  padding: 18px 10px 14px;
  background: #111112;
  border-right: 1px solid var(--line);
}

.category-nav p {
  margin: 0 0 6px;
  padding-left: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.category-nav {
  display: grid;
  gap: 2px;
}

.etc-nav {
  margin-top: 4px;
}

.category-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.category-button:hover,
.category-button:focus-visible {
  color: var(--ink);
  background: var(--panel-soft);
  outline: none;
}

.category-button.is-active {
  color: var(--ink);
  background: var(--panel-hover);
}

.feed {
  min-width: 0;
  padding: 40px;
}

.feed-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 42px;
}

.feed-header.is-page-header {
  max-width: 640px;
  margin-right: auto;
  margin-left: auto;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 0.96;
  letter-spacing: 0;
}

#feed-description {
  max-width: 540px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

#feed-period {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 38px 34px;
}

.post-grid.is-page {
  display: block;
}

.info-page {
  container-type: inline-size;
  max-width: 640px;
  margin: 0 auto;
}

.info-page p {
  margin: 0;
}

.info-list {
  max-width: 640px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.info-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: clamp(0px, calc((100cqw - 450px) * 0.0957), 18px);
  row-gap: 9px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.info-list-meta {
  flex: 0 0 190px;
  min-width: 0;
}

.info-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.info-list em {
  display: block;
  flex: 1 1 260px;
  max-width: 620px;
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.55;
}

@container (max-width: 450px) {
  .info-list li {
    column-gap: 0;
    row-gap: 9px;
  }

  .info-list-meta,
  .info-list em {
    flex-basis: 100%;
  }
}

.info-list strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
  text-align: left;
}

.info-list span {
  display: block;
  margin-top: 5px;
  text-align: left;
  white-space: nowrap;
}

.info-list a {
  color: inherit;
  text-decoration: none;
}

.info-list a:hover,
.info-list a:focus-visible {
  color: var(--ink);
  outline: none;
}

.post-card {
  display: block;
  width: 100%;
  padding: 0;
  min-width: 0;
  color: inherit;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  text-align: left;
}

.post-thumb {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 11;
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.post-thumb.is-document {
  display: grid;
  align-content: space-between;
  padding: 18px;
  background: linear-gradient(135deg, #eeeeef 0%, #bfc4cc 48%, #171719 49%, #171719 100%);
}

.document-type {
  width: max-content;
  padding: 5px 7px;
  color: #111112;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-title {
  max-width: 12ch;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 850;
  line-height: 0.95;
}

.post-card:hover .post-thumb img,
.post-card:focus-visible .post-thumb img {
  transform: scale(1.035);
  filter: brightness(1.08);
}

.post-card:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 6px;
  border-radius: 8px;
}

.post-meta {
  margin-top: 11px;
}

.post-title,
.post-kicker {
  margin: 0;
}

.post-title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-kicker {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.empty-state {
  margin: 80px 0 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
}

.post-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100svh - 36px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 0;
  color: var(--ink);
  background: #141416;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.72);
}

.contact-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: #141416;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.72);
}

.post-dialog[open],
.contact-dialog[open] {
  animation: dialog-enter 180ms ease-out both;
}

.post-dialog::backdrop,
.contact-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.post-dialog[open]::backdrop,
.contact-dialog[open]::backdrop {
  animation: backdrop-enter 180ms ease-out both;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backdrop-enter {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.dialog-close {
  position: sticky;
  top: 14px;
  right: 14px;
  float: right;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 14px 14px -48px auto;
  padding: 0;
  color: var(--ink);
  background: rgba(15, 15, 16, 0.72);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  backdrop-filter: blur(12px);
}

.dialog-close img {
  width: 16px;
  height: 16px;
  filter: invert(1);
}

.dialog-image-wrap {
  display: grid;
  place-items: center;
  min-height: 320px;
  max-height: min(70svh, 720px);
  background: #09090a;
}

.post-dialog.is-text-page .dialog-image-wrap {
  display: none;
}

.dialog-image-wrap img {
  display: block;
  width: 100%;
  max-height: min(70svh, 720px);
  object-fit: contain;
}

.dialog-copy {
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
  --dialog-pad-x: clamp(28px, calc(28px + (100vw - 640px) * 24 / 384), 52px);
  --dialog-pad-top: clamp(42px, calc(42px + (100vw - 640px) * 30 / 384), 72px);
  padding: var(--dialog-pad-top) var(--dialog-pad-x) 48px;
}

.dialog-copy p,
.dialog-copy h2 {
  margin: 0;
}

#dialog-category {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

#dialog-title {
  margin-top: 12px;
  margin-bottom: 30px;
  font-size: clamp(24px, 4vw, 36px);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

#dialog-description {
  width: 100%;
  max-width: none;
  margin-top: 10px;
  color: #b8b8bd;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

#dialog-description h3,
#dialog-description h4 {
  margin: 28px 0 10px;
  color: var(--ink);
  letter-spacing: 0;
}

#dialog-description h3 {
  font-size: 18px;
}

#dialog-description h4 {
  font-size: 15px;
}

#dialog-description p,
#dialog-description ul,
#dialog-description blockquote,
#dialog-description pre,
#dialog-description hr {
  margin: 12px 0 0;
}

#dialog-description pre {
  overflow-x: auto;
  padding: 14px 16px;
  color: #e7e7ea;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre;
}

#dialog-description code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

#dialog-description hr {
  height: 1px;
  background: var(--line);
  border: 0;
}

#dialog-description ul {
  padding-right: 0;
  padding-left: 18px;
}

#dialog-description li + li {
  margin-top: 6px;
}

#dialog-description img {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 0;
}

#dialog-description .image-placeholder {
  margin: 18px 0 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

#dialog-description .image-placeholder div {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

#dialog-description .image-placeholder figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#dialog-description a {
  color: var(--ink);
  text-underline-offset: 3px;
}

#dialog-description blockquote {
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
}

#dialog-description .experiment-log {
  margin: 28px 0 0;
}

#dialog-description .experiment-log > h3 {
  margin-bottom: 12px;
}

#dialog-description details {
  margin: 0;
  padding: 0;
  background: transparent;
  border-top: 1px solid var(--line);
}

#dialog-description details:last-child {
  border-bottom: 1px solid var(--line);
}

#dialog-description summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  padding: 22px 0;
  color: #b8b8bd;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 720;
  line-height: 1.18;
  list-style: none;
}

#dialog-description summary::-webkit-details-marker {
  display: none;
}

#dialog-description summary::after {
  flex: 0 0 auto;
  content: "+";
  color: #a970ff;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

#dialog-description details[open] summary {
  color: var(--ink);
}

#dialog-description details[open] summary::after {
  content: "-";
}

#dialog-description details > div {
  padding: 0 0 22px;
}

#dialog-description .icon-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 0;
}

#dialog-description .icon-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-soft);
}

#dialog-description .icon-card-icon {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 0;
  border-radius: 0;
  filter: invert(1);
  opacity: 0.9;
}

#dialog-description .icon-card-title {
  margin-top: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

#dialog-description .icon-card-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  #dialog-description .icon-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dialog-copy {
    padding-top: 34px;
    padding-bottom: 40px;
  }
}

.contact-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 46px;
  padding: 0 10px 0 18px;
  border-bottom: 1px solid var(--line);
}

.contact-dialog-header h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.contact-dialog-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
}

.contact-dialog-close img {
  width: 16px;
  height: 16px;
  opacity: 0.72;
  filter: invert(1);
  pointer-events: none;
}

.contact-dialog-close:hover,
.contact-dialog-close:focus-visible {
  color: var(--ink);
  background: var(--panel-soft);
  outline: none;
}

.contact-links {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.contact-links a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 8px 0 6px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  background: var(--panel-hover);
  outline: none;
}

.contact-links span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
}

.contact-links strong {
  font-size: 13px;
}

.contact-links small {
  grid-column: 3;
  margin-right: -6px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 650;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.contact-links a > img {
  grid-column: 4;
  justify-self: end;
  width: 14px;
  height: 14px;
  opacity: 0;
  filter: invert(1);
  transform: translateX(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.contact-links a:hover small,
.contact-links a:focus-visible small {
  opacity: 1;
  transform: translateX(0);
}

.contact-links a:hover > img,
.contact-links a:focus-visible > img {
  opacity: 0.58;
  transform: translateX(0);
}

@media (max-width: 760px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .gallery-app {
    display: block;
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-toggle:hover,
  .sidebar-toggle:focus-visible {
    background: var(--panel-soft);
    outline: none;
  }

  .sidebar {
    position: fixed;
    top: var(--page-header-height);
    left: 0;
    z-index: 80;
    width: min(320px, 86vw);
    height: calc(100svh - var(--page-header-height));
    max-height: none;
    padding: 22px 18px 18px;
    background: rgba(17, 17, 18, 0.96);
    border-right: 1px solid var(--line-strong);
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
    transform: translateX(-100%);
    transition: transform 180ms ease, box-shadow 180ms ease;
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
  }

  body.is-sidebar-open .sidebar {
    pointer-events: auto;
    transform: translateX(0);
    box-shadow: 18px 0 56px rgba(0, 0, 0, 0.42);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: var(--page-header-height) 0 0;
    z-index: 70;
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    background: rgba(0, 0, 0, 0.34);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .category-nav {
    grid-template-columns: 1fr;
  }

  .category-nav p {
    grid-column: 1 / -1;
  }

  .feed {
    padding: 26px;
  }

  .feed-header {
    align-items: start;
    flex-direction: column;
    margin-bottom: 28px;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .info-list li {
    column-gap: 0;
  }

  .info-list-meta,
  .info-list em {
    flex-basis: 100%;
  }

}
