/*
  Home page — friend-portfolio
  Built on docs/design.md: tokens from tokens.css, reset/nav/reveal from global.css.
  Only home-specific layout lives here. Colour, size, spacing, radius and motion
  values come from tokens; the few raw numbers are layout ratios copied from the reference.
*/

.page {
  max-width: calc(var(--content-max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-m);
}

/* ---------- Shared pieces ---------- */
.sec, .block { width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--gap-l); padding-bottom: var(--section-pad); }
.block__border { display: none; }
h3, h4, .h3, .h4 { font-weight: inherit; }
.split > *, .about__cols > *, .services__top > *, .faq__cols > *, .bento > * { min-width: 0; }
.h2 { font-size: var(--text-l); line-height: var(--lh-tight); }
.h3, .h4 { font-size: var(--text-m); line-height: var(--lh-tight); }
.lead, .display-24, .body, .lead--sm { font-size: var(--text-m); line-height: var(--lh-tight); color: var(--color-ink); }
.display-24 { color: var(--color-muted); }
.rule { display: none; }
img { display: block; max-width: none; }
svg { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.split, .about__cols, .services__top, .faq__cols {
  width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-m); align-items: start;
}
.split__text, .about__info, .services__left, .faq__left { display: flex; flex-direction: column; align-items: flex-start; gap: var(--gap-m); }
.split__text--center { align-self: center; }
.split__img, .about__photo img, .services__img, .faq__img, .process__img, .reviews__img {
  width: 100%; height: var(--media-h); object-fit: cover; object-position: center; border-radius: var(--radius);
}

.chips { display: flex; flex-wrap: wrap; gap: var(--gap-s) var(--gap-m); }
.chip { color: var(--color-muted); }
.badge, .tag { display: inline-flex; align-items: center; gap: var(--gap-s); font-size: var(--text-s); line-height: var(--lh-tight); color: var(--color-muted); }
.badge__icon { display: none; }
.tag__dot { width: var(--gap-s); height: var(--gap-s); border-radius: 50%; background: var(--color-ink); }

/* Buttons (new pattern, documented in design.md) */
.btn-row { display: flex; align-items: center; justify-content: center; gap: var(--gap-m); flex-wrap: wrap; }
.btn-row--left { justify-content: flex-start; }
.btn { display: inline-flex; background: var(--color-ink); color: var(--color-bg); border-radius: var(--radius); transition: opacity var(--dur-link) var(--ease-link); }
.btn__in { display: flex; padding: var(--gap-m); }
.btn__txt { font-size: var(--text-s); line-height: var(--lh-tight); white-space: nowrap; }
.btn:hover { opacity: 0.8; }
.btn-row .btn + .btn { background: none; color: var(--color-ink); }
.btn-row .btn + .btn:hover { opacity: 1; text-decoration: underline; text-underline-offset: var(--gap-xs); }
.link-display { font-size: var(--text-s); line-height: var(--lh-tight); }
.link-display:hover { text-decoration: underline; text-underline-offset: var(--gap-xs); }

/* ---------- Nav (reuses .nav from global.css) ---------- */
.nav__brand img { height: var(--icon); width: auto; filter: invert(1); }
.nav__right { display: flex; align-items: center; gap: var(--gap-m); }

/* ---------- Hero ---------- */
.hero { width: 100%; padding: var(--hero-top) 0 var(--section-pad); display: flex; flex-direction: column; align-items: center; gap: var(--gap-l); text-align: center; }
.hero__main { width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--gap-l); }
.hero__top { display: flex; flex-direction: column; align-items: center; gap: var(--gap-l); width: 100%; }
.hero__copy { display: flex; flex-direction: column; align-items: center; gap: var(--gap-m); }
.hero__title { font-size: var(--text-xl); line-height: var(--lh-tight); max-width: 840px; }
.hero__body { font-size: var(--text-m); line-height: var(--lh-tight); max-width: 840px; }
.hero__scroll { display: flex; align-items: center; justify-content: center; gap: var(--gap-m); width: 100%; max-width: 640px; color: var(--color-muted); font-size: var(--text-s); }
.hero__scroll .line { flex: 1; height: var(--underline); background: var(--color-muted); opacity: 0.4; }
.hero__scroll span { white-space: nowrap; }
.hero__mouse { width: var(--icon); height: var(--icon); color: var(--color-ink); flex: none; }

/* ---------- Tickers ---------- */
.ticker {
  width: 100%; overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12.5%, #000 87.5%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 12.5%, #000 87.5%, transparent 100%);
}
.ticker__track { display: flex; align-items: center; width: max-content; gap: var(--gap-l); padding-right: var(--gap-l); animation: marquee var(--dur, 30s) linear infinite; }
.ticker__track[data-reverse] { animation-direction: reverse; }
.ticker__track li { flex: none; }
.ticker--logos { max-width: 840px; }
.ticker--logos .ticker__track li img { height: var(--icon); width: auto; filter: invert(1); opacity: 0.65; }
@keyframes marquee { to { transform: translateX(-50%); } }
.ticker__track--chips { gap: var(--gap-m); padding-right: var(--gap-m); }
.pchip { display: flex; align-items: center; gap: var(--gap-s); white-space: nowrap; color: var(--color-muted); }
.pchip svg { width: var(--icon); height: var(--icon); color: var(--color-ink); }
.ticker__track--reviews { align-items: flex-start; gap: var(--gap-m); padding-right: var(--gap-m); }
.more-services { width: 100%; display: flex; flex-direction: column; gap: var(--gap-m); }

/* ---------- Projects ---------- */
.projects { width: 100%; padding-bottom: var(--section-pad); display: flex; flex-direction: column; align-items: center; gap: var(--gap-l); }
.projects__stage { width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--gap-l); }
.projects__grid { display: flex; align-items: center; gap: var(--gap-m); width: 100%; }
.pcol { display: flex; flex-direction: column; gap: var(--gap-m); }
.pcol--side { flex: 0 0 30.74%; }
.pcol--center { flex: 1 1 0; }
.pcard { position: relative; display: block; overflow: hidden; border-radius: var(--radius); aspect-ratio: 16 / 15; }
.pcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-link); will-change: transform; }
.pcard:hover img, .pcard:focus-visible img { transform: scale(1.06); }
.projects__cta { display: flex; align-items: center; justify-content: center; gap: var(--gap-m); }

.vpill {
  position: absolute; left: var(--gap-m); right: var(--gap-m); bottom: var(--gap-m);
  display: flex; align-items: center; justify-content: center; gap: var(--gap-s);
  padding: var(--gap-m); border-radius: var(--radius);
  background: var(--color-bg); color: var(--color-ink); font-size: var(--text-s); line-height: var(--lh-tight);
}
.vpill__arr { position: relative; width: var(--text-s); height: var(--text-s); overflow: hidden; }
.vpill__arr svg { position: absolute; inset: 0; width: var(--text-s); height: var(--text-s); transition: transform var(--dur-link) var(--ease-link); }
.vpill__arr svg:nth-child(2) { transform: translate(-100%, 100%); }
.pcard:hover .vpill__arr svg:nth-child(1) { transform: translate(100%, -100%); }
.pcard:hover .vpill__arr svg:nth-child(2) { transform: none; }

/* ---------- About ---------- */
.about__recent { width: 100%; display: flex; align-items: center; gap: var(--gap-s); color: var(--color-muted); font-size: var(--text-m); }
.about__recent-icon { width: var(--icon); height: var(--icon); color: var(--color-ink); }
.exp { width: 100%; display: flex; flex-direction: column; gap: var(--gap-m); }
.exp__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-m); font-size: var(--text-m); line-height: var(--lh-tight); }
.exp__row span:nth-child(2) { color: var(--color-muted); }
.exp__row span:last-child { text-align: right; }
.carousel { position: relative; width: 100%; overflow: hidden; }
.carousel__track { display: flex; align-items: center; gap: var(--gap-m); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track li { flex: none; width: 303px; scroll-snap-align: start; }
.carousel__track .pcard { aspect-ratio: 303 / 335; }
.carousel__btn { position: absolute; top: 50%; width: 40px; height: 40px; margin-top: -20px; display: grid; place-items: center; border-radius: var(--radius); background: var(--color-bg); transition: opacity var(--dur-link) var(--ease-link); }
.carousel__btn img { width: 40px; height: 40px; filter: invert(1); }
.carousel__btn--prev { left: var(--gap-m); opacity: 0; pointer-events: none; }
.carousel__btn--next { right: var(--gap-m); }
.carousel.has-prev .carousel__btn--prev { opacity: 1; pointer-events: auto; }
.carousel.at-end .carousel__btn--next { opacity: 0; pointer-events: none; }

/* ---------- Process / services / reviews ---------- */
.steps { width: 100%; display: flex; flex-direction: column; gap: var(--gap-l); }
.step { position: relative; display: flex; flex-direction: column; gap: var(--gap-m); }
.step__icon, .scard header svg { width: var(--icon); height: var(--icon); color: var(--color-ink); }
.step__badge { color: var(--color-muted); font-size: var(--text-m); line-height: var(--lh-tight); order: -1; }
.bento { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-l) var(--gap-m); }
.bento__col { display: contents; }
.scard { display: flex; flex-direction: column; gap: var(--gap-m); }
.scard header { display: flex; align-items: center; gap: var(--gap-s); }
.reviews { width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--gap-l); }
.rcard { width: 500px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--gap-m); }
.rcard__av { width: 84px; height: 84px; border-radius: var(--radius); object-fit: cover; }
.rcard__name { display: flex; flex-direction: column; gap: var(--gap-xs); }
.rcard__name .body { color: var(--color-muted); }
.rcard__q { width: 100%; font-size: var(--text-m); line-height: var(--lh-tight); white-space: normal; }
.rating { display: flex; align-items: center; gap: var(--gap-s); font-size: var(--text-m); line-height: var(--lh-tight); color: var(--color-muted); }
.stars { display: flex; gap: var(--gap-xs); color: var(--color-ink); }
.stars svg { width: var(--text-s); height: var(--text-s); }
.stats { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-m); }
.stat { display: flex; flex-direction: column; gap: var(--gap-m); }
.stat .h3 { font-size: var(--text-l); }
.stats__sep { display: none; }

/* ---------- FAQ ---------- */
.faq__list { display: flex; flex-direction: column; gap: var(--gap-m); }
.qa__q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--gap-m); text-align: left; font-size: var(--text-m); line-height: var(--lh-tight); }
.qa__q svg { width: var(--icon); height: var(--icon); flex: none; transition: transform var(--dur-link) var(--ease-link); }
.qa.is-open .qa__q svg { transform: rotate(45deg); }
.qa__a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-link) var(--ease-link); }
.qa.is-open .qa__a { grid-template-rows: 1fr; }
.qa__a > div { overflow: hidden; }
.qa__a > div > * { padding-top: var(--gap-m); color: var(--color-muted); }

/* ---------- Footer ---------- */
.footer-wrap { width: 100%; }
.home-footer { padding: var(--footer-pad) var(--gutter); }
.home-footer__inner { max-width: var(--footer-max); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: var(--gap-l); }
.footer__text { display: flex; flex-direction: column; align-items: center; gap: var(--gap-m); text-align: center; max-width: 840px; }
.footer__h { font-size: var(--text-l); line-height: var(--lh-tight); }
.social { display: flex; align-items: center; gap: var(--gap-m); }
.social a { color: var(--color-ink); }
.social svg { width: var(--icon); height: var(--icon); }
.social i { display: none; }
.footer__detail { width: 100%; display: flex; align-items: center; justify-content: space-between; font-size: var(--text-s); line-height: var(--lh-tight); }
.footer__detail a:hover { text-decoration: underline; text-underline-offset: var(--gap-xs); }

/* ---------- Reveal extras (base reveal lives in global.css) ---------- */
.js .reveal--left { transform: translateY(var(--reveal-up)); }
.js [data-words] .w { display: inline-block; opacity: 0; transform: translateY(var(--reveal-up)); transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease); transition-delay: calc(var(--i) * 40ms); }
.js [data-words].is-in .w { opacity: 1; transform: none; }

/* ---------- Cursor follower (dot; grows on links; shows View on project cards) ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--color-ink); color: var(--color-bg); font-size: var(--text-s); line-height: var(--lh-tight);
  opacity: 0; transform: translate3d(-100px, -100px, 0) scale(0.2);
  transition: opacity var(--dur-link) var(--ease-link);
}
.cursor.is-on { opacity: 1; }
.cursor__label { opacity: 0; transition: opacity var(--dur-link) var(--ease-link); }
.cursor.is-card .cursor__label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Breakpoints (same as design.md) ---------- */
@media (max-width: 1199.98px) {
  .carousel__track li { width: 260px; }
}
@media (max-width: 809.98px) {
  :root { --media-h: 380px; }
  .nav__center { display: none; }
  .split, .about__cols, .services__top, .faq__cols, .bento, .stats { grid-template-columns: 1fr; }
  .hero__scroll span, .hero__scroll .line { display: none; }
  .projects__grid { flex-direction: column; }
  .pcol--side, .pcol--center { flex: none; width: 100%; }
  .rcard { width: 320px; }
  .footer__detail { flex-direction: column; gap: var(--gap-s); align-items: flex-start; }
  .exp__row { grid-template-columns: 1fr; }
  .exp__row span:last-child { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .pcard img { transition: none; }
  .cursor { display: none; }
}
