@font-face {
  font-family: "Macintosh Skeletal Filled";
  src: url("../fonts/MacintoshSkeletalFilled.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Macintosh Skeletal Variable";
  src: url("../fonts/MacintoshSkeletalVariable.otf") format("opentype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #f4f0e6;
  --stage: #101010;
  --page: #f3f1eb;
  --text: #1a1a1a;
  --muted: #555;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--page);
  color: var(--text);
  line-height: 1.4;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  color: #444;
  font-size: 0.95rem;
}

.cta {
  flex: none;
  display: inline-block;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  font-size: 1rem;
  padding: 12px 18px;
  border-radius: 999px;
}

.cta:hover {
  background: #333;
}

.preview {
  margin-top: 20px;
  min-height: 300px;
  padding: 48px 28px;
  background: var(--stage);
  color: var(--ink);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.preview-text {
  margin: 0;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.25;
  font-family: "Macintosh Skeletal Filled", cursive;
  font-weight: 400;
  font-synthesis: none;
  font-variant-ligatures: contextual;
  font-feature-settings: "calt" 1;
}

.preview[data-style="variable"] .preview-text {
  font-family: "Macintosh Skeletal Variable", cursive;
}

.placeholder {
  margin: 0;
  color: rgba(244, 240, 230, 0.55);
  font-size: 1rem;
}

#status {
  min-height: 1.3em;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

#status[data-state="error"] {
  color: #8a1c1c;
}

.controls {
  display: grid;
  gap: 14px;
}

label,
legend {
  font-size: 0.85rem;
  font-weight: 650;
}

textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 72px;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

legend {
  width: 100%;
  padding: 0;
  margin-bottom: 2px;
}

.choice {
  font-weight: 500;
  font-size: 0.95rem;
}

.slider label {
  display: block;
  margin-bottom: 6px;
}

.slider input[type="range"] {
  width: min(100%, 320px);
}

.slider[hidden] {
  display: none;
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

button {
  justify-self: start;
  background: #111;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  background: #333;
}

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

footer {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.8rem;
}

footer a {
  color: #111;
}

:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  header {
    flex-direction: column;
  }

  .cta {
    align-self: stretch;
    text-align: center;
  }

  .preview {
    min-height: 220px;
    padding: 32px 16px;
  }

  button {
    justify-self: stretch;
  }
}
