:root {
  color-scheme: dark;
  --night: #07111e;
  --ink: #0d1d30;
  --blue: #132a46;
  --blue-light: #234b72;
  --gold: #e6bd63;
  --gold-light: #f7dc98;
  --paper: #f8f3e7;
  --white: #ffffff;
  --muted: #aab7c5;
  --line: rgba(230, 189, 99, 0.28);
  --danger: #ffcf9a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--paper);
  background:
    radial-gradient(circle at 80% 8%, rgba(48, 91, 132, 0.38), transparent 28rem),
    linear-gradient(145deg, var(--night), var(--blue) 62%, #0a1929);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background-image:
    linear-gradient(30deg, transparent 48%, rgba(255, 255, 255, 0.03) 50%, transparent 52%),
    linear-gradient(150deg, transparent 48%, rgba(255, 255, 255, 0.025) 50%, transparent 52%);
  background-size: 28px 48px;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.5rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--paper);
  text-decoration: none;
}

.brand .crest {
  display: grid;
  width: 2.7rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 45% 45% 52% 52% / 28% 28% 68% 68%;
  color: var(--gold-light);
  background: linear-gradient(145deg, var(--blue-light), #0c1e33);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 500;
}

.brand small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.hero {
  max-width: 850px;
  padding: clamp(3.5rem, 8vw, 7rem) 0 3.5rem;
}

.eyebrow,
.step {
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 7vw, 5.5rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero > p:not(.eyebrow) {
  max-width: 680px;
  margin: 1.5rem 0 0;
  color: #d5dee7;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.65;
}

.format-example {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.6rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(5, 14, 25, 0.45);
}

.format-example span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.format-example code {
  color: var(--gold-light);
  font-size: 0.9rem;
}

.formatter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  margin-bottom: 7rem;
}

.panel {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(20, 44, 72, 0.96), rgba(7, 17, 30, 0.98));
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.28);
}

.panel-heading {
  display: flex;
  min-height: 3.6rem;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading .step {
  margin-bottom: 0.3rem;
}

h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.panel h2 {
  margin: 0;
  font-size: 1.55rem;
}

textarea {
  width: 100%;
  min-height: 270px;
  margin-top: 1.25rem;
  padding: 1rem;
  resize: vertical;
  border: 1px solid rgba(170, 183, 197, 0.32);
  border-radius: 7px;
  outline: none;
  color: var(--paper);
  background: rgba(3, 10, 19, 0.64);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  transition: border-color 160ms, box-shadow 160ms;
}

textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(230, 189, 99, 0.12);
}

textarea::placeholder {
  color: #718196;
}

.field-help,
.copy-status {
  min-height: 1.2rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.1rem;
}

.primary-button,
.secondary-button,
.text-button {
  border-radius: 6px;
  font-weight: 750;
}

.primary-button,
.secondary-button {
  min-height: 2.8rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--gold);
}

.primary-button {
  color: #172236;
  background: var(--gold);
}

.primary-button:hover {
  background: var(--gold-light);
}

.secondary-button {
  color: var(--paper);
  background: transparent;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.text-button {
  padding: 0.2rem 0;
  border: 0;
  color: var(--gold-light);
  background: transparent;
  font-size: 0.8rem;
}

.text-button:hover:not(:disabled) {
  text-decoration: underline;
}

.text-button:disabled {
  cursor: default;
  color: #657488;
}

.flow-mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--gold);
  background: var(--ink);
}

.review-messages {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.review-message {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--gold);
  border-radius: 3px;
  color: var(--danger);
  background: rgba(230, 189, 99, 0.08);
  font-size: 0.78rem;
  line-height: 1.45;
}

.how-it-works {
  padding-bottom: 6rem;
}

.how-it-works > h2 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-top: 2rem;
}

.feature-grid article {
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.feature-grid article > span {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
}

.feature-grid h3 {
  margin: 0.8rem 0 0.45rem;
  font-size: 1.3rem;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

footer {
  display: flex;
  width: min(1180px, calc(100% - 2.5rem));
  margin: 0 auto;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid rgba(170, 183, 197, 0.15);
  color: var(--muted);
  font-size: 0.72rem;
}

footer p {
  margin: 0;
}

.footer-summary {
  display: grid;
  gap: 0.35rem;
}

.visit-count {
  color: var(--gold-light);
}

.disclaimer {
  text-align: right;
}

.privacy-notice {
  grid-column: 1 / -1;
  max-width: 76ch;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .flow-mark {
    margin: -0.2rem auto;
    transform: rotate(90deg);
  }

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

  .feature-grid article {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
  }

  .feature-grid h3 {
    margin-top: 0;
  }

  .feature-grid p {
    grid-column: 2;
  }
}

@media (max-width: 540px) {
  .site-header,
  main,
  footer {
    width: min(100% - 1.4rem, 1180px);
  }

  .hero {
    padding-top: 2.5rem;
  }

  .format-example {
    display: grid;
  }

  .formatter {
    margin-bottom: 5rem;
  }

  textarea {
    min-height: 230px;
  }

  footer {
    display: grid;
  }

  .disclaimer {
    text-align: left;
  }
}

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