/* home.css — styles used only by index.html ("alaa adil — product designer"). */

:root {
  --card-fill: #f2f2f2;
  /* Feed padding either side of the project grid */
  /* Feed side padding (max 190px left / 220px right). On narrower
     screens the padding shrinks first (split in the same 190:220 ratio)
     so the two card columns keep their ~424px width; only once it hits
     32px do the cards start to narrow. 871px = two 423.5px cards + gap. */
  --content-gap: clamp(32px, calc((100vw - var(--sidebar-total) - 871px) * 0.463), 190px);  /* left */
  --page-gutter: clamp(32px, calc((100vw - var(--sidebar-total) - 871px) * 0.537), 220px);  /* right */
}

/* ══════════════════════════════════════
   LAYOUT — fixed left sidebar + scrolling right feed.
   Reference: a Designfolio-style sidebar layout the user linked
   (screenshot of jennwchoi.com). Experimental branch only.
   ══════════════════════════════════════ */
.shell {
  display: flex;
  min-height: 100vh;
}


/* ── Right feed ── */
.feed {
  flex: 1;
  min-width: 0;
  padding: var(--sidebar-inset-y) var(--page-gutter) 80px var(--content-gap);
}
.feed-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-bottom: 0;
  align-items: start;
}
.feed-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.feed-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.feed-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--card-fill);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.feed-card-link:hover .feed-media { transform: scale(0.99); }
.feed-media video, .feed-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Very light hairline around cards whose media runs edge-to-edge
   on a white-ish frame, so they don't bleed into the page. */
.feed-media.feed-media--bordered::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--hairline);
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}

/* Badge only shows on hover of the card itself (not the custom
   cursor -- a separate, always-on system). */
.feed-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 150ms ease;
}
.feed-card-link:hover .feed-badge { opacity: 1; }

/* ── Skeleton shimmer ── */
.skeleton {
  position: absolute;
  inset: 0;
  background: var(--line);
  overflow: hidden;
  z-index: 2;
  transition: opacity 0.4s ease;
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  animation: skeleton-shimmer 1.6s infinite;
}
.skeleton.hidden {
  opacity: 0;
  pointer-events: none;
}
@keyframes skeleton-shimmer {
  100% { transform: translateX(200%); }
}
@media (max-width: 900px) {
  /* ══════════════════════════════════════
     RESPONSIVE — sidebar collapses to a top bar, feed goes single column
     ══════════════════════════════════════ */
  .shell { flex-direction: column; }
  .feed { padding: 24px 20px 60px; }
  .feed-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .feed-col { gap: 32px; }
}

/* ══════════════════════════════════════
   INTRO — "ALAA" name-drop, plays once on load (same as the live site)
   ══════════════════════════════════════ */
body.intro-active { overflow: hidden; }
/* Intro skipped (see home-intro-gate.js): never show the overlay. */
.skip-intro #wrap { display: none; }
.skip-intro body.intro-active { overflow: auto; }
#wrap {
  --intro-bg: #F2F0EA;
  --intro-ink: #111111;
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  background: var(--intro-bg);
  transition: opacity 0.5s ease;
}
#wrap.intro-hidden {
  opacity: 0;
  pointer-events: none;
}
#stage-scale {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1200px;
  height: 620px;
  transform-origin: 50% 50%;
}
#stage {
  position: relative;
  width: 1200px;
  height: 620px;
  background: var(--intro-bg);
  overflow: hidden;
  transform-origin: 50% 50%;
}
#stage .letter {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}
#stage .letter svg {
  display: block;
  height: 100%;
  width: auto;
}
#stage .letter path { fill: var(--intro-ink); }
#ball {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--intro-ink);
  will-change: transform;
}
#ground {
  position: absolute;
  left: 0;
  right: 0;
  top: 470px;
  height: 1px;
  background: rgba(0,0,0,0);
}
#stage .puff {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--intro-ink);
  opacity: 0;
  pointer-events: none;
}

/* Chat open (desktop): the 420px chat column takes its space from the
   side padding first, so the content only narrows slightly instead of
   shrinking to half. Animates in step with the panel. */
.feed { transition: padding var(--panel-duration) var(--panel-ease); }
@media (min-width: 901px) {
  body.chat-open .feed { padding-left: 48px; padding-right: 48px; }
}
