/* The parchment keeps its native 3:2 proportions. Size it in both axes. */
.journal-stage {
  --journal-top: clamp(4.25rem, 8svh, 5rem);
  --journal-bottom: clamp(2.5rem, 4.5svh, 3rem);
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: var(--journal-top) 2rem var(--journal-bottom);
  background: #513921 url('assets/cabin.png') center / cover no-repeat;
  color: #3d2b1d;
}

.journal-stage-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(118, 78, 36, .09), rgba(17, 14, 9, .7)),
    linear-gradient(90deg, rgba(16, 19, 13, .42), transparent 30%, transparent 70%, rgba(16, 19, 13, .42));
  backdrop-filter: blur(1.5px);
}

.journal-back, .journal-stage-note, .journal-caption { position: absolute; z-index: 3; }

.journal-back {
  top: 1rem;
  left: clamp(1.125rem, 4vw, 3.5rem);
  padding: .55rem .95rem;
  background: rgba(255, 244, 215, .96);
  color: #3d2b1d;
  font-weight: 600;
  line-height: var(--line-height-heading);
}

.journal-stage-note {
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff4d8;
  font: 500 var(--text-caption) / 1.45 var(--font-ui);
  letter-spacing: .075em;
  text-shadow: 0 2px 8px #211309;
}

.open-journal {
  position: relative;
  z-index: 2;
  width: min(91.25rem, 100%, max(45rem, calc((100svh - var(--journal-top) - var(--journal-bottom)) * 1.5)));
  aspect-ratio: 3 / 2;
  filter: drop-shadow(0 30px 30px rgba(8, 7, 3, .52));
  isolation: isolate;
}

.open-journal-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.journal-spread {
  position: absolute;
  z-index: 1;
  inset: 9.5% 9.5% 10%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8.5%;
}

.journal-page {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: .625rem .75rem .875rem;
  overflow: auto;
  scrollbar-width: thin;
}

.journal-page-left { padding-right: 1.125rem; }
.journal-page-right { padding-left: 1.125rem; }

.journal-kicker {
  margin: 0 0 .55rem;
  color: #6b4d30;
  font: 600 var(--text-caption) / 1.4 var(--font-ui);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.journal-kicker-right { text-align: right; }

.journal-page h1 {
  margin: 0 0 .2em;
  color: #352719;
  font-size: clamp(var(--text-heading), 3.7svh, 2.25rem);
  line-height: var(--line-height-heading);
  letter-spacing: .04em;
}

.journal-divider {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: .5rem 0 .65rem;
  color: #805c32;
}

.journal-divider::before,
.journal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(112, 80, 38, .45));
}

.journal-divider::after { transform: scaleX(-1); }

.journal-question {
  margin: 0;
  color: #49351e;
  font-size: var(--text-body-large);
  font-weight: 600;
  line-height: 1.45;
}

.emotion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .25rem .5rem;
  margin-top: .65rem;
}

.emotion-chip {
  position: relative;
  min-height: 2.625rem;
  border: 1px solid transparent;
  border-radius: .5rem;
  padding: .375rem .4rem;
  background: transparent;
  color: #4a3423;
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}

.emotion-chip span { display: inline-block; margin-right: .4em; filter: saturate(.72); }

.journal-page h2 {
  margin: clamp(.75rem, 2svh, 1.75rem) 0 .55rem;
  color: #43301d;
  font-size: clamp(1.5rem, 3svh, 1.75rem);
  font-weight: 600;
  line-height: var(--line-height-heading);
}

.journal-page-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .45rem .6rem;
  margin-top: .65rem;
  color: #60452e;
  font-size: var(--text-caption);
  line-height: 1.5;
}

.journal-finish {
  border: 1px solid rgba(62, 89, 44, .42);
  border-radius: .6rem;
  padding: .45rem .7rem;
  background: rgba(255, 248, 218, .42);
  color: #2c4c2b;
  font-size: var(--text-small);
  font-weight: 700;
  line-height: 1.35;
}

.journal-caption {
  bottom: .55rem;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 2rem);
  transform: translateX(-50%);
  margin: 0;
  color: #fff0cf;
  font: 400 var(--text-caption) / 1.5 var(--font-ui);
  text-align: center;
}

@media (min-width: 701px) and (max-width: 900px) {
  .journal-page h1 { font-size: 1.75rem; }
  .emotion-chip { font-size: var(--text-small); }
}

@media (max-width: 700px) {
  .journal-stage { display: block; padding: 4.125rem .8125rem 2rem; background-position: 51% center; }
  .journal-stage-note { display: none; }
  .journal-back { top: .75rem; left: .75rem; }
  .open-journal { width: 100%; aspect-ratio: auto; filter: drop-shadow(0 20px 25px rgba(8, 7, 3, .48)); }
  .open-journal-art { display: none; }
  .open-journal::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(68, 47, 25, .58);
    border-radius: 12px 10px 18px 8px;
    background: #e7c98e url('assets/journal/journal-open-botanical-edges-v1.png') center / auto 100% no-repeat;
    box-shadow: inset 0 0 35px rgba(108, 67, 24, .18);
  }
  .journal-spread { position: relative; inset: auto; display: block; padding: 2rem 1.625rem; }
  .journal-page { padding: 0; overflow: visible; }
  .journal-page-right { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(91, 62, 32, .32); }
  .journal-kicker-right { text-align: left; }
  .journal-question { font-size: var(--text-body); }
  .emotion-chip { font-size: var(--text-small); }
  .journal-page h2 { margin: .45rem 0 .65rem; }
  .journal-caption { position: relative; bottom: auto; left: auto; width: auto; max-width: none; transform: none; margin-top: 1rem; }
}
