@font-face {
  font-family: 'PF Encore Sans Pro';
  src: url('assets/fonts/PFEncoreSansPro-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --surround-bg: #131313;
  --max-width: 480px;
  --gap: 14px;
  --card-height: 260px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--surround-bg);
  min-height: 100vh;
  font-family: 'PF Encore Sans Pro', Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  background-image: url('assets/img/background.webp');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  padding: calc(var(--gap) + var(--safe-top)) 0 calc(var(--gap) + var(--safe-bottom));
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  overflow-x: hidden;
}

/* Above 575px, float the page as a rounded card off the top of the
   viewport instead of running edge-to-edge — same breakpoint/pattern
   linktr.ee profiles use. The top margin is a fixed value (not tied to
   --gap) so it doesn't shift when --gap doubles for desktop below. */
@media (min-width: 576px) {
  .page {
    --gap: 28px;
    margin-top: 42px;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
  }
}

/* ---------- Carousel ---------- */

.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--gap);
  scroll-padding-right: var(--gap);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 var(--gap);
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.card {
  flex: 0 0 calc((100% - 10px) / 2.5);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  height: var(--card-height);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.card-media {
  flex: 0 0 calc(var(--card-height) / 2);
  height: calc(var(--card-height) / 2);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fixed-height box (not sized to content) clamped to 4 lines of copy.
   Measured at the narrowest card width (~141px, the default 390px mobile
   viewport): ~8 words / ~50-55 characters is the most that displays
   before the 4-line clamp truncates with an ellipsis. Shorter copy (like
   today's lorem-ipsum placeholders) leaves blank space at the bottom of
   the box instead — revisit --card-height once real copy is in so the
   box height matches actual content length. */
.card-copy {
  flex: 0 0 calc(var(--card-height) / 2);
  height: calc(var(--card-height) / 2);
  padding: 20px 14px 14px;
  background: linear-gradient(180deg, #ffffff, #d6d6d6);
  color: #595959;
  overflow: hidden;
}

.card-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Posts ---------- */

.posts {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: var(--gap) var(--gap) 0;
}

.post {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 539;
  overflow: hidden;
  background: #000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.post-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.post-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-play-icon {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.post.is-playing .post-play-icon {
  opacity: 0;
}

.post-link {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-mute {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Footer ---------- */

.footer {
  padding: var(--gap);
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .post-play-icon {
    transition: none;
  }
}
