/* Letter Slot — Ember Terrarium contact
   Cormorant Garamond + Work Sans — distinct from help/account */

body.mb-mail *,
body.mb-mail *::before,
body.mb-mail *::after { box-sizing: border-box; }

body.mb-mail {
  --void: #1C110D;
  --soil: #2A1A14;
  --glass: rgba(48, 28, 20, 0.58);
  --mist: #F6EDE4;
  --mute: #C4A992;
  --clay: #E07A5F;
  --moss: #7BAF7B;
  --honey: #F0C27A;
  --line: rgba(255, 214, 170, 0.18);
  --paper: #e8dcc8;
  --ink: #241610;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  margin: 0;
  min-height: 100vh;
  color: var(--mist);
  font-family: 'Work Sans', system-ui, sans-serif;
  background-color: var(--void);
  background-image:
    radial-gradient(ellipse 48% 38% at 6% 8%, rgba(224, 122, 95, 0.18), transparent 55%),
    radial-gradient(ellipse 42% 32% at 92% 78%, rgba(240, 194, 122, 0.1), transparent 50%),
    radial-gradient(ellipse 40% 28% at 50% 100%, rgba(123, 175, 123, 0.06), transparent 50%);
  -webkit-font-smoothing: antialiased;
}

.mb-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mb-root > .page-main {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.mb-stage {
  flex: 1;
  width: min(100% - 2rem, 1100px);
  margin: 0 auto;
  padding: 1rem 0 2.2rem;
}

/* —— Mast —— */
.mb-mast {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.mb-mast-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--mist);
  text-decoration: none;
  min-width: 0;
}

.mb-mast-mark em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  padding: 0.38rem 0.5rem;
  border: 1px dashed var(--honey);
  border-radius: 0.3rem;
  background: var(--glass);
}

.mb-mast-mark strong {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.15rem, 2.4vw, 1.3rem);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mb-mast-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.28rem;
  padding: 0.28rem;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.mb-mast-nav a {
  color: #EADFD4;
  text-decoration: none;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.mb-mast-nav a.is-on,
.mb-mast-nav a:hover {
  background: var(--clay);
  color: var(--void);
}

.mb-mast-bag {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
}

.mb-mast-bag.has-items {
  background: rgba(224, 122, 95, 0.22);
}

.mb-mast-bag em {
  font-style: normal;
  min-width: 1.15rem;
  text-align: center;
  background: var(--void);
  color: var(--honey);
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
}

.mb-split {
  display: grid;
  grid-template-columns: minmax(15rem, 0.82fr) 1.18fr;
  gap: 1.15rem;
  align-items: stretch;
}

.mb-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--honey);
  font-weight: 700;
}

.mb-slot {
  padding: 1.25rem 1.2rem 1.3rem;
  border-radius: 1.6rem;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.mb-slot h1 {
  margin: 0 0 0.45rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.mb-lede {
  margin: 0 0 1.15rem;
  color: var(--mute);
  max-width: 32ch;
  line-height: 1.55;
  font-size: 1rem;
}

/* Letterbox */
.mb-box {
  position: relative;
  height: 14.5rem;
  margin-bottom: 1.15rem;
  border-radius: 1.35rem;
  background: linear-gradient(180deg, #3a241c, #24140f);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 5px rgba(240, 194, 122, 0.08);
  display: grid;
  place-items: center;
}

.mb-slit {
  width: 1.1rem;
  height: 76%;
  border-radius: 999px;
  background: #0d0806;
  box-shadow:
    inset 0 0 0 2px #c9a15a,
    0 0 0 5px rgba(240, 194, 122, 0.1),
    inset 0 10px 18px rgba(0, 0, 0, 0.65);
  position: relative;
}

.mb-slit span {
  position: absolute;
  inset: 12% 28%;
  background: linear-gradient(180deg, transparent, rgba(246, 237, 228, 0.08), transparent);
}

.mb-box-cap {
  position: absolute;
  bottom: 0.7rem;
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--honey);
  font-weight: 700;
}

.mb-stamps {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.mb-stamp {
  padding: 0.8rem 0.9rem;
  border-radius: 0.45rem;
  border: 2px dashed rgba(240, 194, 122, 0.32);
  background: rgba(28, 17, 13, 0.35);
  transform: rotate(-0.9deg);
}

.mb-stamp:nth-child(2) { transform: rotate(0.9deg); }
.mb-stamp:nth-child(3) { transform: rotate(-0.4deg); }

.mb-stamp span {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--clay);
  font-weight: 800;
}

.mb-stamp h2 {
  margin: 0.15rem 0 0.3rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.mb-stamp p {
  margin: 0;
  color: var(--mute);
  font-size: 0.88rem;
  line-height: 1.4;
}

.mb-channels {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mb-channels a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  background: rgba(28, 17, 13, 0.4);
  border: 1px solid var(--line);
  color: var(--mist);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}

.mb-channels i {
  font-style: normal;
  color: var(--honey);
}

.mb-channels a:hover {
  border-color: var(--clay);
  background: rgba(224, 122, 95, 0.12);
  color: var(--mist);
}

/* Folded letter */
.mb-letter {
  position: relative;
  padding: 1.65rem 1.55rem 1.45rem;
  border-radius: 0.5rem 1.55rem 0.55rem 1.35rem;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(224, 122, 95, 0.05) 42% 43%, transparent 43%),
    linear-gradient(180deg, #efe2cf, var(--paper));
  color: var(--ink);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(90, 50, 30, 0.08);
  overflow: hidden;
  animation: mb-rise 0.5s var(--ease);
}

@keyframes mb-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.mb-fold {
  position: absolute;
  top: 0;
  right: 0;
  width: 4.2rem;
  height: 4.2rem;
  background: linear-gradient(225deg, #dfc9a8 50%, transparent 51%);
  box-shadow: -6px 6px 12px rgba(80, 40, 20, 0.08);
}

.mb-crease {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 49.6%, rgba(90, 50, 30, 0.09) 50%, transparent 50.4%),
    linear-gradient(90deg, transparent 49.6%, rgba(90, 50, 30, 0.06) 50%, transparent 50.4%);
  pointer-events: none;
}

.mb-letter .mb-kicker { color: #8f5640; }

.mb-letter h2 {
  margin: 0 0 1rem;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  position: relative;
}

.mb-notice {
  position: relative;
  padding: 0.8rem 0.9rem;
  border-radius: 0.7rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.mb-notice-ok {
  background: rgba(123, 175, 123, 0.22);
  color: #2a4f2e;
  border: 1px solid rgba(123, 175, 123, 0.35);
}

.mb-notice-bad {
  background: rgba(224, 122, 95, 0.18);
  color: #7a2e22;
  border: 1px solid rgba(224, 122, 95, 0.3);
}

.mb-form {
  display: grid;
  gap: 0.9rem;
  position: relative;
}

.mb-form[hidden] { display: none; }

.mb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.mb-field { display: grid; gap: 0.3rem; }

.mb-field span {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a523c;
  font-weight: 700;
}

.mb-field em {
  font-style: italic;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.mb-field input,
.mb-field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid rgba(90, 50, 30, 0.22);
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0.5rem 0;
  resize: vertical;
}

.mb-field input::placeholder,
.mb-field textarea::placeholder {
  color: rgba(90, 50, 30, 0.4);
}

.mb-field input:focus,
.mb-field textarea:focus {
  outline: none;
  border-bottom-color: var(--clay);
}

.mb-sign {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.mb-sign p {
  margin: 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
}

.mb-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1.2rem;
  background: linear-gradient(135deg, var(--clay), #c46248);
  color: var(--void);
  font-family: 'Work Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s;
}

.mb-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.mb-direct {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.15rem;
}

.mb-direct a {
  color: #7a523c;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}
.mb-direct a:hover { color: var(--clay); }

.mb-foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.7rem;
  width: min(100% - 2rem, 1100px);
  margin: 0 auto 1.3rem;
  padding: 0.95rem 1.15rem;
  border-radius: 1.25rem;
  background: var(--glass);
  border: 1px solid var(--line);
  color: var(--mute);
  font-size: 0.86rem;
}

.mb-foot a {
  color: var(--honey);
  text-decoration: none;
  font-weight: 700;
}
.mb-foot a:hover { color: var(--clay); }

@media (max-width: 900px) {
  .mb-split { grid-template-columns: 1fr; }

  .mb-box { height: 9.5rem; }

  .mb-slit {
    width: 70%;
    height: 1.1rem;
  }
}

@media (max-width: 640px) {
  .mb-stage { width: min(100% - 1.4rem, 1100px); padding-top: 0.75rem; }

  .mb-mast {
    flex-direction: column;
    align-items: stretch;
  }

  .mb-mast-nav {
    border-radius: 1.15rem;
    justify-content: flex-start;
  }

  .mb-slot { padding: 1.1rem 1.05rem 1.15rem; border-radius: 1.4rem; }

  .mb-row { grid-template-columns: 1fr; }

  .mb-sign {
    flex-direction: column;
    align-items: stretch;
  }

  .mb-btn { width: 100%; }

  .mb-letter {
    padding: 1.3rem 1.15rem 1.2rem;
    border-radius: 0.5rem 1.3rem 0.55rem 1.2rem;
  }

  .mb-stamp { transform: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .mb-letter {
    animation: none !important;
  }
  .mb-stamp { transform: none; }
  .mb-btn { transition: none !important; }
}
