:root {
  --page-bg: #d1d1d1;
  --card-bg: #ffffff;
  --brand-blue: #1774cf;
  --brand-blue-hover: #0e68bd;
  --brand-blue-active: #0a5aa6;
  --text: #121212;
  --focus: #ffcc33;
  --shadow: 0 12px 36px rgb(0 0 0 / 10%);
  --pill-radius: 999px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.profile-card {
  width: calc(100% - 40px);
  max-width: 580px;
  min-height: calc(100vh - 40px);
  margin: 40px auto 0;
  padding: 78px 28px 96px;
  overflow: hidden;
  background: var(--card-bg);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow);
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-logo {
  display: block;
  width: 132px;
  height: 132px;
  margin: 0 auto 12px;
  object-fit: cover;
  border-radius: 50%;
}

.profile-header h1 {
  margin: 0;
  color: var(--brand-blue);
  font-size: clamp(1.45rem, 4vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
}

.profile-header p {
  max-width: 440px;
  margin: 8px auto 32px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.link-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list :is(a, button) {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  min-height: 56px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--brand-blue);
  border-radius: 999px;
  box-shadow: 0 3px 8px rgb(0 80 155 / 10%);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.link-list :is(a, button) svg {
  grid-column: 1;
  width: 28px;
  height: 28px;
  color: #ffffff;
}

.link-list :is(a, button) span {
  grid-column: 2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.link-list :is(a, button):hover {
  background: var(--brand-blue-hover);
  box-shadow: 0 7px 16px rgb(0 80 155 / 20%);
  transform: translateY(-2px);
}

.link-list :is(a, button):active {
  background: var(--brand-blue-active);
  box-shadow: 0 2px 5px rgb(0 80 155 / 15%);
  transform: translateY(1px);
}

.link-list :is(a, button):focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.instagram-viewer {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.instagram-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgb(26 64 92 / 82%), rgb(4 30 52 / 92%));
  backdrop-filter: blur(14px);
}

.instagram-viewer__dialog {
  position: relative;
  display: grid;
  width: min(100%, 480px);
  max-height: calc(100dvh - 32px);
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 18px;
  outline: none;
}

.instagram-viewer__stage {
  position: relative;
  min-height: 0;
  touch-action: pan-y;
}

.instagram-post {
  max-height: calc(100dvh - 176px);
  overflow: auto;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 22px 70px rgb(0 0 0 / 34%);
  scrollbar-width: thin;
}

.instagram-post__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.instagram-post__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 16px;
  font-size: 1rem;
}

.instagram-post__header img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
}

.instagram-post__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: min(58dvh, 610px);
  object-fit: contain;
  background: #f5f5f5;
}

.instagram-post__content {
  padding: 12px 17px 18px;
}

.instagram-post__metrics {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 650;
}

.instagram-post__metrics span {
  font-size: 1.65rem;
  font-weight: 400;
  line-height: 1;
}

.instagram-post__content p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.instagram-post__open-hint {
  display: block;
  margin-top: 10px;
  color: var(--brand-blue);
  font-size: 0.87rem;
  font-weight: 700;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  padding: 0 0 4px;
  color: #17212b;
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
  font: 300 2.4rem/1 sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}

.carousel-arrow--previous {
  left: -70px;
}

.carousel-arrow--next {
  right: -70px;
}

.carousel-arrow:focus-visible,
.carousel-dots button:focus-visible,
.instagram-post__link:focus-visible,
.instagram-close:focus-visible,
.instagram-cta:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  max-width: 100%;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
}

.carousel-dots button {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  padding: 0;
  background: rgb(255 255 255 / 45%);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: width 160ms ease, background-color 160ms ease;
}

.carousel-dots button[aria-current="true"] {
  width: 24px;
  background: #ffffff;
}

.instagram-viewer__actions {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.instagram-cta,
.instagram-close {
  min-height: 58px;
  color: #101418;
  background: #ffffff;
  border: 0;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}

.instagram-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

.instagram-cta svg {
  width: 25px;
  height: 25px;
}

.instagram-close {
  display: grid;
  width: 58px;
  place-items: center;
  padding: 0 0 4px;
  border-radius: 50%;
  font: 300 2.3rem/1 sans-serif;
  cursor: pointer;
}

@media (max-width: 640px) {
  html,
  body {
    background: var(--card-bg);
  }

  .profile-card {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 54px 20px 64px;
    border-radius: 0;
    box-shadow: none;
  }

  .profile-logo {
    width: 116px;
    height: 116px;
  }

  .profile-header p {
    margin-bottom: 28px;
  }

  .link-list :is(a, button) {
    grid-template-columns: 34px minmax(0, 1fr) 26px;
    padding-inline: 14px;
    font-size: 0.96rem;
  }

  .instagram-viewer {
    padding: 14px 16px;
  }

  .instagram-viewer__dialog {
    width: min(100%, 420px);
    gap: 14px;
  }

  .instagram-post {
    max-height: calc(100dvh - 150px);
    border-radius: 22px;
  }

  .instagram-post__image {
    max-height: calc(100dvh - 340px);
  }

  .carousel-arrow {
    width: 46px;
    height: 46px;
    background: rgb(255 255 255 / 88%);
  }

  .carousel-arrow--previous {
    left: -10px;
  }

  .carousel-arrow--next {
    right: -10px;
  }
}

@media (max-width: 360px) {
  .profile-card {
    padding-inline: 14px;
  }

  .link-list :is(a, button) {
    grid-template-columns: 30px minmax(0, 1fr) 20px;
    padding-inline: 12px;
    font-size: 0.9rem;
  }

  .link-list :is(a, button) svg {
    width: 25px;
    height: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .link-list :is(a, button):hover,
  .link-list :is(a, button):active {
    transform: none;
  }
}
