/**
 * Appily Fortyeight — Inbox Relay (contact)
 * Layout: dark hero → topic strip → compose-first form → channel grid → ping links
 */

.page-contact-relay {
  --rl-ink: #0C1A14;
  --rl-forest: #163528;
  --rl-lime: #C6F542;
  --rl-mint: #3DDC97;
  --rl-fog: #EAF6EF;
  --rl-mist: #F3FBF6;
  --rl-muted: #5F7468;
  --rl-line: rgba(12, 26, 20, 0.1);
  --rl-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rl-shadow: 0 22px 48px rgba(12, 26, 20, 0.12);
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(198, 245, 66, 0.12), transparent 55%),
    radial-gradient(700px 380px at 0% 100%, rgba(61, 220, 151, 0.09), transparent 50%),
    var(--rl-mist);
}

.page-contact-relay .page-main { padding-top: 0; }
.a48-relay { padding-bottom: 3.25rem; }

.a48-relay-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .65s var(--rl-ease) calc(var(--a48-delay, 0) * .08s),
              transform .65s var(--rl-ease) calc(var(--a48-delay, 0) * .08s);
}
.a48-relay-reveal.is-visible { opacity: 1; transform: none; }

/* ── Hero ── */
.a48-relay-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: clamp(2.4rem, 5.5vw, 3.5rem) 0 clamp(2rem, 4vw, 2.6rem);
  background: var(--rl-ink);
}

.a48-relay-hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 55% 70% at 18% 28%, rgba(198, 245, 66, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 55% at 90% 78%, rgba(61, 220, 151, 0.16), transparent 50%),
    linear-gradient(145deg, #0C1A14, #163528 55%, #0F241C);
  animation: rlGlow 14s ease-in-out infinite alternate;
}
@keyframes rlGlow {
  to { filter: saturate(1.12) hue-rotate(-7deg); }
}

.a48-relay-hero-wave {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -35%;
  height: 70%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(198, 245, 66, .1), transparent 60%);
  animation: rlWave 10s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes rlWave {
  to { transform: translateY(-12px) scale(1.04); }
}

.a48-relay-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr auto;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.a48-relay-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.a48-relay-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid rgba(198, 245, 66, .45);
  background: rgba(198, 245, 66, .1);
  color: var(--rl-lime);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.a48-relay-chip--soft {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .75);
}

.a48-relay-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rl-lime);
  box-shadow: 0 0 0 0 rgba(198, 245, 66, .55);
  animation: rlPing 1.8s ease-out infinite;
}
@keyframes rlPing {
  70%, 100% { box-shadow: 0 0 0 10px transparent; }
}

.a48-relay-hero h1 {
  margin: 0 0 .75rem;
  font-family: var(--a48-font-serif, Georgia, serif);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -.03em;
}
.a48-relay-hero h1 span {
  background: linear-gradient(90deg, var(--rl-lime), var(--rl-mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.a48-relay-lede {
  margin: 0;
  max-width: 44ch;
  color: rgba(234, 246, 239, .78);
  font-size: .95rem;
  line-height: 1.55;
}

.a48-relay-hours {
  min-width: min(100%, 240px);
  padding: 1.15rem 1.35rem;
  border-radius: 22px;
  background: rgba(12, 26, 20, .55);
  border: 1px solid rgba(198, 245, 66, .28);
  backdrop-filter: blur(6px);
  text-align: center;
}
.a48-relay-hours span {
  display: block;
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(234, 246, 239, .65);
  margin-bottom: .4rem;
}
.a48-relay-hours strong {
  display: block;
  font-size: .95rem;
  line-height: 1.4;
  color: var(--rl-lime);
  font-weight: 700;
}

/* Stage */
.a48-relay-stage {
  padding: clamp(1.35rem, 3vw, 2rem) 0 0;
}

/* Topics */
.a48-relay-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
  padding: .55rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--rl-line);
  box-shadow: var(--rl-shadow);
}
.a48-relay-topics-label {
  padding: 0 .65rem 0 .85rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rl-muted);
}
.a48-relay-topic {
  padding: .55rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--rl-fog);
  color: var(--rl-forest);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s var(--rl-ease);
}
.a48-relay-topic:hover { transform: translateY(-1px); }
.a48-relay-topic.is-active {
  background: var(--rl-ink);
  color: var(--rl-lime);
}

/* Compose card — form first, centered max width */
.a48-relay-compose {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  padding: clamp(1.25rem, 2.8vw, 1.85rem);
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--rl-line);
  box-shadow: var(--rl-shadow);
}

.a48-relay-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rl-line);
}
.a48-relay-compose-head h2 {
  margin: .35rem 0 .25rem;
  font-family: var(--a48-font-serif, Georgia, serif);
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  color: var(--rl-ink);
  letter-spacing: -.02em;
}
.a48-relay-compose-head p {
  margin: 0;
  color: var(--rl-muted);
  font-size: .88rem;
}

.a48-relay-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--rl-forest);
}

.a48-relay-ref {
  flex-shrink: 0;
  padding: .4rem .75rem;
  border-radius: 999px;
  background: var(--rl-ink);
  color: var(--rl-lime);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.a48-relay-notice {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  margin-bottom: 1.15rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
}
.a48-relay-notice.is-success {
  background: rgba(198, 245, 66, .16);
  border: 1px solid rgba(198, 245, 66, .4);
  color: var(--rl-ink);
}
.a48-relay-notice.is-error {
  background: #fff4e8;
  border: 1px solid rgba(180, 100, 20, .25);
  color: #7a3e0c;
}
.a48-relay-notice-mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: grid;
  place-content: center;
  flex-shrink: 0;
  font-weight: 800;
  background: var(--rl-ink);
  color: var(--rl-lime);
  font-size: .85rem;
}
.a48-relay-notice.is-success .a48-relay-notice-mark::after {
  content: "";
  width: .45rem;
  height: .75rem;
  border: solid var(--rl-lime);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.a48-relay-notice.is-error .a48-relay-notice-mark {
  background: #c45c26;
  color: #fff;
}
.a48-relay-notice strong {
  display: block;
  margin-bottom: .2rem;
}
.a48-relay-notice p {
  margin: 0;
  font-size: .88rem;
  opacity: .9;
}

.a48-relay-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .95rem;
  margin-bottom: 1.15rem;
}
.a48-relay-field--wide { grid-column: 1 / -1; }

.a48-relay-field {
  position: relative;
  display: grid;
  gap: .35rem;
  padding: .95rem 1rem .95rem 2.75rem;
  border-radius: 16px;
  background: var(--rl-mist);
  border: 1px solid var(--rl-line);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.a48-relay-field:focus-within {
  background: #fff;
  border-color: rgba(61, 220, 151, .5);
  box-shadow: 0 0 0 3px rgba(198, 245, 66, .2);
}
.a48-relay-field-num {
  position: absolute;
  left: .85rem;
  top: 1.05rem;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--rl-forest);
  opacity: .55;
}
.a48-relay-field > span:not(.a48-relay-field-num):not(.a48-relay-char) {
  font-size: .75rem;
  font-weight: 700;
  color: var(--rl-forest);
}
.a48-relay-field input,
.a48-relay-field textarea {
  width: 100%;
  border: 0;
  background: transparent;
  padding: .15rem 0 0;
  font: inherit;
  color: var(--rl-ink);
  resize: vertical;
}
.a48-relay-field input:focus,
.a48-relay-field textarea:focus { outline: none; }
.a48-relay-char {
  font-size: .72rem;
  color: var(--rl-muted);
  justify-self: end;
}

/* Buttons */
.a48-relay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .95rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  font-size: .92rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--rl-ease), background .2s ease;
}
.a48-relay-btn:hover { transform: translateY(-1px); }
.a48-relay-btn--lime {
  background: var(--rl-lime);
  color: var(--rl-ink);
  width: 100%;
}
.a48-relay-btn--lime:hover { background: #d4ff5c; }

/* Channels — under form, not left rail */
.a48-relay-channels {
  margin-bottom: 1.35rem;
  padding: clamp(1.15rem, 2.5vw, 1.55rem);
  border-radius: 28px;
  background: var(--rl-ink);
  color: #fff;
  box-shadow: var(--rl-shadow);
  position: relative;
  overflow: hidden;
}
.a48-relay-channels::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 100% 0%, rgba(198, 245, 66, .14), transparent 50%);
  pointer-events: none;
}
.a48-relay-channels-head {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
}
.a48-relay-channels-head .a48-relay-tag { color: var(--rl-lime); }
.a48-relay-channels-head h2 {
  margin: .35rem 0 0;
  font-family: var(--a48-font-serif, Georgia, serif);
  font-size: 1.35rem;
  letter-spacing: -.02em;
}

.a48-relay-channel-grid {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
.a48-relay-channel {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  transition: border-color .2s ease, background .2s ease;
}
.a48-relay-channel:hover {
  border-color: rgba(198, 245, 66, .35);
  background: rgba(198, 245, 66, .08);
}
.a48-relay-channel--wide { grid-column: span 2; }
.a48-relay-channel-code {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: grid;
  place-content: center;
  flex-shrink: 0;
  background: rgba(198, 245, 66, .14);
  color: var(--rl-lime);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.a48-relay-channel strong {
  display: block;
  margin-bottom: .2rem;
  font-size: .9rem;
}
.a48-relay-channel p {
  margin: 0;
  font-size: .84rem;
  color: rgba(234, 246, 239, .72);
  line-height: 1.4;
  word-break: break-word;
}
.a48-relay-channel a {
  color: var(--rl-lime);
  text-decoration: none;
}
.a48-relay-channel a:hover { text-decoration: underline; }

/* Pings */
.a48-relay-pings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem;
}
.a48-relay-ping {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .9rem 1rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--rl-line);
  text-decoration: none;
  color: var(--rl-ink);
  transition: transform .2s var(--rl-ease), border-color .2s ease, box-shadow .2s ease;
}
.a48-relay-ping:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 220, 151, .45);
  box-shadow: 0 12px 28px rgba(12, 26, 20, .08);
}
.a48-relay-ping span {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  display: grid;
  place-content: center;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .06em;
  background: var(--rl-ink);
  color: var(--rl-lime);
  flex-shrink: 0;
}
.a48-relay-ping strong { font-size: .9rem; }

/* Responsive */
@media (max-width: 900px) {
  .a48-relay-hero-inner { grid-template-columns: 1fr; text-align: center; }
  .a48-relay-hero-meta { justify-content: center; }
  .a48-relay-lede { margin-inline: auto; }
  .a48-relay-hours { margin-inline: auto; }
  .a48-relay-topics { border-radius: 22px; justify-content: center; }
  .a48-relay-channel-grid { grid-template-columns: 1fr 1fr; }
  .a48-relay-channel--wide { grid-column: span 2; }
  .a48-relay-pings { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .a48-relay-fields { grid-template-columns: 1fr; }
  .a48-relay-compose-head { flex-direction: column; }
  .a48-relay-channel-grid { grid-template-columns: 1fr; }
  .a48-relay-channel--wide { grid-column: auto; }
  .a48-relay-pings { grid-template-columns: 1fr; }
  .a48-relay-topics-label { width: 100%; padding: .35rem .65rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .a48-relay-hero-glow,
  .a48-relay-hero-wave,
  .a48-relay-live-dot { animation: none; }
  .a48-relay-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
