:root {
  color-scheme: light dark;
  --bg: #f2eee6;
  --fg: #343c3e;
  --muted: #6a7271;
  --accent: #887657;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--heading-font, Arial, Helvetica, sans-serif);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #242b2d;
    --fg: #eee9dd;
    --muted: #b5bbb4;
    --accent: #d4b28a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

html {
  min-width: 280px;
}

[hidden] {
  display: none !important;
}

.page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  margin: 0 6vw;
  min-height: 74px;
}

.address {
  font-size: 12px;
  letter-spacing: .025em;
  color: var(--muted);
  overflow-wrap: anywhere;
  max-width: calc(100% - 80px);
}

main {
  padding: 35px 7vw 50px;
  min-width: 0;
}

h1 {
  font-weight: var(--heading-weight, 700);
  font-size: clamp(70px, 9.6vw, 144px);
  line-height: .98;
  letter-spacing: var(--tracking, -.06em);
  margin: 0;
}

h1 span {
  display: block;
}

.rule {
  width: 44px;
  height: 2px;
  background: var(--accent);
  margin-top: 30px;
}

.art {
  flex: none;
}

.art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 53svh;
  object-fit: contain;
}

.art .dark-mark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .art .light-mark {
    display: none;
  }

  .art .dark-mark {
    display: block;
  }
}

.site-footer {
  margin: 0 6vw;
  border-top: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  padding: 19px 12px 25px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a:hover {
  color: var(--fg);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

.error {
  font-size: 14px;
  line-height: 1.6;
  max-width: 45ch;
  margin: 0;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 700px) {
  .site-header {
    margin: 0 24px;
    min-height: 62px;
  }

  main {
    padding: 14px 24px 30px;
  }

  h1 {
    font-size: clamp(48px, 13vw, 85px);
    line-height: 1.04;
    text-align: center;
  }

  .rule {
    margin: 22px auto 0;
  }

  .art img {
    max-height: 35svh;
  }

  .address {
    font-size: 11px;
  }
}

@media (max-height: 520px) and (min-width: 701px) {
  .site-header {
    min-height: 54px;
  }

  main {
    padding: 16px 7vw 25px;
  }

  h1 {
    font-size: clamp(64px, 18svh, 100px);
  }
}

@media (max-height: 500px) and (max-width: 700px) {
  .site-header {
    min-height: 52px;
  }

  main {
    padding: 5px 24px 18px;
  }

  h1 {
    font-size: clamp(40px, 11vw, 55px);
  }

  .art img {
    max-height: 29svh;
  }

  .rule {
    margin-top: 16px;
  }
}

@media print {
  .page {
    min-height: 0;
  }

  main {
    padding: 35px;
  }
}

.site-header,
.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.slot {
  display: flex;
  grid-row: 1;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-wrap: wrap;
}

.slot-left {
  grid-column: 1;
  justify-content: flex-start;
  text-align: left;
}

.slot-center {
  grid-column: 2;
  justify-content: center;
  text-align: center;
}

.slot-right {
  grid-column: 3;
  justify-content: flex-end;
  text-align: right;
}

.main-grid {
  max-width: 1260px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: clamp(30px, 6vw, 90px);
  min-height: calc(100svh - 230px);
}

.main-grid.narrow {
  max-width: 760px;
}

.main-grid.normal {
  max-width: 1000px;
}

.main-grid.has-aside {
  grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
}

.main-grid.has-aside.equal {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.main-grid.has-aside.aside-left .sidebar {
  order: -1;
}

.primary,
.sidebar {
  min-width: 0;
}

.identity {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 7vw, 120px);
}

.identity.image-left .art {
  order: -1;
}

.identity.image-above {
  flex-direction: column-reverse;
}

.identity.image-below {
  flex-direction: column;
}

.identity.image-above,
.identity.image-below {
  text-align: center;
}

.identity.image-above .rule,
.identity.image-below .rule {
  margin-left: auto;
  margin-right: auto;
}

.identity .art {
  width: min(29vw, 43svh, 370px);
  max-width: 100%;
}

.identity.solo .art {
  width: min(45vw, 47svh, 400px);
}

.subtitle {
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.5;
  color: var(--muted);
  margin: 22px 0 0;
}

.intro,
.text-block {
  font-size: 16px;
  line-height: 1.75;
  max-width: 65ch;
}

.intro {
  margin-top: 20px;
  color: var(--muted);
}

.content-heading h1 {
  font-size: clamp(42px, 6vw, 82px);
}

.content-heading {
  margin-bottom: 30px;
}

.text-block {
  margin: 0 0 28px;
}

.text-block h2 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.text-block p {
  margin: 0 0 16px;
}

.page:has(.site-header[hidden]) .main-grid {
  min-height: calc(100svh - 160px);
}

.alignment-left .identity {
  justify-content: flex-start;
}

@media (max-width: 700px) {
  .site-header,
  .site-footer {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .slot-center {
    grid-column: 1/-1;
    grid-row: 2;
  }

  .slot-right {
    grid-column: 2;
    grid-row: 1;
  }

  .slot-left {
    grid-column: 1;
    grid-row: 1;
  }

  .site-footer .slot-center {
    grid-row: 1;
  }

  .site-footer .slot-left,
  .site-footer .slot-right {
    grid-row: 2;
  }

  .slot {
    gap: 8px;
  }

  .main-grid {
    min-height: calc(100svh - 180px);
    gap: 30px;
  }

  .main-grid.has-aside,
  .main-grid.has-aside.equal {
    grid-template-columns: minmax(0, 1fr);
  }

  .main-grid.has-aside.aside-left .sidebar {
    order: 0;
  }

  .main-grid.has-aside.mobile-aside-before .sidebar {
    order: -1;
  }

  .identity {
    gap: 23px;
    text-align: center;
  }

  .identity.image-left,
  .identity.image-right,
  .identity.image-above,
  .identity.image-below {
    flex-direction: column-reverse;
  }

  .identity .art {
    order: 0 !important;
    width: clamp(120px, 28svh, 235px);
  }

  .identity.mobile-below {
    flex-direction: column;
  }

  .identity .rule {
    margin-left: auto;
    margin-right: auto;
  }

  .identity.solo .art {
    width: min(55vw, 40svh, 290px);
  }

  .content-heading h1 {
    font-size: clamp(40px, 9vw, 62px);
  }

  .site-footer {
    margin: 0 24px;
  }

  .address {
    max-width: 100%;
  }

  .intro {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 430px) {
  .site-header .slot-right {
    gap: 3px;
  }

  .site-header {
    margin: 0 18px;
  }

  .address {
    font-size: 10px;
  }
}

@media (max-height: 500px) and (max-width: 700px) {
  .identity .art {
    width: 110px;
  }

  .identity {
    gap: 14px;
  }

  .main-grid {
    min-height: calc(100svh - 165px);
  }
}

.slot .text-block {
  margin: 0;
  max-width: 70ch;
  font: inherit;
}

.slot .text-block p {
  margin: 0;
}

.language-picker,
.style-picker {
  appearance: none;
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23818b87' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  border: 1px solid color-mix(in srgb, var(--fg) 16%, transparent);
  border-radius: 6px;
  padding: 7px 28px 7px 10px;
  max-width: 170px;
  min-width: 0;
  cursor: pointer;
}

.language-picker:hover,
.style-picker:hover {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--fg) 35%, transparent);
}

.language-picker:focus-visible,
.style-picker:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.language-picker option,
.style-picker option {
  color: var(--fg);
  background-color: var(--bg);
}

@media (max-width: 700px) {
  .language-picker,
  .style-picker {
    font-size: 11px;
    max-width: 135px;
    padding: 6px 23px 6px 7px;
    background-position: right 6px center;
  }
}

@media (max-width: 430px) {
  .language-picker,
  .style-picker {
    max-width: 110px;
  }
}

@media print {
  .language-picker,
  .style-picker {
    display: none;
  }
}
