/* ============================================================
   Ritika Sharma — portfolio landing page
   ============================================================ */

:root {
  --ink:        #131313;
  --ink-soft:   #4a4a4a;
  --muted:      #7b7b7b;
  --line:       #e6e6e6;
  --paper:      #ffffff;
  --dark:       #191919;
  --dark-2:     #2b2b2b;
  --blue:       #2f6bff;

  --nav-h: 62px;

  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif:  'Playfair Display', 'Iowan Old Style', Georgia, serif;
  --font-script: 'Dancing Script', 'Snell Roundhand', cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

.arr { font-size: .85em; }

.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 42px);
  text-align: center;
  margin: 0 0 46px;
  letter-spacing: -.01em;
}

/* ─────────────────────────  NAV  ───────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 22px;
  background: rgba(17, 17, 17, .88);
  backdrop-filter: blur(12px);
  color: #fff;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
}

.nav__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  /* keep her face in the circle when the wide illustration is cropped */
  object-position: 46% 30%;
}

.nav__links {
  display: flex;
  gap: 34px;
  font-size: 13.5px;
  font-weight: 400;
  color: #eaeaea;
}

.nav__links a { opacity: .85; transition: opacity .2s; }
.nav__links a:hover { opacity: 1; }

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-size: 12.5px;
  font-weight: 500;
  transition: transform .2s, box-shadow .2s;
}
.nav__cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }

/* ─────────────────────────  HERO  ─────────────────────────
   .hero is the scroll runway. Inside it a sticky viewport holds a
   stage whose children are driven by two progress values set in JS:
     --p1 : 0 → 1   image goes full-bleed → small card
     --p2 : 0 → 1   side frames fly in from the left / right
   ---------------------------------------------------------- */
.hero {
  position: relative;
  height: 340vh;              /* runway length = how long the pin lasts */
  background: var(--dark);
}

.hero__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--dark);
}

.hero__stage {
  --p1: 0;
  --p2: 0;
  position: relative;
  width: 100%;
  height: 100%;
}

/* the shrinking image ------------------------------------- */
.hero__img {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  z-index: 2;
  overflow: hidden;
  transform: translate(-50%, -50%);

  /* interpolate between full-bleed and a 360px card */
  width:  calc(360px + (100vw - 360px) * (1 - var(--p1)));
  height: calc(360px + (100vh - 360px) * (1 - var(--p1)));
  border-radius: calc(var(--p1) * 10px);
  box-shadow: 0 calc(var(--p1) * 40px) calc(var(--p1) * 90px) rgba(0, 0, 0, .55);
}

.hero__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* the illustration is wide; bias the crop so she stays centred in the
     square card at the end of the shrink */
  object-position: 47% 50%;
}

/* the script headline ------------------------------------- */
.hero__headline {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(1100px, 92vw);
  margin: 0;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: var(--font-script);
  font-weight: 600;
  font-size: clamp(30px, 5.2vw, 66px);
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 4px 26px rgba(0, 0, 0, .55);
  pointer-events: none;
}

/* the frames that fly in ----------------------------------
   Geometry and motion are both authored in script.js (FRAMES config):
   each frame is placed relative to the centre of the stage so it can
   never crowd the main image, then swept in along an arc.           */
.frames {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.frame {
  position: absolute;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 22px 48px rgba(0, 0, 0, .5);
  opacity: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

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

/* ─────────────────────────  INTRO  ───────────────────────── */
.intro {
  max-width: 720px;
  margin: 0 auto;
  padding: 96px 24px 30px;
  text-align: center;
}

.intro__kicker {
  margin: 0;
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 400;
  color: var(--ink-soft);
}

.intro__title {
  margin: 10px 0 30px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -.015em;
}

.intro__copy {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* ────────────────────  FEATURED PROJECTS  ──────────────────── */
.projects {
  max-width: 1080px;
  margin: 0 auto;
  padding: 90px 24px 40px;
}

/* Each card sticks a bit lower than the one before it, so as you scroll
   the next card slides up and covers the previous one. Each card is also
   a little WIDER than the one it covers, which is what makes the stack
   read as depth rather than as three identical slabs. */
.stack {
  --grow: 46px;                 /* width added per step in the stack */
  --last: 2;                    /* index of the last card (set by script.js) */
  display: flex;
  flex-direction: column;
  gap: 54px;
}

.pcard {
  position: sticky;
  top: calc(var(--nav-h) + 30px + var(--i) * 20px);
  width: calc(100% - (var(--last) - var(--i)) * var(--grow));
  margin-inline: auto;
  /* opaque so it hides the card beneath — but no panel, radius or shadow:
     the text should read as sitting straight on the page */
  background: var(--paper);
  padding-bottom: 6px;
}

.pcard__media {
  border-radius: 12px;
  overflow: hidden;
  padding: 24px 24px 0;
  aspect-ratio: 16 / 8.4;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .10);
}

.pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px 8px 0 0;
}

.pcard__media--blue  { background: linear-gradient(160deg, #cfe0ff, #6f94ea); }
.pcard__media--green { background: linear-gradient(160deg, #d5f0d1, #3f7a45); }
.pcard__media--peach { background: linear-gradient(160deg, #ffd9c2, #e07a5f); }

.pcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 26px 6px 46px;
}

.pcard__foot h3 {
  margin: 0 0 9px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.015em;
}

.pcard__foot p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 56ch;
}

.pcard__btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border: 1px solid #c9d6f6;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--blue);
  background: #f7f9ff;
  transition: background .2s, transform .2s;
}
.pcard__btn:hover { background: #eaf0ff; transform: translateY(-1px); }

/* ──────────────────  CANVAS AND COLOR (marquee)  ────────────────── */
.canvas { padding: 110px 0 90px; }

.marquee {
  overflow: hidden;
  /* fade the edges so cards enter and leave softly */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.marquee__track {
  display: flex;
  gap: 22px;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

.art {
  margin: 0;
  flex: none;
  width: 340px;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
}

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

@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }   /* track is duplicated */
}

/* ─────────────────────────  FOOTER  ───────────────────────── */
.footer {
  background: var(--dark-2);
  color: #f2f2f2;
  text-align: center;
  padding: 46px 24px 26px;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
}

.footer__title {
  margin: 14px 0 12px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: .02em;
}

.footer__copy {
  margin: 0 0 26px;
  font-size: 12.5px;
  color: #b9b9b9;
}
.footer__copy a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.socials { display: flex; justify-content: center; gap: 12px; }

.socials a {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #efefef;
  color: #1c1c1c;
  transition: transform .2s, background .2s;
}
.socials a:hover { background: #fff; }

.socials svg { width: 17px; height: 17px; }
.socials a:hover { transform: translateY(-2px); }

.footer__legal {
  margin: 30px 0 0;
  font-size: 10.5px;
  color: #8a8a8a;
}

/* ─────────────────────────  RESPONSIVE  ───────────────────────── */
@media (max-width: 860px) {
  .nav__links { display: none; }

  .hero { height: 300vh; }

  .hero__img {
    width:  calc(260px + (100vw - 260px) * (1 - var(--p1)));
    height: calc(260px + (100vh - 260px) * (1 - var(--p1)));
  }

  .stack { --grow: 22px; }
  .pcard__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 4px 34px;
  }
  .art { width: 250px; }
}

/* Respect reduced-motion: no pinning choreography, no marquee. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero { height: 100vh; }
  .hero__stage { --p1: 1; }
  .marquee__track { animation: none; }
  .pcard { position: static; }
}
