/* Grunnstillingar fyrir síðuna */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: #44251f;
  background:
    radial-gradient(circle at top left, rgba(255, 219, 229, 0.95), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(255, 185, 161, 0.7), transparent 30rem),
    linear-gradient(135deg, #fff7f1 0%, #ffe8df 46%, #ffd5df 100%);
}

body.modal-open {
  overflow: hidden;
}

button {
  font: inherit;
}

.page {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 28px 16px 42px;
}

.hero {
  text-align: center;
  padding: 26px 0 20px;
}

.tiny-note {
  margin: 0 0 10px;
  color: #a64d5f;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 8vw, 4.4rem);
  line-height: 1.05;
}

.subtitle {
  max-width: 620px;
  margin: 16px auto 0;
  font-size: 1.1rem;
  line-height: 1.55;
}

.calendar-section {
  margin-top: 34px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 16px;
  perspective: 900px;
}

.door {
  position: relative;
  min-height: 190px;
  padding: 18px 14px;
  border: 0;
  border-radius: 8px;
  color: #ffe9c8;
  background:
    linear-gradient(90deg, rgba(33, 13, 5, 0.34) 0 2px, transparent 2px 29px, rgba(255, 225, 174, 0.09) 30px 32px, transparent 32px 58px),
    linear-gradient(8deg, transparent 0 22%, rgba(40, 15, 7, 0.22) 23% 24%, transparent 25% 100%),
    linear-gradient(174deg, rgba(255, 218, 154, 0.08), transparent 28%, rgba(42, 15, 8, 0.28) 72%),
    linear-gradient(160deg, #8a461e 0%, #693016 48%, #421b0e 100%);
  box-shadow:
    inset 0 0 0 3px rgba(31, 12, 5, 0.42),
    inset 0 0 0 10px rgba(255, 220, 160, 0.09),
    inset 14px 0 18px rgba(255, 219, 156, 0.08),
    inset -16px 0 20px rgba(25, 8, 3, 0.28),
    0 13px 22px rgba(61, 25, 12, 0.3);
  cursor: pointer;
  overflow: hidden;
  transform-origin: left center;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.door::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(225, 170, 103, 0.42);
  border-radius: 7px;
  box-shadow:
    inset 0 0 0 5px rgba(36, 13, 6, 0.18),
    inset 0 0 22px rgba(21, 7, 3, 0.24);
  pointer-events: none;
}

.door::after {
  content: "";
  position: absolute;
  inset: 18px;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(28, 9, 4, 0.24) 49% 51%, transparent 52% 100%),
    linear-gradient(0deg, transparent 0 46%, rgba(235, 174, 106, 0.14) 47% 48%, rgba(39, 14, 7, 0.2) 50% 51%, transparent 52% 100%);
  pointer-events: none;
}

.door:hover,
.door:focus-visible {
  transform: translateY(-3px) rotateY(-7deg);
  box-shadow:
    inset 0 0 0 3px rgba(31, 12, 5, 0.42),
    inset 0 0 0 10px rgba(255, 220, 160, 0.1),
    inset 14px 0 18px rgba(255, 219, 156, 0.1),
    inset -16px 0 20px rgba(25, 8, 3, 0.28),
    0 18px 30px rgba(61, 25, 12, 0.38);
  outline: none;
}

.door.opening {
  animation: doorOpen 520ms ease forwards;
}

.door * {
  pointer-events: none;
}

.door-date {
  display: block;
  position: relative;
  z-index: 1;
  font-size: 1.9rem;
  font-weight: 700;
  text-shadow: 0 2px 2px rgba(53, 20, 9, 0.42);
}

.lock {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 2;
  width: 92px;
  height: 70px;
  transform: translateX(-50%);
}

.lock-shackle {
  position: absolute;
  left: 31px;
  top: 0;
  width: 30px;
  height: 28px;
  border: 6px solid #b47724;
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow:
    inset 0 2px 0 rgba(255, 231, 166, 0.38),
    0 2px 3px rgba(43, 20, 8, 0.28);
  transition: transform 180ms ease;
}

.lock-body {
  position: absolute;
  left: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 92px;
  height: 42px;
  border: 1px solid rgba(68, 34, 10, 0.38);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 238, 172, 0.7), transparent 26%),
    linear-gradient(160deg, #c89137 0%, #9f671f 45%, #6f4214 100%);
  box-shadow:
    inset 0 2px 0 rgba(255, 241, 184, 0.42),
    inset 0 -3px 0 rgba(73, 39, 10, 0.34),
    0 4px 8px rgba(31, 13, 5, 0.32);
}

.lock-body::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 5px;
  height: 8px;
  border-radius: 3px;
  background: rgba(70, 37, 11, 0.72);
  transform: translateX(-50%);
}

.lock-label {
  margin-top: -5px;
  color: #6c4014;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  text-shadow:
    0 1px 0 rgba(255, 219, 136, 0.38),
    0 -1px 0 rgba(59, 31, 8, 0.58);
}

.open-lock .lock-shackle {
  transform: translateX(-20px) rotate(-34deg);
  transform-origin: right bottom;
}

.door.locked {
  color: #e5d2b3;
  background:
    linear-gradient(90deg, rgba(20, 10, 6, 0.32) 0 2px, transparent 2px 29px, rgba(255, 225, 174, 0.05) 30px 32px, transparent 32px 58px),
    linear-gradient(8deg, transparent 0 22%, rgba(18, 9, 5, 0.28) 23% 24%, transparent 25% 100%),
    linear-gradient(160deg, #66503e 0%, #4d3428 48%, #342119 100%);
  cursor: not-allowed;
  filter: grayscale(0.2) brightness(0.82);
}

.door.locked:hover {
  transform: none;
  box-shadow:
    inset 0 0 0 3px rgba(66, 29, 14, 0.3),
    inset 0 0 0 10px rgba(255, 220, 170, 0.08),
    0 12px 22px rgba(85, 37, 21, 0.24);
}

.door.final-door {
  color: #fff0c8;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 18%, rgba(92, 44, 14, 0.15) 19%, transparent 21%),
    linear-gradient(160deg, #c87b32 0%, #9b4c24 42%, #6e2d17 100%);
  box-shadow:
    inset 0 0 0 3px rgba(98, 39, 15, 0.32),
    inset 0 0 0 10px rgba(255, 223, 151, 0.14),
    0 16px 30px rgba(145, 74, 33, 0.28);
}

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(38, 18, 14, 0.68);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.photo-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.photo-frame {
  width: min(60vw, 760px);
  max-height: 72vh;
  overflow: auto;
  border-radius: 8px;
  scrollbar-color: rgba(255, 209, 190, 0.65) rgba(38, 18, 14, 0.25);
  animation: photoPop 320ms ease;
}

.modal-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

@keyframes doorOpen {
  0% {
    transform: translateY(-3px) rotateY(-7deg);
  }

  55% {
    transform: translateY(-3px) rotateY(-64deg) skewY(-1deg);
    filter: brightness(1.08);
  }

  100% {
    transform: translateY(-3px) rotateY(-74deg) skewY(-1deg);
    opacity: 0.45;
  }
}

@keyframes photoPop {
  from {
    opacity: 0;
    transform: scale(0.88) rotateY(-12deg);
  }

  to {
    opacity: 1;
    transform: scale(1) rotateY(0);
  }
}

@media (max-width: 520px) {
  .page {
    padding-inline: 12px;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .door {
    min-height: 170px;
    padding-inline: 10px;
  }

  .lock {
    bottom: 18px;
    transform: translateX(-50%) scale(0.86);
  }

  .photo-frame {
    width: 88vw;
    max-height: 72vh;
  }
}
