/* URL Shortener — cosmic dark, match homepage / my-time */

:root {
  --bg:         #03040f;
  --bg2:        #080a1c;
  --bg3:        #0d1030;
  --purple:     #8b5cf6;
  --purple-dim: #5b21b6;
  --cyan:       #22d3ee;
  --gold:       #fbbf24;
  --gold-deep:  #f59e0b;
  --gold-light: #fde68a;
  --rose:       #f472b6;
  --text:       #e2e8f0;
  --muted:      #94a3b8;
  --border:     rgba(139,92,246,0.18);
  --card:       rgba(10,12,35,0.85);
  --red:        #f87171;
  --nav-h:      64px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100%;
}

button, a, input { font-family: inherit; }
button { touch-action: manipulation; }

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.nebula {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.nebula::before,
.nebula::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.nebula::before {
  width: 60vw; height: 60vw;
  top: -20vw; left: -10vw;
  background: radial-gradient(ellipse, rgba(139,92,246,0.12) 0%, transparent 70%);
  animation: nebulaDrift 30s ease-in-out infinite alternate;
}
.nebula::after {
  width: 50vw; height: 50vw;
  bottom: -10vw; right: -5vw;
  background: radial-gradient(ellipse, rgba(34,211,238,0.09) 0%, transparent 70%);
  animation: nebulaDrift 40s ease-in-out infinite alternate-reverse;
}
@keyframes nebulaDrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(3vw, 4vh) scale(1.08); }
}

.page { position: relative; z-index: 2; }

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: var(--nav-h);
  background: rgba(3,4,15,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: Cinzel, serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple);
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.7); }
}
.site-nav nav { display: flex; gap: 1.5rem; }
.site-nav nav a {
  font-family: Cinzel, serif;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}
.site-nav nav a:hover,
.site-nav nav a[aria-current="page"] { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  border: none;
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 0 20px rgba(139,92,246,0.35);
}
.btn-primary:hover:not(:disabled) {
  background: #7c3aed;
  box-shadow: 0 0 32px rgba(139,92,246,0.55);
  transform: translateY(-1px);
}
.btn-ghost {
  border: 1px solid var(--border);
  background: rgba(139,92,246,0.08);
}
.btn-ghost:hover {
  border-color: rgba(139,92,246,0.45);
  background: rgba(139,92,246,0.18);
}

main.page {
  padding: calc(var(--nav-h) + 2.75rem) 2rem 4rem;
  max-width: 640px;
  margin: 0 auto;
}

.hero { margin-bottom: 2.5rem; }
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--purple);
  font-weight: 500;
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: Cinzel, serif;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.08;
  background: linear-gradient(135deg, #fff 0%, var(--purple) 50%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.9rem;
}
.lede {
  font-family: "Playfair Display", serif;
  font-style: italic;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.6;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 1.5rem 1.85rem;
  box-shadow: 0 0 40px rgba(91,33,182,0.12);
}

.field-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 0.55rem;
}

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

input[type="url"],
input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
}
input[type="url"]::placeholder {
  color: rgba(148,163,184,0.55);
}
input[readonly] {
  color: var(--cyan);
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: text;
}

.hint {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(248,113,113,0.35);
  background: rgba(185,28,28,0.18);
  color: #fecaca;
  font-size: 0.9rem;
}

.result {
  margin-top: 1.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
}

.result-actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.result-actions .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.copy-feedback {
  margin-top: 0.55rem;
  min-height: 1.25rem;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 500;
}

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


@media (max-width: 560px) {
  .site-nav { padding: 0 1rem; }
  main.page { padding-left: 1rem; padding-right: 1rem; }
  .row { flex-direction: column; }
  .btn { width: 100%; }
}
