/* TischEins Prompt Generator - matches the tischeins.org theme (paper, ink, Georgia/Arial) */

* {
  box-sizing: border-box;
}

:root {
  --paper: #faf4eb;
  --paper-deep: #f2e9dc;
  --field: #eae5df;
  --ink: #412708;
  --line: #ddd2c4;
  --muted: #7a6a57;
  --focus: #997237;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.page {
  width: min(1180px, 100% - 32px);
  margin: 0 auto;
  padding: 26px 0 30px;
}

/* Masthead */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font: 24px/1 var(--serif);
  text-decoration: none;
}

.back-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid #ac9780;
  padding-bottom: 3px;
}

.back-link:hover {
  color: var(--ink);
}

.intro {
  padding: 46px 0 34px;
}

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

h1,
h2 {
  font-family: var(--serif);
  font-weight: normal;
}

h1 {
  margin: 10px 0 18px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -1.2px;
}

.lede {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

/* Layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px;
  align-items: start;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

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

.group {
  display: grid;
  gap: 18px;
  min-width: 0;
  margin: 0;
  padding: 0 0 26px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.group legend {
  padding: 0;
  margin-bottom: 16px;
  font: 22px/1.2 var(--serif);
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span,
.slider-field__head span {
  font-size: 12px;
  color: var(--muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

select,
input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
}

select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

input[type="text"] {
  font-family: var(--mono);
  font-size: 14px;
}

input[type="text"]::placeholder {
  color: var(--muted);
}

.slider-field {
  display: grid;
  gap: 8px;
}

.slider-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slider-field output {
  font-family: var(--mono);
  font-size: 13px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
}

input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--ink);
}

input[type="range"]:disabled {
  opacity: 0.35;
}

.field-hint {
  margin: -10px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.field-hint--warning {
  color: #8a3b12;
}

/* Buttons */

.primary,
.secondary {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
}

.primary {
  background: var(--ink);
  color: var(--paper);
}

.primary:hover {
  background: #2f1c05;
}

.secondary:hover {
  background: var(--paper-deep);
}

.text-button {
  justify-self: start;
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid #ac9780;
  background: none;
  font-size: 12px;
}

.text-button:hover {
  border-bottom-color: var(--ink);
}

/* Output */

.output {
  position: sticky;
  top: 24px;
  min-width: 0;
}

.output__head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.2;
}

.status {
  margin: 0 0 16px;
  font-size: 12px;
  color: var(--muted);
}

textarea {
  display: block;
  width: 100%;
  min-height: 300px;
  padding: 18px;
  border: 0;
  border-radius: 0;
  background: var(--field);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  resize: vertical;
  overflow-wrap: break-word;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.actions .primary,
.actions .secondary {
  margin: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.meta .text-button {
  color: var(--ink);
}

.meta .text-button:first-of-type {
  margin-left: auto;
}

.note {
  max-width: 520px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Footer */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.footer__links a {
  margin-left: 14px;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .output {
    position: static;
  }
}

@media (max-width: 520px) {
  .page {
    padding-top: 18px;
  }

  .intro {
    padding: 30px 0 24px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

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

  .actions .primary {
    grid-column: 1 / -1;
  }

  .meta .text-button:first-of-type {
    margin-left: 0;
  }

  .footer {
    flex-direction: column;
  }

  .footer__links a {
    margin: 0 14px 0 0;
  }
}

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