:root {
  color-scheme: dark;
  --mono: "JetBrains Mono", monospace;
  --sans: "Montserrat", sans-serif;

  /* Surfaces: void -> raised -> row. No fourth step. */
  --bg: #0a0610;
  --surface: #150f1f;
  --surface-row: #1b1428;
  --surface-hover: #241b33;
  --border: #2e2440;

  /* Ink. Every value clears 4.5:1 on all three surfaces. */
  --text: #f5f2fa;
  --muted: #9c8fb3;

  --accent: #b268ea;
  --accent-hover: #c77dff;
  --accent-active: #a359da;
  --danger: #d97a93;

  --dur: 150ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}
a {
  color: inherit;
}
.mono {
  font-family: var(--mono);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
}
.muted a,
.link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--dur) var(--ease);
}
.muted a:hover,
.link:hover {
  color: var(--accent-hover);
}

/* One focus treatment for the whole surface, so the keyboard path is
   legible and identical everywhere. Outline is used rather than a ring
   box-shadow because the table and cards clip their overflow. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 32px;
  min-height: 64px;
  background: rgba(10, 6, 16, 0.92);
}
.dither-bar {
  height: 2px;
  background-image: url("/static/dither-purple.png");
  background-size: 8px 2px;
  image-rendering: pixelated;
  opacity: 0.7;
}
.dither-bar-thick {
  height: 3px;
  background-size: 16px 3px;
  margin-bottom: 24px;
}
.dither-blob {
  position: absolute;
  background-image: url("/static/dither-purple.png");
  image-rendering: pixelated;
  -webkit-mask-image: radial-gradient(circle, black, transparent 70%);
  mask-image: radial-gradient(circle, black, transparent 70%);
  pointer-events: none;
}
main {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 80px 24px;
}
main.wide {
  max-width: 920px;
}
main.narrow {
  max-width: 400px;
}
main.result {
  max-width: 560px;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 36px;
}
.brand {
  white-space: nowrap;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand span {
  color: var(--accent);
}
.brand img {
  vertical-align: -6px;
  margin-right: 8px;
}
.nav-links {
  display: flex;
  gap: 24px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  transition: color var(--dur) var(--ease);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-email {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
}
h1 {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.subhead {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 62ch;
  text-wrap: pretty;
}
.card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}
.field-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"] {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}
input::placeholder {
  color: var(--muted);
}
input:hover {
  border-color: var(--muted);
}
input:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}
.grow {
  flex: 1;
  min-width: 220px;
}
button,
.btn {
  border: none;
  font-weight: 600;
  font-size: 14px;
  padding: 0 22px;
  height: 46px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sans);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.btn-primary {
  background-color: var(--accent);
  color: var(--bg);
  background-image: url("/static/dither-black.png");
  background-size: 8px 8px;
  image-rendering: pixelated;
}
.btn-primary:hover {
  background-color: var(--accent-hover);
}
.btn-primary:active {
  background-color: var(--accent-active);
}
.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background-color: var(--surface-hover);
  border-color: var(--muted);
}
.btn-ghost:active {
  background-color: var(--surface);
}
.btn-danger {
  background-color: var(--danger);
  color: var(--bg);
}
.btn-danger:hover {
  background-color: #e4839c;
}
.btn-danger:active {
  background-color: #bd617a;
}
button:disabled,
.btn:disabled {
  background-color: var(--surface);
  background-image: none;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: not-allowed;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.chip {
  position: relative;
}
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.chip span {
  display: block;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--muted);
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.chip:hover span {
  background-color: var(--surface-hover);
  color: var(--text);
}
.chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.chip:hover input:checked + span {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
}
/* The radio itself is visually hidden, so its focus ring has to be drawn
   on the label it controls. */
.chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  cursor: pointer;
}
.error {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--danger);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 16px;
}
.error::before {
  content: "!";
  font-family: var(--mono);
  font-weight: 700;
  flex: none;
}
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
th,
td {
  text-align: left;
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
thead th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  background: var(--surface);
}
td,
tbody th {
  background: var(--surface-row);
  font-weight: 400;
}
.trend {
  color: var(--accent);
  line-height: 0;
}
tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: none;
}
tbody tr {
  transition: background-color var(--dur) var(--ease);
}
tbody tr:hover td {
  background: var(--surface-hover);
}
.short-code {
  font-family: var(--mono);
  font-weight: 600;
}
.dest {
  color: var(--muted);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delete-btn {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  color: var(--danger);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
/* Keeps the 28px visual weight the table wants while giving touch a
   44x44 target. */
.delete-btn::after {
  content: "";
  position: absolute;
  inset: -8px;
}
.delete-btn:hover {
  background-color: var(--danger);
  border-color: var(--danger);
  color: var(--bg);
}
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-family: var(--mono);
}
.short-link {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 600;
  word-break: break-all;
}
.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.copy-btn {
  height: 34px;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* Opaque, not transparent: it sits over a bled dither blob and the
     label must never be read against texture. */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.copy-btn:hover {
  background-color: var(--surface-hover);
  border-color: var(--muted);
  color: var(--text);
}
.copy-btn[data-copied] {
  border-color: var(--accent);
  color: var(--accent);
}
/* A recessed panel, not a nested card: it drops back to the void rather
   than stacking another raised surface inside one. */
.recessed {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.hero-logo {
  width: 1em;
  height: 1em;
  vertical-align: -0.18em;
  margin-right: 0.28em;
}
.table-wrap {
  overflow-x: auto;
}
.card-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 28px;
}
@media (max-width: 640px) {
  .nav {
    padding: 12px 16px;
    gap: 12px;
  }
  .nav-left {
    gap: 18px;
  }
  .nav-email {
    display: none;
  }
  main {
    padding: 48px 20px;
  }
  .dest {
    max-width: 160px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
