:root {
  --ink: #251f1a;
  --muted: #756a5d;
  --paper: #f4ead5;
  --surface: #fff9ed;
  --line: rgba(37, 31, 26, 0.15);
  --wine: #7d2c3b;
  --wine-dark: #521b27;
  --bronze: #b87935;
  --olive: #697c4b;
  --shadow: 0 24px 60px rgba(37, 31, 26, 0.14);
  --radius: 14px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(37, 31, 26, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 12% 8%, rgba(184, 121, 53, 0.22), transparent 30%),
    radial-gradient(circle at 86% 10%, rgba(125, 44, 59, 0.16), transparent 28%),
    linear-gradient(135deg, #efe0c2, #fff8ea 48%, #ead9bd);
  background-size: 32px 32px, auto, auto, auto;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

a {
  color: var(--wine-dark);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  background: rgba(244, 234, 213, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max);
  padding: 16px 22px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--wine);
  border: 2px solid var(--bronze);
  color: #fff6df;
  display: inline-flex;
  font-size: 1.25rem;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.nav-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.page-shell {
  margin: 0 auto;
  max-width: var(--max);
  padding: 30px 22px 58px;
}

.hero {
  align-items: stretch;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  margin: 26px 0 24px;
}

.eyebrow {
  color: var(--wine-dark);
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.35rem, 5.8vw, 5.45rem);
  letter-spacing: -0.055em;
  line-height: 0.92;
  margin: 0 0 18px;
  max-width: 840px;
  text-wrap: balance;
}

.hero p {
  color: var(--muted);
  font-size: 1.08rem;
  margin: 0;
  max-width: 730px;
}

.hero-actions,
.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  align-items: center;
  border: 2px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 900;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  text-decoration: none;
}

.btn-primary {
  background: var(--wine);
  color: #fff6df;
}

.btn-secondary {
  background: var(--bronze);
  color: #fffaf0;
}

.btn-ghost {
  background: rgba(37, 31, 26, 0.08);
  color: var(--ink);
}

.hero-card,
.panel,
.content-page {
  background: rgba(255, 249, 237, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  gap: 8px;
  padding: 22px;
}

.roman-large {
  color: var(--wine);
  display: block;
  font-size: clamp(2.5rem, 7vw, 4.1rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  line-height: 0.9;
}

.hero-card strong {
  font-size: 1.2rem;
}

.tool-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
}

.controls {
  padding: 18px;
}

.panel-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 900;
  justify-content: space-between;
  margin: -18px -18px 18px;
  padding: 16px 18px;
}

.panel-heading small,
.hint,
.status {
  color: var(--muted);
  font-size: 0.92rem;
}

.control {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

label {
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 900;
}

input,
textarea {
  background: #fffdf6;
  border: 1px solid rgba(37, 31, 26, 0.18);
  border-radius: 12px;
  color: var(--ink);
  padding: 11px 12px;
  width: 100%;
}

input[type="text"] {
  text-transform: uppercase;
}

.hint,
.status {
  margin: 0;
}

.quick-buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
}

.quick-buttons button {
  background: rgba(184, 121, 53, 0.12);
  border: 1px solid rgba(184, 121, 53, 0.24);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 900;
  min-height: 38px;
}

.result-panel {
  overflow: hidden;
}

.result-main {
  background:
    linear-gradient(135deg, rgba(125, 44, 59, 0.11), rgba(184, 121, 53, 0.16)),
    var(--surface);
  padding: 24px;
  text-align: center;
}

.result-main span,
.result-main p,
.stats-grid span {
  color: var(--muted);
}

.result-main strong {
  color: var(--wine);
  display: block;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  letter-spacing: -0.06em;
  line-height: 1;
  margin: 8px 0;
  overflow-wrap: anywhere;
}

.result-main p {
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stats-grid div {
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
  padding: 14px 16px;
}

.stats-grid div:last-child {
  border-right: 0;
}

.stats-grid span {
  display: block;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.stats-grid strong {
  display: block;
  font-size: 1.25rem;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.breakdown {
  border-top: 1px solid var(--line);
  padding: 20px 24px;
}

.breakdown h2 {
  font-size: 1.25rem;
  margin: 0 0 10px;
}

.breakdown ul {
  color: var(--muted);
  margin: 0;
  padding-left: 20px;
}

.copy-output {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  display: block;
  font-family: "Consolas", "Courier New", monospace;
  min-height: 150px;
  resize: vertical;
}

.seo-section,
.content-page {
  margin-top: 24px;
  padding: 26px;
}

.seo-section h2,
.content-page h1 {
  font-size: clamp(1.7rem, 3vw, 2.85rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 14px;
}

.seo-section p,
.content-page p,
.content-page li {
  color: var(--muted);
}

.feature-grid,
.faq-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

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

.feature,
.faq-item {
  background: rgba(255, 249, 237, 0.72);
  border: 1px solid rgba(37, 31, 26, 0.12);
  border-radius: 14px;
  padding: 17px;
}

.feature h3,
.faq-item h3 {
  margin: 0 0 8px;
}

.feature p,
.faq-item p {
  margin: 0;
}

.content-page {
  max-width: 820px;
}

.content-page h2 {
  margin-top: 28px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 22px 34px;
}

.footer-inner {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

@media (max-width: 900px) {
  .hero,
  .tool-grid,
  .feature-grid,
  .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-shell {
    padding-inline: 14px;
  }

  .quick-buttons,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid div {
    border-right: 0;
  }

  .hero-actions,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
