:root {
  color-scheme: light;
  --ink: #243765;
  --terra: #994021;
  --paper: #fbf5e9;
  --line: #d8cab3;
  --white: #fffdf8;
  --blue: #314988;
  --muted: #575c65;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font:
    16px/1.53 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
a {
  color: inherit;
  text-underline-offset: 0.2em;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
.button {
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 19px;
  font-weight: 650;
  background: var(--terra);
  color: white;
  text-decoration: none;
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
}
button:hover,
.button:hover {
  filter: brightness(0.93);
}
:focus-visible {
  outline: 3px solid #b65b2b;
  outline-offset: 3px;
}
main,
.mast nav {
  max-width: 1220px;
  margin: auto;
  padding-inline: clamp(18px, 4vw, 56px);
}
main {
  padding-bottom: 72px;
}
.mast {
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
}
.mast nav,
.shelf-head,
.chat-actions,
.program-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.mast nav {
  min-height: 75px;
}
.mast nav > a:last-child,
.shelf-head > a {
  font-size: 0.9rem;
  font-weight: 600;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font:
    700 29px Georgia,
    serif;
  text-decoration: none;
}
.wordmark img {
  border-radius: 8px;
}
h1,
h2,
h3,
legend {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
  text-wrap: balance;
}
h1 {
  font-size: clamp(36px, 5vw, 62px);
  margin: 24px 0 16px;
}
h2 {
  font-size: clamp(28px, 3.8vw, 42px);
  margin: 26px 0 16px;
}
h3 {
  font-size: 24px;
  margin: 6px 0;
}
main > a:first-child {
  display: inline-block;
  margin-top: 24px;
}
p {
  margin: 8px 0 15px;
}
.welcome {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(25px, 6vw, 82px);
  padding: clamp(26px, 4.6vw, 60px) 0 30px;
  align-items: center;
}
.conversation {
  min-width: 0;
}
.welcome h1 {
  font-size: clamp(40px, 5.5vw, 76px);
  letter-spacing: -0.043em;
  font-weight: 500;
  line-height: 1.02;
  margin: 0 0 16px;
}
.welcome h1 em {
  color: var(--terra);
  font-weight: 500;
}
.intro {
  max-width: 48ch;
  color: #414c62;
  margin: 0 0 22px;
}
.postcard {
  position: relative;
  margin: 0 12px 0 4px;
  transform: rotate(2deg);
  isolation: isolate;
  padding: 10px 10px 0;
  background: #fffdf6;
  box-shadow: 0 9px 23px #57402022;
  border: 1px solid #d8cbb8;
}
.postcard:before {
  content: "";
  position: absolute;
  inset: 10px -13px -13px 10px;
  z-index: -2;
  background: var(--blue) url("/assets/birds.webp") center/210px;
  transform: rotate(-5deg);
  border: 1px solid #a68c65;
}
.postcard:after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fffdf6;
  z-index: -1;
}
.postcard > img {
  width: 100%;
  height: clamp(260px, 28vw, 370px);
  object-fit: cover;
  display: block;
}
.postcard figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 6px 13px;
  font:
    italic 20px Georgia,
    serif;
}
.postcard figcaption span {
  font: 12px system-ui;
  color: #675849;
}
#chat-form {
  padding: 14px 16px 13px;
  border: 1px solid #bda88a;
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 4px 14px #7455260d;
}
#chat-form label {
  margin: 0;
  color: var(--ink);
  font-weight: 650;
}
#message {
  width: 100%;
  min-height: 60px;
  resize: vertical;
  display: block;
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 7px 0;
}
#message::placeholder {
  color: #676973;
}
.chat-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.chat-actions button span {
  font-size: 19px;
}
#chat-status,
.wait,
.note {
  font-size: 14px;
  color: var(--muted);
}
.starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.starter {
  padding: 5px 10px;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  border-radius: 12px;
}
#ready {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
}
.shelf-head {
  margin-bottom: 20px;
}
.shelf-head h2 {
  margin: 12px 0;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 20px;
}
.tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.tile > img {
  width: 100%;
  height: auto;
  aspect-ratio: 1.94;
  object-fit: cover;
}
.tile > div {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.tile small,
.dateline {
  color: var(--terra);
  font-size: 14px;
  font-weight: 650;
}
.tile p {
  color: var(--muted);
  font-size: 15px;
}
.tile span {
  margin-top: auto;
  color: var(--terra);
  font-weight: 600;
}
.tile:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
.dialog.active {
  display: block;
  max-width: 820px;
  margin: auto;
}
.dialog.active .intro,
.dialog.active .postcard,
.dialog.active .starters {
  display: none;
}
.dialog.active h1 {
  font-size: 32px;
}
.dialog.active h1 br {
  display: none;
}
#messages {
  max-height: 53vh;
  overflow: auto;
  scrollbar-gutter: stable;
}
.bubble {
  max-width: 92%;
  width: fit-content;
  margin: 8px 0 16px;
  padding: 12px 16px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 3px;
  overflow-wrap: anywhere;
}
.bubble.user {
  margin-left: auto;
  background: #e7edf5;
  border-color: #cdd7e3;
  border-radius: 14px 14px 3px 14px;
}
.bubble strong {
  font-size: 13px;
  color: var(--terra);
}
.bubble p {
  white-space: pre-wrap;
  margin: 4px 0;
}
.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 13px;
  margin-top: 9px;
}
form:not(#chat-form):not(.download),
.album {
  background: var(--white);
  padding: clamp(18px, 4vw, 38px);
  max-width: 900px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
label,
fieldset {
  display: block;
  margin: 0 0 15px;
}
input,
select {
  max-width: 100%;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  border-radius: 6px;
  border: 1px solid #aca091;
  display: block;
}
.check,
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row {
  flex-wrap: wrap;
}
.check {
  margin: 0;
  padding: 6px;
}
.check input {
  width: 18px;
  height: 18px;
}
.chat-result {
  max-width: 820px;
  margin: auto;
}
.program-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
.download {
  margin: 15px 0;
}
summary {
  cursor: pointer;
  padding: 15px 0;
  font-weight: 600;
}
.album h1 {
  font-size: clamp(30px, 4vw, 46px);
}
.timeline {
  padding: 0;
  list-style: none;
}
.timeline li {
  display: grid;
  grid-template-columns: minmax(90px, 31%) 1fr;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.timeline figure {
  margin: 0;
}
.timeline img {
  display: block;
  width: 100%;
  height: 145px;
  object-fit: cover;
  border-radius: 5px;
}
.timeline b {
  color: var(--terra);
}
.timeline figcaption,
.address {
  font-size: 13px;
  color: var(--muted);
}
.venue {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.venue p {
  margin: 0;
}
[role="alert"] {
  color: #902f21;
}
@media (max-width: 780px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .welcome {
    gap: 20px;
  }
  .postcard > img {
    height: 255px;
  }
}
@media (max-width: 620px) {
  .mast nav {
    min-height: 62px;
  }
  .wordmark {
    font-size: 25px;
  }
  .wordmark img {
    width: 38px;
    height: 38px;
  }
  .welcome {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 25px 0 12px;
    gap: 20px;
  }
  .welcome h1 {
    font-size: 46px;
  }
  .postcard {
    margin: 0 10px 12px;
    transform: rotate(1deg);
  }
  .postcard > img {
    height: 152px;
    object-position: 50% 49%;
  }
  .postcard figcaption {
    font-size: 16px;
    padding: 6px;
  }
  .conversation {
    width: 100%;
  }
  .starters {
    gap: 5px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .shelf-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
  .tile > img {
    aspect-ratio: 2.2;
  }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .timeline img {
    height: 155px;
  }
  .dialog.active h1 {
    font-size: 28px;
  }
  .bubble {
    max-width: 96%;
  }
}
@media print {
  body {
    background: white;
    color: #243452;
    font:
      10.4pt/1.35 Arial,
      sans-serif;
  }
  .album {
    border: 0;
    padding: 0;
    max-width: none;
  }
  .album h1 {
    font:
      700 26pt/1.08 Georgia,
      serif;
    margin: 3mm 0;
  }
  .album h2 {
    font-size: 17pt;
    break-after: avoid;
  }
  .album h3 {
    font-size: 15pt;
  }
  .album p {
    margin: 2mm 0;
  }
  .button {
    padding: 0;
    background: transparent;
    color: #783b26;
    text-decoration: underline;
  }
  .timeline li {
    display: grid;
    grid-template-columns: 52mm 1fr;
    gap: 6mm;
    break-inside: avoid;
    padding: 4mm 0;
  }
  .timeline img {
    width: 52mm;
    height: 34mm;
    object-fit: contain;
    background: #f8f3e8;
    border-radius: 2mm;
  }
  .timeline figure figcaption {
    font-size: 7.5pt;
    line-height: 1.15;
    margin: 1mm 0;
  }
  .venue {
    break-inside: avoid;
    padding: 2mm 0;
  }
  .dateline {
    font-size: 10pt;
  }
  .address {
    font-size: 9pt;
  }
}
@media print {
  .album {
    background: white;
  }
  .album h2 {
    margin: 4mm 0 2mm;
  }
  .venue-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4mm;
    break-inside: avoid;
  }
  .venue {
    font-size: 9pt;
    overflow-wrap: anywhere;
  }
}

/* The masthead and photo caption share the ink of the Kolomna anniversary mark. */
@media screen {
  .mast {
    background: var(--ink);
    color: var(--white);
    border: 0;
  }
  .mast nav {
    min-height: 64px;
  }
  .mast nav > a:last-child {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration-color: #c8a07b;
  }
  .wordmark img {
    background: var(--white);
  }
  .welcome {
    padding-block: clamp(28px, 5vw, 64px);
    align-items: center;
  }
  .welcome h1 {
    letter-spacing: -0.035em;
    line-height: 1.04;
  }
  .active-title,
  .dialog.active .greeting {
    display: none;
  }
  .dialog.active .active-title {
    display: inline;
  }
  .postcard {
    transform: none;
    margin: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
    background: var(--ink);
    color: var(--white);
    overflow: hidden;
    border-radius: 100px 12px 12px 12px;
  }
  .postcard::before,
  .postcard::after {
    display: none;
  }
  .postcard figcaption {
    border-bottom: 5px solid var(--terra);
    padding: 12px 20px;
    font-size: 18px;
  }
  .postcard figcaption span {
    color: #e4d8c6;
  }
  .intro {
    max-width: 45ch;
    line-height: 1.48;
  }
  #chat-form {
    box-shadow: none;
    padding: 14px 15px 10px;
    border-radius: 14px;
  }
  #chat-form:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 1px var(--blue);
  }
  #message {
    padding: 8px 0;
    min-height: 66px;
    line-height: 1.4;
  }
  #message:focus-visible {
    outline: none;
  }
  .chat-actions {
    border-top: 1px solid var(--line);
    padding-top: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }
  .chat-actions button {
    min-height: 44px;
    padding: 7px 16px;
    border-radius: 9px;
  }
  .starters {
    gap: 6px;
    margin-top: 10px;
  }
  .starter {
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 24px;
    line-height: 1.25;
    background: var(--white);
  }
  .tile {
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .tile > img {
    border-radius: 8px;
  }
  .tile > div {
    padding: 12px 1px;
  }
  .tile h3 {
    line-height: 1.18;
  }
  .tile small {
    font-size: 13px;
  }
  #ready {
    margin-top: 0;
  }
  .dialog.active {
    padding-block: 24px 12px;
  }
  .dialog.active h1 {
    margin-bottom: 14px;
  }
  #messages {
    max-height: 54dvh;
    overscroll-behavior: contain;
  }
  .bubble {
    line-height: 1.5;
  }
  .sources a,
  .bubble a[href="#chat-program"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .guide-contact {
    border-inline-start: 3px solid var(--terra);
    padding: 4px 12px;
    margin: 18px 0;
    background: #f7f1e5;
  }
  .guide-contact a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .timeline .rest {
    display: block;
    border: 0;
    padding: 9px 14px;
    background: #edf0f7;
    border-radius: 6px;
  }
  .rest b {
    margin-right: 0.5em;
  }
  @media (prefers-reduced-motion: no-preference) {
    .bubble {
      animation: reply-in 0.16s ease-out;
    }
    @keyframes reply-in {
      from {
        opacity: 0;
        transform: translateY(3px);
      }
      to {
        opacity: 1;
        transform: none;
      }
    }
  }
}
@media screen and (max-width: 620px) {
  .mast nav {
    min-height: 56px;
  }
  .mast nav > a:last-child {
    font-size: 14px;
  }
  .welcome {
    gap: 0;
    padding: 18px 0 22px;
    display: block;
  }
  .welcome:not(.active) {
    position: relative;
  }
  .welcome:not(.active) h1 {
    width: 64%;
    min-height: 95px;
    align-content: center;
    font-size: clamp(34px, 9vw, 54px);
    margin: 0 0 14px;
    line-height: 1.09;
  }
  .postcard {
    position: absolute;
    inset: 18px 0 auto auto;
    width: 32%;
    height: 94px;
    border-radius: 44px 7px 7px 7px;
    border-bottom: 4px solid var(--terra);
  }
  .postcard > img {
    height: 100%;
    object-position: 55% 50%;
  }
  .postcard figcaption {
    display: none;
  }
  .intro {
    margin-bottom: 16px;
  }
  .starters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 3px;
    margin-inline: -3px;
    scrollbar-width: thin;
  }
  .starter {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .shelf-head {
    margin: 0 0 12px;
    gap: 0;
  }
  .shelf-head > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .shelf-head h2 {
    margin-bottom: 0;
  }
  .cards {
    gap: 0;
  }
  .tile {
    display: grid;
    grid-template-columns: clamp(70px, 22vw, 115px) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding-block: 12px;
    border-top: 1px solid var(--line);
  }
  .tile > img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
  }
  .tile > div {
    padding: 0;
  }
  .tile h3 {
    font-size: clamp(19px, 5.1vw, 25px);
    order: -1;
    margin: 0 0 5px;
  }
  .tile small {
    font-size: 13px;
    line-height: 1.4;
  }
  .tile p {
    display: none;
  }
  .dialog.active {
    padding: 16px 0;
  }
  .dialog.active #messages {
    max-height: 48dvh;
  }
  .dialog.active h1 {
    font-size: 24px;
  }
  main {
    padding-bottom: max(36px, env(safe-area-inset-bottom));
  }
  .program-actions {
    gap: 7px;
  }
  .program-actions .download {
    margin: 0;
  }
}
@media print {
  .timeline .rest {
    display: block;
    padding: 2mm 0;
  }
  .guide-contact {
    break-inside: avoid;
  }
}
