:root {
  color-scheme: dark;
  --bg: #05070f;
  --bg-muted: rgba(16, 23, 42, 0.65);
  --bg-glass: rgba(15, 21, 38, 0.45);
  --bg-card: rgba(23, 33, 63, 0.6);
  --bg-accent: rgba(79, 70, 229, 0.35);
  --fg: #f8fafc;
  --fg-muted: #94a3b8;
  --primary: #6366f1;
  --primary-strong: #4338ca;
  --accent: #22d3ee;
  --error: #f87171;
  --success: #34d399;
  --border: rgba(148, 163, 184, 0.2);
  --shadow: 0 20px 60px -25px rgba(79, 70, 229, 0.55);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.08), rgba(99, 102, 241, 0.05) 40%, transparent 65%), var(--bg);
  color: var(--fg);
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3.5rem 1.5rem 0;
}

.page {
  position: relative;
  width: min(1100px, 100%);
  z-index: 1;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.branding {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-waves {
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
}

.logo-waves span {
  position: absolute;
  border-radius: 50%;
  animation: pulse 3.2s infinite ease-in-out;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.85), rgba(34, 211, 238, 0.7));
}

.logo-waves span:nth-child(1) {
  width: 100%;
  height: 100%;
}

.logo-waves span:nth-child(2) {
  width: 32px;
  height: 32px;
  animation-delay: 0.25s;
}

.logo-waves span:nth-child(3) {
  width: 18px;
  height: 18px;
  animation-delay: 0.5s;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.6;
  }
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow);
}

.btn.primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border);
}

.btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.2rem;
  margin-bottom: 3.5rem;
  padding: 2.8rem;
  border-radius: 32px;
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 80px -45px rgba(15, 23, 42, 0.9);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(34, 211, 238, 0.08);
  pointer-events: none;
}

.hero-content h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.5rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.hero-content p {
  margin: 0 0 1.8rem;
  color: var(--fg-muted);
  max-width: 32ch;
}

.feature-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.feature-badges span {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.2);
  border: 1px solid rgba(79, 70, 229, 0.3);
  font-size: 0.85rem;
}

.glass-panel {
  background: var(--bg-glass);
  border-radius: 28px;
  padding: 2.2rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.shorten-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.shorten-form label {
  font-weight: 600;
  font-size: 0.95rem;
}

.shorten-form input[type="url"],
.shorten-form input[type="text"] {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.6);
  color: var(--fg);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shorten-form input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.input-prefix {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.45);
}

.input-prefix span {
  color: var(--fg-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.input-prefix input {
  border: none;
  padding: 0;
  background: transparent;
}

.hint {
  color: var(--fg-muted);
  font-size: 0.85rem;
}

.urls-section {
  background: rgba(10, 14, 26, 0.75);
  border-radius: 28px;
  padding: 2.4rem;
  border: 1px solid rgba(79, 70, 229, 0.12);
  backdrop-filter: blur(18px);
}

.urls-section header h2 {
  margin: 0;
  font-size: 1.8rem;
}

.urls-section header p {
  margin: 0.4rem 0 2rem;
  color: var(--fg-muted);
}

.url-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.6rem;
}

.url-card {
  background: rgba(15, 20, 40, 0.75);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.url-card:hover {
  border-color: rgba(34, 211, 238, 0.4);
}

.url-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.short-link {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.short-link:hover {
  text-decoration: underline;
}

.short-link-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 20, 35, 0.7);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  border-color: rgba(34, 211, 238, 0.6);
  background: rgba(34, 211, 238, 0.12);
  transform: translateY(-1px);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  color: var(--fg-muted);
}

.icon-btn.copied {
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(52, 211, 153, 0.15);
  color: #bbf7d0;
}

.url-top time {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.long-link {
  color: var(--fg-muted);
  font-size: 0.9rem;
  word-break: break-word;
  text-decoration: none;
}

.long-link:hover {
  color: var(--accent);
}

.alert {
  padding: 1rem 1.2rem;
  border-radius: 14px;
  margin-bottom: 1.5rem;
  border: 1px solid;
}

.alert.error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.alert.success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.3);
  color: #bbf7d0;
}

.empty-state {
  padding: 2.4rem;
  text-align: center;
  border-radius: 20px;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  background: rgba(15, 20, 35, 0.5);
}

.empty-state p {
  margin-bottom: 1rem;
  color: var(--fg-muted);
}

.empty-state.callout {
  border-style: solid;
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.empty-state.callout h2 {
  margin: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  z-index: 10;
}

.modal-card {
  position: relative;
  width: min(420px, calc(100% - 2rem));
  background: rgba(15, 20, 35, 0.9);
  border-radius: 24px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 2.2rem 2rem 1.8rem;
  box-shadow: 0 30px 70px -30px rgba(79, 70, 229, 0.65);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: center;
}

.modal-card h3 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-card p {
  margin: 0;
  color: var(--fg-muted);
}

.modal-link {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: stretch;
}

.modal-link code {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(7, 12, 24, 0.9);
  word-break: break-all;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  color: var(--fg-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--accent);
}

.copy-btn {
  width: 100%;
}

.error-state {
  padding: 4rem 2rem;
  text-align: center;
  background: rgba(15, 20, 35, 0.65);
  border-radius: 26px;
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.error-state h1 {
  margin-bottom: 1rem;
}

.error-state p {
  color: var(--fg-muted);
  margin-bottom: 1.8rem;
}

code {
  background: rgba(15, 23, 42, 0.8);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

details {
  margin-bottom: 1.5rem;
  text-align: left;
}

details pre {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 12px;
  padding: 1.2rem;
  overflow-x: auto;
}

.footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: 0.85rem;
}

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

.bg-gradient {
  position: fixed;
  inset: auto -15% -25% auto;
  width: min(1200px, 100vw);
  opacity: 0.75;
  z-index: 0;
  pointer-events: none;
  filter: blur(0);
}

@media (max-width: 720px) {
  body {
    padding: 2rem 1rem 3rem;
  }

  .hero-card {
    padding: 2rem;
  }

  .glass-panel {
    padding: 1.8rem;
  }

  .urls-section {
    padding: 2rem 1.5rem;
  }

  .nav {
    flex-direction: column;
    align-items: flex-end;
  }
}
