/* Open Later — midnight postal service.
   Palette ported exactly from the live production build:
   navy #0c1748, cream #f3ecd9/#f6f0df, terracotta #b35d38, postmark #d19662. */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100svh;
}

body {
  background: #0c1748;
  color: #f6f0df;
  padding: 28px;
  font-family: Georgia, "Times New Roman", serif;
}

button {
  font: inherit;
  cursor: pointer;
}

.postal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-block: 1px solid #7380ad;
  padding: 14px 0;
  font: 600 0.72rem/1.2 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.18em;
}

.letter-desk {
  max-width: 1180px;
  margin: 8vh auto;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 8vw;
  align-items: start;
}

.letter-intro p {
  max-width: 42ch;
  color: #bbc2db;
  line-height: 1.65;
}

.letter-intro .kicker,
.postmark {
  font: 600 0.72rem ui-monospace, monospace;
  letter-spacing: 0.16em;
  color: #d19662;
  margin: 0 0 8px;
}

.letter-intro h1 {
  font-size: clamp(3rem, 6.8vw, 7.2rem);
  line-height: 0.88;
  letter-spacing: -0.06em;
  margin: 24px 0;
}

.letter-sheet,
.sealed-panel,
.opened-letter {
  background: #f3ecd9;
  color: #17204b;
  padding: clamp(28px, 5vw, 70px);
  box-shadow: 0 40px 100px #050b25;
  position: relative;
}

.letter-sheet::before {
  content: "";
  position: absolute;
  inset: 15px;
  border: 1px solid #c7baa0;
  pointer-events: none;
}

.letter-sheet > label {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.letter-sheet textarea {
  display: block;
  width: 100%;
  min-height: 330px;
  border: 0;
  border-bottom: 1px solid #b3a68d;
  background: repeating-linear-gradient(transparent 0 39px, #ded3bc 40px);
  padding: 16px 0;
  resize: vertical;
  font: 1.25rem/40px Georgia, serif;
  color: #17204b;
  outline: none;
}

.letter-meta {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-top: 26px;
  font: 600 0.7rem ui-monospace, monospace;
  letter-spacing: 0.08em;
}

.letter-meta label {
  display: grid;
  gap: 8px;
}

.letter-meta input,
.sealed-panel input {
  border: 1px solid #96886d;
  background: #fffaf0;
  padding: 12px;
  font: inherit;
  width: 100%;
}

.seal-button {
  display: block;
  width: 100%;
  margin-top: 28px;
  border: 0;
  background: #b35d38;
  color: #fff;
  padding: 17px;
  font: 700 0.76rem ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.seal-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.sealed-panel {
  border: 12px solid #be6845;
}

.sealed-panel h2 {
  font-size: 2.4rem;
  margin: 0 0 20px;
}

.sealed-panel label {
  display: grid;
  gap: 8px;
  font: 600 0.72rem ui-monospace, monospace;
}

.envelope {
  aspect-ratio: 1.8;
  display: grid;
  place-items: center;
  border: 2px solid #7e321d;
  background:
    linear-gradient(30deg, transparent 49%, #bf6b48 50%, transparent 51%),
    linear-gradient(-30deg, transparent 49%, #a95336 50%, transparent 51%);
  color: #7e321d;
  font: 700 1rem ui-monospace, monospace;
  letter-spacing: 0.2em;
  margin-bottom: 20px;
}

.postal-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.postal-actions button {
  flex: 1;
  border: 1px solid #17204b;
  background: transparent;
  color: #17204b;
  padding: 12px;
}

.status-line {
  font: 500 0.75rem ui-monospace, monospace;
  color: #b35d38;
  min-height: 1.2em;
  margin-top: 10px;
}

.opened-letter {
  max-width: 760px;
  margin: 12vh auto;
}

.opened-letter h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  margin: 0.4em 0;
}

.opened-letter article {
  white-space: pre-wrap;
  font-size: 1.3rem;
  line-height: 1.8;
}

.hidden {
  display: none !important;
}

@media (max-width: 780px) {
  .letter-desk {
    grid-template-columns: 1fr;
    margin-top: 5vh;
  }
  .letter-intro h1 {
    font-size: 3.8rem;
  }
  .letter-sheet textarea {
    min-height: 260px;
  }
  .letter-meta {
    display: grid;
  }
  .postal-actions {
    flex-direction: column;
  }
}
