/* People, features, tour, portal, letter and closing band. */
:root { --nav-h: 68px; }

/* People */
.people { padding-block: 24px 24px; text-align: center; }
.people .section-title { font-size: clamp(24px, 3vw, 32px); margin-block-end: 40px; }
.people-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px 20px; margin: 0; padding: 0; list-style: none; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 190px; perspective: 600px; }
.avatar {
  width: 104px; height: 104px; margin-block-end: 10px; border-radius: 50%;
  box-shadow: 0 0 0 5px #fff, var(--shadow-1);
  transition: transform .6s var(--ease);
  animation: breathe 5s ease-in-out infinite;
}
.person:nth-child(2) .avatar { animation-delay: -1s; }
.person:nth-child(3) .avatar { animation-delay: -2s; }
.person:nth-child(4) .avatar { animation-delay: -3s; }
.person:nth-child(5) .avatar { animation-delay: -4s; }
.person:hover .avatar { transform: rotateY(22deg) rotateZ(-4deg) translateY(-6px); }
@keyframes breathe { 50% { translate: 0 -5px; } }
.person strong { font-size: 15px; }
.person .hand { font-size: 21px; color: var(--ink-2); }

/* Features */
.features { padding-block: 104px 24px; }
.section-head { max-width: 780px; margin-block-end: 48px; }
.underlined { position: relative; display: inline-block; white-space: nowrap; }
.underlined .doodle { position: absolute; left: 0; bottom: -12px; width: 100%; height: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.feature {
  position: relative; padding: 28px 24px 26px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
}
/* Beats the reveal rule's transition; reveal props keep the stagger, tilt stays snappy */
.feature.tilt[data-tilt] {
  transition: transform .7s var(--ease), box-shadow .4s,
    opacity .8s var(--ease) var(--stagger, 0s), translate .9s var(--ease) var(--stagger, 0s);
}
.feature.tilt.is-tilting { transition-duration: .15s, .4s, .8s, .9s; }
.feature:hover { box-shadow: 0 34px 50px -30px rgba(31, 42, 55, .5), inset 0 0 0 1px var(--line); }
.feature-grid > :nth-child(4n + 2) { --stagger: .08s; }
.feature-grid > :nth-child(4n + 3) { --stagger: .16s; }
.feature-grid > :nth-child(4n + 4) { --stagger: .24s; }
.glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
}
.feature:hover .glare { opacity: 1; }
.feature-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-block-end: 20px; border-radius: 16px;
  color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 10px 18px -12px var(--accent);
}
.feature-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pop, .pop-2 { transition: transform .7s var(--ease); }
.tilt:hover .pop { transform: translateZ(54px); }
.tilt:hover .pop-2 { transform: translateZ(28px); }
.feature h3 { margin-block-end: 10px; font-size: 19px; }
.feature p { font-size: 15.5px; color: var(--ink-2); }
.feature .aside { margin-block-start: 14px; font-size: 22px; color: var(--marker); rotate: -2deg; }

/* Tour: a sticky stage whose carousel turns as you scroll */
.tour {
  position: relative; height: 520vh; margin-block-start: 88px;
  background: linear-gradient(transparent, rgba(27, 106, 232, .045) 8%, rgba(27, 106, 232, .045) 92%, transparent);
}
.tour-sticky {
  position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); height: calc(100svh - var(--nav-h));
  display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: center; gap: 24px;
  max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); overflow: hidden;
}
.tour-steps { display: grid; }
.tour-step { grid-area: 1 / 1; opacity: 0; translate: 0 22px; pointer-events: none; transition: opacity .45s, translate .6s var(--ease); }
.tour-step.is-active { opacity: 1; translate: none; pointer-events: auto; }
.tour-step .time { width: max-content; font-size: 32px; color: var(--marker); rotate: -3deg; }
.tour-step h3 { margin-block: 8px 14px; font-size: clamp(26px, 3vw, 38px); font-weight: 800; }
.tour-step p { font-size: 17px; color: var(--ink-2); }
.tour-dots { display: flex; gap: 4px; margin: 32px 0 0; padding: 0; list-style: none; }
.tour-dots button {
  position: relative; padding: 8px 10px 12px; border: 0; background: none; cursor: pointer;
  font: 700 14px var(--font); color: var(--ink-3);
}
.tour-dots button::after { content: ""; position: absolute; inset-inline: 10px; bottom: 2px; height: 3px; border-radius: 3px; background: var(--line); transition: background-color .3s; }
.tour-dots .is-active button { color: var(--ink); }
.tour-dots .is-active button::after { background: var(--marker); }
.tour-dots button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }

.tour-copy { position: relative; z-index: 2; }
/* Edge fade so screens turning away never cover the copy */
.ring-stage {
  position: relative; height: min(86vh, 780px); display: grid; place-items: center; perspective: 2000px; perspective-origin: 50% 35%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ring {
  position: relative; width: min(100%, 640px); aspect-ratio: 16 / 10.4; transform-style: preserve-3d;
  transform: translateZ(calc(var(--r, 520px) * -1)) rotateX(-6deg) rotateY(var(--angle, 0deg));
}
.panel {
  position: absolute; inset: 0; margin: 0; overflow: hidden; border-radius: 16px; background: #fff;
  box-shadow: 0 40px 70px -40px rgba(31, 42, 55, .6), 0 0 0 1px rgba(31, 42, 55, .08);
  transform: rotateY(calc(var(--i) * 72deg)) translateZ(var(--r, 520px));
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.panel::after { content: ""; position: absolute; inset: 0; background: var(--paper); opacity: var(--fog, 0); pointer-events: none; }
.panel figcaption {
  display: flex; align-items: center; justify-content: center; height: 30px;
  font-size: 12px; font-weight: 700; color: var(--ink-2); background: #f1ece3; border-block-end: 1px solid var(--line);
}
.panel img { display: block; width: 100%; height: calc(100% - 30px); object-fit: cover; object-position: top; }

/* Client portal */
.portal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 64px; padding-block: 128px 24px; }
.portal-copy > p:not(.kicker) { margin-block: 18px 26px; font-size: 18px; color: var(--ink-2); }
.ticks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding-inline-start: 36px; font-weight: 600; }
.ticks li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: #dcf5e9 var(--tick) center / 15px no-repeat;
}
.portal-visual { position: relative; perspective: 1400px; }
.portal-card {
  overflow: hidden; border-radius: 16px; background: #fff; box-shadow: var(--shadow-2);
  transform: rotateY(-22deg) rotateX(10deg) rotateZ(1deg); transform-origin: 30% 50%;
  transition: transform 1.3s var(--ease);
}
.portal-visual.is-in .portal-card { transform: rotateY(-11deg) rotateX(4deg); }
.portal-visual:hover .portal-card { transform: rotateY(-3deg) rotateX(1deg); }
.portal-card img { display: block; width: 100%; height: auto; }
.portal-chip { position: absolute; inset-inline-end: -18px; bottom: 14%; animation: bob 7s ease-in-out infinite; }
.annot-portal { inset-inline-end: 2%; top: -78px; max-width: 17ch; rotate: -3deg; }
.annot-portal .doodle { left: -112px; top: 6px; width: 110px; height: 64px; }

/* Letter from the team: lands on the desk as it scrolls in */
.note-section { display: flex; justify-content: center; padding-block: 128px 24px; perspective: 1400px; }
.letter {
  position: relative; max-width: 700px; padding: 48px 56px 40px 76px;
  font-size: 18px; line-height: 32px; color: var(--ink);
  background-color: #fffdf6;
  background-image: repeating-linear-gradient(transparent 0 31px, rgba(27, 106, 232, .13) 31px 32px);
  background-origin: content-box;
  border-radius: 6px; box-shadow: 0 2px 0 #efe6d4, 0 34px 60px -30px rgba(60, 40, 10, .45);
  transform: rotate(-1.4deg);
}
.letter::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 44px; width: 2px; background: rgba(242, 100, 59, .35); }
.letter p + p { margin-block-start: 32px; }
.js .letter[data-reveal] { transform: rotateX(42deg) rotate(-5deg); transform-origin: 50% 0; transition: opacity .9s var(--ease), translate 1s var(--ease), transform 1.3s var(--ease); }
.js .letter[data-reveal].is-in { transform: rotate(-1.4deg); }
.letter-hi, .letter-sign { font-size: 34px; line-height: 32px; color: var(--blue); }
.letter-sign { display: flex; align-items: center; gap: 10px; }
.doodle-heart { width: 30px; height: 30px; stroke-width: 2; }
.tape-left { left: 48px; translate: none; rotate: -8deg; }
.tape-right { left: auto; inset-inline-end: 48px; translate: none; rotate: 6deg; }

/* Closing band */
.cta-band {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: center; gap: 32px;
  margin-block-start: 128px; padding: 56px; overflow: hidden; border-radius: 32px; color: #fff;
  background: radial-gradient(520px 320px at 82% 40%, rgba(91, 155, 255, .38), transparent 70%), var(--night);
}
.cta-band h2 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 800; }
.cta-band p { max-width: 46ch; margin-block: 16px 30px; font-size: 18px; color: rgba(255, 255, 255, .75); }
.mark-stage { position: relative; height: 260px; display: grid; place-items: center; perspective: 900px; }
.mark-stage::after {
  content: ""; position: absolute; left: 50%; bottom: 14px; width: 150px; height: 26px; translate: -50% 0;
  border-radius: 50%; background: radial-gradient(rgba(0, 0, 0, .45), transparent 70%);
}
.mark3d { position: relative; width: 168px; height: 168px; transform-style: preserve-3d; transform: rotateX(var(--mx, 12deg)) rotateY(var(--my, -26deg)); }
.mark3d .layer { position: absolute; inset: 0; border-radius: 42px; background: #0f3d91; transform: translateZ(var(--z)); }
.mark3d .layer-front { background: url("../img/eezycrm-mark.svg") center / 100% no-repeat; }
.mark3d .layer-front::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, .35), transparent 45%);
}
.mark3d .layer-back { background: #1557c4; }

@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal { grid-template-columns: minmax(0, 1fr); gap: 96px; }
}
@media (max-width: 900px) {
  .tour-sticky { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; gap: 8px; }
  .ring-stage { order: -1; height: 46svh; }
  .ring { width: min(86vw, 520px); }
  .tour-step h3 { margin-block: 4px 8px; }
  .tour-step p { font-size: 15.5px; }
  .tour-dots { margin-block-start: 16px; }
}
@media (max-width: 600px) {
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .person { width: 150px; }
  .avatar { width: 88px; height: 88px; }
  .annot-portal { position: static; display: block; margin-block-end: 18px; }
  .annot-portal .doodle { display: none; }
  .portal { gap: 40px; padding-block-start: 96px; }
  .portal-chip { inset-inline-end: 8px; bottom: -24px; scale: .85; }
  .letter { padding: 40px 22px 32px 46px; font-size: 16.5px; }
  .letter::before { inset-inline-start: 28px; }
  .cta-band { grid-template-columns: minmax(0, 1fr); padding: 40px 24px 16px; border-radius: 24px; }
  .mark-stage { height: 220px; }
  .tour-dots button { padding-inline: 7px; font-size: 13px; }
  .tour-dots button::after { inset-inline: 7px; }
}
