/* ============================================================
   HOME PAGE (owned by the Home session). Uses tokens/components from base.css.
   ============================================================ */

/* ---------- Hero ---------- */
.home-hero{
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + var(--s-9)) var(--gutter) var(--s-9);
  isolation: isolate;
}
/* The glow is allowed to spill past the hero (no overflow clipping) so there's no hard edge when scrolling */
.home-hero-glow{
  position: absolute; top: 6%; left: 50%;
  width: min(900px, 95vw); aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,123,172,.24), transparent);
  z-index: -1; pointer-events: none;
}

/* The cube: same build as the original site */
.hero-cube-scene{
  position: relative;
  width: 100%;
  display: flex; justify-content: center;
  perspective: 1400px;
  margin: clamp(0px, 3vh, 40px) 0 clamp(40px, 7vw, 72px);
  --size: clamp(170px, 20vw, 280px);
}
.cube-parallax{
  width: var(--size); height: var(--size);
  transform-style: preserve-3d;
  transition: transform .3s ease-out;
  will-change: transform;
}
/* Touch drags follow the finger directly (no easing lag) */
.cube-parallax.is-touch{ transition: none; }
/* Invisible flat drag/tap area over the cube (added by home.js). Taps on the spinning 3D faces
   are unreliable on phones, so presses land here and the cube follows.
   pan-y: on phones, sideways swipes spin the cube and up/down swipes still scroll the page. */
.cube-hit{
  position: absolute; z-index: 1; top: 50%; left: 50%;
  width: calc(var(--size) * 1.25); height: calc(var(--size) * 1.25);
  transform: translate(-50%, -50%);
  border-radius: calc(var(--size) * .2);
  cursor: grab; touch-action: pan-y;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.cube-hit:active{ cursor: grabbing; }
.cube-spin{
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: cube-spin 24s linear infinite;
}
.cube-spin.is-offscreen{ animation-play-state: paused; }
@keyframes cube-spin{
  from{ transform: rotateX(-18deg) rotateY(0deg); }
  to  { transform: rotateX(-18deg) rotateY(360deg); }
}
.cube-face{
  position: absolute; inset: 0;
  border: 3px solid rgba(255,123,172,.6);
  border-radius: calc(var(--size) * .16);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.face-front { background: linear-gradient(145deg, rgba(255,123,172,.35), rgba(255,123,172,.05)); transform: translateZ(calc(var(--size) / 2)); }
.face-back  { background: linear-gradient(145deg, rgba(11,11,12,.9), rgba(11,11,12,.6));       transform: translateZ(calc(var(--size) / -2)) rotateY(180deg); }
.face-right { background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(255,255,255,.02)); transform: rotateY(90deg) translateZ(calc(var(--size) / 2)); }
.face-left  { background: linear-gradient(145deg, rgba(242,71,143,.4), rgba(242,71,143,.08));   transform: rotateY(-90deg) translateZ(calc(var(--size) / 2)); }
.face-top   { background: linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,.05)); transform: rotateX(90deg) translateZ(calc(var(--size) / 2)); }
.face-bottom{ background: linear-gradient(145deg, rgba(11,11,12,.85), rgba(11,11,12,.5));      transform: rotateX(-90deg) translateZ(calc(var(--size) / 2)); }

.cube-core{ position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.cube-core-logo, .cube-core-slice{
  position: absolute; top: 50%; left: 50%;
  width: 62%; height: auto; max-width: none;
  pointer-events: none;
}
.cube-core-slice{ transform: translate(-50%, -50%) translateZ(var(--z)); filter: brightness(.55); opacity: .9; }
.cube-core-logo{
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  filter:
    drop-shadow(2px 2px 0 rgba(120,20,55,.6))
    drop-shadow(4px 4px 0 rgba(80,10,35,.4))
    drop-shadow(0 0 16px rgba(255,123,172,.55));
}
.cube-core-logo-a{ transform: translate(-50%, -50%) translateZ(8px); }
.cube-core-logo-b{ transform: translate(-50%, -50%) translateZ(-8px) rotateY(180deg) scaleX(-1); }

.cube-hint{
  position: absolute;
  top: calc(var(--size) * .12);
  left: calc(50% + var(--size) * .78);
  display: flex; flex-direction: column; align-items: flex-end;
  color: #c7c7cc;
  pointer-events: none;
  transform: rotate(-4deg);
  transition: opacity var(--t-med) var(--ease);
}
.cube-hint.is-gone{ opacity: 0; }
.cube-hint-text{
  font-family: 'Permanent Marker', 'Marker Felt', 'Comic Sans MS', cursive;
  font-size: clamp(11px, 1.07vw, 13px);
  line-height: 1; white-space: nowrap;
}
.hint-tap{ display: none; }
@media (hover: none){ .hint-click{ display: none; } .hint-tap{ display: inline; } }
.cube-hint-arrow{ width: 25px; height: 21px; margin: 1px 1px 0 0; }

/* Hero copy */
.home-hero-copy{ display: flex; flex-direction: column; align-items: center; gap: var(--s-5); max-width: 820px; }
.home-hero-title{ line-height: 0; }
.home-hero-lockup{ height: clamp(2.4rem, 7.5vw, 4.6rem); width: auto; }
.home-hero-copy .btn-row{ justify-content: center; margin-top: var(--s-2); }

/* ---------- Shared bits ---------- */
.home-head{ margin-bottom: var(--s-7); }
.home-head .eyebrow{ margin-bottom: var(--s-3); }
.home-head--center{ text-align: center; }
.home-head--center .h2{ margin-inline: auto; }
.home-link{ display: inline-flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 15px; font-weight: 600; }
.home-link span{ transition: transform var(--t-med) var(--ease); }
.home-link:hover span{ transform: translateX(5px); }

/* ---------- Services: numbered rows on one glass panel ---------- */
.home-services{ border-radius: var(--r-lg); padding: var(--s-2) clamp(var(--s-2), 2vw, var(--s-4)); }
.home-service{
  display: grid; grid-template-columns: 64px 1fr 32px; align-items: start; gap: var(--s-4);
  padding: clamp(22px, 3vw, 34px) clamp(12px, 2vw, 24px);
  border-radius: var(--r-md);
  transition: background var(--t-med) var(--ease);
}
.home-service + .home-service{ border-top: 1px solid var(--line); }
.home-service:hover{ background: rgba(255,123,172,.08); }
.home-service-num{ padding-top: 6px; font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--pink); }
.home-service .h3{ font-size: clamp(22px, 2.6vw, 32px); text-transform: uppercase; letter-spacing: -.01em; transition: color var(--t-fast); }
.home-service:hover .h3{ color: var(--pink); }
.home-service-body p{
  max-width: 56ch; color: var(--dim); font-size: 16px; line-height: 1.5;
  opacity: 0; margin-top: 0;
  overflow: hidden; max-height: 0;
  transition: max-height var(--t-med) var(--ease), opacity var(--t-med) var(--ease), margin-top var(--t-med) var(--ease);
}
.home-service:hover .home-service-body p, .home-service:focus-visible .home-service-body p{ max-height: 140px; opacity: 1; margin-top: var(--s-3); }
.home-service-arrow{ padding-top: 4px; font-size: 20px; color: var(--pink); justify-self: end; transition: transform var(--t-med) var(--ease); }
.home-service:hover .home-service-arrow{ transform: translateX(6px); }
/* Touch screens can't hover, so always show the description */
@media (hover: none){
  .home-service-body p{ max-height: none; opacity: 1; margin-top: var(--s-2); }
}
@media (max-width: 560px){
  .home-service{ grid-template-columns: 36px 1fr 20px; gap: var(--s-3); }
}

/* ---------- Projects ---------- */
.home-work{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.home-card{
  display: flex; flex-direction: column;
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--t-med) var(--ease), border-color var(--t-med);
}
.home-card:hover{ transform: translateY(-4px); border-color: rgba(255,123,172,.45); }
.home-card-visual{ position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--bg-2); }
.home-card-visual > img:first-child{ width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.home-card:hover .home-card-visual > img:first-child{ transform: scale(1.05); }
.home-card-cube{
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
  transition: transform var(--t-med) var(--ease);
}
.home-card:hover .home-card-cube{ transform: rotate(135deg) scale(1.15); }
.home-card-meta{ padding: var(--s-5); display: flex; flex-direction: column; gap: 6px; }
.home-card-meta h3{ font-size: 19px; letter-spacing: -.01em; line-height: 1.2; }
.home-card-services{ font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--pink); }
.home-card-meta p:last-child{ color: var(--dim); font-size: 14px; line-height: 1.45; }
.home-work-more{ display: flex; justify-content: center; margin-top: var(--s-7); }
/* Phones: a swipeable row instead of tall stacked cards */
@media (max-width: 760px){
  .home-work{
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%;
    gap: var(--s-3);
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
    scrollbar-width: none; padding-bottom: 4px;
  }
  .home-work::-webkit-scrollbar{ display: none; }
  .home-card{ scroll-snap-align: start; border-radius: var(--r-md); }
}

/* ---------- Instagram (Behold feed) ---------- */
.home-insta{ text-align: center; display: flex; flex-direction: column; align-items: center; }
.home-insta .eyebrow{ display: inline-flex; align-items: center; gap: 8px; }
.home-insta-icon{ display: inline-flex; color: var(--pink); transition: color var(--t-fast); }
.home-insta-icon:hover{ color: var(--ink); }
.home-insta-icon svg{ width: 16px; height: 16px; }
.home-insta-frame{ width: 100%; max-width: 860px; min-height: 200px; margin-top: var(--s-6); border-radius: var(--r-lg); overflow: hidden; }
.home-insta-frame noscript a{ color: var(--ink); font-weight: 600; }
.home-insta-handle{ margin-top: var(--s-6); font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--pink); transition: color var(--t-fast); }
.home-insta-handle:hover{ color: var(--ink); }

/* ---------- Touch screens: no hover movement left "stuck" after a tap ---------- */
@media (hover: none){
  .home-card:hover, .home-card:hover .home-card-visual > img:first-child,
  .home-card:hover .home-card-cube, .home-service:hover .home-service-arrow{ transform: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce){
  .cube-spin{ animation: none; transform: rotateX(-18deg) rotateY(-30deg); }
  .cube-hint{ display: none; }
  .home-card:hover, .home-card:hover .home-card-visual > img:first-child{ transform: none; }
}
