/* ============================================================
   TUMS — Message page  
   ============================================================ */

.msg-page {
  --m-ink:       #0d1a2b;
  --m-ink-2:     #16273c;
  --m-ink-soft:  #4b5c73;
  --m-muted:     #8794a5;
  --m-gold:      #b98f45;
  --m-gold-2:    #d9b877;
  --m-gold-3:    #f0dfb5;
  --m-cream:     #f7f3ec;
  --m-cream-2:   #efe9dd;
  --m-white:     #ffffff;
  --m-line:      rgba(13,26,43,.08);
  --m-line-2:    rgba(13,26,43,.16);
  --m-radius:    22px;
  --m-radius-sm: 14px;
  --m-shadow:    0 40px 80px -46px rgba(13,26,43,.45);
  --m-shadow-sm: 0 16px 34px -20px rgba(13,26,43,.30);
  --m-ease:      cubic-bezier(.22,.8,.28,1);
  --m-serif:     Georgia, "Times New Roman", "Playfair Display", serif;

  position: relative;
  background: var(--m-cream);
  color: var(--m-ink);
  overflow: clip;
  isolation: isolate;
  padding: clamp(48px, 6vw, 88px) 0;
}

.msg-page::before,
.msg-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(70px);
  opacity: .5;
}
.msg-page::before {
  width: 640px; height: 640px;
  top: -220px; left: -200px;
  background: radial-gradient(circle, rgba(185,143,69,.55), transparent 65%);
}
.msg-page::after {
  width: 760px; height: 760px;
  bottom: -300px; right: -240px;
  background: radial-gradient(circle, rgba(23,46,80,.28), transparent 68%);
}

/* ============================================================
   Shell (centered, max 1180)
   ============================================================ */
.msg-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
}

/* ============================================================
   Card — the split shell
   ============================================================ */
.msg-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .74fr) minmax(0, 1.26fr);
  gap: clamp(26px, 3.4vw, 52px);

  background: var(--m-white);
  border: 1px solid var(--m-line);
  border-radius: var(--m-radius);
  padding: clamp(26px, 3.4vw, 48px);
  box-shadow: var(--m-shadow);
  overflow: hidden;
}
.msg-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg,
    var(--m-gold) 0%,
    var(--m-gold-2) 35%,
    transparent 70%);
}

/* top-right flourish */
.msg-flourish {
  position: absolute;
  top: 18px; right: 18px;
  width: 44px; height: 44px;
  pointer-events: none;
  opacity: .5;
  background:
    radial-gradient(circle at 100% 0, var(--m-gold-3) 0 6px, transparent 7px),
    radial-gradient(circle at 100% 0, var(--m-gold-2) 0 12px, transparent 13px);
  border-top-right-radius: var(--m-radius);
}

/* empty state */
.msg-card--empty {
  grid-template-columns: 1fr;
  text-align: center;
  padding: clamp(40px, 5vw, 70px);
}

/* ============================================================
   Aside — portrait + identity
   ============================================================ */
.msg-aside {
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-self: start;
  position: sticky;
  top: 24px;
}

.msg-portrait {
  margin: 0;
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 46vh;
  border-radius: var(--m-radius-sm);
  overflow: hidden;
  background: var(--m-cream-2);
  box-shadow: var(--m-shadow-sm);
}
.msg-portrait img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  display: block;
}
.msg-portrait::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(13,26,43,0) 55%,
    rgba(13,26,43,.42) 100%);
  pointer-events: none;
}
.msg-portrait--empty {
  display: grid; place-items: center;
}
.msg-portrait-ph {
  font-size: 64px;
  color: var(--m-gold);
  opacity: .55;
}

.msg-badge {
  position: absolute;
  left: 14px; bottom: 14px;
  z-index: 2;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(247,243,236,.96);
  display: grid; place-items: center;
  color: var(--m-gold);
  font-size: 15px;
  box-shadow: 0 12px 24px -10px rgba(0,0,0,.55);
  border: 1px solid rgba(185,143,69,.55);
}

.msg-id {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--m-radius-sm);
  background: linear-gradient(160deg, var(--m-cream) 0%, #fff 100%);
  border: 1px solid var(--m-line);
}
.msg-id-k {
  font: 600 10px/1 system-ui, sans-serif;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--m-gold);
  margin-bottom: 4px;
}
.msg-id-name {
  font-family: var(--m-serif);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.3;
  color: var(--m-ink);
}
.msg-id-role {
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--m-muted);
  font-style: normal;
}

/* ============================================================
   Main — headline + 60vh scroll + footer
   ============================================================ */
.msg-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.msg-head { margin-bottom: 22px; }

.msg-eyebrow {
  display: inline-block;
  font: 600 10.5px/1 system-ui, sans-serif;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--m-gold);
  margin-bottom: 14px;
}
.msg-eyebrow--num {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.msg-eyebrow-badge {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(185,143,69,.14);
  font-family: var(--m-serif);
  font-style: italic;
  font-size: 11.5px;
  letter-spacing: 0;
  color: var(--m-gold);
}

.msg-title {
  margin: 0;
  font-family: var(--m-serif);
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 38px);
  line-height: 1.14;
  letter-spacing: -.02em;
  color: var(--m-ink);
}
.msg-title em {
  font-style: italic;
  color: var(--m-gold);
}

.msg-lede {
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--m-ink-soft);
}

/* ============================================================
   THE 60vh SCROLL REGION
   ============================================================ */
.msg-scroll {
  position: relative;
  height: 60vh;
  min-height: 320px;
  max-height: 720px;

  padding: 6px 22px 30px 0;
  overflow-y: auto;
  overflow-x: hidden;

  /* nicer scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(185,143,69,.45) transparent;
  scroll-behavior: smooth;

  /* mask bottom edge to hint at more */
  -webkit-mask-image: linear-gradient(180deg,
    #000 0,
    #000 calc(100% - 48px),
    transparent 100%);
          mask-image: linear-gradient(180deg,
    #000 0,
    #000 calc(100% - 48px),
    transparent 100%);

  /* focus ring when tabbed to */
  outline: none;
}
.msg-scroll:focus-visible {
  outline: 2px solid var(--m-gold);
  outline-offset: 6px;
  border-radius: 8px;
}
.msg-scroll::-webkit-scrollbar { width: 8px; }
.msg-scroll::-webkit-scrollbar-track { background: transparent; }
.msg-scroll::-webkit-scrollbar-thumb {
  background: rgba(185,143,69,.35);
  border-radius: 999px;
}
.msg-scroll::-webkit-scrollbar-thumb:hover { background: rgba(185,143,69,.65); }

.msg-scroll p {
  margin: 0 0 1.1em;
  font-size: clamp(14.5px, 1vw, 16px);
  line-height: 1.9;
  color: var(--m-ink-soft);
}
.msg-scroll p:first-child::first-letter {
  font-family: var(--m-serif);
  font-size: 3.2em;
  line-height: .9;
  float: left;
  padding: .08em .12em .05em 0;
  color: var(--m-gold);
  font-weight: 500;
}
.msg-empty {
  font-style: italic;
  color: var(--m-muted);
}

/* ---------- signature inside the scroll ---------- */
.msg-sign {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--m-line);
}
.msg-sign-line {
  width: 44px; height: 2px;
  background: linear-gradient(90deg, var(--m-gold), var(--m-gold-2));
  border-radius: 2px;
  margin-bottom: 12px;
}
.msg-sign strong {
  font: 600 15px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--m-ink);
}
.msg-sign span {
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--m-muted);
}

/* ============================================================
   Footer row
   ============================================================ */
.msg-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;

  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--m-line);
}

.msg-back,
.msg-alt {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 999px;
  font: 600 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background-color .3s var(--m-ease),
              color .3s var(--m-ease),
              border-color .3s var(--m-ease),
              transform .3s var(--m-ease);
}
.msg-back {
  background: var(--m-ink);
  color: var(--m-white) !important;
  border: 1px solid var(--m-ink);
}
.msg-back:hover {
  background: var(--m-gold);
  border-color: var(--m-gold);
  transform: translateX(-2px);
}
.msg-alt {
  background: transparent;
  color: var(--m-ink) !important;
  border: 1px solid var(--m-line-2);
}
.msg-alt:hover {
  border-color: var(--m-gold);
  color: var(--m-gold) !important;
  transform: translateX(2px);
}

/* ============================================================
   Empty state (404)
   ============================================================ */
.msg-card--empty .msg-eyebrow { display: block; margin-bottom: 14px; }
.msg-card--empty .msg-title { margin-bottom: 14px; }
.msg-card--empty .msg-lede { margin: 0 auto 22px; max-width: 44ch; }
.msg-card--empty .msg-back { display: inline-flex; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .msg-card {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 32px;
  }
}

@media (max-width: 820px) {
  .msg-card {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .msg-aside { position: static; }
  .msg-portrait { aspect-ratio: 4 / 3; max-height: none; }

  /* on mobile, don't force 60vh scroll — let it flow */
  .msg-scroll {
    height: auto;
    max-height: none;
    padding-right: 0;
    -webkit-mask-image: none;
            mask-image: none;
  }
}

@media (max-width: 520px) {
  .msg-card { padding: 22px 18px 24px; border-radius: var(--m-radius-sm); }
  .msg-flourish { top: 12px; right: 12px; width: 32px; height: 32px; }
  .msg-title { font-size: clamp(20px, 6vw, 26px); }
  .msg-badge { width: 38px; height: 38px; font-size: 13px; }
  .msg-scroll p:first-child::first-letter { font-size: 2.6em; }

  .msg-foot { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .msg-back, .msg-alt, .msg-scroll { transition: none; scroll-behavior: auto; }
}