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

:root {
  --bg: #0c0c10;
  --surface: #14141c;
  --border: #252530;
  --text: #eceae4;
  --muted: #7a7880;
  --accent: #d4b483;
  --accent-dim: rgba(212, 180, 131, 0.12);
  --danger: #e07070;
  --radius: 12px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --serif: "Instrument Serif", Georgia, serif;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.25rem 2rem;
}

.brand {
  text-align: center;
  margin-bottom: 2.5rem;
}

.brand.compact {
  margin-bottom: 1.5rem;
}

.brand h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 400;
  line-height: 1;
}

.brand h1 a {
  color: var(--accent);
  text-decoration: none;
}

.brand p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

main {
  width: 100%;
  max-width: 34rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.label em {
  text-transform: none;
  letter-spacing: 0;
  font-style: normal;
  opacity: 0.7;
}

input[type="url"],
input[type="text"] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s;
}

input:focus {
  border-color: var(--accent);
}

.code-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}

.code-input:focus-within {
  border-color: var(--accent);
}

.code-input .prefix {
  padding: 0.75rem 0 0.75rem 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  font-size: 0.85rem;
}

.code-input input {
  border: none;
  border-radius: 0;
  padding-left: 0.25rem;
}

button[type="submit"],
.copy,
.go-btn {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: opacity 0.15s, transform 0.1s;
}

button[type="submit"] {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.85rem;
  background: var(--accent);
  color: #1a1510;
  font-weight: 500;
  letter-spacing: 0.04em;
}

button[type="submit"]:hover,
.copy:hover,
.go-btn:hover {
  opacity: 0.9;
}

button[type="submit"]:active,
.copy:active {
  transform: scale(0.98);
}

button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  margin-top: 0.85rem;
  color: var(--danger);
  font-size: 0.82rem;
}

.result {
  margin-top: 1rem;
}

.result-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.result-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.result-row a {
  flex: 1;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  font-weight: 500;
}

.copy {
  padding: 0 1rem;
  background: var(--border);
  color: var(--text);
  white-space: nowrap;
}

.copy.copied {
  background: var(--accent-dim);
  color: var(--accent);
}

.meta {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}

.meta a {
  color: var(--accent);
}

footer {
  margin-top: auto;
  padding-top: 2.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
}

footer code {
  color: var(--accent);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

.stats-card .short-display {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  word-break: break-all;
}

.stats-card .short-display a {
  color: var(--accent);
  text-decoration: none;
}

.stats {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats dt {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.stats dd {
  word-break: break-all;
}

.stats dd a {
  color: var(--text);
}

.go-btn {
  display: inline-block;
  padding: 0.75rem 1.1rem;
  background: var(--accent);
  color: #1a1510;
  text-decoration: none;
  font-weight: 500;
}

@media (max-width: 480px) {
  .result-row {
    flex-direction: column;
  }

  .copy {
    padding: 0.75rem;
  }
}
