:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --fg: #221f1a;
  --muted: #5b554c;
  --line: #d8d0c3;
  --blue: #2f6f7c;
  --blue-dark: #245b65;
  --green: #4a6741;
  --green-dark: #395234;
  --paper: #f5f0e1;
  --ink: #1a3c34;
  --danger: #a33d2d;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, #f7f4ee 0%, #edf3f1 52%, #f4efe8 100%);
  color: var(--fg);
  font-family: Arial, Helvetica, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

body.sloth-mode {
  background: #f2ead8;
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

main {
  min-height: 100vh;
  padding: 32px 20px;
}

.shell {
  min-height: calc(100vh - 64px);
  width: min(100%, 1120px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

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

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

body.sloth-mode .eyebrow {
  color: var(--green);
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(42px, 8vw, 72px);
  line-height: 1.08;
  font-weight: 900;
}

.intro {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  padding: 8px 16px;
  font-size: 14px;
}

.tab.active {
  border-color: #332d25;
  background: #332d25;
  color: #fffaf0;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
  }
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(34, 31, 26, 0.08);
}

.input-panel {
  background: rgba(255, 255, 255, 0.82);
}

label {
  display: block;
  margin-bottom: 12px;
  color: #332d25;
  font-size: 14px;
  font-weight: 700;
}

textarea {
  min-height: 176px;
  width: 100%;
  resize: vertical;
  border: 1px solid #cfc6b8;
  border-radius: 6px;
  background: #fffdf8;
  padding: 16px;
  color: #221f1a;
  line-height: 1.75;
  outline: none;
}

textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 111, 124, 0.15);
}

body.sloth-mode textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(74, 103, 65, 0.16);
}

.controls {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6c665d;
  font-size: 14px;
}

.controls .too-long {
  color: var(--danger);
  font-weight: 700;
}

button {
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

#generate {
  border: 0;
  background: var(--blue);
  color: white;
  padding: 10px 20px;
}

#generate:hover:not(:disabled) {
  background: var(--blue-dark);
}

body.sloth-mode #generate {
  background: var(--green);
}

body.sloth-mode #generate:hover:not(:disabled) {
  background: var(--green-dark);
}

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

.error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
}

.output-panel {
  background: #221f1a;
  color: #fffaf0;
  transition: background 0.3s ease, color 0.3s ease;
}

body.sloth-mode .output-panel {
  border-color: #cdbf9d;
  background: var(--paper);
  color: var(--ink);
}

.gospel-note {
  display: none;
  margin: 0 0 8px;
  color: #8a7e6b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-align: center;
}

body.sloth-mode .gospel-note {
  display: block;
}

.output-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 14px;
}

#copy {
  border: 1px solid rgba(255, 250, 240, 0.3);
  background: transparent;
  color: #fffaf0;
  padding: 8px 12px;
  font-size: 14px;
}

#copy:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

body.sloth-mode #copy {
  border-color: rgba(26, 60, 52, 0.25);
  color: var(--ink);
}

body.sloth-mode #copy:hover:not(:disabled) {
  background: rgba(26, 60, 52, 0.1);
}

.result {
  min-height: 288px;
  white-space: pre-wrap;
  border: 1px solid rgba(255, 250, 240, 0.15);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  padding: 16px;
  color: #fffaf0;
  font-size: 15px;
  line-height: 2;
}

body.sloth-mode .result {
  border-color: #cdbf9d;
  background: rgba(255, 248, 230, 0.55);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

.seal-wrap {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.seal {
  display: inline-flex;
  width: 80px;
  height: 80px;
  align-items: center;
  justify-content: center;
  border: 2px solid;
  border-radius: 999px;
  transform: rotate(-10deg);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 900;
}

.seal.diligent {
  border-color: #b08a22;
  background: rgba(215, 178, 74, 0.18);
  color: #9a7519;
}

.seal.slothful {
  border-color: #9f2f2f;
  background: rgba(159, 47, 47, 0.1);
  color: #9f2f2f;
}

.seal.easter_egg {
  border-color: var(--green);
  background: rgba(74, 103, 65, 0.1);
  color: var(--green);
}

.author-badge {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 10;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.9);
  padding: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(34, 31, 26, 0.08);
  backdrop-filter: blur(8px);
}
