:root {
  --paper: #f6f0e7;
  --canvas: #e4ded2;
  --ink: #182329;
  --muted: #5f6c6b;
  --teal: #0f7d71;
  --teal-deep: #0a544c;
  --copper: #c45d2f;
  --signal: #e0b34f;
  --card: rgba(255, 250, 242, 0.88);
  --card-strong: rgba(255, 248, 235, 0.96);
  --line: rgba(24, 35, 41, 0.1);
  --shadow: 0 24px 60px rgba(24, 35, 41, 0.14);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(196, 93, 47, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(15, 125, 113, 0.18), transparent 28%),
    linear-gradient(180deg, #f8f4ec 0%, #eee5d7 48%, #e4dbcf 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 35, 41, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 35, 41, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 80%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--teal), var(--teal-deep));
  color: #f8f4ec;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1.6rem;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topnav a,
.action-pill,
.inline-actions button {
  transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

.topnav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(24, 35, 41, 0.12);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.55);
}

.topnav a:hover,
.topnav a.is-active,
.action-pill:hover,
.inline-actions button:hover,
.primary:hover,
.secondary:hover {
  transform: translateY(-1px);
}

.topnav a.is-active,
.topnav a:hover {
  background: rgba(15, 125, 113, 0.11);
  border-color: rgba(15, 125, 113, 0.25);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 24px;
}

.content-column {
  display: grid;
  gap: 22px;
}

.card,
.preview-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.card::after,
.preview-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.16), transparent 40%);
}

.card {
  padding: 28px;
}

.hero {
  padding: 34px 30px;
}

.eyebrow,
.kicker,
.status-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--copper);
}

.hero h1,
.section-head h2,
.preview-meta h2 {
  margin: 10px 0 14px;
  font-family: Georgia, "Palatino Linotype", serif;
  line-height: 1.04;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 4.6rem);
  max-width: 12ch;
}

.hero-copy,
.context-note p,
.privacy-copy p,
.faq-list p,
.status-grid p {
  color: var(--muted);
  line-height: 1.58;
}

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

.action-pill,
.primary,
.secondary {
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
}

.action-pill,
.secondary {
  border: 1px solid rgba(24, 35, 41, 0.14);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink);
}

.primary {
  border: 1px solid transparent;
  background: linear-gradient(140deg, var(--teal), var(--teal-deep));
  color: #f8f4ec;
}

.status-grid,
.mail-grid,
.faq-list {
  display: grid;
  gap: 14px;
}

.status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
}

.status-grid article,
.faq-list article,
.context-note {
  border: 1px solid rgba(24, 35, 41, 0.08);
  border-radius: 20px;
  background: var(--card-strong);
}

.status-grid article {
  padding: 16px;
}

.status-grid strong,
.context-note h3,
.faq-list h3 {
  display: block;
  margin: 8px 0;
  font-size: 1.05rem;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(1.75rem, 2.3vw, 2.5rem);
}

.two-up {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.stacked-form {
  display: grid;
  gap: 14px;
}

.stacked-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(24, 35, 41, 0.16);
  border-radius: 16px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

textarea {
  resize: vertical;
  min-height: 180px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 125, 113, 0.26);
  outline-offset: 2px;
}

.context-note {
  padding: 18px;
}

.context-note ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.context-note.warm {
  background: linear-gradient(180deg, rgba(255, 245, 229, 0.95), rgba(255, 250, 241, 0.92));
}

.context-note.cool {
  background: linear-gradient(180deg, rgba(234, 247, 245, 0.95), rgba(248, 252, 251, 0.92));
}

.context-note.signal {
  background: linear-gradient(180deg, rgba(255, 246, 225, 0.95), rgba(255, 252, 245, 0.92));
}

.context-note.ink {
  background: linear-gradient(180deg, rgba(232, 239, 241, 0.95), rgba(250, 252, 252, 0.92));
}

.compact p {
  margin: 8px 0;
}

.mail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.faq-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.faq-list article {
  padding: 18px;
}

.preview-column {
  position: relative;
}

.preview-shell {
  position: sticky;
  top: 22px;
  padding: 22px;
}

.preview-meta {
  margin-bottom: 18px;
}

.preview-meta h2 {
  font-size: clamp(1.6rem, 2vw, 2.2rem);
}

.preview-card {
  min-height: 640px;
  border-radius: 22px;
  border: 1px solid rgba(24, 35, 41, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 240, 234, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.mail-preview,
#tool-preview-frame {
  width: 100%;
  height: 100%;
}

.mail-preview {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-height: 640px;
}

.mail-bar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(24, 35, 41, 0.08);
  font-size: 0.95rem;
}

.mail-bar.emphasis {
  background: rgba(15, 125, 113, 0.08);
  color: var(--teal-deep);
}

.mail-body {
  padding: 24px 20px;
  line-height: 1.64;
}

.mail-footnote {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(24, 35, 41, 0.14);
}

.translation-preview {
  margin-top: 22px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(15, 125, 113, 0.18);
  background: rgba(15, 125, 113, 0.06);
}

.translation-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

#translation-pair-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(10, 84, 76, 0.12);
  color: var(--teal-deep);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.translation-status {
  margin: 12px 0 14px;
  color: var(--muted);
}

.translation-result {
  margin: 10px 0 0;
  line-height: 1.6;
}

#tool-preview-frame {
  display: none;
  min-height: 640px;
  border: 0;
  background: #fff;
}

.is-iframe #tool-preview-frame {
  display: block;
}

.is-iframe #mail-preview {
  display: none;
}

.route-target.is-focused {
  border-color: rgba(15, 125, 113, 0.35);
  box-shadow: 0 24px 60px rgba(15, 125, 113, 0.13);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 550ms ease forwards;
}

.reveal:nth-child(2) { animation-delay: 70ms; }
.reveal:nth-child(3) { animation-delay: 120ms; }
.reveal:nth-child(4) { animation-delay: 170ms; }
.reveal:nth-child(5) { animation-delay: 220ms; }

.tool-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
}

.tool-card {
  padding: 26px;
}

.tool-card h1 {
  margin: 8px 0 10px;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(2rem, 3vw, 3rem);
}

.tool-subtitle {
  color: var(--muted);
  line-height: 1.58;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.tool-grid h2 {
  margin-top: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 1.3rem;
}

.tool-pane,
.tool-alert {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(24, 35, 41, 0.12);
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.tool-alert-error {
  border-color: rgba(196, 93, 47, 0.22);
  background: rgba(255, 245, 239, 0.92);
}

.tool-stack {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.tool-hint {
  color: var(--muted);
  line-height: 1.58;
}

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

@media (max-width: 1120px) {
  .layout,
  .two-up,
  .status-grid,
  .mail-grid,
  .faq-list,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .preview-shell {
    position: static;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 14px 34px;
  }

  .topbar,
  .hero-actions,
  .hero .status-grid,
  .mail-bar {
    flex-direction: column;
  }

  .card,
  .preview-shell,
  .hero {
    padding: 20px;
  }

  .hero h1 {
    max-width: none;
  }

  .preview-card,
  .mail-preview,
  #tool-preview-frame {
    min-height: 460px;
  }
}
