/* Screen 1: Home Feed */

/* ---------- Header ---------- */
.app-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--status-h) + 10px);
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}
/* INYEON wordmark (from the brand logo): thin, widely spaced capitals with a crescent O */
.wordmark {
  display: flex; align-items: center;
  font-family: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.3em;
  color: var(--fg);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.wordmark .wm-o {
  width: 1.25em; height: 1.05em;
  margin-right: 0.28em;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(157, 92, 255, 0.7));
}

.feed-tabs { display: flex; gap: 18px; padding-inline: 10px; }
.feed-tab {
  position: relative;
  padding-block: 12px 14px;
  font-size: 14px; font-weight: 700;
  color: rgba(255, 255, 255, 0.62);
}
.feed-tab.active { color: var(--fg); }
.feed-tab.active::after {
  content: "";
  position: absolute; left: 50%; bottom: 4px;
  transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--glow);
}
.bell { position: relative; display: grid; place-items: center; width: 36px; height: 36px; }
.bell svg { width: 24px; height: 24px; }
.bell.has-unread::after {
  content: "";
  position: absolute; top: 5px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* ---------- Feed ---------- */
/* One post per screen: each swipe snaps to the next post, like TikTok */
.feed {
  position: absolute;
  top: 0; left: 0; right: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

/* ---------- Post card (full-bleed media with overlays) ---------- */
.post {
  position: relative;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #0d0a14;
  isolation: isolate;
}
.post .scene {
  position: absolute; inset: -20%;
  z-index: -2;
  background:
    radial-gradient(34% 26% at var(--x1, 30%) var(--y1, 22%), var(--c1), transparent 70%),
    radial-gradient(40% 30% at var(--x2, 72%) var(--y2, 48%), var(--c2), transparent 72%),
    radial-gradient(30% 24% at var(--x3, 40%) var(--y3, 78%), var(--c3), transparent 70%);
  filter: blur(20px) saturate(1.25);
  animation: drift 14s ease-in-out infinite alternate;
}
.post img.photo, .post video.clip {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
.post::after {
  /* film grain + top/bottom shade so overlay text stays readable */
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 20%, transparent 55%, rgba(0,0,0,0.75)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.22'/></svg>");
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.post-top {
  position: absolute;
  top: calc(var(--header-h) + 10px);
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.poster { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  border: 2px solid rgba(255, 255, 255, 0.85);
}
.avatar.venue { border-radius: 14px; font-family: var(--font-display); font-size: 12px; }
.poster-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.poster-name { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 17px; }
.verified { width: 15px; height: 15px; color: var(--accent-light); }
.poster-time { font-size: 13px; color: rgba(255, 255, 255, 0.82); font-weight: 500; }

.location {
  flex: none;
  display: flex; align-items: center; gap: 9px;
  max-width: 52%;
  padding: 8px 14px 8px 11px;
  border-radius: 16px;
  background: rgba(8, 6, 14, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.location svg { flex: none; width: 20px; height: 20px; color: var(--accent-light); }
.location div { min-width: 0; display: flex; flex-direction: column; }
.location b, .location span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.location b { font-size: 13px; font-weight: 700; }
.location span { font-size: 11px; color: rgba(255, 255, 255, 0.72); }

.play {
  position: absolute; top: 46%; left: 50%;
  pointer-events: none;
  transition: opacity 0.2s;
  transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.post.playing .play { opacity: 0; }

/* right-hand action column */
.rail {
  position: absolute; right: max(8px, env(safe-area-inset-right, 0px)); bottom: 30px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.rail-btn {
  width: 58px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}
.rail-btn svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }
.rail-btn.like.on svg { color: var(--accent); filter: drop-shadow(0 0 10px var(--glow)); }
.rail-btn.like.on svg path { fill: var(--accent); stroke: var(--accent); }
.rail-btn.like.pop svg { animation: pop 0.35s ease; }
@keyframes pop { 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* bottom-left: crossed paths + caption + progress */
.post-bottom {
  position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); right: 80px; bottom: 26px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
}
.crossed {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 16px 5px 6px;
  border-radius: 999px;
  background: rgba(10, 7, 18, 0.66);
  border: 1px solid rgba(185, 139, 255, 0.35);
  box-shadow: 0 0 20px rgba(157, 92, 255, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 14px; font-weight: 700;
  color: var(--accent-light);
}
.crossed .faces { display: flex; }
.crossed .faces span {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  border: 2px solid #15101f;
  margin-left: -8px;
}
.crossed .faces span:first-child { margin-left: 0; }
.caption {
  margin: 0;
  font-size: 15px; line-height: 1.45; font-weight: 500;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
.progress {
  position: absolute; left: 16px; right: 16px; bottom: 12px;
  height: 3px; border-radius: 2px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.progress i {
  display: block; height: 100%; width: 100%;
  background: #fff; border-radius: 2px;
  transform-origin: left;
  animation: playback var(--dur, 20s) linear infinite;
}
@keyframes playback { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.progress.real i { animation: none; transform: scaleX(0); }

@media (prefers-reduced-motion: reduce) {
  .post .scene { animation: none; }
  .progress i { animation: none; transform: scaleX(0.15); }
}

/* vibe tag on posts made in Create */
.post-vibe {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(157, 92, 255, 0.35);
  border: 1px solid rgba(210, 182, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13px; font-weight: 800;
}

/* right side of the header: credits pill + bell */
.home-right { justify-self: end; display: flex; align-items: center; gap: 4px; }
.credits-pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 9px 0 7px;
  border-radius: 999px;
  background: rgba(157, 92, 255, 0.22);
  border: 1px solid rgba(185, 139, 255, 0.45);
  font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: none;
}
.credits-pill svg { width: 15px; height: 15px; color: var(--accent-light); }
.credits-pill.bump { animation: pill-bump 0.6s ease; }
@keyframes pill-bump {
  30% { transform: scale(1.12); box-shadow: 0 0 18px var(--glow); }
}

@media (max-width: 370px) {
  .wordmark { font-size: 12px; letter-spacing: 0.24em; }
}

/* ---------- Video controls (mobile, minimal) ---------- */
/* speaker: under the venue pill; 36px circle, 44px touch area */
.sound {
  position: absolute;
  top: calc(var(--header-h) + 66px);
  right: max(16px, env(safe-area-inset-right, 0px));
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(8, 6, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
}
.sound::before { content: ""; position: absolute; inset: -5px; }
.sound svg { width: 18px; height: 18px; }
.sound[aria-pressed="true"] { border-color: rgba(185, 139, 255, 0.55); color: var(--accent-light); }

/* the venue pill is a button: tap opens Venue Detail */
button.location { text-align: left; color: inherit; }
button.location:active { background: rgba(157, 92, 255, 0.3); }

/* play button: hidden while playing, shown when paused or when autoplay was blocked */
.post.blocked .play, .post.user-paused .play { opacity: 1; }

.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

/* "Live vibe · High Energy" context tag */
.post-live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: rgba(8, 6, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
}
.post-live i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 8px var(--accent);
  animation: live-pulse 1.6s ease-in-out infinite;
}
.post-live b { font-weight: 700; letter-spacing: 0; text-transform: none; font-size: 12px; color: rgba(255, 255, 255, 0.8); }
.post-live b::before { content: "·"; margin-right: 7px; color: rgba(255, 255, 255, 0.5); }
@keyframes live-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .post-live i { animation: none; } }

/* small phones (iPhone SE and similar): tighter rail so the caption keeps room */
@media (max-height: 700px) {
  .rail { gap: 8px; bottom: 22px; }
  .rail-btn svg { width: 27px; height: 27px; }
  .post-bottom { bottom: 20px; gap: 9px; }
  .caption { font-size: 14px; }
}
@media (max-width: 350px) {
  .avatar { width: 40px; height: 40px; }
  .poster-name { font-size: 15px; }
  .location { padding: 7px 11px 7px 9px; }
}

/* 320–359px phones: the For You / Following tabs move to a second header row so nothing wraps */
@media (max-width: 359px) {
  .app-header { grid-template-columns: 1fr auto; row-gap: 0; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
  .feed-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .feed-tab { padding-block: 6px 12px; white-space: nowrap; }
  .post-top { top: calc(var(--header-h) + 36px); }
  .sound { top: calc(var(--header-h) + 90px); }
}

/* phone turned sideways: compact rail so it doesn't run into the header (portrait is the main layout) */
@media (max-height: 500px) {
  .rail { gap: 6px; bottom: 14px; }
  .rail-btn { width: 44px; }
  .rail-btn span { display: none; }
  .rail-btn svg { width: 24px; height: 24px; }
  .sound { top: calc(var(--header-h) + 58px); }
  .post-bottom { bottom: 16px; gap: 6px; }
}


/* ---------- Tappable creator + crossed pill ---------- */
button.poster { text-align: left; }
button.poster:active .avatar, button.crossed:active { transform: scale(0.96); }
button.crossed { transition: transform 0.15s; }
.rail-btn.add-btn.on svg { color: var(--accent-light); }
.rail-btn:active svg { transform: scale(0.88); }

/* ---------- Home sheets (comments, add, invite, share, notifications) ---------- */
.hs-sheet { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.hs-sheet .fs-sub { margin: -6px 0 0; }
.hs-av { flex: none; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.hs-av.initials { background: linear-gradient(135deg, var(--a1), var(--a2)); }
.hs-av.me { background: linear-gradient(135deg, #ff6fb5, #7a35e8); font-size: 11px; }
.hs-av.icon { background: rgba(157, 92, 255, 0.16); border: 1px solid rgba(185, 139, 255, 0.35); color: var(--accent-light); }
.hs-av.icon svg { width: 18px; height: 18px; }
.hs-count { font-family: var(--font-body); font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 6px; }

.hs-comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-height: 46vh; overflow-y: auto; overscroll-behavior: contain; }
.hs-comment { display: flex; gap: 10px; align-items: flex-start; }
.hs-comment div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hs-comment p { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.hs-name { position: relative; font-size: 13px; font-weight: 800; color: #e4def0; }
button.hs-name::before { content: ""; position: absolute; inset: -10px -4px; }
.hs-comment em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.hs-text { font-size: 14px; line-height: 1.45; color: var(--fg); overflow-wrap: anywhere; }
.hs-comment.mine .hs-name { color: var(--accent-light); }
.hs-compose {
  position: sticky; bottom: 0;
  display: flex; gap: 8px; align-items: center;
  margin: 4px -4px 0; padding: 10px 4px 2px;
  background: #0b0911;
}
.hs-input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  color: var(--fg); font: inherit; font-size: 15px;
}
.hs-input:focus { outline: none; border-color: var(--accent-light); }
.hs-send { min-height: 46px; padding: 0 18px; border-radius: 999px; font-size: 14px; }

.hs-big-av { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(185, 139, 255, 0.5); box-shadow: 0 0 24px rgba(157, 92, 255, 0.35); }
.hs-big-av.venue { border-radius: 22px; display: grid; place-items: center; font-family: var(--font-display); font-size: 16px; background: linear-gradient(135deg, var(--a1), var(--a2)); }
.hs-sheet .btn[disabled] { opacity: 0.85; cursor: default; }

.hs-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hs-people li { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 0; }
.hs-people li + li { border-top: 1px solid var(--line); }
.hs-people-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hs-people-text b { font-size: 15px; font-weight: 800; }
.hs-people-text span { font-size: 12px; color: var(--muted); }
.hs-mini { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 13px; position: relative; }
.hs-mini::before { content: ""; position: absolute; inset: -4px; }
.hs-done { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; color: var(--accent-light); }
.hs-done svg { width: 15px; height: 15px; }
.hs-link { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.hs-link-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hs-link-text b { font-size: 14px; }
.hs-link-text span { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hs-share-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.hs-share-opt { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 0; font-size: 11.5px; font-weight: 700; color: #d9d5e3; }
.hs-share-opt span { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--accent-light); transition: transform 0.15s, background 0.15s; }
.hs-share-opt svg { width: 22px; height: 22px; }
.hs-share-opt:active span { transform: scale(0.92); background: var(--accent-soft); }
.hs-back { position: relative; align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.hs-back::before { content: ""; position: absolute; inset: -12px -8px; }
.hs-back svg { width: 16px; height: 16px; }

.hs-notif-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 44px; }
.hs-markall { position: relative; font-size: 13px; font-weight: 800; color: var(--accent-light); }
.hs-markall::before { content: ""; position: absolute; inset: -12px -6px; }
.hs-allread { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.hs-allread svg { width: 14px; height: 14px; }
.hs-notifs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.hs-notifs li + li { border-top: 1px solid var(--line); }
.hs-notif { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; text-align: left; }
.hs-notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: #cfc8de; line-height: 1.35; }
.hs-notif-text b { color: var(--fg); }
.hs-notif-text em { font-style: normal; font-size: 12px; color: var(--muted); }
.hs-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.hs-notif.unread .hs-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.hs-notif.unread .hs-notif-text { color: var(--fg); }
.hs-sheet .sf-stack { align-self: stretch; }
@media (max-width: 350px) {
  .hs-share-grid { gap: 2px; }
  .hs-share-opt { font-size: 10.5px; }
  .hs-share-opt span { width: 44px; height: 44px; }
}
