:root {
  color-scheme: light dark;
  --bg: #0f172a;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(148, 163, 184, 0.24);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dark: #075985;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f1f5f9;
    --panel: rgba(15, 23, 42, 0.05);
    --panel-strong: rgba(15, 23, 42, 0.08);
    --border: rgba(15, 23, 42, 0.14);
    --text: #0f172a;
    --muted: #475569;
    --accent-dark: #e0f2fe;
  }
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  margin: 0;
  padding: 42px 16px 32px;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.16), transparent 52%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter,
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
}

.shell {
  width: min(100%, 480px);
  margin: 0 auto;
}

.panel,
.link-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.panel {
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.empty-state,
.builder {
  padding: 24px;
}

.empty-state {
  text-align: center;
}

.benefits {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  color: var(--muted);
  line-height: 1.45;
  list-style: none;
}

.benefits li {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel-strong);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  letter-spacing: -0.04em;
}

p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.link-list {
  display: grid;
  gap: 14px;
}

.link-card {
  position: relative;
  display: block;
  padding: 18px 46px 18px 18px;
  color: inherit;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.link-card::after {
  content: ">";
  position: absolute;
  top: 50%;
  right: 18px;
  color: var(--muted);
  transform: translateY(-50%);
}

.link-card:focus-visible {
  border-color: rgba(56, 189, 248, 0.75);
  background: var(--panel-strong);
  outline: none;
}

@media (hover: hover) {
  .link-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.75);
    background: var(--panel-strong);
  }
}

.link-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.link-description {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: 0.86;
}

.builder {
  margin-top: 18px;
}

.builder-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 9px 14px;
  background: var(--accent);
  color: #082f49;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--text);
}

.button:hover,
.button:focus-visible {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.3);
  outline: none;
}

.link-fields {
  display: grid;
  gap: 14px;
}

.link-field {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
}

label span,
.output-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.92rem;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  background: rgba(15, 23, 42, 0.28);
  color: var(--text);
  font: inherit;
}

@media (prefers-color-scheme: light) {
  input {
    background: rgba(255, 255, 255, 0.7);
  }
}

input:focus {
  border-color: var(--accent);
  outline: none;
}

.field-actions,
.builder-actions,
.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.builder-actions {
  margin-top: 16px;
}

.output-label {
  margin-top: 20px;
}

.share-row {
  align-items: stretch;
}

.share-url {
  flex: 1 1 220px;
  min-height: 42px;
}

@media (max-width: 520px) {
  .share-url {
    flex-basis: auto;
  }
}

.footer {
  width: min(100%, 480px);
  margin: auto auto 0;
  padding: 22px 16px 0;
  text-align: center;
}

.footer-action {
  margin-bottom: 10px;
}

.footer a,
.footer-button {
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.footer-button {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  opacity: 0.82;
}

.footer a:hover,
.footer a:focus-visible,
.footer-button:hover,
.footer-button:focus-visible {
  color: var(--accent);
  outline: none;
}

@media (max-width: 520px) {
  body {
    padding: 22px 12px 28px;
  }

  .empty-state,
  .builder,
  .link-card {
    border-radius: 14px;
  }

  .builder-head,
  .share-row {
    flex-direction: column;
  }

  .field-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .builder-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .builder-actions .button:last-child {
    grid-column: 1 / -1;
  }

  .button {
    width: 100%;
  }
}
