/* ==========================================================================
   AkhilJ.ca — home.css  (Homepage only, loaded after v3.css + flow.css)
   A calm landing that invites scrolling: centred headline, the five project
   covers fanned out and peeking below the fold (they straighten and spread
   as you scroll), then short chapters in the same colour flow as Work.
   ========================================================================== */

.page-home .hm-kicker { font-size: var(--fs-sm); color: var(--wk-muted); }
.hm-h2 {
  margin-top: 16px;
  font-size: clamp(2.4rem, 1rem + 4.2vw, 5.2rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--wk-ink);
  text-wrap: balance;
}
.hm-h2 span { color: var(--wk-muted); }

/* ---------- Hero ---------- */
.hm-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--header-h));
  padding-top: clamp(28px, 5.5vh, 80px);
  overflow: clip;
  text-align: center;
}
.hm-hero__eyebrow { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.hm-hero__eyebrow span { font-weight: 400; color: var(--muted); }
.hm-hero__title {
  margin: 22px auto 0;
  font-size: clamp(3rem, 1rem + 5.6vw, 6.6rem);
  line-height: 0.94;
  letter-spacing: -0.058em;
  max-width: 11ch;
}
.hm-hero__title em { color: var(--accent); letter-spacing: -0.05em; }
.hm-hero__lede { margin: 26px auto 0; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem); line-height: 1.5; color: var(--ink-2); max-width: 40ch; }
.hm-hero__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 32px; margin-top: 34px; }

/* The fan: five covers, overlapping and tilted, cut off by the fold.
   --s (0 → 1, set by home.js as the hero scrolls away) straightens and spreads them. */
.hm-fan {
  --s: 0;
  --w: clamp(220px, 25vw, 400px);
  position: relative;
  flex: 1 0 auto;
  min-height: calc(var(--w) * 0.66);
  margin-top: clamp(36px, 5.5vh, 72px);
}
.hm-fan__card {
  --a: max(var(--i), calc(var(--i) * -1));
  position: absolute;
  left: 50%;
  bottom: calc(var(--w) * -0.16);
  width: var(--w);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 10px;
  background: var(--stone);
  box-shadow: 0 0 0 1px var(--line);
  z-index: calc(10 - var(--a));
  transform-origin: 50% 120%;
  transform:
    translateX(calc(-50% + var(--i) * var(--w) * (0.42 + 0.66 * var(--s))))
    translateY(calc(var(--a) * 22px * (1 - var(--s))))
    rotate(calc(var(--i) * 6deg * (1 - var(--s))));
  transition: translate 1200ms var(--ease-out), opacity 900ms var(--ease), scale 700ms var(--ease-out);
  transition-delay: calc(var(--a) * 90ms);
}
.hm-fan__card img { width: 100%; height: 100%; object-fit: cover; }
.hm-fan__card:hover { scale: 1.04; transition-delay: 0ms; }
/* One-time entrance: the cards rise into place */
.js .hm-fan:not(.is-in) .hm-fan__card { translate: 0 30%; opacity: 0; }

/* ---------- Proof: three numbers ---------- */
.hm-proof { padding: clamp(120px, 14vw, 208px) 0; text-align: center; }
.hm-proof .hm-h2 { margin-inline: auto; max-width: 16ch; }
.hm-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(64px, 8vw, 112px);
}
.hm-stats li { padding: 8px clamp(12px, 2vw, 32px); }
.hm-stats li + li { border-left: 1px solid var(--wk-line); }
.hm-stat {
  font-size: clamp(3.6rem, 1.6rem + 6vw, 8.4rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: var(--wk-ink);
  font-variant-numeric: tabular-nums;
}
.hm-plus { color: var(--wk-muted); }
.hm-stats li > p:last-child { margin-top: 16px; font-size: var(--fs-sm); color: var(--wk-muted); }
.hm-proof__foot { margin: clamp(56px, 6vw, 88px) auto 0; max-width: 46ch; font-size: 1.05rem; line-height: 1.6; color: var(--wk-ink-2); }
.hm-proof__foot .text-link { color: var(--wk-ink); }

/* ---------- Selected work: swipeable row ---------- */
.hm-work { padding: clamp(112px, 12vw, 184px) 0 clamp(88px, 9vw, 140px); }
.hm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; }
.hm-rail__ctrl { display: flex; gap: 10px; }
.hm-arrow {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  transition: box-shadow 300ms var(--ease), opacity 300ms var(--ease), background-color 300ms var(--ease);
}
.hm-arrow svg { width: 16px; height: 16px; }
.hm-arrow:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.hm-arrow:disabled { opacity: 0.3; cursor: default; box-shadow: inset 0 0 0 1px var(--line-strong); }

.hm-rail {
  margin-top: clamp(40px, 4.5vw, 64px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--container)) / 2));
  scrollbar-width: none;
}
.hm-rail::-webkit-scrollbar { display: none; }
.hm-rail__track {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  width: max-content;
  padding-inline: max(var(--gutter), calc((100vw - var(--container)) / 2));
}
.hm-slide { width: clamp(280px, 40vw, 600px); scroll-snap-align: start; }
.hm-slide a { display: block; }
.hm-slide__img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-l); background: var(--stone); }
.hm-slide__img img { width: 100%; height: 100%; object-fit: cover; transition: scale 1100ms var(--ease-out); }
.hm-slide a:hover .hm-slide__img img { scale: 1.035; }
.hm-slide__meta { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: var(--fs-xs); color: var(--muted); }
.hm-slide__tag { padding: 2px 7px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-2); }
.hm-slide__name { display: block; margin-top: 8px; font-size: clamp(1.5rem, 1.2rem + 0.9vw, 2.1rem); letter-spacing: -0.04em; line-height: 1.1; color: var(--ink); transition: color 400ms var(--ease); }
.hm-slide a:hover .hm-slide__name { color: var(--accent); }
.hm-slide__line { display: block; margin-top: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.hm-work__all { margin-top: clamp(40px, 4.5vw, 56px); }

/* ---------- What I do ---------- */
.hm-do { padding: clamp(112px, 12vw, 184px) 0; text-align: center; }
.hm-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: clamp(56px, 6vw, 88px);
  text-align: left;
}
.hm-tile {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  padding: clamp(22px, 2vw, 30px);
  border-radius: var(--radius-l);
  background: rgba(251, 249, 246, 0.62);
  transition: background-color 500ms var(--ease);
}
.hm-tile:hover { background: var(--surface); }
.hm-tile h3 { margin-top: auto; font-size: clamp(1.35rem, 1.1rem + 0.6vw, 1.75rem); letter-spacing: -0.035em; line-height: 1.1; }
.hm-tile p { margin-top: 12px; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; }

.hm-method { margin-top: clamp(56px, 6vw, 88px); }
.hm-method > p { font-size: var(--fs-xs); color: var(--muted); }
.hm-method ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 0; margin-top: 16px; }
.hm-method li { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-sm); color: var(--ink); }
.hm-method li + li::before { content: ""; align-self: center; width: clamp(16px, 2.4vw, 40px); height: 1px; margin: 0 clamp(10px, 1.2vw, 18px); background: var(--line-strong); }

/* ---------- About ---------- */
.hm-about { padding: clamp(112px, 12vw, 184px) 0; }
.hm-about__grid { align-items: center; row-gap: 48px; }
.hm-about__media { grid-column: 1 / span 5; margin-top: 0; cursor: default; }
.hm-about__photo { position: relative; aspect-ratio: 4 / 5; background: #DCD5C9; }
.hm-about__text { grid-column: 7 / span 6; }
.hm-about__quote { margin-top: 18px; font-size: clamp(1.7rem, 1.1rem + 1.7vw, 2.8rem); line-height: 1.12; letter-spacing: -0.04em; color: var(--wk-ink); }
.hm-about__quote em { color: var(--accent); }
.hm-about__body { margin-top: 22px; max-width: 48ch; color: var(--wk-ink-2); }
.hm-about__text > .arrow-link { margin-top: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hm-fan { --w: clamp(180px, 44vw, 320px); }
  .hm-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-about__media, .hm-about__text { grid-column: 1 / -1; }
  .hm-about__media { width: min(100%, 420px); }
}
@media (max-width: 640px) {
  .hm-fan { --w: 60vw; }
  .hm-stats { grid-template-columns: 1fr; }
  .hm-stats li { padding: 28px 0; }
  .hm-stats li + li { border-left: 0; border-top: 1px solid var(--wk-line); }
  .hm-tiles { grid-template-columns: 1fr; }
  .hm-tile { min-height: 0; }
  .hm-tile h3 { margin-top: 28px; }
  .hm-method ol { flex-direction: column; align-items: center; gap: 12px; }
  .hm-method li + li::before { display: none; }
  .hm-slide { width: 78vw; }
  .hm-rail__ctrl { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-fan__card { transition: none; }
  .js .hm-fan:not(.is-in) .hm-fan__card { translate: none; opacity: 1; }
  .hm-slide a:hover .hm-slide__img img, .hm-fan__card:hover { scale: 1; }
}
