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

:root {
  --radius: 2px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Sans 3', sans-serif;
  --bg: #e8eef3;
  --surface: #f7fafc;
  --border: #b8c5d1;
  --text: #0c1b2a;
  --text-muted: #4a5d6e;
  --accent: #1a5f7a;
  --accent-ink: #f7fafc;
  --success: #1f7a5c;
  --error: #9b2c2c;
}

html {
  color-scheme: light;
}

body {
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, #c5d6e4 0%, transparent 60%),
    linear-gradient(180deg, #eef3f7 0%, var(--bg) 40%, #dfe8ef 100%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

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

.hidden {
  display: none !important;
}

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 24px 120px;
}

.hero {
  text-align: center;
  margin-bottom: 36px;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5.2rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--text);
  animation: brand-in 0.7s var(--ease-out) both;
}

.headline {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.25;
  margin-top: 18px;
  color: var(--accent);
  animation: rise 0.55s 0.08s var(--ease-out) both;
}

.lede {
  margin: 16px auto 0;
  max-width: 32rem;
  color: var(--text-muted);
  font-size: 1.08rem;
  animation: rise 0.55s 0.14s var(--ease-out) both;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.shorten-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--text) 6%, transparent);
  animation: rise 0.55s 0.2s var(--ease-out) both;
}

.shorten-form {
  display: flex;
  gap: 10px;
}

#url-input {
  flex: 1;
  min-width: 0;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

#submit-btn {
  position: relative;
  overflow: hidden;
  padding: 15px 26px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease-out), filter 0.2s, box-shadow 0.2s;
}

#submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 28%, transparent);
}

#submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

#submit-btn:disabled {
  cursor: wait;
}

#submit-btn.is-loading .btn-label {
  opacity: 0.35;
}

.btn-progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: color-mix(in srgb, #fff 22%, transparent);
  pointer-events: none;
}

#submit-btn.is-loading .btn-progress {
  animation: load-bar 0.9s linear infinite;
}

@keyframes load-bar {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.result {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: pop-in 0.4s var(--ease-out);
}

.result a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  font-weight: 700;
  font-size: 1.05rem;
}

.result a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.copy-btn {
  padding: 10px 16px;
  border: 1px solid var(--success);
  border-radius: var(--radius);
  background: var(--success);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease-out);
}

.copy-btn:hover {
  transform: scale(1.03);
}

.copy-btn.copied {
  animation: boom-btn 0.45s var(--ease-out);
}

.delete-btn {
  margin-left: auto;
  padding: 4px 10px;
  border: 1px solid var(--error);
  border-radius: var(--radius);
  background: transparent;
  color: var(--error);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.delete-btn:hover {
  background: var(--error);
  color: #fff;
}

.pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.plan {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 4px;
}

.plan h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}

.price {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
}

.price span {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.plan ul {
  list-style: none;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.plan ul li {
  margin-bottom: 5px;
}

.plan ul li::before {
  content: '— ';
  color: var(--accent);
  font-weight: 700;
}

.plan-badge {
  margin-top: auto;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.plan-pro {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}

.plan-pro .price span,
.plan-pro ul {
  color: color-mix(in srgb, var(--surface) 72%, transparent);
}

.plan-pro ul li::before {
  color: color-mix(in srgb, var(--surface) 80%, transparent);
}

.plan-cta {
  margin-top: auto;
  display: inline-block;
  text-align: center;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  transition: transform 0.15s var(--ease-out), filter 0.2s;
}

.plan-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.urls-section h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.urls-hint {
  margin: 0 0 14px;
  font-size: 0.9rem;
  opacity: 0.7;
}

.urls-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.url-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: rise 0.35s var(--ease-out) both;
}

.url-card .original {
  color: var(--text-muted);
  font-size: 0.85rem;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.url-card .short {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.url-card .short a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.url-card .meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.empty-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  font-style: italic;
}

.ad-slot {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.ad-slot.hidden-banner {
  display: none;
}

.ad-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ad-content {
  flex: 1;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.ad-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

.ad-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.ad-close:hover {
  opacity: 1;
  color: var(--text);
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  padding: 12px 22px;
  border-radius: 4px;
  font-weight: 700;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--text) 18%, transparent);
  animation: pop-in 0.3s var(--ease-out);
}

.toast.success {
  background: var(--success);
  color: #fff;
}

.toast.error {
  background: var(--error);
  color: #fff;
}

.boom {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  z-index: 150;
  transform: translate(-50%, -50%) scale(0.2);
}

.boom.is-on {
  animation: boom-burst 0.55s var(--ease-out) forwards;
}

@keyframes brand-in {
  from {
    opacity: 0;
    transform: translateY(16px);
    letter-spacing: 0.04em;
  }
  to {
    opacity: 1;
    transform: none;
    letter-spacing: -0.03em;
  }
}

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

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes boom-btn {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes boom-burst {
  0% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.3);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(7);
    box-shadow: 0 0 0 36px transparent;
  }
}

.warn-panel .dest {
  word-break: break-all;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: #fff;
  border-radius: var(--radius);
  font-size: 1.02rem;
  color: var(--text);
  animation: rise 0.55s 0.2s var(--ease-out) both;
}

.warn-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  animation: rise 0.55s 0.26s var(--ease-out) both;
}

a.warn-go,
a.warn-cancel {
  display: inline-block;
  padding: 15px 26px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 0.15s var(--ease-out), filter 0.2s, box-shadow 0.2s;
}

a.warn-go {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
}

a.warn-go:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 28%, transparent);
}

a.warn-cancel {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

a.warn-cancel:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.warn-note {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  animation: rise 0.55s 0.32s var(--ease-out) both;
}

@media (max-width: 560px) {
  .page {
    padding: 48px 16px 80px;
  }

  .shorten-form {
    flex-direction: column;
  }

  #submit-btn {
    width: 100%;
  }

  .pricing {
    grid-template-columns: 1fr;
  }

  .result {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-btn {
    width: 100%;
    text-align: center;
  }

  .url-card .short {
    flex-direction: column;
    align-items: stretch;
  }

  .ad-slot {
    flex-wrap: wrap;
  }

  a.warn-go,
  a.warn-cancel {
    width: 100%;
    text-align: center;
  }
}
