/*
  Card 02 — Dynamic Profile Card — standalone HTML/CSS implementation.
  No build step, no framework, no external dependency: copy index.html and
  this file into any project as-is. Uses native CSS Container Queries so
  the split-vs-stacked layout responds to the card's own width, not the
  viewport.
*/

:root {
  --card-accent: #39ff14;
  --card-fg: oklch(0.145 0 0);
  --card-muted: oklch(0.5 0 0);
  --card-border: oklch(0.88 0 0);
  --card-border-hover: oklch(0.74 0 0);
  --card-success: oklch(0.5 0.14 155);
  --card-tint: oklch(0.985 0.002 260);
}

/* The `@container` context has to live on a wrapper, not on
   `.profile-card` itself — a container query can only ever match a
   container's descendants, never the container element's own layout. */
.profile-card-container {
  container-type: inline-size;
  width: 100%;
}

.profile-card {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  overflow: hidden;
  border-radius: 2rem 0.5rem 0.5rem 2rem;
  background-color: var(--card-tint);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
}

.profile-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background-color: oklch(0.96 0 0);
}

.profile-card__media img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 250ms ease-out;
}

.profile-card:hover .profile-card__media img {
  transform: scale(1.035);
}

.profile-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.25rem;
}

.profile-card__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--card-fg);
}

.profile-card__role {
  margin: 0;
  font-size: 0.875rem;
  color: var(--card-muted);
}

.profile-card__meta {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: var(--card-muted);
}

.profile-card__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.profile-card__meta-item svg {
  height: 0.875rem;
  width: 0.875rem;
}

.profile-card__status-dot {
  height: 0.375rem;
  width: 0.375rem;
  border-radius: 9999px;
  background-color: var(--card-success);
}

.profile-card__rail {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--card-border);
  padding: 0.75rem 1.25rem;
  transition: background-color 200ms ease-out;
}

.profile-card:hover .profile-card__rail,
.profile-card:focus-within .profile-card__rail {
  background-color: color-mix(in oklab, var(--card-fg) 4%, transparent);
}

.profile-card__cta {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 1px solid var(--card-border);
  border-radius: 9999px;
  background: none;
  padding: 0.5rem 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--card-fg);
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: border-color 150ms ease-out;
}

.profile-card__cta:hover {
  border-color: var(--card-border-hover);
}

.profile-card__cta:focus-visible {
  outline: 2px solid var(--card-fg);
  outline-offset: 2px;
}

.profile-card__cta svg {
  height: 1rem;
  width: 1rem;
  transition: transform 150ms ease-out;
}

.profile-card:hover .profile-card__cta svg {
  transform: translateX(2px);
}

.profile-card__social {
  display: flex;
  height: 2.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--card-muted);
  text-decoration: none;
  outline: none;
  transition: color 150ms ease-out;
}

.profile-card__social:hover {
  color: var(--card-fg);
}

.profile-card__social:focus-visible {
  outline: 2px solid var(--card-fg);
  outline-offset: 2px;
}

.profile-card__social svg {
  height: 1rem;
  width: 1rem;
}

/* Split layout once the card itself (not the viewport) has room —
   matches the React version's `@container`/`@md:` breakpoint (28rem). */
@container (min-width: 28rem) {
  .profile-card {
    flex-direction: row;
  }

  .profile-card__media {
    aspect-ratio: auto;
    width: 38%;
    flex-shrink: 0;
  }

  .profile-card__rail {
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    border-top: none;
    border-left: 1px solid var(--card-border);
    padding: 0 0.75rem;
  }

  /* Unset the mobile row's `flex: 1 1 auto` — in the stretched column
     rail it would otherwise pull the button into a tall elongated pill
     instead of a compact icon button. */
  .profile-card__cta {
    flex: none;
    height: 2.25rem;
    width: 2.25rem;
    padding: 0;
  }

  .profile-card__cta-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-card__media img,
  .profile-card__rail,
  .profile-card__cta svg {
    transition: none;
  }

  .profile-card:hover .profile-card__media img,
  .profile-card:hover .profile-card__cta svg {
    transform: none;
  }
}

/*
  Page layout — the canvas this resource is presented on. Adjust or drop it
  when placing the resource inside your own layout.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(to bottom, #fafafa, #f4f4f5);
}
.card02-layout {
  display: flex;
  min-height: 24rem;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
}
.card02-layout__panel {
  width: 100%;
  max-width: 32rem;
}
