/* Devolotion link — mobile-first */
:root {
  --background: 240 8% 4%;
  --foreground: 0 0% 98%;
  --card: 240 6% 7%;
  --primary: 199 75% 45%;
  --primary-soft: 200 50% 58%;
  --muted-foreground: 240 5% 58%;
  --border: 240 5% 14%;
  --radius: 0.75rem;
  --glass: 240 8% 10%;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.link-page {
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  background: hsl(var(--background));
}

.link-page.is-launching {
  overflow: hidden;
}
.link-page.is-launching .link-shell {
  opacity: 0;
}

.link-launch {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--background));
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.link-launch.is-exiting {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.link-launch-inner {
  text-align: center;
  padding: 1.5rem;
  animation: link-launch-in 0.5s ease both;
}
.link-launch-mark {
  margin: 0 auto 0.85rem;
  width: 3.5rem;
  height: 3.5rem;
}
.link-launch-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid hsl(var(--border));
  display: block;
}
.link-launch-avatar--letter {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 600;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
}
.link-launch-name {
  margin: 0 0 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}
.link-launch-loader {
  width: 5.5rem;
  height: 2px;
  margin: 0 auto;
  background: hsl(var(--border));
  border-radius: 999px;
  overflow: hidden;
}
.link-launch-loader-bar {
  display: block;
  height: 100%;
  width: 40%;
  background: hsl(var(--primary) / 0.7);
  border-radius: inherit;
  animation: link-launch-progress 1.1s ease-in-out infinite;
}

@keyframes link-launch-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes link-launch-progress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

.link-bg-base {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 100% 60% at 50% -15%, hsl(199 40% 22% / 0.12), transparent 50%),
    linear-gradient(180deg, hsl(240 8% 5%) 0%, hsl(var(--background)) 50%, hsl(240 10% 3%) 100%);
  pointer-events: none;
}

.link-bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  animation: link-float 18s ease-in-out infinite alternate;
  opacity: 0.55;
}
.link-bg-glow--1 {
  width: min(260px, 70vw);
  height: min(260px, 70vw);
  top: -8%;
  right: -20%;
  background: hsl(199 60% 40% / 0.14);
}
.link-bg-glow--2 {
  width: min(220px, 60vw);
  height: min(220px, 60vw);
  bottom: 8%;
  left: -25%;
  background: hsl(220 30% 35% / 0.1);
  animation-delay: -6s;
}

.link-bg-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 90% 80% at 50% 20%, transparent 50%, hsl(240 10% 2% / 0.5) 100%);
}

@keyframes link-float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-12px, 16px) scale(1.06); }
}

.link-glass {
  background: hsl(var(--glass) / 0.55);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid hsl(0 0% 100% / 0.06);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px hsl(0 0% 0% / 0.2);
}

.link-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.75rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: opacity 0.35s ease 0.05s;
}
.link-page:not(.is-launching) .link-shell {
  opacity: 1;
}

.link-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  margin-bottom: 0.15rem;
  padding: 0.65rem 0;
}

.link-profile-text {
  flex: 1;
  min-width: 0;
}

.link-avatar-wrap {
  position: relative;
  width: 4.25rem;
  height: 4.25rem;
  margin: 0;
  flex-shrink: 0;
}
.link-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid hsl(var(--border));
  box-shadow: none;
}
.link-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
}
.link-avatar-ring {
  display: none;
}

.link-name {
  margin: 0 0 0.15rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}
.link-headline {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  color: hsl(var(--primary-soft));
  font-weight: 500;
  line-height: 1.35;
}
.link-location {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.link-bio {
  margin: 0;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-section { margin-bottom: 0; }
.link-section--skills {
  padding: 0.65rem 0.75rem;
  background: hsl(var(--card) / 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.link-section:not(.link-section--skills) .link-section-title {
  margin-bottom: 0.55rem;
  padding-left: 0.1rem;
}
.link-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: hsl(var(--muted-foreground));
}

.link-skill-group { margin-bottom: 0.35rem; }
.link-skill-group:last-child { margin-bottom: 0; }
.link-skill-cat {
  margin: 0 0 0.3rem;
  font-size: 0.65rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.link-skill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.link-skill-pill {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.28rem 0.55rem;
  border-radius: 6px;
  background: hsl(var(--background) / 0.6);
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground) / 0.9);
  backdrop-filter: none;
  box-shadow: none;
}

.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  background: hsl(var(--card) / 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid hsl(var(--border));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}
.link-card:active {
  transform: scale(0.99);
  background: hsl(var(--card));
}
@media (hover: hover) {
  .link-card:hover {
    border-color: hsl(var(--primary) / 0.25);
    background: hsl(var(--card) / 0.85);
  }
}
.link-card-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  font-size: 0.9rem;
  box-shadow: none;
}
.link-card-body {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.link-card-title {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
}
.link-card-sub {
  display: block;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-card-chevron {
  flex-shrink: 0;
  color: hsl(var(--muted-foreground));
  opacity: 0.45;
}

.link-footer {
  text-align: center;
  padding-top: 1rem;
}
.link-footer-muted {
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
  opacity: 0.5;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .link-bg-glow { animation: none; }
  .link-launch-inner { animation: none; }
  .link-launch-loader-bar { animation: none; width: 100%; opacity: 0.5; }
  .reveal { transition: none; opacity: 1; transform: none; }
}

.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ——— Admin ——— */
.admin-body {
  min-height: 100dvh;
  background: hsl(var(--background));
}
.admin-layout {
  display: flex;
  min-height: 100dvh;
}
.admin-sidebar {
  width: 15rem;
  flex-shrink: 0;
  background: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}
.admin-sidebar-header {
  padding: 0 1rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 0.5rem;
}
.admin-sidebar-title { font-weight: 600; font-size: 0.95rem; margin: 0; }
.admin-sidebar-sub { font-size: 0.75rem; color: hsl(var(--muted-foreground)); margin: 0.25rem 0 0; }
.admin-nav a {
  display: block;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  border-left: 2px solid transparent;
}
.admin-nav a:hover,
.admin-nav a.active {
  color: hsl(var(--foreground));
  background: hsl(var(--border) / 0.35);
  border-left-color: hsl(var(--primary));
}
.admin-nav a.logout { color: hsl(0 62% 55%); margin-top: 0.5rem; }

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 1rem;
}
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.admin-topbar h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: inherit;
  cursor: pointer;
}
.admin-sidebar-backdrop {
  display: none;
}

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  margin-top: 0.75rem;
}
.form-label:first-child { margin-top: 0; }
.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: inherit;
}
.form-textarea { min-height: 5rem; resize: vertical; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary));
  color: #fff;
  cursor: pointer;
}
.btn-secondary {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.btn-danger {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(0 62% 40% / 0.5);
  background: hsl(0 62% 40% / 0.15);
  color: hsl(0 80% 70%);
  cursor: pointer;
}
.alert-success {
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: hsl(142 50% 30% / 0.25);
  border: 1px solid hsl(142 50% 40% / 0.4);
  font-size: 0.875rem;
}
.alert-error {
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  background: hsl(0 62% 40% / 0.2);
  border: 1px solid hsl(0 62% 50% / 0.4);
  font-size: 0.875rem;
}
.row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}
.row-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

@media (max-width: 768px) {
  .admin-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .admin-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .admin-sidebar.is-open { transform: translateX(0); }
  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .admin-sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  body.admin-nav-open { overflow: hidden; }
}

.login-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.login-card {
  width: 100%;
  max-width: 22rem;
}
