:root {
  color-scheme: light;
  --ink: #283e38;
  --red: #953d38;
  --paper: #fcf7ed;
  --line: #d5c7ac;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font:
    16px/1.5 Georgia,
    serif;
}
header,
main {
  max-width: 1280px;
  margin: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 5vw, 68px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: bold;
  text-decoration: none;
  color: var(--ink);
}
.brand span {
  color: var(--red);
  font-size: 23px;
  margin-right: 6px;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  color: inherit;
}
#music,
.visit {
  border: 1px solid #adb4a6;
  border-radius: 30px;
  background: transparent;
  padding: 10px 17px;
  font: 600 14px/1.5 system-ui;
}
#music span {
  text-transform: uppercase;
  font-size: 10px;
}
.cover {
  margin: 28px clamp(16px, 4vw, 60px) 48px;
  display: grid;
  grid-template-columns: 0.85fr 1.4fr;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2e9d8;
}
.intro {
  padding: clamp(24px, 4vw, 68px);
}
small,
.section-title span,
.hint,
#status {
  font-family: system-ui, sans-serif;
}
small {
  color: var(--red);
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font-size: clamp(45px, 5.4vw, 84px);
  line-height: 0.98;
  font-weight: 500;
  letter-spacing: -0.055em;
  margin: 19px 0;
}
h1 i {
  color: var(--red);
}
.intro p {
  max-width: 28ch;
  font-size: 18px;
}
.visit {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  margin-top: 24px;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
}
.house-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}
#casa {
  margin: 0 auto 60px;
  width: min(1080px, 92%);
  scroll-margin-top: 16px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title h2,
dialog h2 {
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 500;
  letter-spacing: -0.04em;
}
.section-title span {
  font-size: 13px;
}
.hint,
#status {
  font-size: 14px;
  margin: 6px 0 16px;
}
.roof {
  height: 54px;
  background: repeating-linear-gradient(
    165deg,
    #983e37 0 9px,
    #883832 10px 12px
  );
  clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%);
  border-bottom: 6px solid #6b362a;
  display: grid;
  place-items: center;
  color: #ffdc91;
  font-size: 28px;
}
.roof span {
  line-height: 1;
}
#windows {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: #d6b38b;
  border: 8px solid #9a7152;
  border-top: none;
  box-shadow: 0 6px 0 #75513f;
}
.window {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  perspective: 400px;
  overflow: hidden;
  background: radial-gradient(ellipse, #ffe2a1, #bb784a);
  border: 0;
  border-bottom: 7px solid #a87b56;
  border-right: 3px solid #b19170;
  aspect-ratio: 1.28;
  padding: 8px;
}
.window:before,
.window:after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 8%;
  bottom: 8%;
  width: 43%;
  border: 3px double #eee0be;
  background:
    repeating-linear-gradient(90deg, transparent 0 10px, #ffffff15 11px 12px),
    var(--paint, #7c9184);
  transition: transform 0.65s ease;
  backface-visibility: hidden;
}
.window:before {
  left: 7%;
  transform-origin: left;
}
.window:after {
  right: 7%;
  transform-origin: right;
}
.window:nth-child(3n) {
  --paint: #a97069;
}
.window:nth-child(3n + 2) {
  --paint: #758994;
}
.window:disabled {
  cursor: default;
  background: #c4ac92;
}
.window strong {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: #f9edd7;
  color: #524437;
  border-radius: 50%;
  border: 1px solid #b18f6d;
  font: italic 24px Georgia;
}
.window:not(:disabled) strong {
  box-shadow: 0 0 20px #ffdb85;
  background: #fff2ba;
  color: #653219;
}
.window.open:before {
  transform: rotateY(79deg);
}
.window.open:after {
  transform: rotateY(-79deg);
}
.window.open {
  background-position: center;
  background-size: cover;
}
.window.open strong {
  align-self: end;
  width: 28px;
  height: 28px;
  font-size: 16px;
}
:focus-visible {
  outline: 3px solid #14599c;
  outline-offset: -3px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  width: min(510px, 92vw);
  max-height: 91dvh;
  text-align: center;
  overscroll-behavior: contain;
}
dialog[open] {
  animation: appear 0.38s ease-out;
}
dialog::backdrop {
  background: #10241ee0;
}
dialog img {
  width: 100%;
  height: min(40dvh, 350px);
  object-fit: contain;
  background: #e6d8bf;
  display: block;
}
dialog article {
  padding: 18px 22px 26px;
}
dialog h2 {
  font-size: 32px;
}
#verse {
  white-space: pre-line;
  font-size: 20px;
  line-height: 1.5;
  font-style: italic;
}
#close {
  position: sticky;
  float: right;
  top: 8px;
  margin: 8px 8px -52px 0;
  z-index: 2;
  border: 0;
  border-radius: 100%;
  width: 44px;
  height: 44px;
  font-size: 27px;
  background: var(--paper);
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
}
@media (max-width: 700px) {
  .cover {
    grid-template-columns: 1fr;
    margin: 14px 14px 30px;
  }
  .house-photo {
    min-height: 0;
    aspect-ratio: 1.7;
  }
  .intro {
    padding: 24px;
  }
  .intro p {
    max-width: none;
  }
  .visit {
    margin-top: 16px;
  }
  .section-title h2 {
    font-size: 32px;
  }
  #windows {
    grid-template-columns: repeat(3, 1fr);
  }
  .roof {
    height: 38px;
  }
  header {
    padding: 8px 15px;
  }
  .brand {
    font-size: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.roof {
  position: relative;
  box-shadow:
    inset 0 5px #f7f0df,
    inset 0 8px #c4c6b8;
}
.roof::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 9px;
  background: radial-gradient(
      circle at 12px 4px,
      #ffe5a0 0 2px,
      #b18a51 3px,
      transparent 4px
    )
    repeat-x;
  background-size: 26px 8px;
  background-color: #385343;
}
.window:focus-visible {
  z-index: 1;
}
.window:disabled strong {
  background: #eee3cf;
}
.window:not(:disabled):hover strong {
  transform: scale(1.05);
}
body:has(dialog[open]) {
  overflow: hidden;
}
@media (max-height: 500px) and (orientation: landscape) {
  dialog[open] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(760px, 94vw);
    align-items: center;
  }
  dialog img {
    height: 80dvh;
  }
  #close {
    position: absolute;
    right: 4px;
    top: 4px;
  }
}
