* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: oklch(0.975 0.005 75);
  --surface: oklch(0.993 0.003 75);
  --text: oklch(0.22 0.008 75);
  --text-secondary: oklch(0.45 0.008 75);
  --text-tertiary: oklch(0.58 0.006 75);
  --border: oklch(0.88 0.006 75);
  --border-focus: oklch(0.72 0.008 75);
  --accent: oklch(0.52 0.1 250);
  --accent-hover: oklch(0.46 0.12 250);
}

body {
  font-family: "Figtree", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem);
  line-height: 1.5;
}

main {
  max-width: 52rem;
  margin: 0 auto;
}

header {
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

h1 {
  font-family: "Vollkorn", Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.375rem;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .editor {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.panel label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

textarea {
  width: 100%;
  height: 300px;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.15s ease-out;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.52 0.1 250 / 0.1);
}

textarea[readonly] {
  cursor: default;
  background: var(--bg);
}

textarea::placeholder {
  color: var(--text-tertiary);
  opacity: 0.7;
}

.actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

button {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease-out, color 0.15s ease-out, background 0.15s ease-out;
}

button:hover:not(:disabled) {
  border-color: var(--border-focus);
  color: var(--text);
}

button:active:not(:disabled) {
  background: var(--bg);
}

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

button:disabled {
  opacity: 0.4;
  cursor: default;
}

details {
  border-top: 1px solid var(--border);
  padding-top: clamp(1.5rem, 3vw, 2rem);
}

summary {
  font-family: "Vollkorn", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 500;
  font-style: italic;
  cursor: pointer;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  transition: color 0.15s ease-out;
}

summary:hover {
  color: var(--text);
}

summary::marker {
  color: var(--text-tertiary);
}

.reasons {
  max-width: 38rem;
  margin-bottom: 1.5rem;
}

.reason {
  padding: 0.6rem 0;
}

.reason + .reason {
  border-top: 1px solid oklch(0.92 0.004 75);
}

.reason dt {
  font-weight: 600;
  font-size: 0.925rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.reason dd {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.credits {
  font-size: 0.825rem;
  color: var(--text-tertiary);
}

.credits a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: oklch(0.52 0.1 250 / 0.35);
  transition: text-decoration-color 0.15s ease-out;
}

.credits a:hover {
  text-decoration-color: var(--accent);
}

.credits a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
