:root {
  color-scheme: light;
  --page: #f4ecdc;
  --paper: #fffaed;
  --ink: #253c35;
  --green: #174b42;
  --rust: #9f422f;
  --line: #dcd0bb;
  --muted: #506057;
}
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 0, #fffaee 0, var(--page) 70%);
  font: 16px/1.55 system-ui, sans-serif;
}
a { color: inherit; }
button, input { font: inherit; }
button, .primary, summary { touch-action: manipulation; user-select: none; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 4px; }
.layout {
  max-width: 1120px;
  min-height: 100svh;
  margin: auto;
  padding: calc(16px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.mast, footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--muted);
  font-size: .75rem;
}
.mast { min-height: 52px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
.mast a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--green);
  font: bold 1.18rem Georgia, serif;
  text-decoration: none;
}
footer { margin-top: 22px; padding: 13px 0 0; border-top: 1px solid var(--line); }
footer span:nth-child(2) { color: var(--rust); }
.postcard {
  padding: 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 13px 32px #58432312;
}
.postcard-picture { position: relative; margin: 0; min-height: 176px; }
.postcard-picture img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: 50% 49%;
}
.postcard-picture figcaption {
  position: absolute;
  bottom: 9px;
  left: 9px;
  padding: 4px 8px;
  color: var(--green);
  background: var(--paper);
  font: italic .77rem Georgia, serif;
}
.welcome { padding: 23px clamp(13px, 4vw, 40px) 20px; }
.eyebrow { margin: 0; color: var(--rust); font-size: .67rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
h1 {
  margin: 7px 0 14px;
  color: var(--green);
  font: 500 clamp(3rem, 9.7vw, 6rem)/.88 Georgia, serif;
  letter-spacing: -.066em;
  overflow-wrap: anywhere;
}
h1 em { color: var(--rust); font-weight: inherit; }
p { margin: 0 0 16px; }
.welcome form { display: grid; gap: 8px; max-width: 390px; margin-top: 16px; }
label { font-size: .86rem; font-weight: 700; }
input {
  min-width: 0;
  min-height: 49px;
  padding: 10px 12px;
  background: #fffdf6;
  border: 1px solid #a59e88;
  border-radius: 5px;
  color: var(--ink);
  font-size: 16px;
}
.primary {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--green);
  color: #fffaf0;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
}
.primary span { font-size: 1.25em; }
.primary:active { background: #103b33; transform: translateY(1px); }
.error { margin: 0; color: #8a3523; font-size: .88rem; }
.private { max-width: 620px; margin: auto; }
.envelope {
  padding: clamp(15px, 5vw, 38px);
  background:
    linear-gradient(145deg, transparent 51%, #f4e5c680 51% 52%, transparent 52%),
    linear-gradient(215deg, transparent 51%, #f4e5c680 51% 52%, transparent 52%),
    #dac49a;
  border: 1px solid #c7b187;
}
.letter {
  display: grid;
  justify-items: center;
  padding: clamp(18px, 6vw, 40px);
  border: 1px solid #c9b68e;
  background: var(--paper);
  text-align: center;
  box-shadow: 0 8px 25px #45321921;
}
.letter h1 { font-size: clamp(2.5rem, 8.7vw, 5.1rem); }
.letter form, .letter .primary { width: min(100%, 295px); }
.seal {
  display: grid;
  place-items: center;
  width: 49px;
  aspect-ratio: 1;
  margin-bottom: 17px;
  border-radius: 48% 52% 54% 46%;
  background: var(--rust);
  border: 3px double #e1a087;
  color: var(--paper);
  font: 1.45rem Georgia, serif;
}
.opened { animation: unfold .35s ease-out both; }
@keyframes unfold { from { opacity: .35; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.reception { margin: 16px 0; padding: 13px 15px; border-left: 2px solid var(--rust); }
.reception p + p { margin: 4px 0 0; font: italic 1.07rem/1.4 Georgia, serif; }
.house { border-block: 1px solid var(--line); }
summary { padding: 10px 5px; min-height: 44px; font-weight: 650; }
summary:active { background: #eaddc6; }
.house > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; }
.house > summary::-webkit-details-marker { display: none; }
.house-content { padding: 0 8px 12px; }
.house-content details { border-top: 1px dashed var(--line); }
.house-content p { margin: 0 0 7px; }
.house-content details[open] { padding-bottom: 10px; }
.house-content a { display: inline-flex; align-items: center; min-height: 44px; font-size: .87rem; text-underline-offset: 3px; }
.logout { display: flex; justify-content: end; margin-top: 8px; }
.logout button { min-height: 44px; padding-inline: 5px; border: 0; background: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: .86rem; }
.logout button:active { color: var(--rust); }
@media (min-width: 780px) {
  .layout { padding-inline: 30px; }
  .mast { margin-bottom: 26px; }
  .postcard { display: grid; grid-template-columns: 1.12fr 1fr; }
  .postcard-picture img { height: 100%; min-height: 420px; }
  .welcome { align-self: center; padding-block: 35px; }
}
@media (hover: hover) and (pointer: fine) {
  .primary:hover { background: #236456; }
  .logout button:hover, .mast a:hover { color: var(--rust); }
}
@media (prefers-reduced-motion: reduce) {
  .opened { animation: none; }
}
