.home .header {
  gap: 18px;
  position: relative;
  z-index: 4;
}
.home-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.home-tools details { position: relative; }
.home-tools summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.home-tools summary::-webkit-details-marker { display: none; }
.home-tools summary:focus-visible,
.home-tools button:focus-visible,
.home-tools a:focus-visible { outline: 1px solid var(--red); outline-offset: 3px; }
.home-language-current { font: 500 12px/1 var(--sans); }
.home-language-arrow { font-size: 10px; color: var(--muted); }
.home-preferences summary {
  width: 32px;
  justify-content: center;
  color: var(--muted);
  font-size: 19px;
}
.home-tool-popover {
  position: absolute;
  right: 0;
  z-index: 2;
  top: calc(100% + 3px);
  min-width: 164px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 30px #0002;
}
html[data-theme="dark"] .home-tool-popover { background: #202122; }
.home-tool-popover button,
.home-tool-popover a {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  font: 13px/1.4 var(--sans);
  white-space: nowrap;
}
.home-tool-popover button:hover,
.home-tool-popover a:hover,
.home-tool-popover button[aria-pressed="true"] { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.home-language-panel button[aria-pressed="true"]::after {
  content: '✓';
  margin-left: auto;
  color: var(--red);
}
.brush-flag {
  --stroke: polygon(0% 20%,8% 10%,22% 16%,38% 7%,62% 12%,83% 5%,98% 16%,94% 32%,100% 43%,92% 55%,97% 68%,85% 77%,96% 85%,68% 93%,47% 87%,26% 99%,7% 87%,13% 74%,1% 61%,8% 50%);
  width: 29px;
  height: 20px;
  display: inline-grid;
  align-content: center;
  flex: 0 0 auto;
  transform: rotate(-7deg);
}
.brush-flag i {
  height: 7px;
  display: block;
  background: linear-gradient(3deg, #0002, transparent 45%, #fff2), var(--pigment, transparent);
  clip-path: var(--stroke);
}
.brush-flag i:nth-child(2) { margin: -1px 0 0 1px; }
.brush-flag i:nth-child(3) { margin: -1px 1px 0 0; }
.brush-ru { --a: #f7f3ea; --b: #2857a8; --c: #be302b; }
.brush-de { --a: #353536; --b: #bd3131; --c: #de9a28; }
.brush-es { --a: #a5282c; --b: #f1ad37; --c: #b82f34; }
.brush-ru i:first-child,.brush-de i:first-child,.brush-es i:first-child { --pigment: var(--a); }
.brush-ru i:nth-child(2),.brush-de i:nth-child(2),.brush-es i:nth-child(2) { --pigment: var(--b); }
.brush-ru i:nth-child(3),.brush-de i:nth-child(3),.brush-es i:nth-child(3) { --pigment: var(--c); }
.brush-en,.brush-fr,.brush-zh { clip-path: var(--stroke); }
.brush-fr { background: linear-gradient(90deg,#3156a1 0 32%,#f2ecde 37% 62%,#b52e37 68% 100%); }
.brush-en {
  background:
    linear-gradient(90deg,transparent 43%,#bc3945 43% 56%,transparent 56%),
    linear-gradient(transparent 38%,#bc3945 38% 63%,transparent 63%),
    linear-gradient(90deg,transparent 37%,#f1ecdf 37% 62%,transparent 62%),
    linear-gradient(transparent 28%,#f1ecdf 28% 73%,transparent 73%),
    linear-gradient(35deg,transparent 45%,#f1ecdf 45% 54%,transparent 54%),
    linear-gradient(-35deg,transparent 45%,#f1ecdf 45% 54%,transparent 54%),#2b4174;
}
.brush-zh {
  background: radial-gradient(ellipse at 28% 33%,#ffce62 0 10%,transparent 12%),
    radial-gradient(ellipse at 44% 52%,#ffce62 0 4%,transparent 7%),#c53930;
}
.brush-en::after,.brush-fr::after,.brush-zh::after {
  content: '';
  grid-area: 1/1;
  height: 20px;
  background: repeating-linear-gradient(1deg,#fff2 0 1px,transparent 1px 4px);
}
.brush-en i,.brush-fr i,.brush-zh i { display: none; }
.home-content-language { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.home-content-language[hidden] { display: none; }
@media (min-width: 1000px) and (min-height: 600px) {
  body.home { grid-template-rows: 52px minmax(0,1fr); }
  .home-content-language:not([hidden]) + .featured-grid { height: calc(100% - 21px); }
}
@media (max-width: 600px) {
  .home .header { padding-block: 11px; }
  .home .header #main-nav { z-index: 1; }
  .home .home-tools { position: relative; z-index: 2; gap: 9px; }
}

@media (max-width: 600px) {
  .home .header { padding-block: 6px; }
  .home .header .theme-orbit {
    width: 56px;
    height: 44px;
    aspect-ratio: auto;
    flex: none;
    margin: 0 0 0 -5px;
    border-radius: 6px;
  }
  .home .header .theme-orbit svg { stroke-width: 8; }
  .home .header .theme-orbit .sun { width: 37%; box-shadow: none; }
  html[data-theme="dark"] .home .header .theme-orbit .sun { box-shadow: inset -2px -1px 0 #55534b29; }
  .home .header .theme-orbit .orbit-theme-hint { display: none; }
  .home .header .theme-orbit:hover .sun,
  .home .header .theme-orbit:focus-visible .sun { outline: none; }
  .home .header .theme-orbit:focus-visible { outline: 1px solid var(--red); outline-offset: 1px; }

  .home .hero { padding-top: 10px; padding-bottom: 20px; }
  .home .hero-top.hero-with-portrait { grid-template-columns: 25% minmax(0, 1fr); gap: 12px; }
  .home .hero-with-portrait h1 { font-size: 11vw; line-height: 1.02; }

  .home .painting-carousel.painting-section .painting-banner {
    height: auto;
    aspect-ratio: 3.2 / 1;
    clip-path: none;
  }
  .home .painting-carousel.painting-section .painting-banner img { transform: none; }
  .home .painting-carousel .painting-caption { margin-top: 0; padding-block: 5px 10px; font-size: 12px; }
  .home .painting-carousel .gallery-links { flex-direction: row; align-items: baseline; }

  .home main > .directions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
    margin: 8px 6% 0;
  }
  .home main > .directions a {
    grid-template-columns: 19px minmax(0, 1fr) auto;
    gap: 5px;
    min-height: 44px;
    padding: 8px 0;
    font: 400 clamp(14px, 4.3vw, 19px)/1.16 var(--sans);
    letter-spacing: -.02em;
    overflow-wrap: anywhere;
  }
  .home main > .directions a:first-child { margin-bottom: 0; }
  .home main > .directions .index { grid-column: auto; margin: 0; font-size: 10px; }
  .home main > .directions a span:last-child { font-size: 16px; }
}
