@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700&family=Work+Sans:wght@400;500;600&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg-1: #0a1a18;
  --bg-2: #0f2623;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(17, 24, 23, 0.9);
  --border: rgba(255, 255, 255, 0.18);
  --text: #f6f4ef;
  --muted: #b9c2b8;
  --accent: #ff8b3d;
  --accent-2: #46d7c6;
  --shadow: rgba(6, 10, 9, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Work Sans', system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 900px at 85% -10%, rgba(70, 215, 198, 0.25), transparent),
    radial-gradient(900px 600px at -10% 20%, rgba(255, 139, 61, 0.2), transparent),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
  position: relative;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><circle cx="1" cy="1" r="1" fill="%23ffffff" fill-opacity="0.03"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.backdrop .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.4;
  mix-blend-mode: screen;
}

.backdrop .orb.one {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255, 139, 61, 0.65), transparent 70%);
  top: 8%;
  right: 6%;
}

.backdrop .orb.two {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(70, 215, 198, 0.55), transparent 70%);
  bottom: 12%;
  left: 8%;
}

.shell {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  align-items: center;
}

.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.6rem, 4vw, 3.6rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.badge,
.pill {
  font-family: 'Space Mono', ui-monospace, monospace;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.pill {
  background: rgba(70, 215, 198, 0.12);
  color: var(--accent-2);
  border-color: rgba(70, 215, 198, 0.4);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 20px 50px var(--shadow);
  backdrop-filter: blur(14px);
  animation: rise 0.6s ease both;
}

.panel:nth-child(2) {
  animation-delay: 0.1s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h2 {
  font-family: 'Fraunces', serif;
  margin: 0 0 14px;
  font-size: 1.4rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(8, 14, 13, 0.55);
  color: var(--text);
  font-family: 'Space Mono', ui-monospace, monospace;
}

input[readonly] {
  opacity: 0.9;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--accent);
  color: #1a1a1a;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: 1px solid var(--border);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.status {
  min-height: 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

.display {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid rgba(255, 139, 61, 0.25);
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.message-item {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: rgba(7, 12, 11, 0.6);
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
  animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-item:hover {
  border-color: var(--accent-2);
}

.message-item.active {
  border-color: var(--accent);
  background: rgba(255, 139, 61, 0.15);
}

.message-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.message-subject {
  font-weight: 600;
  margin-top: 6px;
}

.detail {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(5, 9, 8, 0.75);
}

.detail h3 {
  margin-top: 0;
  font-family: 'Fraunces', serif;
}

.detail pre {
  white-space: pre-wrap;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.9rem;
}

.inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.attachment-link {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(70, 215, 198, 0.12);
  border: 1px solid rgba(70, 215, 198, 0.3);
  color: var(--accent-2);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.attachment-link:hover {
  background: rgba(70, 215, 198, 0.22);
}

[data-detail-attachments],
[data-detail-actions] {
  margin-top: 16px;
}

footer {
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
