body[data-view='home'] :is(#main, .site-footer) { background: var(--bg); }

#home-content {
  --site-gutter: clamp(16px, 2.1vw, 38px);
  --home-ink: #f5f3ee;
  --home-muted: #b4b2ac;
  --home-line: #363636;
  --home-active: #adcaff;
  --home-panel: #252525;
}

#home-content .shell {
  width: min(1500px, calc(100% - var(--site-gutter) * 2));
}

.home-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(36px, 3.5vw, 56px) clamp(30px, 3vw, 47px);
  text-align: center;
}

.home-intro-inner {
  position: relative;
}

.home-intro-media {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.home-intro-media img {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: -44%;
  display: block;
  width: 190%;
  height: auto;
  transform: translateY(-34%);
  filter: saturate(.72) brightness(.68);
}

.home-intro-media::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, #1313133d, #13131329 37%, #131313b5 81%, #131313),
    linear-gradient(90deg, #131313a0, #1313134a 28%, #1313133a 72%, #131313a0);
  content: '';
}

.home-intro h1 {
  color: var(--home-ink);
  font-size: clamp(3.6rem, 6.1vw, 6.75rem);
  font-weight: 760;
  letter-spacing: -.06em;
  line-height: 1.025;
}

.home-intro p {
  max-width: 33rem;
  margin: 17px auto 0;
  color: #deddda;
  font-size: clamp(.95rem, 1.32vw, 1.1rem);
  line-height: 1.65;
}

.home-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 22px;
  padding-inline: 24px;
  border: 1px solid #e8e5dd;
  border-radius: 24px;
  background: #efede6;
  color: #161616;
  font-size: .9375rem;
  font-weight: 680;
  transition: background .16s ease, border-color .16s ease;
}
.home-start:is(:hover, :focus-visible) { border-color: #fff; background: #fff; }

.home-discovery { padding-bottom: clamp(54px, 8vw, 110px); }
.home-discovery:focus { outline: none; }

.home-discovery-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) minmax(145px, 180px);
  align-items: center;
  gap: 8px 11px;
  margin-bottom: 18px;
}

.home-discovery-order, .home-discovery-filters {
  display: flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid var(--home-line);
  border-radius: 12px;
}

.home-discovery-toolbar button,
.home-topic-list button {
  min-height: 36px;
  padding: 0 clamp(8px, .85vw, 13px);
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  color: var(--home-muted);
  font-size: .875rem;
  font-weight: 560;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.home-discovery-toolbar button:is(:hover, :focus-visible),
.home-topic-list button:is(:hover, :focus-visible) {
  background: var(--home-panel);
  color: var(--home-ink);
}

.home-discovery-toolbar button[aria-pressed='true'],
.home-topic-list button[aria-pressed='true'] {
  border-color: #55514d;
  background: #383633;
  color: var(--home-ink);
}

.home-discovery-search {
  grid-column: 4;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid var(--home-line);
  border-radius: 12px;
  color: var(--home-muted);
}

.home-discovery-search:focus-within { border-color: var(--home-active); }
.home-discovery-search input {
  min-width: 0;
  flex: 1;
  min-height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--home-ink);
  font-size: .875rem;
}
.home-discovery-search input::placeholder { color: var(--home-muted); }
#home-content :focus-visible { outline-color: var(--home-active); }
#home-content .home-discovery-search input:focus-visible { outline: 0; }

.home-discovery-toolbar .home-topic-toggle { display: none; }

#home-topics-panel {
  min-width: 0;
  grid-column: 3;
  grid-row: 1;
}

.home-topic-rail {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  border: 1px solid var(--home-line);
  border-radius: 12px;
}

.home-topic-list {
  display: flex;
  gap: 4px;
  overflow: auto hidden;
  padding: 3px 1px;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}
.home-topic-list button { flex: none; min-height: 34px; }
.home-topic-list button:focus-visible { outline-offset: -2px; }

.home-topic-rail > button {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--home-muted);
}
.home-topic-rail > button:disabled { opacity: .34; cursor: default; }
.home-topic-rail > button:not(:disabled):is(:hover, :focus-visible) {
  border-color: #4d4b49;
  background: var(--home-panel);
  color: var(--home-ink);
}

.home-discovery-grid {
  --home-gallery-gap: clamp(17px, 2vw, 29px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: var(--home-gallery-gap) clamp(10px, 1.2vw, 19px);
}

.home-discovery-grid[data-masonry] {
  grid-auto-rows: 1px;
  row-gap: 0;
}

.home-discovery-grid[data-masonry] > .home-card {
  margin-bottom: var(--home-gallery-gap);
}

.home-card { position: relative; display: block; min-width: 0; }
.home-card-open { display: block; }
.home-card-open:focus-visible { outline: 2px solid var(--home-active); outline-offset: 3px; }
.home-card-media {
  width: 100%;
  overflow: hidden;
  border-radius: clamp(7px, 1vw, 14px);
}
.home-card-media picture { display: block; }
.home-card-image {
  display: block;
  width: 100%;
  height: auto;
}

.home-card-open:is(:hover, :focus-visible) .home-card-title { color: var(--home-active); }

.home-card-copy {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 7px;
  padding-top: 9px;
  padding-inline-end: 72px;
  min-height: 50px;
}

.home-card-heading { min-width: 0; }
.home-card-title {
  color: var(--home-ink);
  font-size: .985rem;
  font-weight: 660;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.home-card-topic { overflow: hidden; margin-top: 3px; color: var(--home-muted); font-size: .8125rem; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.home-card-actions { display: contents; }
.home-card-action,
.home-card-favorite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  border: 1px solid #52657d;
  border-radius: 999px;
  background: #17202c;
  color: #e3efff;
  padding-inline: 11px;
  font-size: .8125rem;
  font-weight: 650;
  white-space: nowrap;
}
.home-card .home-card-action { position: absolute; right: 0; bottom: 0; }
.home-card > .home-card-actions .home-card-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 40px;
  padding: 0;
  background: #111925ed;
}
.home-card .home-card-favorite span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.home-card-favorite::before {
  width: 14px;
  height: 17px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Cpath d='M2 3h12v15l-6-4-6 4z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  content: '';
}
.home-card-favorite[aria-pressed='true']::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 20'%3E%3Cpath d='M2 3h12v15l-6-4-6 4z' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.home-card :is(.home-card-action,.home-card-favorite):is(:hover,:focus-visible) { border-color: #b9d8ff; }
.home-card-favorite[aria-pressed='true'],
.home-card > .home-card-actions .home-card-favorite[aria-pressed='true'] {
  border-color: #b8d9ff;
  background: #c8e1ff;
  color: #102238;
}

.home-discovery-more:not([hidden]) {
  display: block;
  margin: 24px auto 0;
  padding: 9px 16px;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 6px;
  cursor: pointer;
}
.home-discovery-empty { padding: 42px 0; color: var(--home-muted); text-align: center; }

.home-preview :is(button, a):is(:hover, :focus-visible) {
  border-color: #a29e99;
}

.home-preview {
  --detail-panel: #131922;
  --detail-line: #a8c5ed28;
  --detail-muted: #9eabbc;
  --detail-ink: #eaf1fa;
  --detail-blue: #bbd9ff;
  width: min(1520px, calc(100% - 42px));
  max-width: none;
  max-height: calc(100dvh - 42px);
  margin: auto;
  padding: clamp(14px, 2.15vw, 32px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #91b4e345;
  border-radius: 23px;
  background: #0c1119;
  color: var(--detail-ink);
}

.home-preview::backdrop { background: #05080cdd; }

.home-preview-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(17px, 2.15vw, 32px);
}
.home-preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(154px, 17%);
  align-items: start;
  gap: clamp(12px, 1.6vw, 24px);
}
.home-preview-work {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 33%);
  overflow: hidden;
  border: 1px solid var(--detail-line);
  border-radius: 17px;
  background: var(--detail-panel);
}
.home-preview-header h2 {
  margin: .24em 0 .38em;
  font-size: clamp(1.375rem, 2.25vw, 2.1rem);
  line-height: 1.18;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.home-preview-header p { color: var(--detail-muted); font-size: .87rem; line-height: 1.55; }
#home-preview-topic { color: #b4cbee; font-weight: 620; }

.home-preview .icon-button { width: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }

.home-preview-stage {
  margin: 0;
  min-width: 0;
  background: #090d13;
}
.home-preview-art {
  position: relative;
  display: grid;
  place-items: center;
  height: clamp(330px, 58dvh, 720px);
  padding: clamp(7px, 1.1vw, 16px);
}
.home-preview-art img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.home-preview-stage figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 10px clamp(10px, 1.45vw, 18px);
  border-top: 1px solid var(--detail-line);
  color: var(--detail-muted);
  font-size: .8125rem;
}
.home-preview-stage figcaption a { color: var(--detail-blue); padding-block: 4px; }

.home-preview-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-self: end;
  width: min(100%, 540px);
  gap: 8px;
}
.home-preview-pager button { display: flex; align-items: center; gap: 10px; text-align: start; min-width: 0; }
.home-preview-pager button:last-child { justify-content: end; text-align: end; }
.home-preview-pager button > span[aria-hidden] { color: var(--detail-blue); font-size: 1.25rem; }
.home-preview-pager button > span:not([aria-hidden]) { min-width: 0; }
.home-preview-pager strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; }
.home-preview-pager small { color: var(--detail-muted); font-size: .75rem; }
.home-preview-pager button:disabled { opacity: .42; cursor: default; }
.home-preview :where(button, .home-preview-primary a) {
  min-height: 44px;
  padding-inline: 12px;
  border: 1px solid var(--detail-line);
  background: #17202d;
  color: var(--detail-ink);
  border-radius: 9px;
  font-size: .875rem;
}
.home-preview :is(button,a):focus-visible { outline: 2px solid var(--detail-blue); outline-offset: 2px; }

.home-preview-actions {
  min-width: 0;
  padding: clamp(15px, 1.65vw, 25px);
  border-inline-start: 1px solid var(--detail-line);
}
.home-preview-primary { display: flex; align-items: stretch; gap: 8px; margin: 17px 0 22px; }
.home-preview-primary a {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #c8e1ff;
  background: #c8e1ff;
  color: #102238;
  font-size: .875rem;
  font-weight: 720;
}
.home-preview-primary a:is(:hover, :focus-visible) { background: #e2efff; border-color: #e2efff; }
.home-preview-rebuild h3, .home-preview-related h3 { margin: 0 0 10px; font-size: .9rem; font-weight: 680; }
#home-preview-copy-all { width: 100%; margin-bottom: 10px; border-color: #86b0e16b; font-weight: 660; }
.home-preview-material-options { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.home-preview-material-options button { flex: 1 0 auto; min-height: 36px; padding: 0 8px; font-size: .77rem; }
.home-preview-material-options button[aria-pressed='true'] { background: #233953; border-color: #91b7e57a; }
#home-preview-material-copy { width: 100%; margin-top: 8px; }
#home-preview-material-text { font-size: .8125rem; max-height: 200px; }
#home-preview-material-text[data-language='html'] { font-family: ui-monospace, monospace; }
#home-preview-all-text { margin-top: 8px; }
.home-preview-related button {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  padding: 0;
  text-align: start;
  background: #151e29;
  color: var(--detail-ink);
}
.home-preview-related button + button { margin-top: 9px; }
.home-preview-related button img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.home-preview-related button span { width: 100%; padding: 6px 8px; overflow: hidden; background: #10151e; white-space: nowrap; text-overflow: ellipsis; font-size: .77rem; }

#home-preview-prompt {
  margin-top: 11px;
  padding: 0 9px;
  border: 1px solid var(--detail-line);
  border-radius: 9px;
  background: #171f2a;
}

#home-preview-prompt summary {
  min-height: 44px;
  padding-block: 10px;
  color: var(--detail-ink);
  font-size: .8125rem;
  font-weight: 640;
  cursor: pointer;
}

.home-preview-actions :is(textarea, input) {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--detail-line);
  border-radius: 6px;
  background: #0b111a;
  color: var(--detail-ink);
  font-size: .875rem;
  line-height: 1.55;
}

.home-preview-actions textarea { min-height: 114px; max-height: min(30dvh, 250px); resize: vertical; }
.home-preview-actions input { margin-top: 8px; }
.home-preview-status { margin: 7px 0; color: var(--detail-muted); font-size: .8125rem; line-height: 1.4; }
.home-preview-status:empty { display: none; }
#home-preview-prompt-copy { margin-block: 8px 10px; }
.home-preview-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.home-preview .home-preview-links :is(button, a) {
  min-height: 36px;
  justify-content: start;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--detail-blue);
  font-size: .8rem;
}
.home-preview-links :is(button, a):hover { text-decoration: underline; }

@media (max-width: 950px) {
  .home-discovery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-discovery-toolbar { grid-template-columns: minmax(0, 1fr) auto minmax(146px, 176px); }
  .home-discovery-search { grid-column: 3; }
  #home-topics-panel { grid-column: 1 / -1; grid-row: 2; }
  .home-preview-layout { grid-template-columns: minmax(0, 1fr); }
  .home-preview-related > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .home-preview-related button + button { margin-top: 0; }
}

@media (max-width: 850px) {
  .home-intro h1 { font-size: clamp(2.7rem, 7.8vw, 4.3rem); }
  .home-discovery-toolbar button { padding-inline: 7px; }
}

@media (max-width: 710px) {
  .home-discovery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-preview { width: calc(100% - 16px); max-height: calc(100dvh - 16px); padding: 11px; border-radius: 16px; }
  .home-preview-bar { gap: 6px; }
  .home-preview-work { grid-template-columns: minmax(0, 1fr); }
  .home-preview-actions { border-inline-start: 0; border-top: 1px solid var(--detail-line); }
  .home-preview-art { height: clamp(175px, 42dvh, 380px); }
  .home-preview-pager button { padding-inline: 7px; gap: 4px; }
}

@media (max-width: 420px) {
  .home-preview-bar { grid-template-columns: 1fr auto; }
  .home-preview-pager { grid-column: 1 / -1; grid-row: 2; }
  #home-preview-close { grid-column: 2; grid-row: 1; }
  #home-preview-back { justify-self: start; }
  .home-preview-related button { aspect-ratio: 5 / 4; }
}

@media (max-width: 650px) {
  .home-intro { padding-block: 27px 23px; }
  .home-intro h1 { font-size: clamp(1.85rem, 8vw, 3.4rem); letter-spacing: -.055em; }
  .home-intro h1 br { display: none; }
  .home-intro p { max-width: 18rem; margin-top: 9px; font-size: .875rem; }
  .home-start { min-height: 44px; margin-top: 13px; }
  .home-intro-media img { inset-inline-start: -52%; width: 210%; }
  .home-discovery-toolbar {
    grid-template-columns: 138px minmax(0, 1fr) minmax(62px, 21%);
    gap: 6px;
    padding-top: 6px;
    margin-bottom: 9px;
  }
  .home-discovery-filters { grid-column: 1 / 3; min-width: 0; width: 100%; gap: 2px; padding-inline: 0; overflow-x: auto; scrollbar-width: thin; border-color: transparent; }
  .home-discovery-filters button { flex: 0 0 auto; min-height: 36px; padding-inline: 6px; font-size: .825rem; }
  .home-discovery-toolbar .home-topic-toggle {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 42px;
    border-color: var(--home-line);
  }
  .home-topic-toggle[aria-expanded='true'] { background: var(--home-panel); color: var(--home-ink); }
  #home-topic-toggle-label { overflow: hidden; text-overflow: ellipsis; }
  .home-discovery-order { grid-column: 1; grid-row: 2; padding: 2px; }
  .home-discovery-order button { min-height: 36px; }
  .home-discovery-search { grid-column: 2 / 4; grid-row: 2; min-height: 42px; padding-inline: 7px; }
  .home-discovery-search input { min-height: 40px; }
  .home-discovery-search input::placeholder { color: #b8b5ae; }
  #home-topics-panel { grid-row: 3; }
  #home-topics-panel:not([data-open='true']) { display: none; }
}

@media (max-width: 550px) {
  .home-card-copy { padding-top: 7px; }
  .home-card-title { font-size: .925rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .home-card-media { overflow: hidden; }
  .home-card-image { transition: transform 200ms ease-out; }
  .home-card-arrow { transition: transform 160ms ease-out; }
  .home-card-action,
  .home-card-favorite { transition: background-color 150ms ease, border-color 150ms ease, transform 130ms ease; }
  .home-card-open:focus-visible .home-card-arrow { transform: translate(2px, -2px); }
  .home-card-action:active,
  .home-card-favorite:active { transform: scale(.96); }
  @media (hover: hover) and (pointer: fine) {
    .home-card-open:hover .home-card-image { transform: scale(1.022); }
    .home-card-open:hover .home-card-arrow { transform: translate(2px, -2px); }
  }
}
