/* Barlow Condensed draws the story; the editor around it uses the blog's type. */
@font-face {
  font-family: Story;
  src: url("/preferiresti/story.ttf") format("truetype");
  font-weight: 400;
  font-display: block;
}

/* the editor on the left, the live 9:16 preview on the right */
.pref .tool-head {
  padding-bottom: 8px;
}
.layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
aside {
  padding: 28px 28px 28px 0;
  border-right: 1px solid var(--line);
}
.intro {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.intro b {
  display: block;
  color: var(--ink);
  font: 700 21px / 1.25 var(--display);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
h2 {
  margin: 0 0 16px;
  font: 600 12px / 1 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.section {
  margin-bottom: 28px;
}

/* ---- background ---- */
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.preset {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 3px solid var(--paper);
  border-radius: 50%;
  outline: 1px solid var(--rule);
  transition: transform 0.15s;
}
@media (hover: hover) {
  .preset:hover {
    transform: scale(1.1);
  }
}
.preset[aria-pressed="true"] {
  outline: 2px solid var(--ink);
}
.colors {
  display: grid;
  grid-template-columns: 1fr 28px 1fr;
  align-items: end;
  gap: 10px;
}
.color-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}
.color-field {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
}
.color-field input {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.color-field input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-field input::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}
.hex {
  font: 12px var(--mono);
  color: var(--muted);
}
.swap {
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 19px;
}
.glow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 13px;
}
.glow input {
  accent-color: var(--accent);
}

/* ---- dilemma and text ---- */
label.field {
  display: block;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 13px;
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--ink);
  line-height: 1.5;
  resize: vertical;
}
.field textarea {
  min-height: 98px;
}
.field input:hover,
.field textarea:hover {
  border-color: var(--rule);
}
.option-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.remove-option {
  padding: 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 13px;
}
.add-option,
.font-button {
  display: inline-block;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.add-option {
  width: 100%;
}
@media (hover: hover) {
  .add-option:hover,
  .font-button:hover {
    box-shadow: inset 0 0 0 1px var(--ink);
  }
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.row label {
  color: var(--muted);
  font-size: 13px;
}
.row output {
  font: 13px var(--mono);
  font-variant-numeric: tabular-nums;
}
input[type="range"] {
  width: 100%;
  margin: 0;
  cursor: pointer;
}
.details {
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
summary {
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
details p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
details a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.font-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.font-input:focus-visible + .font-button {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.reset {
  margin-top: 10px;
  padding: 12px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
}
@media (hover: hover) {
  .reset:hover {
    color: var(--accent);
  }
}

/* ---- preview ---- */
.preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 30px 0 30px 36px;
}
.preview-meta {
  display: flex;
  justify-content: space-between;
  width: min(100%, 360px);
  color: var(--muted);
  font: 12px var(--mono);
}
.live {
  display: flex;
  align-items: center;
  gap: 6px;
}
.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
canvas {
  display: block;
  width: min(100%, 360px);
  height: auto;
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(28, 26, 20, 0.22);
}
.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
}
.hint.left {
  margin-top: 10px;
  text-align: left;
}
.status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
@media (min-width: 1000px) and (min-height: 900px) {
  canvas,
  .preview-meta {
    width: min(100%, 405px);
  }
}
@media (max-width: 760px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .preview-area {
    grid-row: 1;
    padding: 24px 0;
  }
  .preview-area canvas,
  .preview-meta {
    width: min(100%, 260px);
  }
  aside {
    padding: 26px 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
}
