:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --border: #e7e2db;
  --text: #1f1b16;
  --text-muted: #6b645b;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fff1e6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: min(760px, 100% - 40px);
  margin: 0 auto;
  padding: 56px 0 32px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  margin: 0 0 8px;
  text-wrap: balance;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
}

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

input {
  flex: 1 1 320px;
  padding: 14px 16px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

button {
  padding: 14px 22px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

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

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

button.secondary {
  padding: 8px 14px;
  font-size: 0.875rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
}


.result {
  margin-top: 16px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.result-header h2 {
  margin: 0;
  font-size: 1rem;
}
.status {
  min-height: 1.5em;
  margin: 16px 0 0;
  color: var(--text-muted);
}

.status.error {
  color: #b91c1c;
}


pre {
  margin: 0;
  padding: 24px;
  font: inherit;
  line-height: 1.75;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  max-height: 60vh;
  overflow-y: auto;
}
.result:has(#output:empty) {
  display: none;
}

footer {
  margin-top: auto;
  padding-top: 56px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

footer nav {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

footer ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

footer a {
  position: relative;
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.25s ease-out;
}

footer a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease-out;
}



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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}


@media (max-width: 600px) {
  .input-group button {
    flex: 1 1 100%;
  }
  .input-group {
    gap: 12px;
  }
  footer ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .container {
    padding-top: 40px;
  }

  header {
    margin-bottom: 28px;
  }

  .subtitle {
    line-height: 1.5;
  }
}


@media (hover: hover) {
  footer a:hover {
    color: var(--accent);
  }
  button:hover:not(:disabled) {
    background: var(--accent-hover);
  }

  button.secondary:hover:not(:disabled) {
    color: var(--text);
    background: var(--surface);
  }

  footer a:hover::after {
    transform: scaleX(1);
  }
}

@media (hover: none) {
  footer a {
    color: var(--accent);
  }
  footer a::after {
    transform: scaleX(1);
    height: 1px;
    background-color: var(--border);
    opacity: 0.35;
  }
}
