:root {
  --ink: #07141a;
  --muted: #3d5a66;
  --paper: #f7fbfc;
  --card: #ffffff;
  --line: #c9dde4;
  --teal: #0e7490;
  --teal-deep: #0a4f63;
  --teal-bright: #14b8a6;
  --sky: #5ec8e8;
  --warn-bg: #fff8e8;
  --warn-line: #f0d9a0;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(7, 40, 52, 0.18);
  --font: "DM Sans", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: #082029;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(94, 200, 232, 0.45), transparent 60%),
    radial-gradient(700px 480px at 90% 10%, rgba(20, 184, 166, 0.35), transparent 55%),
    linear-gradient(160deg, #0a3a4a 0%, #0e7490 42%, #0b5f6e 72%, #082029 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from { filter: hue-rotate(0deg) saturate(1); transform: scale(1); }
  to { filter: hue-rotate(12deg) saturate(1.08); transform: scale(1.03); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.top {
  text-align: center;
  padding: 3.2rem 1.25rem 1.5rem;
  animation: rise 0.7s ease both;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}

.brand-mark { color: #fff; }
.brand-dot { color: var(--sky); }
.brand-rest { color: rgba(255, 255, 255, 0.88); font-size: 0.72em; font-weight: 600; }

.tagline {
  margin: 0.55rem 0 0;
  color: rgba(232, 244, 248, 0.9);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

main {
  width: min(560px, calc(100% - 2rem));
  margin: 0 auto 3rem;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
  animation: rise 0.8s 0.08s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0.45rem 0 1.25rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.field {
  position: relative;
  display: block;
  margin-bottom: 0.85rem;
}

.field input {
  width: 100%;
  padding: 0.95rem 2.4rem 0.95rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.18);
  background: #fff;
}

.clear {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  border-radius: 999px;
  background: #d7e8ee;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.clear:hover { background: #c2d8e0; color: var(--ink); }

.submit {
  width: 100%;
  margin-top: 0.35rem;
  padding: 1rem 1.25rem;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #1290b0, var(--teal-deep));
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(10, 79, 99, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.submit:active { transform: translateY(0); }
.submit:disabled { opacity: 0.65; cursor: wait; transform: none; }

.error {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 10px;
  font-size: 0.95rem;
}

.result {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  animation: rise 0.45s ease both;
}

.result-label {
  margin: 0 0 0.55rem;
  font-weight: 600;
  color: var(--teal-deep);
}

.result-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preview-link {
  color: var(--teal);
  font-weight: 600;
  font-size: 1.05rem;
  word-break: break-all;
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
}

.copy:hover { color: var(--teal-deep); border-color: var(--teal); }
.copy.copied { color: #067a5a; border-color: #9ad4c2; background: #eefaf5; }

.expires {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hint {
  margin: 0.75rem 0 0;
  padding: 0.75rem 0.9rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  color: #6b5420;
  font-size: 0.9rem;
  line-height: 1.4;
}

.how {
  margin-top: 2rem;
  padding: 0 0.25rem;
  color: rgba(232, 244, 248, 0.92);
  animation: rise 0.9s 0.15s ease both;
}

.how h2 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: 1.35rem;
  color: #fff;
}

.how ol {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.55;
}

.how li { margin-bottom: 0.55rem; }

.how code {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  font-size: 0.9em;
}

footer {
  text-align: center;
  padding: 0 1rem 2.5rem;
  color: rgba(232, 244, 248, 0.7);
  font-size: 0.9rem;
}

footer a { color: var(--sky); }

@media (max-width: 480px) {
  .top { padding-top: 2.2rem; }
  .panel { padding: 1.35rem 1.1rem 1.2rem; }
}
