*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #241811;
  --muted: #5d4938;
  --soft: #7c624a;
  --gold: #b8833d;
  --gold-deep: #875c28;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  overflow: auto;
  background:
    linear-gradient(rgba(22, 11, 6, 0.02), rgba(22, 11, 6, 0.02)),
    url("./assets/images/homepage/background.png") center center / cover no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 244, 222, 0.018), transparent 36%),
    radial-gradient(circle at 50% 55%, transparent 64%, rgba(20, 9, 5, 0.045) 100%);
}

.foundry-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(0.7rem, 2vw, 1.6rem);
}

.letter-sheet {
  position: relative;
  width: min(1180px, 70vw);
  min-height: min(850px, 87vh);
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: center;
  gap: clamp(1.1rem, 2.1vh, 1.75rem);
  padding: clamp(1.1rem, 2.1vw, 2.25rem) clamp(1rem, 3vw, 3.25rem);
  text-align: center;
}

.brand,
.intro,
.choice,
.steps-note,
.footer-line {
  position: relative;
  z-index: 2;
}

.brand {
  position: relative;
}

.brand::after {
  content: none;
}

.letter-heart {
  position: absolute;
  top: clamp(0.2rem, 0.8vh, 0.55rem);
  right: clamp(5.2rem, 7.2vw, 9rem);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 2.35vw, 2.65rem);
  line-height: 1;
  color: var(--gold);
  font-weight: 400;
  transform: rotate(-8deg);
}

.brand-kicker {
  margin: 0 0 clamp(0.8rem, 1.8vh, 1.25rem);
  font-family: Arial, sans-serif;
  font-size: clamp(0.62rem, 0.76vw, 0.72rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 4.25vw, 4.95rem);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.052em;
}

.headline-script {
  margin: clamp(0.5rem, 0.95vh, 0.85rem) 0 0;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(1.35rem, 1.9vw, 2.05rem);
  line-height: 1.08;
  font-style: normal;
  color: var(--muted);
  transform: rotate(-1.1deg);
}

.intro {
  width: min(650px, 88%);
  margin: 0 auto;
  font-size: clamp(0.82rem, 0.9vw, 0.95rem);
  line-height: 1.48;
  color: var(--muted);
}

.intro p {
  margin: 0.12rem 0;
}

.choice {
  width: min(920px, 88%);
  margin: 0 auto;
}

.choice h2 {
  margin: 0 0 clamp(0.3rem, 0.7vh, 0.5rem);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.94rem, 1.1vw, 1.08rem);
  line-height: 1.1;
  font-weight: 500;
  font-style: italic;
  color: var(--soft);
}

.handwritten-line {
  margin: 0 0 clamp(0.85rem, 1.5vh, 1.15rem);
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(1.05rem, 1.45vw, 1.35rem);
  line-height: 1.08;
  color: var(--muted);
  transform: rotate(-0.7deg);
}

.door-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  row-gap: 0;
  column-gap: 0;
}

.door {
  position: relative;
  min-height: clamp(4.05rem, 7.5vh, 5rem);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.24rem;
  padding: 0.4rem 0.35rem;

  text-align: center;
  text-decoration: none;
  color: var(--ink);

  border: 0;
  background: rgba(255, 255, 255, 0);

  transition:
    background 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease;
}

.door::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 0;
  height: 1px;
  background: rgba(113, 82, 49, 0.24);
}

.door:nth-child(n + 5)::before {
  background: rgba(113, 82, 49, 0.2);
}

.door::after {
  content: "";
  position: absolute;
  top: 12%;
  bottom: 12%;
  right: 0;
  width: 1px;
  background: rgba(113, 82, 49, 0.18);
}

.door:nth-child(4n)::after {
  content: none;
}

.door:nth-child(n + 5) {
  border-bottom: 0;
}

.door:hover,
.door:focus-visible,
.door.is-selected {
  outline: none;
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(182, 134, 67, 0.18),
    0 8px 18px rgba(90, 58, 26, 0.07);
}

.door-icon {
  width: clamp(1.62rem, 1.88vw, 1.98rem);
  height: clamp(1.62rem, 1.88vw, 1.98rem);
  color: #bd873e;
}

.door-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.02;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.door span:last-child {
  font-size: clamp(0.76rem, 0.86vw, 0.9rem);
}

.steps-note {
  width: min(760px, 68%);
  margin: 0 auto;
  padding: clamp(0.58rem, 1vh, 0.82rem) clamp(0.8rem, 1.6vw, 1.2rem);
  background:
    linear-gradient(180deg, rgba(224, 198, 160, 0.52), rgba(205, 174, 130, 0.38));
  border: 1px solid rgba(128, 89, 46, 0.08);
  box-shadow:
    0 12px 22px rgba(69, 42, 18, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: rotate(0.12deg);
}

.steps-note h2 {
  margin: 0 0 0.36rem;
  font-family: "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  line-height: 1.05;
  font-weight: 400;
  font-style: normal;
  color: var(--muted);
  transform: rotate(-0.6deg);
}

.steps-note ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.steps-note li {
  min-height: 2.45rem;
  padding: 0.18rem 0.36rem;
  display: grid;
  align-content: start;
  gap: 0.08rem;
  border-left: 1px solid rgba(117, 79, 39, 0.12);
}

.steps-note li:first-child {
  border-left: 0;
}

.steps-note strong {
  font-weight: 500;
  font-size: clamp(0.78rem, 0.88vw, 0.9rem);
  color: var(--gold-deep);
}

.steps-note span {
  font-size: clamp(0.61rem, 0.72vw, 0.68rem);
  line-height: 1.16;
  color: var(--ink);
}

.footer-line p {
  margin: 0;
  font-size: clamp(0.72rem, 0.9vw, 0.86rem);
  color: var(--muted);
}

@media (max-width: 900px) {
  body {
    overflow: auto;
    background-size: auto 100vh;
  }

  .foundry-page {
    min-height: 100svh;
  }

  .letter-sheet {
    width: min(720px, 94vw);
    min-height: calc(100svh - 1.4rem);
    grid-template-rows: auto;
  }

  .letter-heart {
    right: 1rem;
  }

  .door-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .door:nth-child(2n)::after {
    content: none;
  }

  .door:nth-child(4n)::after {
    content: "";
  }

  .door:nth-child(8)::after {
    content: none;
  }

  .steps-note {
    width: min(620px, 92%);
  }

  .steps-note ol {
    grid-template-columns: 1fr;
  }

  .steps-note li {
    border-left: 0;
    border-top: 1px solid rgba(117, 79, 39, 0.17);
  }

  .steps-note li:first-child {
    border-top: 0;
  }
}

@media (max-width: 480px) {
  .letter-sheet {
    padding: 1rem;
  }

  h1 {
    font-size: clamp(2.45rem, 15vw, 3.6rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
