:root {
  --paper: #f3f0e8;
  --ink: #17211c;
  --muted: #647067;
  --line: #c9c9be;
  --accent: #2864dc;
  --accent-dark: #1749a6;
  --blue: #b9d7ee;
  --white: #fffdf8;
  --shadow: 0 20px 55px rgba(41, 50, 43, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 83% 8%, rgba(185, 215, 238, 0.7), transparent 22rem),
    var(--paper);
  font-family: "Manrope", system-ui, sans-serif;
  min-width: 320px;
}

button,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.site-header {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 84px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 30px;
  color: white;
  background: var(--accent);
  border-radius: 9px 9px 9px 3px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.help-link {
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  text-underline-offset: 4px;
}

.header-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 22px;
}

.noscript-notice {
  width: min(1400px, calc(100% - 48px));
  margin: 20px auto 0;
  padding: 14px 18px;
  color: #712d18;
  background: #fff0e8;
  border: 1px solid #e5bcae;
  font-size: 13px;
}

main {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  max-width: 850px;
  padding: 78px 0 54px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent-dark);
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.93;
  letter-spacing: -0.065em;
  font-weight: 600;
}

.hero h1 em {
  color: var(--accent);
  font-family: "Newsreader", Georgia, serif;
  font-weight: 500;
}

.intro {
  max-width: 660px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.converter {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.toolbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}

.format-choice {
  display: flex;
  padding: 4px;
  background: #e9e7df;
  border-radius: 999px;
}

.format-button,
.text-button,
.download-button,
.copy-button {
  border: 0;
  cursor: pointer;
}

.format-button {
  padding: 9px 16px;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.format-button.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 2px 10px rgba(30, 40, 32, 0.09);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
}

.text-button,
.download-button {
  padding: 8px 10px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button:hover,
.download-button:hover {
  color: var(--accent-dark);
}

.editor-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.editor-panel {
  min-width: 0;
}

.input-panel {
  border-right: 1px solid var(--line);
}

.panel-header {
  height: 63px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.panel-header > div {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.step,
.count {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.panel-header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

textarea {
  display: block;
  width: 100%;
  height: 520px;
  resize: vertical;
  padding: 26px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.72;
}

textarea:focus {
  outline-offset: -3px;
}

textarea::placeholder {
  color: #9a9f98;
}

#facebook-output {
  padding-bottom: 86px;
}

.output-panel {
  position: relative;
  background: #fdfcf7;
}

.conversion-arrow {
  position: absolute;
  z-index: 2;
  top: 23px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  border: 4px solid var(--white);
  border-radius: 50%;
  font-size: 16px;
}

.output-actions {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  background: linear-gradient(transparent, #fdfcf7 28%);
}

.status {
  margin-right: auto;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.copy-button {
  min-width: 125px;
  padding: 12px 17px;
  color: white;
  background: var(--ink);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
}

.copy-button:hover {
  background: var(--accent-dark);
}

.copy-button span {
  margin-right: 7px;
}

.notes {
  display: grid;
  grid-template-columns: 0.8fr 2fr;
  gap: 70px;
  padding: 100px 0 110px;
}

.notes h2 {
  max-width: 340px;
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
}

.note-grid article {
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}

.note-number {
  color: var(--accent-dark);
  font-family: "DM Mono", monospace;
  font-size: 11px;
}

.note-grid h3 {
  margin: 34px 0 12px;
  font-size: 16px;
}

.note-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.faq {
  display: grid;
  grid-template-columns: 0.8fr 2fr;
  gap: 70px;
  padding: 0 0 110px;
}

.faq-heading h2 {
  max-width: 410px;
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.faq-heading > p:last-child {
  max-width: 390px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.faq-list {
  border-top: 2px solid var(--ink);
}

.faq-list details {
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  position: relative;
  padding: 24px 48px 24px 0;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  top: 18px;
  right: 0;
  color: var(--accent);
  font-size: 25px;
  font-weight: 400;
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details > p {
  max-width: 700px;
  margin: -5px 48px 24px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.faq-list code {
  padding: 2px 5px;
  color: var(--ink);
  background: #e9e7df;
  border-radius: 2px;
  font-family: "DM Mono", monospace;
  font-size: 0.92em;
}

footer {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  padding: 25px 0 35px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: "DM Mono", monospace;
  font-size: 10px;
}

footer > p,
.footer-actions p {
  margin: 0;
}

.footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.support-menu {
  position: relative;
}

.support-menu summary {
  list-style: none;
}

.support-menu summary::-webkit-details-marker {
  display: none;
}

.support-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  color: white;
  background: var(--accent);
  border-radius: 3px;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.support-button:hover,
.support-menu[open] .support-button {
  background: var(--accent-dark);
}

.support-options {
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: calc(100% + 10px);
  width: 238px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 14px 35px rgba(41, 50, 43, 0.16);
}

.support-options::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: var(--white);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

.support-options a {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  padding: 11px 10px;
  color: var(--ink);
  border-radius: 3px;
  font-family: "Manrope", system-ui, sans-serif;
  text-decoration: none;
}

.support-options a:hover {
  background: #edf3ff;
}

.support-options a + a {
  border-top: 1px solid var(--line);
}

.support-options a > span:first-child {
  font-size: 17px;
  text-align: center;
}

.support-options strong,
.support-options small {
  display: block;
}

.support-options strong {
  font-size: 12px;
}

.support-options small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.support-options .paypal-mark {
  color: #173b73;
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
}

.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: 850px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .tagline {
    display: none;
  }

  .hero {
    padding-top: 58px;
  }

  .editor-grid,
  .notes,
  .faq {
    grid-template-columns: 1fr;
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .conversion-arrow {
    top: 50%;
    left: auto;
    right: 22px;
    transform: translateY(-50%) rotate(90deg);
  }

  textarea {
    height: 400px;
  }

  .notes {
    gap: 50px;
  }

  .faq {
    gap: 50px;
  }
}

@media (max-width: 620px) {
  .site-header,
  main,
  footer {
    width: min(100% - 28px, 1400px);
  }

  .site-header {
    min-height: 70px;
  }

  .header-nav {
    gap: 13px;
  }

  .header-nav .help-link:first-child {
    display: none;
  }

  .hero {
    padding: 44px 0 38px;
  }

  .hero h1 {
    font-size: clamp(43px, 15vw, 65px);
  }

  .intro {
    font-size: 15px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .format-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-actions {
    justify-content: flex-end;
  }

  .panel-header {
    padding: 0 18px;
  }

  textarea {
    padding: 20px;
  }

  .count {
    display: none;
  }

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

  .note-grid h3 {
    margin-top: 18px;
  }

  .notes {
    padding: 78px 0;
  }

  .faq {
    padding-bottom: 78px;
  }

  footer {
    flex-direction: column;
  }

  .footer-actions {
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
